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

Don't use static crt by default when build proc-macro #69519

Merged
merged 9 commits into from
Mar 17, 2020

Conversation

12101111
Copy link
Contributor

@12101111 12101111 commented Feb 27, 2020

Don't check value of crt-static when build proc-macro crates, since they are always built dynamically.
For more information, see rust-lang/cargo#7563 (comment)
I hope this will fix issues about compiling proc_macro crates on musl host without bring more issues.
Fix rust-lang/cargo#7563

@rust-highfive
Copy link
Collaborator

r? @varkor

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 27, 2020
@Centril
Copy link
Contributor

Centril commented Feb 27, 2020

r? @eddyb cc @petrochenkov

@rust-highfive rust-highfive assigned eddyb and unassigned varkor Feb 27, 2020
@eddyb
Copy link
Member

eddyb commented Feb 27, 2020

r? @alexcrichton (I don't know much about linking or crt-static)

@rust-highfive rust-highfive assigned alexcrichton and unassigned eddyb Feb 27, 2020
@alexcrichton
Copy link
Member

Sorry while I'm familiar with the bits here I wouldn't be comfortable signing off and approving this. Everything dealing with crt-static I feel has become very hairy and hard to follow, and I no longer fully understand all the ways it interacts with rustc. Can another reviewer be assigned?

@Centril
Copy link
Contributor

Centril commented Mar 1, 2020

Let's try r? @nagisa

@rust-highfive rust-highfive assigned nagisa and unassigned alexcrichton Mar 1, 2020
@nagisa
Copy link
Member

nagisa commented Mar 1, 2020

I’m not the most familiar with this code either, but a 5 minute look around the relevant portions of the code-base makes me feel that this is wrong and is just trying to work around an issue elsewhere.

In particular this appears to now ignore the crt-static feature entirely and my intuition says that this isn't ever correct when rustc is used in isolation. That is, rustc --crate-type=proc-macro -Ctarget-feature=+crt-static is still an invalid way to build a proc-macro and should fail, rather than ignoring the option.

@12101111
Copy link
Contributor Author

12101111 commented Mar 2, 2020

This PR is based on the idea from #40174 (comment) suggested by rust-lang/cargo#7564 (comment)

I have updated the code and test it locally.

$ cat test.rs
extern crate proc_macro;
$ rustc test.rs --crate-type proc-macro
warning: dropping unsupported crate type `proc-macro` for target `x86_64-unknown-linux-musl`
$ rustc test.rs --crate-type proc-macro -C target-feature=-crt-static
$ rustc test.rs --crate-type proc-macro -C target-feature=+crt-static
warning: dropping unsupported crate type `proc-macro` for target `x86_64-unknown-linux-musl`
$ rustc +stage1 test.rs --crate-type proc-macro
$ rustc +stage1 test.rs --crate-type proc-macro -C target-feature=-crt-static
$ rustc +stage1 test.rs --crate-type proc-macro -C target-feature=+crt-static
warning: dropping unsupported crate type `proc-macro` for target `x86_64-unknown-linux-musl`

I don’t know the progress of bootstraping rustc on Redox OS , but this PR also affect the Redox target(if they have built a runable rustc on Redox) since relibc have the same behavior like musl.

@nagisa
Copy link
Member

nagisa commented Mar 2, 2020

So the idea is probably in the right direction, but I think twiddling with how the crt_static_default itself is computed rather than trying to adjust invalid_output_for_target will be significantly more understandable, maintainable and reliable. Could also adjust the crt_static function itself too.

Please also add a test (probably will need to resort to a run-make one, you can see some examples in src/test/run-make)

@12101111 12101111 changed the title Don't check crt-static when build proc-macro Don't use static crt by default when build proc-macro Mar 3, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-03T08:30:45.2387899Z ========================== Starting Command Output ===========================
2020-03-03T08:30:45.2393714Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/10678631-12fb-4579-8373-b3ead94b621c.sh
2020-03-03T08:30:45.2394215Z 
2020-03-03T08:30:45.2398556Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-03T08:30:45.2416735Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69519/merge to s
2020-03-03T08:30:45.2420183Z Task         : Get sources
2020-03-03T08:30:45.2420440Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-03T08:30:45.2420684Z Version      : 1.0.0
2020-03-03T08:30:45.2420849Z Author       : Microsoft
---
2020-03-03T08:30:46.2293741Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-03T08:30:46.2298747Z ##[command]git config gc.auto 0
2020-03-03T08:30:46.2302207Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-03T08:30:46.2305396Z ##[command]git config --get-all http.proxy
2020-03-03T08:30:46.2311536Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/69519/merge:refs/remotes/pull/69519/merge
---
2020-03-03T09:34:56.3728398Z .................................................................................................... 1700/9726
2020-03-03T09:35:00.9010746Z .................................................................................................... 1800/9726
2020-03-03T09:35:13.0636345Z ......................................................i............................................. 1900/9726
2020-03-03T09:35:20.2094954Z .................................................................................................... 2000/9726
2020-03-03T09:35:33.9874485Z ............................................iiiii................................................... 2100/9726
2020-03-03T09:35:43.9360595Z .................................................................................................... 2300/9726
2020-03-03T09:35:46.1737134Z .................................................................................................... 2400/9726
2020-03-03T09:35:49.9403775Z .................................................................................................... 2500/9726
2020-03-03T09:36:11.3172157Z .................................................................................................... 2600/9726
---
2020-03-03T09:38:47.9332422Z .....i...............i.............................................................................. 5000/9726
2020-03-03T09:38:57.5995634Z .................................................................................................... 5100/9726
2020-03-03T09:39:02.1750169Z ................................................i................................................... 5200/9726
2020-03-03T09:39:10.5818916Z .................................................................................................... 5300/9726
2020-03-03T09:39:17.7296225Z ...........................ii.ii........i...i....................................................... 5400/9726
2020-03-03T09:39:25.5460394Z .................................................................................................... 5600/9726
2020-03-03T09:39:34.7688555Z .................................................................................................... 5700/9726
2020-03-03T09:39:41.7723437Z ..................i................................................................................. 5800/9726
2020-03-03T09:39:47.9351402Z .................................................................................................... 5900/9726
2020-03-03T09:39:47.9351402Z .................................................................................................... 5900/9726
2020-03-03T09:39:58.7690988Z .................................................................................................... 6000/9726
2020-03-03T09:40:09.9236582Z ..........ii...i..ii...........i.................................................................... 6100/9726
2020-03-03T09:40:26.1345292Z .................................................................................................... 6300/9726
2020-03-03T09:40:32.8229019Z .................................................................................................... 6400/9726
2020-03-03T09:40:32.8229019Z .................................................................................................... 6400/9726
2020-03-03T09:40:49.8764714Z .........................................i..ii...................................................... 6500/9726
2020-03-03T09:41:11.5079421Z .................................................................................................... 6700/9726
2020-03-03T09:41:13.5283927Z .................................i.................................................................. 6800/9726
2020-03-03T09:41:15.5672155Z .................................................................................................... 6900/9726
2020-03-03T09:41:17.8221193Z ...............................................................i.................................... 7000/9726
---
2020-03-03T09:42:56.8971148Z .................................................................................................... 7700/9726
2020-03-03T09:43:02.2933001Z .................................................................................................... 7800/9726
2020-03-03T09:43:07.7004257Z .................................................................................................... 7900/9726
2020-03-03T09:43:16.2625401Z ..........i......................................................................................... 8000/9726
2020-03-03T09:43:25.2254943Z ...........................................................iiiiiii.i................................ 8100/9726
2020-03-03T09:43:39.5749077Z i......i............................................................................................ 8300/9726
2020-03-03T09:43:44.9829077Z .................................................................................................... 8400/9726
2020-03-03T09:43:59.5487615Z .................................................................................................... 8500/9726
2020-03-03T09:44:07.9004179Z .................................................................................................... 8600/9726
---
2020-03-03T09:46:02.3180615Z ---- [ui] ui/proc-macro/musl-proc-macro.rs stdout ----
2020-03-03T09:46:02.3181100Z 
2020-03-03T09:46:02.3182050Z error: test compilation failed although it shouldn't!
2020-03-03T09:46:02.3182388Z status: exit code: 1
2020-03-03T09:46:02.3184566Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/proc-macro/musl-proc-macro.rs" "-Zthreads=1" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/musl-proc-macro/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target=x86_64-unknown-linux-musl" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/musl-proc-macro/auxiliary"
2020-03-03T09:46:02.3186346Z ------------------------------------------
2020-03-03T09:46:02.3186538Z 
2020-03-03T09:46:02.3186942Z ------------------------------------------
2020-03-03T09:46:02.3187181Z stderr:
2020-03-03T09:46:02.3187181Z stderr:
2020-03-03T09:46:02.3187596Z ------------------------------------------
2020-03-03T09:46:02.3188089Z error[E0463]: can't find crate for `std`
2020-03-03T09:46:02.3188535Z    |
2020-03-03T09:46:02.3189112Z    = note: the `x86_64-unknown-linux-musl` target may not be installed
2020-03-03T09:46:02.3189589Z error: aborting due to previous error
2020-03-03T09:46:02.3189910Z 
2020-03-03T09:46:02.3190426Z For more information about this error, try `rustc --explain E0463`.
2020-03-03T09:46:02.3190661Z 
---
2020-03-03T09:46:02.3193918Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-03T09:46:02.3194373Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-03T09:46:02.3207901Z 
2020-03-03T09:46:02.3208142Z 
2020-03-03T09:46:02.3222109Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-03T09:46:02.3233242Z 
2020-03-03T09:46:02.3233350Z 
2020-03-03T09:46:02.3233606Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-03-03T09:46:02.3234003Z Build completed unsuccessfully in 1:07:30
2020-03-03T09:46:02.3234003Z Build completed unsuccessfully in 1:07:30
2020-03-03T09:46:02.3276872Z == clock drift check ==
2020-03-03T09:46:02.3295260Z   local time: Tue Mar  3 09:46:02 UTC 2020
2020-03-03T09:46:02.8708201Z   network time: Tue, 03 Mar 2020 09:46:02 GMT
2020-03-03T09:46:02.8708495Z == end clock drift check ==
2020-03-03T09:46:03.4585871Z 
2020-03-03T09:46:03.4671189Z ##[error]Bash exited with code '1'.
2020-03-03T09:46:03.4694645Z ##[section]Finishing: Run build
2020-03-03T09:46:03.4772276Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69519/merge to s
2020-03-03T09:46:03.4777237Z Task         : Get sources
2020-03-03T09:46:03.4777548Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-03T09:46:03.4778016Z Version      : 1.0.0
2020-03-03T09:46:03.4778222Z Author       : Microsoft
2020-03-03T09:46:03.4778222Z Author       : Microsoft
2020-03-03T09:46:03.4778550Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-03T09:46:03.4778943Z ==============================================================================
2020-03-03T09:46:03.8087628Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-03T09:46:03.8140499Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/69519/merge to s
2020-03-03T09:46:03.8228722Z Cleaning up task key
2020-03-03T09:46:03.8229822Z Start cleaning up orphan processes.
2020-03-03T09:46:03.8414214Z Terminate orphan process: pid (4037) (python)
2020-03-03T09:46:03.8675181Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-03T11:18:17.9296438Z ========================== Starting Command Output ===========================
2020-03-03T11:18:17.9300049Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/cda4cc99-c271-4acb-b211-7e531fe54078.sh
2020-03-03T11:18:17.9301179Z 
2020-03-03T11:18:17.9305185Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-03T11:18:17.9326485Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69519/merge to s
2020-03-03T11:18:17.9331099Z Task         : Get sources
2020-03-03T11:18:17.9331751Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-03T11:18:17.9332070Z Version      : 1.0.0
2020-03-03T11:18:17.9332307Z Author       : Microsoft
---
2020-03-03T11:18:19.1406773Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-03T11:18:19.1420827Z ##[command]git config gc.auto 0
2020-03-03T11:18:19.1425804Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-03T11:18:19.1429614Z ##[command]git config --get-all http.proxy
2020-03-03T11:18:19.1437345Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/69519/merge:refs/remotes/pull/69519/merge
---
2020-03-03T11:24:34.6381410Z Done!
2020-03-03T11:24:34.6386193Z some tidy checks failed
2020-03-03T11:24:34.6392014Z 
2020-03-03T11:24:34.6392284Z 
2020-03-03T11:24:34.6394364Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2020-03-03T11:24:34.6395730Z 
2020-03-03T11:24:34.6395905Z 
2020-03-03T11:24:34.6401105Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2020-03-03T11:24:34.6401757Z Build completed unsuccessfully in 0:01:38
2020-03-03T11:24:34.6401757Z Build completed unsuccessfully in 0:01:38
2020-03-03T11:24:34.6447756Z == clock drift check ==
2020-03-03T11:24:34.6459880Z   local time: Tue Mar  3 11:24:34 UTC 2020
2020-03-03T11:24:34.9315152Z   network time: Tue, 03 Mar 2020 11:24:34 GMT
2020-03-03T11:24:34.9318820Z == end clock drift check ==
2020-03-03T11:24:35.6719311Z 
2020-03-03T11:24:35.6795637Z ##[error]Bash exited with code '1'.
2020-03-03T11:24:35.6810318Z ##[section]Finishing: Run build
2020-03-03T11:24:35.6859711Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69519/merge to s
2020-03-03T11:24:35.6865275Z Task         : Get sources
2020-03-03T11:24:35.6865657Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-03T11:24:35.6865990Z Version      : 1.0.0
2020-03-03T11:24:35.6866222Z Author       : Microsoft
2020-03-03T11:24:35.6866222Z Author       : Microsoft
2020-03-03T11:24:35.6866615Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-03T11:24:35.6867041Z ==============================================================================
2020-03-03T11:24:36.0140449Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-03T11:24:36.0189227Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/69519/merge to s
2020-03-03T11:24:36.0276773Z Cleaning up task key
2020-03-03T11:24:36.0278117Z Start cleaning up orphan processes.
2020-03-03T11:24:36.0449468Z Terminate orphan process: pid (3742) (python)
2020-03-03T11:24:36.0579146Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

src/librustc_session/session.rs Outdated Show resolved Hide resolved
// on musl target

// build-pass
// only-musl
Copy link
Contributor

Choose a reason for hiding this comment

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

This test doesn't depend on any musl-specific functionality, so I would expect it to run everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It depend on musl target but CI don't have it.

2020-03-03T09:46:02.3188089Z error[E0463]: can't find crate for `std`
2020-03-03T09:46:02.3188535Z    |
2020-03-03T09:46:02.3189112Z    = note: the `x86_64-unknown-linux-musl` target may not be installed
2020-03-03T09:46:02.3189589Z error: aborting due to previous error
2020-03-03T09:46:02.3189910Z 
2020-03-03T09:46:02.3190426Z For more information about this error, try `rustc --explain E0463`.

Copy link
Contributor

Choose a reason for hiding this comment

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

Which CI job was it? This is a problem with the CI configuration, not something that needs to be worked around in the test. Specifically, the musl targets built by CI are missing the dynamic version of libstd. To fix this, they need to be built with crt_static=false (the config.toml option, not the rustc flag), like the dist-x86_64-musl job does:

--set target.x86_64-unknown-linux-musl.crt-static=false \

Copy link
Contributor

Choose a reason for hiding this comment

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

@smaeul it failed on x86_64-gnu-llvm-7.

Copy link
Contributor

Choose a reason for hiding this comment

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

The x86_64-gnu-llvm-7 job only builds for x86_64-unknown-linux-gnu. It doesn't look like it does anything with musl at all. So where did "--target=x86_64-unknown-linux-musl" in the rustc arguments for this test come from?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see, the old version of the test had compile-flags: --target=x86_64-unknown-linux-musl in it. That was the problem. After removing that line, the test should work on all targets.

So since the behavior tested here is not musl-specific, I would suggest 1) removing only-musl and 2) renaming the test to mention crt-static instead of musl.

src/librustc_session/session.rs Outdated Show resolved Hide resolved
@mati865
Copy link
Contributor

mati865 commented Mar 8, 2020

I fairly confident your test would pass regardless of changes in this PR.
dist-i586-gnu-i586-i686-musl cross compiles tests from x86_64-unknown-linux-gnu and proc-macro works fine in that case.
x86_64-unknown-linux-musl runs tests with -crt-static in order to make dylib tests like run-make-fulldeps pass. This also makes all proc-macro tests pass.

@12101111
Copy link
Contributor Author

12101111 commented Mar 8, 2020

It seems a hack like // compile-flags: -Ctarget-feature= will override -Ctarget-feature=-crt-static from compiletest
master:

running 1 test
F
failures:

---- [ui] ui/proc-macro/musl-proc-macro.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit code: 1
command: "/home/han/rust/build/x86_64-unknown-linux-musl/stage1/bin/rustc" "/home/han/rust/src/test/ui/proc-macro/musl-proc-macro.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-musl" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "--out-dir" "/home/han/rust/build/x86_64-unknown-linux-musl/test/ui/proc-macro/musl-proc-macro" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/han/rust/build/x86_64-unknown-linux-musl/native/rust-test-helpers" "-Ctarget-feature=-crt-static" "-A" "unused" "-Ctarget-feature=" "-L" "/home/han/rust/build/x86_64-unknown-linux-musl/test/ui/proc-macro/musl-proc-macro/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
warning: dropping unsupported crate type `proc-macro` for target `x86_64-unknown-linux-musl`

