-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustbuild with verbose fails with custom cargo
path
#41779
Comments
@alexcrichton ping ? it is a regress for stable |
Sounds bad! |
Will investigate. |
Hm, I'm unable to reproduce. @semarie Could you post a log with the failure? |
The problem is in impl Flags {
pub fn parse(args: &[String]) -> Flags {
// [...]
// All subcommands can have an optional "Available paths" section
if matches.opt_present("verbose") {
let flags = Flags::parse(&["build".to_string()]);
let mut config = Config::default();
config.build = flags.build.clone();
let mut build = Build::new(flags, config);
metadata::build(&mut build);
let maybe_rules_help = step::build_rules(&build).get_help(subcommand);
if maybe_rules_help.is_some() {
extra_help.push_str(maybe_rules_help.unwrap().as_str());
}
} else {
extra_help.push_str(format!("Run `./x.py {} -h -v` to see a list of available paths.",
subcommand).as_str());
}
// [...]
}
} For calling In my configuration, the Here a log a build of
The
|
I confirm this with Rust 1.18.0 (building using 1.17.0, as described in #42543). |
#42695 fixes this issue. |
…crichton Use custom cargo/rustc paths when parsing flags. Fixes rust-lang#41779, probably also rust-lang#42543 (I think they're duplicates). I'm not entirely happy with the implementation, since it means we parse the configuration twice, but it's the minimal solution. I think the other choice is to move both calls to Config::parse inside Flags::parse and merge them, but I don't know if that's a good idea. r? @alexcrichton
…crichton Use custom cargo/rustc paths when parsing flags. Fixes rust-lang#41779, probably also rust-lang#42543 (I think they're duplicates). I'm not entirely happy with the implementation, since it means we parse the configuration twice, but it's the minimal solution. I think the other choice is to move both calls to Config::parse inside Flags::parse and merge them, but I don't know if that's a good idea. r? @alexcrichton
When rustbuild is invoked with
-v
,extra_help
variable is populate usingmetadata::build()
(for any command). It will callcargo metadata
for several crates.The build configuration used is at this place is
Config::default()
.As I use
config.toml
to setcargo
binary path, the setting is ignored, and rustbuild fails when-v
is on command-line: by default it usesstage0_root
path, andcargo
binary isn't available at this place.The text was updated successfully, but these errors were encountered: