-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
allow compiletest to pass down --extern
flags
#54020
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
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.
Looks great! A few nits.
} | ||
|
||
#[test] | ||
fn test_parse_name_kv_directive() { |
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.
woah tests. Totally not idiomatic for compiletest. 😛
|
||
fn main() { | ||
let x = Yellow{}; | ||
} |
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.
Can we port the extern prelude test to use this?
What about your existing tests for suggestions?
after some fiddling I've learned more about some implied things for @nikomatsakis is there a standard call for doing naming normalization (like the ones that make the output for a |
The job Click to expand the log.
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 |
The job Click to expand the log.
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 |
src/tools/compiletest/src/runtest.rs
Outdated
rustc.arg(format!("{}={}/lib{}", | ||
aux_crate.key, | ||
aux_dir.display(), | ||
&aux_crate.value.replace(".rs", ".so").replace("-","_"))); |
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.
@alexcrichton is there a place on the compiler where I can get the official codepath that does this in a cross-platform way?
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 think this can probably use std::env::consts::DLL_EXTENSION
perhaps? We typically don't need to factor in cross compilation here
I am very sad this hasn't landed yet. It would be very useful. |
Ping from triage @qmx, what is the status of this PR? |
closing this for now, will revisit it later |
The job Click to expand the log.
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 |
this still doesn't have the definitive answer, but at least is a working start .
The job Click to expand the log.
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 ps this rust-highfive output seems to be excluding anything actionable |
Ping from triage @qmx: It looks like this PR is failing on travis.
Thanks for the notice, sadly I don't have the time to work on the bot right now. |
Ping from triage @qmx: What is the status of this PR? |
will reopen when I get around putting more time on it, sorry for the noise! |
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on #54020, and can be used in the future to replace and simplify some of the Makefile tests.
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on rust-lang#54020, and can be used in the future to replace and simplify some of the Makefile tests.
When cargo exposes a crate to rustc, it uses
--extern
, with the potential for crate name aliasing. This PR adds this support to compiletest via aaux-crate:foo=baz.rs
header, where it exposes the cratebaz
under afoo
alias.This is specially useful for testing the new Rust 2018 edition module behaviors, since crates listed via
--extern
appear in the prelude.Additionally, this also adds some tests to the existing compiletest parsing code.
Fixes #53737