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

Remove crate_type and crate_name attributes from compiler crates #41706

Closed
wants to merge 1 commit into from
Closed

Remove crate_type and crate_name attributes from compiler crates #41706

wants to merge 1 commit into from

Conversation

daniellockyer
Copy link
Contributor

@daniellockyer daniellockyer commented May 2, 2017

Fixes #41701.

@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.

@aidanhs
Copy link
Member

aidanhs commented May 3, 2017

Hi @neosilky, thanks for the PR! We'll check back now and again to make sure @brson or another reviewer gets to this soon.

@aidanhs aidanhs added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 3, 2017
@Mark-Simulacrum
Copy link
Member

@brson Checking in, could you review this PR?

cc @alexcrichton

@brson
Copy link
Contributor

brson commented May 7, 2017

@bors r+ thanks @neosilky !

@bors
Copy link
Contributor

bors commented May 7, 2017

📌 Commit f3cee21 has been approved by brson

@brson
Copy link
Contributor

brson commented May 7, 2017

Travis failure is spurious.

@bors
Copy link
Contributor

bors commented May 7, 2017

⌛ Testing commit f3cee21 with merge fbd491e...

@bors
Copy link
Contributor

bors commented May 7, 2017

💔 Test failed - status-appveyor

@@ -11,7 +11,6 @@
// See rsbegin.rs for details.

#![feature(no_core, lang_items, optin_builtin_traits)]
#![crate_type="rlib"]
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be re-added, as there is no associated Cargo.toml.

@@ -23,7 +23,6 @@
// of other runtime components (registered via yet another special image section).

#![feature(no_core, lang_items, optin_builtin_traits)]
#![crate_type="rlib"]
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be re-added, as there is no associated Cargo.toml.

@Mark-Simulacrum
Copy link
Member

@neosilky Found a few more problems, but I think those should be the last things.

@daniellockyer
Copy link
Contributor Author

@Mark-Simulacrum Ah yes! I've re-added in the latest commit.

@Mark-Simulacrum
Copy link
Member

@brson I think this is ready for another review. Could you take a look?

@carols10cents
Copy link
Member

Looks like there's a test failure?

[00:50:31] failures:
[00:50:31] 
[00:50:31] ---- [run-make] run-make/alloc-extern-crates stdout ----
[00:50:31] 	
[00:50:31] error: make failed
[00:50:31] status: exit code: 2
[00:50:31] command: "make"
[00:50:31] stdout:
[00:50:31] ------------------------------------------
[00:50:31] make[1]: Entering directory '/checkout/src/test/run-make/alloc-extern-crates'
[00:50:31] LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu  fakealloc.rs
[00:50:31] LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu  ../../../liballoc/lib.rs --cfg feature=\"external_crate\" --extern external=/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu/libfakealloc.rlib
[00:50:31] thread 'main' panicked at 'Some tests failed', /checkout/src/tools/compiletest/src/main.rs:315
[00:50:31] Makefile:4: recipe for target 'all' failed
[00:50:31] make[1]: Leaving directory '/checkout/src/test/run-make/alloc-extern-crates'
[00:50:31] 
[00:50:31] ------------------------------------------
[00:50:31] stderr:
[00:50:31] ------------------------------------------
[00:50:31] make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[00:50:31] error: language item required, but not found: `panic_fmt`
[00:50:31] 
[00:50:31] error: language item required, but not found: `eh_personality`
[00:50:31] 
[00:50:31] error: aborting due to 2 previous errors
[00:50:31] 
[00:50:31] make[1]: *** [all] Error 101
[00:50:31] 
[00:50:31] ------------------------------------------
[00:50:31] 
[00:50:31] thread '[run-make] run-make/alloc-extern-crates' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2467
[00:50:31] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:50:31] 
[00:50:31] 
[00:50:31] failures:
[00:50:31]     [run-make] run-make/alloc-extern-crates
[00:50:31] 
[00:50:31] test result: FAILED. 149 passed; 1 failed; 0 ignored; 0 measured

@carols10cents carols10cents added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2017
@bors
Copy link
Contributor

bors commented May 13, 2017

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

@arielb1
Copy link
Contributor

arielb1 commented May 16, 2017

Nice PR, @neosilky! There are however some test failures. Do you need help fixing them?

@bors
Copy link
Contributor

bors commented May 21, 2017

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

@arielb1
Copy link
Contributor

arielb1 commented May 23, 2017

compilation failure:

