Fix tar extraction with windows-2016 image#62
Conversation
|
We can add more tests, but the extraction was the main issue. I left the logic the same as before for windows-2019, so when windows-2016 is removed, the logic using Git tar can be removed. The mswin build does not work with windows-2016, as extension gems will not compile with VS 2017 and the build's libraries. I really don't see a need for generating another version. |
|
Thanks for the fix! |
| export function win2nix(path) { | ||
| return (/^[A-Z]:/i.test(path) ? | ||
| ('/' + path[0].toLowerCase() + path.split(':')[1]) : | ||
| path).replace(/\\/g, '/').replace(/ /g, '\\ ') |
There was a problem hiding this comment.
Could you use a simple if and re-assign here?
I find a multi-line ternary condition hard to read.
There was a problem hiding this comment.
Done. Simplified, as js is pass by value, at least with 'primitive' types.
| run: which -a ruby rake | ||
| - name: where ruby, rake | ||
| if: matrix.os == 'windows' | ||
| if: startsWith(matrix.os, 'windows') |
There was a problem hiding this comment.
Could you leave this file unchanged, in order to avoid conflicts with #60 ?
| exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])) | ||
| await common.measure('Extracting Ruby', async () => { | ||
| if (process.env.ImageOS === 'win16') { | ||
| await exec.exec('"C:\\Program Files\\Git\\usr\\bin\\tar.exe"', [ '-xz', '-C', common.win2nix(rubiesDir), '-f', |
There was a problem hiding this comment.
Could you extract the path to tar in a variable, similar to how it's done below?
Then the logic and arguments will nicely align with below.
1. common.js - add function win2nix(path) to convert windows style paths to nix style 2. ruby_builder.js - use Git tar for windows-2016, leave windows-2019 as is
common.js - add function win2nix(path) to convert windows style paths to nix style
ruby_builder.js - use Git tar for windows-2016, leave windows-2019 as is
Add three windows-2016 JRuby builds to test.yml
Closes #61