error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
  --> /home/han/rust/src/test/ui/proc-macro/musl-proc-macro.rs:13:1
   |
LL | #[proc_macro_derive(Foo)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

@nagisa
Copy link
Member

nagisa commented Mar 8, 2020

@bors r+

Thanks for putting up with us :)

@rust-highfive
Copy link
Collaborator

The job test-various of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-16T08:06:07.4509282Z ---- [ui] ui/proc-macro/crt-static.rs stdout ----
2020-03-16T08:06:07.4509484Z 
2020-03-16T08:06:07.4509865Z error: test compilation failed although it shouldn't!
2020-03-16T08:06:07.4510111Z status: exit code: 1
2020-03-16T08:06:07.4511658Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/proc-macro/crt-static.rs" "-Zthreads=1" "--target=wasm32-unknown-unknown" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/crt-static" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-A" "unused" "-Ctarget-feature=" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/crt-static/auxiliary"
2020-03-16T08:06:07.4512985Z ------------------------------------------
2020-03-16T08:06:07.4513137Z 
2020-03-16T08:06:07.4513451Z ------------------------------------------
2020-03-16T08:06:07.4513631Z stderr:
2020-03-16T08:06:07.4513631Z stderr:
2020-03-16T08:06:07.4513948Z ------------------------------------------
2020-03-16T08:06:07.4514658Z warning: dropping unsupported crate type `proc-macro` for target `wasm32-unknown-unknown`
2020-03-16T08:06:07.4514907Z 
2020-03-16T08:06:07.4515346Z error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
2020-03-16T08:06:07.4515862Z   --> /checkout/src/test/ui/proc-macro/crt-static.rs:12:1
2020-03-16T08:06:07.4516452Z LL | #[proc_macro_derive(Foo)]
2020-03-16T08:06:07.4516676Z    | ^^^^^^^^^^^^^^^^^^^^^^^^^
2020-03-16T08:06:07.4516811Z 
2020-03-16T08:06:07.4516991Z error: aborting due to previous error
---
2020-03-16T08:06:07.4548564Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-16T08:06:07.4549541Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-16T08:06:07.4575929Z 
2020-03-16T08:06:07.4576108Z 
2020-03-16T08:06:07.4582263Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-wasm32-unknown-unknown" "--mode" "ui" "--target" "wasm32-unknown-unknown" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/node-v9.2.0-linux-x64/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "9.0.1-rust-1.43.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-16T08:06:07.4584652Z 
2020-03-16T08:06:07.4584759Z 
2020-03-16T08:06:07.4585597Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-unknown src/test/run-make src/test/ui src/test/compile-fail src/test/mir-opt src/test/codegen-units src/libcore
2020-03-16T08:06:07.4586109Z Build completed unsuccessfully in 1:34:26
2020-03-16T08:06:07.4586109Z Build completed unsuccessfully in 1:34:26
2020-03-16T08:06:07.4646439Z == clock drift check ==
2020-03-16T08:06:07.4685540Z   local time: Mon Mar 16 08:06:07 UTC 2020
2020-03-16T08:06:07.9983974Z   network time: Mon, 16 Mar 2020 08:06:07 GMT
2020-03-16T08:06:07.9985602Z == end clock drift check ==
2020-03-16T08:06:08.9464011Z 
2020-03-16T08:06:08.9553735Z ##[error]Bash exited with code '1'.
2020-03-16T08:06:08.9613861Z ##[section]Starting: Checkout rust-lang/rust@auto to s
2020-03-16T08:06:08.9621459Z ==============================================================================
2020-03-16T08:06:08.9621879Z Task         : Get sources
2020-03-16T08:06:08.9622294Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Mar 16, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 16, 2020
@12101111
Copy link
Contributor Author

Sorry for the inconvenience. Could you try this again? @nagisa

@Dylan-DPC-zz
Copy link

@bors r=nagisa

@bors
Copy link
Contributor

bors commented Mar 17, 2020

📌 Commit afd374f has been approved by nagisa

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2020
@bors
Copy link
Contributor

bors commented Mar 17, 2020

⌛ Testing commit afd374f with merge 04cc8af4d0b1e758c7f9a34146848ccc557c7063...

@Centril
Copy link
Contributor

Centril commented Mar 17, 2020

@bors retry yielding

@bors
Copy link
Contributor

bors commented Mar 17, 2020

⌛ Testing commit afd374f with merge 7ceebd9...

@Manishearth
Copy link
Member

@bors p=20

@bors
Copy link
Contributor

bors commented Mar 17, 2020

☀️ Test successful - checks-azure
Approved by: nagisa
Pushing 7ceebd9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 17, 2020
@bors bors merged commit 7ceebd9 into rust-lang:master Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot produce proc-macro when --target is set on musl host toolchain