-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Migrate compiler-lookup-paths
, dump-mono-stats
and prune-link-args
run-make
tests to rmake
or ui
format
#126208
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
Merged
bors
merged 4 commits into
rust-lang:master
from
Oneirical:one-flew-over-the-cuckoo's-test
Jul 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
rewrite compiler-lookup-paths to rmake
- Loading branch information
commit 9ce62297fafc4640351164be8b335ab6b6fb2880
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// Since #19941, rustc can accept specifications on its library search paths. | ||
// This test runs Rust programs with varied library dependencies, expecting them | ||
// to succeed or fail depending on the situation. | ||
// The second part of the tests also checks that libraries with an incorrect hash | ||
// fail to be used by the compiler. | ||
// See https://github.com/rust-lang/rust/pull/19941 | ||
|
||
use run_make_support::fs_wrapper; | ||
use run_make_support::{rmake_out_path, rustc}; | ||
Oneirical marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
fn main() { | ||
assert!(rmake_out_path("libnative.a").exists()); | ||
Kobzol marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
fs_wrapper::create_dir_all(rmake_out_path("crate")); | ||
fs_wrapper::create_dir_all(rmake_out_path("native")); | ||
fs_wrapper::rename(rmake_out_path("libnative.a"), rmake_out_path("native")); | ||
rustc().input("a.rs").run(); | ||
fs_wrapper::rename(rmake_out_path("liba.a"), rmake_out_path("crate")); | ||
rustc() | ||
.input("b.rs") | ||
.specific_library_search_path("native", rmake_out_path("crate")) | ||
.run_fail(); | ||
rustc() | ||
.input("b.rs") | ||
.specific_library_search_path("dependency", rmake_out_path("crate")) | ||
.run_fail(); | ||
rustc().input("b.rs").specific_library_search_path("crate", rmake_out_path("crate")).run(); | ||
rustc().input("b.rs").specific_library_search_path("all", rmake_out_path("crate")).run(); | ||
|
||
rustc() | ||
.input("c.rs") | ||
.specific_library_search_path("native", rmake_out_path("crate")) | ||
.run_fail(); | ||
rustc().input("c.rs").specific_library_search_path("crate", rmake_out_path("crate")).run_fail(); | ||
rustc().input("c.rs").specific_library_search_path("dependency", rmake_out_path("crate")).run(); | ||
rustc().input("c.rs").specific_library_search_path("all", rmake_out_path("crate")).run(); | ||
|
||
rustc() | ||
.input("d.rs") | ||
.specific_library_search_path("dependency", rmake_out_path("native")) | ||
.run_fail(); | ||
rustc() | ||
.input("d.rs") | ||
.specific_library_search_path("crate", rmake_out_path("native")) | ||
.run_fail(); | ||
rustc().input("d.rs").specific_library_search_path("native", rmake_out_path("native")).run(); | ||
rustc().input("d.rs").specific_library_search_path("all", rmake_out_path("native")).run(); | ||
|
||
// Deduplication tests. | ||
fs_wrapper::create_dir_all(rmake_out_path("e1")); | ||
fs_wrapper::create_dir_all(rmake_out_path("e2")); | ||
|
||
rustc().input("e.rs").output(rmake_out_path("e1/libe.rlib")).run(); | ||
rustc().input("e.rs").output(rmake_out_path("e2/libe.rlib")).run(); | ||
// If the library hash is correct, compilation should succeed. | ||
rustc() | ||
.input("f.rs") | ||
.library_search_path(rmake_out_path("e1")) | ||
.library_search_path(rmake_out_path("e2")) | ||
.run(); | ||
rustc() | ||
.input("f.rs") | ||
.specific_library_search_path("crate", rmake_out_path("e1")) | ||
.library_search_path(rmake_out_path("e2")) | ||
.run(); | ||
rustc() | ||
.input("f.rs") | ||
.specific_library_search_path("crate", rmake_out_path("e1")) | ||
.specific_library_search_path("crate", rmake_out_path("e2")) | ||
.run(); | ||
// If the library has a different hash, errors should occur. | ||
rustc().input("e2.rs").output(rmake_out_path("e2/libe.rlib")).run(); | ||
rustc() | ||
.input("f.rs") | ||
.library_search_path(rmake_out_path("e1")) | ||
.library_search_path(rmake_out_path("e2")) | ||
.run_fail(); | ||
rustc() | ||
.input("f.rs") | ||
.specific_library_search_path("crate", rmake_out_path("e1")) | ||
.library_search_path(rmake_out_path("e2")) | ||
.run_fail(); | ||
rustc() | ||
.input("f.rs") | ||
.specific_library_search_path("crate", rmake_out_path("e1")) | ||
.specific_library_search_path("crate", rmake_out_path("e2")) | ||
.run_fail(); | ||
// Native and dependency paths do not cause errors. | ||
rustc() | ||
.input("f.rs") | ||
.specific_library_search_path("native", rmake_out_path("e1")) | ||
.library_search_path(rmake_out_path("e2")) | ||
.run(); | ||
rustc() | ||
.input("f.rs") | ||
.specific_library_search_path("dependency", rmake_out_path("e1")) | ||
.library_search_path(rmake_out_path("e2")) | ||
.run(); | ||
rustc() | ||
.input("f.rs") | ||
.specific_library_search_path("dependency", rmake_out_path("e1")) | ||
.specific_library_search_path("crate", rmake_out_path("e2")) | ||
.run(); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: maybe specify that the restriction is the kind of search path? We could also link to https://doc.rust-lang.org/rustc/command-line-arguments.html#-l-add-a-directory-to-the-library-search-path.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't add the link, because it's over 100 characters and tidy would complain, but I did add a precision.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add
// ignore-tidy-linelength
(or was it// tidy-ignore-linelength
?) to make tidy ignore the line length check for this file.