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

Support Rust configure when UWP targets are present #195

Merged
merged 1 commit into from Aug 21, 2019
Merged

Conversation

@jdm
Copy link
Member

jdm commented Aug 19, 2019

The existing code that attempts to detect if a given target will allow compiling Rust code assumes that if multiple Rust targets target the same CPU that the triple's OS value will be unique (ie. x86_64-pc-windows-msvc vs. x86_64-pc-windows-gnu). This is no longer true with the introduction of x86_64-uwp-windows-msvc, but it's not enough to include the vendor string in the checks - the configure script is passed a different target (x86_64-windows-mingw32), and the python configuration code needs to reverse-engineer a Rust triple from it to use when compiling Rust code as part of the mozjs build. We bypass this issue by storing the target and host triples that Cargo makes available in the build script and using those value when the python configuration heuristics fail.


This change is Reviewable

@jdm
Copy link
Member Author

jdm commented Aug 19, 2019

@asajeffrey
Copy link
Member

asajeffrey commented Aug 19, 2019

@bors-servo r+ Pity we need this, but sigh, we do.

@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

📌 Commit 97f720b has been approved by asajeffrey

bors-servo added a commit that referenced this pull request Aug 19, 2019
Support Rust configure when UWP targets are present

The existing code that attempts to detect if a given target will allow compiling Rust code assumes that if multiple Rust targets target the same CPU that the triple's OS value will be unique (ie. x86_64-pc-windows-msvc vs. x86_64-pc-windows-gnu). This is no longer true with the introduction of x86_64-uwp-windows-msvc, but it's not enough to include the vendor string in the checks - the configure script is passed a different target (x86_64-windows-mingw32), and the python configuration code needs to reverse-engineer a Rust triple from it to use when compiling Rust code as part of the mozjs build. We bypass this issue by storing the target and host triples that Cargo makes available in the build script and using those value when the python configuration heuristics fail.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/195)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

Testing commit 97f720b with merge a0f36b1...

@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

💔 Test failed - status-appveyor

@SimonSapin
Copy link
Member

SimonSapin commented Aug 20, 2019

ERROR: Don't know how to translate x86_64-pc-mingw32 for rustc
@jdm
Copy link
Member Author

jdm commented Aug 20, 2019

Yay, my changes work with nightly rustc but fail with stable and beta. More fiddling is required.

@jdm jdm force-pushed the jdm:uwp-fix branch from e27bc36 to 67b6573 Aug 21, 2019
@jdm
Copy link
Member Author

jdm commented Aug 21, 2019

@bors-servo r=asajeffrey

@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2019

📌 Commit 67b6573 has been approved by asajeffrey

@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2019

Testing commit 67b6573 with merge 9c0e589...

bors-servo added a commit that referenced this pull request Aug 21, 2019
Support Rust configure when UWP targets are present

The existing code that attempts to detect if a given target will allow compiling Rust code assumes that if multiple Rust targets target the same CPU that the triple's OS value will be unique (ie. x86_64-pc-windows-msvc vs. x86_64-pc-windows-gnu). This is no longer true with the introduction of x86_64-uwp-windows-msvc, but it's not enough to include the vendor string in the checks - the configure script is passed a different target (x86_64-windows-mingw32), and the python configuration code needs to reverse-engineer a Rust triple from it to use when compiling Rust code as part of the mozjs build. We bypass this issue by storing the target and host triples that Cargo makes available in the build script and using those value when the python configuration heuristics fail.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/195)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: asajeffrey
Pushing 9c0e589 to master...

@bors-servo bors-servo merged commit 67b6573 into servo:master Aug 21, 2019
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build cancelled
Details
Travis CI - Pull Request Build Canceled
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

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