Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build under MSYS2/MINGW64 #54

Merged
merged 6 commits into from Nov 11, 2015
Merged

Fix build under MSYS2/MINGW64 #54

merged 6 commits into from Nov 11, 2015

Conversation

@vvuk
Copy link
Contributor

vvuk commented Sep 22, 2015

This is a set of changes needed to build mozjs under msys2/mingw64.

Core changes:

  • Allow building with msys make
  • Don't strip "lib" prefix from library names
  • Use system nspr with correct lib names (nspr-config gives incorrect values)
  • Force using native win32 python instead of the mingw64/msys python

I'm not really happy with these changes since these are all basically core m-c js files, and I don't think we could take some of these changes in m-c. But, the majority of changes are correct or are resolving deeper issues in the m-c build system (e.g. the need to use the native win32 python instead of the msys one).

The ICU libprefix stuff can probably be resolved a different way, I just wasn't sure how to go about it.

Review on Reviewable

@metajack
Copy link
Contributor

metajack commented Sep 22, 2015

I'm mostly concerned about the upstream build system modifications. Have you talked to the JS team about these changes and issues?

cc @tschneidereit


Reviewed 7 of 7 files at r1.
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


makefile.cargo, line 49 [r1] (raw file):
Is this path guaranteed to exist or just where you happened to install the tool?


makefile.cargo, line 58 [r1] (raw file):
Our other tools are tolerant of python3 vs. python2 stuff. Is it possible not to hardcode a python version here?

Also this is the only difference in the two branches. Could we pull that out and then only have one all rule?


mozjs/config/baseconfig.mk, line 34 [r1] (raw file):
We don't typically change these files since they are from upstream. Does upstream specifically forbid msys?


mozjs/config/external/icu/Makefile.in, line 30 [r1] (raw file):
is the libs intentional? This looks like a typo. For example it's lib/s in the else branch.


Comments from the review on Reviewable.io

@tschneidereit
Copy link

tschneidereit commented Sep 22, 2015

It'd be great if you could split these changes into upstreamable and hacky bits. Then we can take the former on mozilla-central and deal with the hacky bits later. It's not like we don't have build system hacks already.

@vvuk vvuk force-pushed the vvuk:win32 branch from 297406e to bb3dbb9 Sep 24, 2015
@Ms2ger
Copy link
Collaborator

Ms2ger commented Sep 24, 2015

And rebase, please.

@vvuk vvuk force-pushed the vvuk:win32 branch 2 times, most recently from 68185cd to 1d13f00 Sep 24, 2015
@vvuk
Copy link
Contributor Author

vvuk commented Sep 24, 2015

Rebased and commits split out.

The missing #! to milestone.py, and the allowing of msys make for mingw64/msys2 could be upstreamed. The latter patch would ideally need a reliable way of actually detecting MSYS2 -- mozilla-build currently has $MSYSTEM = MINGW32 for historical raisins, even though that's mostly a lie.

The ICU changes are... correct, but it depends on what you're trying to accomplish. If we're trying to use mingw to create windows-style libraries, then they're not correct (we don't want lib* as a prefix). But if we're trying to make static libs, then they are. The right thing here might be to have an entirely separate platform config file that's something like mingw64-msys2, and then find a way to explicitly tell ICU to use that config.

The makefile.cargo fixes are unfortunate, for the python change. But I couldn't find any way to get around it, given that the spidermonkey tree has its own copy of virtualenv.py that it really wants to use.

@vvuk vvuk force-pushed the vvuk:win32 branch from 1d13f00 to 197cbb7 Sep 29, 2015
@adamncasey
Copy link

adamncasey commented Oct 18, 2015

Would be nice to see this added soon, so servo on windows can move forward

@jdm
Copy link
Member

jdm commented Oct 19, 2015

I'd like @metajack to look at the new changes, but he's out all week :/

@metajack
Copy link
Contributor

metajack commented Oct 19, 2015

I appreciate the extra comments in the weird spots. There are still two comments that appear unanswered.

In makefile.cargo on line 49 there is a hardcoded path, which I asked if that was guaranteed to be there.

In the icu makefile there seems to be a typo between "lib" and "libs" in the two branches. Is that intentional or an error?


Reviewed 5 of 6 files at r2, 1 of 1 files at r3.
Review status: all files reviewed at latest revision, 3 unresolved discussions, all commit checks successful.


build.rs, line 23 [r3] (raw file):
Why do we only need to link nspr on windows?


Comments from the review on Reviewable.io

@vvuk
Copy link
Contributor Author

vvuk commented Oct 20, 2015

In makefile.cargo on line 49 there is a hardcoded path, which I asked if that was guaranteed to be there.

The default install location is now hardcoded, along with a NATIVE_WIN32_PYTHON env var fallback. There's a message that gets printed if python can't be found using either of the two.

In the icu makefile there seems to be a typo between "lib" and "libs" in the two branches. Is that intentional or an error?

Intentional -- both branches are moving libraries that have an "s" prefix to ones that don't (libsicu -> libicu, or sicu -> icu).

build.rs, line 23 [r3](raw file): Why do we only need to link nspr on windows?

JS doesn't have the "mini nspr" for Windows that posixy platforms have in vm/PosixNSPR.{cpp,h} We need to link with real nspr until someone writes that code... it shouldn't be difficult to do, other than the lack of native condvars on Windows.

@metajack
Copy link
Contributor

metajack commented Oct 20, 2015

The path I am talking about is /mingw64/include/nspr which is not related to python. What about that path?

Other than that, you've answered the questions I had.

@vvuk
Copy link
Contributor Author

vvuk commented Oct 27, 2015

Oh, sorry, was looking at the wrong line. That path is where the nspr includes will be from the mingw64 nspr package. They will always be in that location (/mingw64/include/nspr will get mapped to wherever the base msys2 install happened in the actual filesystem).

@metajack
Copy link
Contributor

metajack commented Oct 27, 2015

Squash and r=me


Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


Comments from the review on Reviewable.io

@vvuk
Copy link
Contributor Author

vvuk commented Oct 27, 2015

I'm working on changing the linking here a bit -- figured out how to link with nspr statically, to avoid the DLL deps. I'll update this PR once things check out.

@vvuk vvuk force-pushed the vvuk:win32 branch from 265c176 to 268f7ac Oct 27, 2015
@vvuk
Copy link
Contributor Author

vvuk commented Oct 27, 2015

static nspr linking didn't work out -- it has issues with threading, since some of the nspr threading functionality depends on DllMain being notified of thread attach/detach.

@metajack
Copy link
Contributor

metajack commented Nov 3, 2015

@vvuk Is this ready for re-review?

@vvuk
Copy link
Contributor Author

vvuk commented Nov 11, 2015

Sorry, yes -- this should be ready for re-review.

@metajack
Copy link
Contributor

metajack commented Nov 11, 2015

@bors-servo r+


Reviewed 4 of 4 files at r4.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Nov 11, 2015

@bors-servo: r=metajack

@bors-servo
Copy link
Contributor

bors-servo commented Nov 11, 2015

📌 Commit 268f7ac has been approved by metajack

@bors-servo
Copy link
Contributor

bors-servo commented Nov 11, 2015

Testing commit 268f7ac with merge 446871d...

bors-servo added a commit that referenced this pull request Nov 11, 2015
Fix build under MSYS2/MINGW64

This is a set of changes needed to build mozjs under msys2/mingw64.

Core changes:
- Allow building with msys make
- Don't strip "lib" prefix from library names
- Use system nspr with correct lib names (nspr-config gives incorrect values)
- Force using native win32 python instead of the mingw64/msys python

I'm not really happy with these changes since these are all basically core m-c js files, and I don't think we could take some of these changes in m-c.  But, the majority of changes are correct or are resolving deeper issues in the m-c build system (e.g. the need to use the native win32 python instead of the msys one).

The ICU libprefix stuff can probably be resolved a different way, I just wasn't sure how to go about it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/54)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 11, 2015

☀️ Test successful - travis

@bors-servo bors-servo merged commit 268f7ac into servo:master Nov 11, 2015
3 checks passed
3 checks passed
code-review/reviewable Review complete: all files reviewed, all discussions resolved
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.