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

Some run-make-fulldeps don't fail if -include fails #83773

Closed
jyn514 opened this issue Apr 2, 2021 · 2 comments · Fixed by #109770
Closed

Some run-make-fulldeps don't fail if -include fails #83773

jyn514 opened this issue Apr 2, 2021 · 2 comments · Fixed by #109770
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 2, 2021

I tried this code:

renamed:    run-make-fulldeps/exit-code/Makefile -> run-make/exit-code/Makefile
renamed:    run-make-fulldeps/exit-code/compile-error.rs -> run-make/exit-code/compile-error.rs
renamed:    run-make-fulldeps/exit-code/lint-failure.rs -> run-make/exit-code/lint-failure.rs
renamed:    run-make-fulldeps/exit-code/success.rs -> run-make/exit-code/success.rs

I expected to see this happen: The test fails, because the Makefile includes ../tools.mk which doesn't exist - it should include ../../run-make-fulldeps/tools.mk instead.

Instead, this happened: The test passes.

I can change it to a hard error by changing -include to include, but it seems bad to have a test that passes even if the commands it's running don't exist 😟

Meta

This is based off of a5029ac.

@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Apr 2, 2021
@jyn514
Copy link
Member Author

jyn514 commented Apr 2, 2021

Ok it looks like make defaults to the environment variable if it's not set? So because x.py is setting RUSTC and RUSTDOC for the bootstrap shim, they get set to reasonable values:

$ cat Makefile
all:
    echo $(RUSTC) $(RUSTDOC)
$ x.py test src/test/run-make/exit-code
echo /home/joshua/rustc3/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /home/joshua/rustc3/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc

Maybe this doesn't need changes? I'm not sure how important it is that RUSTC and RUSTDOC get set to their new values:

RUSTC := $(BARE_RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR) $(RUSTFLAGS)
RUSTDOC := $(BARE_RUSTDOC) -L $(TARGET_RPATH_DIR)

If it is important, I think the fix is as simple as changing -include to include everywhere.

@jyn514
Copy link
Member Author

jyn514 commented Apr 2, 2021

Looks like TMPDIR is also set: /home/joshua/rustc3/build/x86_64-unknown-linux-gnu/test/run-make/rustdoc-map-file/rustdoc-map-file

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 2, 2021
Move rustdoc run-make-fulldeps tests to run-make

This cuts the time to run the tests in half, because they don't require
building a stage 2 compiler. They were all added to fulldeps before rust-lang#82802 because rustdoc wasn't available in run-make tests.

This doesn't change coverage tests, which will be changed soon in a
separate PR (rust-lang#83755 (comment)).

This also changes some of the `-include` directives, see rust-lang#83773 for what's going on there.

r? `@petrochenkov`
@bors bors closed this as completed in 3328913 Apr 3, 2023
oli-obk pushed a commit to oli-obk/miri that referenced this issue Apr 4, 2023
Move almost all run-make-fulldeps tests to run-make

They pass fine, and this avoids having to build the compiler twice.

There are few enough tests left that I think it should be possible to get rid of this test suite altogether, but I expect this PR to fail at least a few times in bors and want to get it merged before tackling further changes. cc rust-lang/rust#83775

Fixes rust-lang/rust#66085. Fixes rust-lang/rust#83773.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant