Skip to content

Add windows support - #236

Merged
hzoo merged 15 commits into
lerna:masterfrom
laurentdesmet:master
Aug 12, 2016
Merged

hzoo merged 15 commits into
lerna:masterfrom
laurentdesmet:master

Conversation

@laurentdesmet

Copy link
Copy Markdown
Contributor

See #226

@gigabo

gigabo commented Jun 20, 2016

Copy link
Copy Markdown
Contributor

Looks like cross-spawn-async has been superseded by cross-spawn:

This module is deprecated, use cross-spawn instead which no longer requires a build toolchain.

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

Wow, I was looking for the difference between these two modules and I completely missed that... So I decided to take the one with the most downloads. Thanks for notifying!

@Daniel15

Copy link
Copy Markdown
Contributor

Thanks! Did you test this on Windows?

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

I did test it quickly by hand on a Windows machine and it seemed to work, but there is still some work to do for all the tests to pass on Windows. I'll fix the tests for Windows in one of the following days. Adding a Windows CI build using appveyor as in #230 is the next step to verify this automatically.

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

I already made some progress making the tests pass on Windows using appveyor but I don't have access to a Windows machine right now, which makes testing difficult because of slow feedback cycles. I'll continue when I have access to a Windows machine where I can run the tests locally.

@hzoo

hzoo commented Jun 21, 2016 •

Copy link
Copy Markdown
Contributor

There's already a few prs for windows - #230 like you mentioned as well as #171, #141. I would just rebase those changes into yours which has a lot of the work already done

@laurentdesmet laurentdesmet changed the title refactor: replace child_process.spawn by cross-spawn-async refactor: replace child_process.spawn by cross-spawn Jun 21, 2016
@laurentdesmet

Copy link
Copy Markdown
Contributor Author

Ok, I will do this and continue testing

@zkochan

zkochan commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

Is it going to be merged? Lerna bootstrap is currently not usable on Windows

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

I could not find any free time to work on this but I'll continue working on this PR, the moment my schedule allows it

@zkochan

zkochan commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

I might be able to work on this today. Have you pushed your latest changes?

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

I pushed everything, definitely check #171 as @hzoo already mentioned here. It already contains a lot of work but I didn't check yet how much it is still up to date with the HEAD of the master branch.

@zkochan

zkochan commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

@laurentdesmet, I rebased your changes on master and #171 then fixed the tests that were not passing on my Windows 10. I am going to make a pull request to your fork now

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

I merged the changes into the master branch of my fork, locally on my machine (Mac) all the tests passed for all Node versions (also v0.10.46), but they did fail on Travis and AppVeyor. I should configure my Windows machine (which is not used for months now...) to test it locally on Windows. But because the tests where passing on your machine, it seems something AppVeyor related makes the test fail.

@zkochan

zkochan commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

AppVeyor is slower than Travis, so the 3 timeout issues should be fixed by simply increasing the timeouts for those tests

The 4th failed test seems to be Windows related because the line ending didn't match. It is weird though that on my machine that test passed.

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

Ok, Travis tests do pass now (https://travis-ci.org/laurentdesmet/lerna/builds/144003698) but I didn't change anything, just made a separate branch. This nondeterministic test results are a little bit annoying... Gonna check if I can find the cause of them.

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

I found out why the 4th test failed on your machine. On line 265 of test/PublishCommand.js, \n got replaced by EOL but this should remain \n because this should have the same contents as the lerna.json. On Windows you have probably core.autocrlf set to true, which causes the file to have its line endings being converted to CRLF and that made test pass on your system.

@laurentdesmet laurentdesmet changed the title refactor: replace child_process.spawn by cross-spawn Add windows support Jul 11, 2016
@zkochan

zkochan commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

Good job! I am super happy the latest lerna will work on Windows with no more issues!

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

If this PR gets merged, then #171 and #230 can also be closed because its work is merged in this PR.

Comment thread test/PublishCommand.js Outdated
{ args: ["git checkout -- packages/*/package.json"] },

{ args: ["npm dist-tag ls package-1"], returns: "lerna-temp: 1.0.0-alpha.81e3b443\nstable: 1.0.0" },
{ args: ["npm dist-tag ls package-1"], returns: "lerna-temp: 1.0.0-canary.81e3b443" + EOL + "stable: 1.0.0" },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is alpha being turned into canary. We definitely do not want canary #166

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be rebased?

@jdanyow

jdanyow commented Jul 28, 2016

Copy link
Copy Markdown

will this be merged?

@hzoo

hzoo commented Jul 29, 2016

Copy link
Copy Markdown
Contributor

Yeah there was #236 (diff) so need to look at the test output more carefully- maybe it just needs to be rebased?

@laurentdesmet

laurentdesmet commented Jul 29, 2016 •

Copy link
Copy Markdown
Contributor Author

Sorry for the lack of response, had some busy weeks. I rebased my master branch on top of the lerna:master branch. Node.js 0.10 and 0.12 are temporarily commented out now in the appveyor configuration file, I'll investigate this during the weekend because this lead to some problems if I remember well. Some other stuff I can help with?

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

aaa4cdb replaced alpha by canary, but I see no reason why, so I reverted this change. I also added the node versions 0.10, 1.12, 5 and 6 to the appveyor CI configuration file.

I think there is one more thing we can do to polish the PR a little bit more: now we put os.EOL everywhere instead of \n and I think that we could maybe replace it by something like normalize-newline so we can still use \n instead of concatenating strings with the less readable os.EOL. I'll look into this during the weekend.

@gigabo

gigabo commented Aug 10, 2016

Copy link
Copy Markdown
Contributor

Hi @laurentdesmet - I just pushed a branch with this PR rebased onto current master, and appveyor failed on node 0.12. Looks like it didn't make it past npm install. Any idea what might be going on there?

@laurentdesmet

Copy link
Copy Markdown
Contributor Author

@gigabo I rebased this branch on top of master (that was updated with another two commits since your rebase) and it succeeds now. So no idea what the problem was, didn't check the changes from the last two commits on master.

@gigabo

gigabo commented Aug 12, 2016

Copy link
Copy Markdown
Contributor

Great! Must have been a spurious failure... thanks for getting up to date.

The normalize-newline thing might be nice, but seems worth getting this merged in first.

So, this looks good to me. @hzoo, @thejameskyle?

@hzoo

hzoo commented Aug 12, 2016 •

Copy link
Copy Markdown
Contributor

Yeah lets do it in a follow up pr then? It's been a too long for these changes so we should get them in.

🎉

@lock

lock Bot commented Dec 28, 2018

Copy link
Copy Markdown

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants