Skip to content

Commit

Permalink
Work around rust-lang/cargo#4423 - cargo auditable no longer breaks…
Browse files Browse the repository at this point in the history
… compilation of proc macros
  • Loading branch information
Shnatsel committed Jul 30, 2022
1 parent 2c035c7 commit 457c2db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cargo-auditable/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ fn cargo_command(cargo_auditable_args: &Subcommand) -> Command {
for arg in cargo_auditable_args.args() {
command.arg(arg);
}
// Work around https://github.com/rust-lang/cargo/issues/4423 by explicitly passing the host platform if not already specified.
// Otherwise proc macros will fail to build. Sadly this changes the output directory, which is one hell of a footgun!
// TODO: either prevent the change to the output dir, or make it so different and obvious that it's not confusing anymore.
if cargo_auditable_args.target().is_none() {
command.arg(format!("--target={}", cargo_auditable_args.host_triple()));
}
command
}

Expand Down

0 comments on commit 457c2db

Please sign in to comment.