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

rustc: Use link_section, not wasm_custom_section #52353

Merged
merged 1 commit into from
Jul 18, 2018

Conversation

alexcrichton
Copy link
Member

This commit transitions definitions of custom sections on the wasm target from
the unstable #[wasm_custom_section] attribute to the
already-stable-for-other-targets #[link_section] attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088

@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(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 Jul 13, 2018
@alexcrichton
Copy link
Member Author

cc @eddyb

ty::TyUint(ast::UintTy::U8) => return,
_ => {}
}
fn maybe_check_static_with_link_section(tcx: TyCtxt, id: DefId, span: Span) {
Copy link
Member

Choose a reason for hiding this comment

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

cc @oli-obk Should this be in rustc_typeck?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems fine for now. I can merge it into #51361 once that becomes a thing (since this is more of a constant value validation than a type check)

@eddyb
Copy link
Member

eddyb commented Jul 13, 2018

LGTM, and I guess rustc_typeck is an okay place to put it.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (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.
travis_time:start:test_incremental
Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:52:56] 
[00:52:56] running 90 tests
[00:53:09] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:53:09] .........................................................F................................
[00:53:09] 
[00:53:09] ---- [incremental] incremental/issue-49595/issue_49595.rs stdout ----
[00:53:09] 
[00:53:09] 
[00:53:09] error in revision `cfail2`: test compilation failed although it shouldn't!
[00:53:09] status: exit code: 101
[00:53:09] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/incremental/issue-49595/issue_49595.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "cfail2" "-C" "incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/issue-49595/issue_49595/issue_49595.inc" "-Z" "incremental-verify-ich" "-Z" "incremental-queries" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/issue-49595/issue_49595/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "query-dep-graph" "--test" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/issue-49595/issue_49595/auxiliary"
[00:53:09] ------------------------------------------
[00:53:09] 
[00:53:09] ------------------------------------------
[00:53:09] stderr:
[00:53:09] stderr:
[00:53:09] ------------------------------------------
[00:53:09] {"message":"expected module named `issue_49595-tests` to be Codegened but is Reused","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/incremental/issue-49595/issue_49595.rs","byte_start":612,"byte_end":683,"line_start":18,"line_end":18,"column_start":1,"column_end":72,"is_primary":true,"text":[{"text":"#![rustc_partition_codegened(module=\"issue_49595-tests\", cfg=\"cfail2\")]","highlight_start":1,"highlight_end":72}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: expected module named `issue_49595-tests` to be Codegened but is Reused\n  --> /checkout/src/test/incremental/issue-49595/issue_49595.rs:18:1\n   |\nLL | #![rustc_partition_codegened(module=\"issue_49595-tests\", cfg=\"cfail2\")]\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:53:09] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:53:09] ------------------------------------------
[00:53:09] 
[00:53:09] thread '[incremental] incremental/issue-49595/issue_49595.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3139:9
[00:53:09] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:53:09] test result: FAILED. 89 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[00:53:09] 
[00:53:09] 
[00:53:09] 
[00:53:09] 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/incremental" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "incremental" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-hFri, 13 Jul 2018 20:11:44 GMT

The command "date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
" exited with 0.
travis_fold:start:after_failure.1
---
travis_time:end:0031f296:start=1531512706512068392,finish=1531512706520219355,duration=8150963
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:19b13b27
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:1a1cdef0
$ dmesg | grep -i kill

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)

@alexcrichton
Copy link
Member Author

@michaelwoerister hm can you help me figure out how to fix the test here? I believe because I've switched to codegen_fn_attrs in a few locations it's causing better cache reuse (yay!) so the test is failing where something was previously regenerated but it no longer is. I've verified locally that the test in question works correctly, though.

For example commenting out the #[ignore] does indeed cause the test to be ignored in the resulting binary, and additionally switching the string constant does indeed print out something different. I think the issue is that something is still recodegen'd on cfail2 for the test (after #[ignore] is added), but I'm not quite sure what. How do I find the name of the module to insert there?

@bors
Copy link
Contributor

bors commented Jul 14, 2018

☔ The latest upstream changes (presumably #52266) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton alexcrichton force-pushed the wasm-custom-section branch 2 times, most recently from 0d82c0f to d0288cb Compare July 16, 2018 14:19
@alexcrichton
Copy link
Member Author

Ok, I think I figured out the appropriate incantation

@bors
Copy link
Contributor

bors commented Jul 16, 2018

☔ The latest upstream changes (presumably #52264) made this pull request unmergeable. Please resolve the merge conflicts.

This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes rust-lang#51088
@alexcrichton
Copy link
Member Author

r? @eddyb

@eddyb
Copy link
Member

eddyb commented Jul 16, 2018

@bors+

@alexcrichton
Copy link
Member Author

@bors: r=eddyb

@bors
Copy link
Contributor

bors commented Jul 18, 2018

📌 Commit b7ef674 has been approved by eddyb

@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 Jul 18, 2018
@bors
Copy link
Contributor

bors commented Jul 18, 2018

⌛ Testing commit b7ef674 with merge cd5f5a1...

bors added a commit that referenced this pull request Jul 18, 2018
rustc: Use link_section, not wasm_custom_section

This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088
@bors
Copy link
Contributor

bors commented Jul 18, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing cd5f5a1 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants