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 built-in target detection #33363

Merged
merged 3 commits into from
Jul 27, 2016
Merged

fix built-in target detection #33363

merged 3 commits into from
Jul 27, 2016

Conversation

japaric
Copy link
Member

@japaric japaric commented May 3, 2016

previously the logic was accepting wrong triples (like
x86_64_unknown-linux-musl) as valid ones (like x86_64-unknown-linux-musl) if
they contained an underscore instead of a dash.

fixes #33329


r? @brson

I wanted to use a compile-fail test at first. But, you can't pass an extra --target flag to rustc for those because they already call rustc --target $HOST so you get a error: Option 'target' given more than once.. The run-make test used here works fine though.

previously the logic was accepting wrong triples (like
`x86_64_unknown-linux-musl`) as valid ones (like `x86_64-unknown-linux-musl`) if
they contained an underscore instead of a dash.

fixes rust-lang#33329
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@brson
Copy link
Contributor

brson commented May 3, 2016

@bors r+

@bors
Copy link
Contributor

bors commented May 3, 2016

📌 Commit 5943507 has been approved by brson

@@ -71,10 +71,9 @@ macro_rules! supported_targets {

// this would use a match if stringify! were allowed in pattern position
Copy link
Contributor

Choose a reason for hiding this comment

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

is this comment stale now?

Copy link
Contributor

@durka durka May 3, 2016

Choose a reason for hiding this comment

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

(it wasn't true anyway)

Copy link
Member Author

Choose a reason for hiding this comment

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

(it wasn't true anyway)

Actually it would look like this: http://is.gd/ot9Ta2

Now that we are using $triple instead of $module we can change this into a match. I'll send a follow up PR because this one already got pulled into the rollup.

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like no longer in the rollup

bors added a commit that referenced this pull request May 3, 2016
Rollup of 14 pull requests

- Successful merges: #33277, #33294, #33314, #33322, #33333, #33338, #33339, #33340, #33343, #33357, #33363, #33365, #33371, #33372
- Failed merges:
bors added a commit that referenced this pull request May 3, 2016
Rollup of 14 pull requests

- Successful merges: #33277, #33294, #33314, #33322, #33333, #33338, #33339, #33340, #33343, #33357, #33363, #33365, #33371, #33372
- Failed merges:
bors added a commit that referenced this pull request May 4, 2016
Rollup of 14 pull requests

- Successful merges: #33277, #33294, #33314, #33322, #33333, #33338, #33339, #33340, #33343, #33357, #33363, #33365, #33371, #33372
- Failed merges:
bors added a commit that referenced this pull request May 4, 2016
Rollup of 14 pull requests

- Successful merges: #33277, #33294, #33314, #33322, #33333, #33338, #33339, #33340, #33343, #33357, #33363, #33365, #33371, #33372
- Failed merges:
@japaric
Copy link
Member Author

japaric commented May 5, 2016

Pushed a commit with the if -> match refactor

@bors r=brson

@bors
Copy link
Contributor

bors commented May 5, 2016

📌 Commit ec616d5 has been approved by brson

@bors
Copy link
Contributor

bors commented May 8, 2016

⌛ Testing commit ec616d5 with merge c9ef2c4...

@bors
Copy link
Contributor

bors commented May 8, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@japaric
Copy link
Member Author

japaric commented Jun 17, 2016

I had forgotten about this PR 😅. Hmm, I guess this failed because there is no grep on windows? What's a cross platform way to grep files? cc @alexcrichton

@alexcrichton
Copy link
Member

Oh I think that Windows has grep (part of MinGW), but the grep looks like it may have just failed. Maybe an error string difference?

@japaric
Copy link
Member Author

japaric commented Jun 18, 2016

@alexcrichton Does the msvc bot also have grep installed? And does it run the tests under the mingw shell? AFAICT my grep string has no special characters... just alphanum chars and ':'.

@alexcrichton
Copy link
Member

They should yeah, currently all those bots run in a MinGW shell

@brson
Copy link
Contributor

brson commented Jul 11, 2016

@bors retry

Just retrying to see the error again.

@bors
Copy link
Contributor

bors commented Jul 11, 2016

⌛ Testing commit ec616d5 with merge 7240b18...

@brson
Copy link
Contributor

brson commented Jul 21, 2016

Error was:


---- [run-make] run-make\issue-33329 stdout ----

error: make failed
status: exit code: 2
command: "make"
stdout:
------------------------------------------
make[1]: Entering directory '/c/bot/slave/auto-win-msvc-64-opt-rustbuild/build/src/test/run-make/issue-33329'
C:\bot\slave\auto-win-msvc-64-opt-rustbuild\build\obj\build\x86_64-pc-windows-msvc\stage2\bin\rustc.exe --target x86_64_unknown-linux-musl main.rs 2>&1 | \
    grep "error: Error loading target specification: Could not find specification for target"
Makefile:2: recipe for target 'all' failed
make[1]: Leaving directory '/c/bot/slave/auto-win-msvc-64-opt-rustbuild/build/src/test/run-make/issue-33329'

------------------------------------------
stderr:
------------------------------------------
make[1]: *** [all] Error 1

------------------------------------------

thread '[run-make] run-make\issue-33329' panicked at 'explicit panic', C:\bot\slave\auto-win-msvc-64-opt-rustbuild\build\src\tools\compiletest\src\runtest.rs:2243
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    [run-make] run-make\issue-33329

test result: FAILED. 129 passed; 1 failed; 0 ignored; 0 measured



command did not execute successfully: "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\compiletest.exe" "--compile-lib-path" "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\stage2\\bin" "--run-lib-path" "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\stage2\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "--rustc-path" "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\stage2\\bin\\rustc.exe" "--rustdoc-path" "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\stage2\\bin\\rustdoc.exe" "--src-base" "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\src/test\\run-make" "--build-base" "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\test\\run-make" "--stage-id" "stage2-x86_64-pc-windows-msvc" "--mode" "run-make" "--target" "x86_64-pc-windows-msvc" "--host" "x86_64-pc-windows-msvc" "--llvm-filecheck" "C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\llvm\\build\\Release/bin\\FileCheck.exe" "--host-rustcflags" "-Crpath -O" "--target-rustcflags" "-Crpath -O -Lnative=C:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\rust-test-helpers" "--docck-python" "python" "--lldb-python" "python" "--gdb-version" "GNU gdb (GDB) 7.8" "--cc" "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC/bin\\amd64\\cl.exe" "--cxx" "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC/bin\\amd64\\cl.exe" "--cflags" "/nologo /MD" "--llvm-components" "aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils all all-targets analysis arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo asmparser asmprinter bitreader bitwriter codegen core debuginfocodeview debuginfodwarf debuginfopdb engine executionengine instcombine instrumentation interpreter ipo irreader libdriver lineeditor linker lto mc mcdisassembler mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser native nativecodegen objcarcopts object option orcjit passes powerpc powerpcasmparser powerpcasmprinter powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata runtimedyld scalaropts selectiondag support symbolize tablegen target transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils" "--llvm-cxxflags" "-IC:\\bot\\slave\\auto-win-msvc-64-opt-rustbuild\\build\\obj\\build\\x86_64-pc-windows-msvc\\llvm/include  /nologo /MD /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4324 -w14062 -we4238 /Zc:inline /MD /O2 /Ob2 /D NDEBUG  /EHs-c- /GR- /MP -D_DEBUG_POINTER_IMPL= -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" "--adb-path" "adb" "--adb-test-dir" "/data/tmp" "--android-cross-path" ""
thread 'main' panicked at 'Some tests failed', C:\bot\slave\auto-win-msvc-64-opt-rustbuild\build\src\tools\compiletest\src\main.rs:293
expected success, got: exit code: 101

@brson
Copy link
Contributor

brson commented Jul 21, 2016

@japaric Can we just xfail this on windows and push it through?

@japaric
Copy link
Member Author

japaric commented Jul 22, 2016

@brson By "xfail" do you mean ignoring this test on windows? That would be fine by me. Is this the standard way to do that?

@brson
Copy link
Contributor

brson commented Jul 22, 2016

@japaric Yep, and that snippet looks ok to me (but I've never ignored a run-make test before).

@japaric
Copy link
Member Author

japaric commented Jul 22, 2016

I just realized my Makefile is missing the -include ../tools.mk that all the other run-make Makefiles have ... so I'm going to first check if that was the problem.

@bors try

@bors
Copy link
Contributor

bors commented Jul 22, 2016

⌛ Trying commit 94ae8bb with merge 756564a...

bors added a commit that referenced this pull request Jul 22, 2016
fix built-in target detection

previously the logic was accepting wrong triples (like
`x86_64_unknown-linux-musl`) as valid ones (like `x86_64-unknown-linux-musl`) if
they contained an underscore instead of a dash.

fixes #33329

---

r? @brson

I wanted to use a compile-fail test at first. But, you can't pass an extra `--target` flag to `rustc` for those because they already call `rustc --target $HOST` so you get a `error: Option 'target' given more than once.`. The run-make test used here works fine though.
@bors
Copy link
Contributor

bors commented Jul 23, 2016

💥 Test timed out

@alexcrichton
Copy link
Member

Ah unfortunately @bors: try doesn't actually work, but let's see if 94ae8bb works on bors

@bors: r+ 94ae8bb

@japaric
Copy link
Member Author

japaric commented Jul 25, 2016

This was stuck in the queue as failed (because of the previous try). Rebased so I can r+ it again.

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 25, 2016

📌 Commit f438801 has been approved by japaric

@bors
Copy link
Contributor

bors commented Jul 25, 2016

⌛ Testing commit f438801 with merge 5033302...

@alexcrichton
Copy link
Member

@bors: retry force clean

  • restarted buildbot

@alexcrichton
Copy link
Member

@bors: retry force clean

@bors
Copy link
Contributor

bors commented Jul 25, 2016

⌛ Testing commit f438801 with merge 31db8e2...

@bors
Copy link
Contributor

bors commented Jul 25, 2016

💔 Test failed - auto-win-gnu-32-opt

@alexcrichton
Copy link
Member

@bors: retry

On Mon, Jul 25, 2016 at 2:45 PM, bors [email protected] wrote:

💔 Test failed - auto-win-gnu-32-opt
https://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt/builds/5067


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#33363 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95JsWjEYoFRvExsLFPCnpxNy_2Jhtks5qZS5ogaJpZM4IV058
.

@bors
Copy link
Contributor

bors commented Jul 26, 2016

⌛ Testing commit f438801 with merge c1b278a...

@bors
Copy link
Contributor

bors commented Jul 26, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@alexcrichton
Copy link
Member

@bors: retry

On Tue, Jul 26, 2016 at 3:02 AM, bors [email protected] wrote:

💔 Test failed - auto-win-gnu-32-opt-rustbuild
https://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt-rustbuild/builds/1948


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#33363 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95HrVYYpYJGJMdY_p4VjYYSyzs7Rlks5qZds9gaJpZM4IV058
.

@bors
Copy link
Contributor

bors commented Jul 27, 2016

⌛ Testing commit f438801 with merge a373b84...

bors added a commit that referenced this pull request Jul 27, 2016
fix built-in target detection

previously the logic was accepting wrong triples (like
`x86_64_unknown-linux-musl`) as valid ones (like `x86_64-unknown-linux-musl`) if
they contained an underscore instead of a dash.

fixes #33329

---

r? @brson

I wanted to use a compile-fail test at first. But, you can't pass an extra `--target` flag to `rustc` for those because they already call `rustc --target $HOST` so you get a `error: Option 'target' given more than once.`. The run-make test used here works fine though.
@bors bors merged commit f438801 into rust-lang:master Jul 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validate target triples before resolving crates
7 participants