[00:03:07] error[E0432]: unresolved import `Substitution`
[00:03:07]   --> /checkout/src/librustc_errors/diagnostic.rs:12:5
[00:03:07]    |
[00:03:07] 12 | use Substitution;
[00:03:07]    |     ^^^^^^^^^^^^ no `Substitution` in the root
[00:03:07] 
[00:03:07] error[E0560]: struct `CodeSuggestion` has no field named `substitution_parts`
[00:03:07]    --> /checkout/src/librustc_errors/diagnostic.rs:209:13
[00:03:07]     |
[00:03:07] 209 |             substitution_parts: vec![Substitution {
[00:03:07]     |             ^^^^^^^^^^^^^^^^^^^ field does not exist - did you mean `substitutes`?
[00:03:07] 
[00:03:07] error[E0560]: struct `CodeSuggestion` has no field named `substitution_parts`
[00:03:07]    --> /checkout/src/librustc_errors/diagnostic.rs:220:13
[00:03:07]     |
[00:03:07] 220 |             substitution_parts: vec![Substitution {
[00:03:07]     |             ^^^^^^^^^^^^^^^^^^^ field does not exist - did you mean `substitutes`?
[00:03:07] 
[00:03:07] error: no field `substitution_parts` on type `&CodeSuggestion`
[00:03:07]   --> /checkout/src/librustc_errors/emitter.rs:41:21
[00:03:07]    |
[00:03:07] 41 |                sugg.substitution_parts.len() == 1 &&
[00:03:07]    |                     ^^^^^^^^^^^^^^^^^^
[00:03:07] 

Are you working on this @neosilky? Need any help?

@arielb1
Copy link
Contributor

arielb1 commented May 23, 2017

Feel free to ask for help on IRC (on #rust-internals or #rustc) - you can ping me (arielb1/arielby) personally.

@daniellockyer
Copy link
Contributor Author

Sorry @arielb1, I'm just prepping for an exam tomorrow... I will fix this up after then!

@Mark-Simulacrum Mark-Simulacrum dismissed their stale review May 28, 2017 03:40

No longer relevant.

@aidanhs
Copy link
Member

aidanhs commented Jun 1, 2017

Hi @neosilky, just want to make sure this hasn't dropped off your radar! Do you think you'll get time to look at it?

@Mark-Simulacrum
Copy link
Member

Hm, that same test failure that @arielb1 noticed is still present, and I'm not actually quite sure why. @arielb1 is there a chance you could investigate and comment here?

@arielb1
Copy link
Contributor

arielb1 commented Jun 13, 2017

Taking a fresh look at the test failure, which is:

[00:45:34] ---- [run-make] run-make/alloc-extern-crates stdout ----
[00:45:34] 	
[00:45:34] error: make failed
[00:45:34] status: exit code: 2
[00:45:34] command: "make"
[00:45:34] stdout:
[00:45:34] ------------------------------------------
[00:45:34] make[1]: Entering directory '/checkout/src/test/run-make/alloc-extern-crates'
[00:45:34] LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu  fakealloc.rs
[00:45:34] LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu  ../../../liballoc/lib.rs --cfg feature=\"external_crate\" --extern external=/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/alloc-extern-crates.stage2-x86_64-unknown-linux-gnu/libfakealloc.rlib
[00:45:34] Makefile:4: recipe for target 'all' failed
[00:45:34] make[1]: Leaving directory '/checkout/src/test/run-make/alloc-extern-crates'
[00:45:34] 
[00:45:34] ------------------------------------------
[00:45:34] stderr:
[00:45:34] ------------------------------------------
[00:45:34] make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[00:45:34] error: language item required, but not found: `panic_fmt`
[00:45:34] 
[00:45:34] error: language item required, but not found: `eh_personality`
[00:45:34] 
[00:45:34] error: aborting due to previous error(s)
[00:45:34] 
[00:45:34] make[1]: *** [all] Error 101
[00:45:34] 
[00:45:34] ------------------------------------------
[00:45:34] 
[00:45:34] thread '[run-make] run-make/alloc-extern-crates' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2480
[00:45:34] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:45:34] 
[00:45:34] 
[00:45:34] failures:
[00:45:34]     [run-make] run-make/alloc-extern-crates

It really looks like the problem is that https://github.com/rust-lang/rust/blob/master/src/test/run-make/alloc-extern-crates/Makefile#L5 is missing a --crate-type=rlib:

-include ../tools.mk

all:
	$(RUSTC) fakealloc.rs
	$(RUSTC) ../../../liballoc/lib.rs --cfg feature=\"external_crate\" --extern external=$(TMPDIR)/$(shell $(RUSTC) --print file-names fakealloc.rs)
        # ^ should be `--crate-type=rlib`

@arielb1
Copy link
Contributor

arielb1 commented Jun 13, 2017

After you fix the test, you can check it locally by running ./x.py test src/test/run-make

@bors
Copy link
Contributor

bors commented Jun 15, 2017

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

@arielb1
Copy link
Contributor

arielb1 commented Jun 20, 2017

🕸 Closing PR to keep the queue clean 🕸. This looks like a simple fix - feel free to reopen with it.

@arielb1 arielb1 closed this Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants