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

make: building rust crate should depend on all of its sub crates #8056

Closed
pnkfelix opened this issue Jul 26, 2013 · 2 comments
Closed

make: building rust crate should depend on all of its sub crates #8056

pnkfelix opened this issue Jul 26, 2013 · 2 comments

Comments

@pnkfelix
Copy link
Member

Right now the tests.mk file has lines like this:

TEST_TARGET_CRATES = std extra
TEST_HOST_CRATES = syntax rustc rustdoc rust rustpkg rusti
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
...
$(3)/stage$(1)/test/rusttest-$(2)$$(X_$(2)): \
$$(RUST_LIB) $$(RUST_INPUTS)    \
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2))
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test

When I do make check-stage1 --trace with remake, I get the following problem:

Invoking recipe from /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:372 to update target `x86_64-apple-darwin/stage1/test/rusttest-x86_64-apple-darwin'.
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo  compile_and_link: x86_64-apple-darwin/stage1/test/rusttest-x86_64-apple-darwin
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
compile_and_link: x86_64-apple-darwin/stage1/test/rusttest-x86_64-apple-darwin
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
x86_64-apple-darwin/stage1/bin/rustc --cfg stage1  -O --cfg debug -Z no-debug-borrows --target=x86_64-apple-darwin  -o x86_64-apple-darwin/stage1/test/rusttest-x86_64-apple-darwin /Users/pnkfelix/Dev/Mozilla/rust-basis7081/src/librust/rust.rs --test
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/Users/pnkfelix/Dev/Mozilla/rust-basis7081/src/librust/rust.rs:23:0: 23:19 error: can't find crate for `rustpkg`
/Users/pnkfelix/Dev/Mozilla/rust-basis7081/src/librust/rust.rs:23 extern mod rustpkg;
                                                                  ^~~~~~~~~~~~~~~~~~~
/Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:372: *** [x86_64-apple-darwin/stage1/test/rusttest-x86_64-apple-darwin] Error 101

#0  x86_64-apple-darwin/stage1/test/rusttest-x86_64-apple-darwin at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:372
#1  tmp/check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin-rust.ok at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:425
#2  check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin-rust-exec at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:425
#3  check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin-crates-exec at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:300
#4  check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin-exec at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:300
#5  check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:730
#6  check-stage1-H-x86_64-apple-darwin at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:770
#7  check-stage1 at /Users/pnkfelix/Dev/Mozilla/rust-basis7081/mk/tests.mk:751
Command-line invocation:
    "/Users/pnkfelix/opt-remake/bin/remake check-stage1 --trace"

Namely, building rusttest fails because the rust crate needs the crates for rustc, rustdoc, etc to already have been built; but in this case, the rustpkg crate has not yet been built.

This probably manifests in this manner because rustpkg comes after rust in the definition for TEST_HOST_CRATES. Maybe the fact that the extern entry for rustpkg comes first in the rust.rs file has something to do with it too.

For my local checkout, it seems like one can hack around the problem by moving rust to the end of the TEST_HOST_CRATES definition. But that is a fragile fix: It does not properly indicate the relationship between these entities.

A more appropriate fix would be for the Makefile to indicate that rusttest has a direct or indirect dependence on the rustpkg crate, as well as all the other crates it uses.

@pnkfelix
Copy link
Member Author

To be honest, I do not understand why the problem manifests itself for me now and it had not earlier; nor do I understand why I have not seen the same problem while doing make check or make check-stage2, etc. Possibly I/we have just been getting lucky? Not sure.

@pnkfelix
Copy link
Member Author

part of #8058

@ghost ghost assigned pnkfelix Jul 29, 2013
@bors bors closed this as completed in fc57182 Aug 2, 2013
@pnkfelix pnkfelix removed their assignment Jun 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 13, 2022
… r=llogiq

Fix `type_repetition_in_bounds`

fixes rust-lang#7360
fixes rust-lang#8162
fixes rust-lang#8056

changelog: Check for full equality in `type_repetition_in_bounds` rather than just equal hashes
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 a pull request may close this issue.

1 participant