Skip to content

Commit

Permalink
Fix flowistry running on build scripts, fixes #64.
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton committed Nov 30, 2022
1 parent 3f73c05 commit 2cd31e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/rustc_plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,9 @@ pub fn driver_main<T: RustcPlugin>(plugin: T) {
let primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok();
let normal_rustc = args.iter().any(|arg| arg.starts_with("--print"));
let is_lib = args.iter().any(|arg| arg == "src/lib.rs");
let is_build_script = args.iter().any(|arg| arg == "build.rs");
let plugin_lib_target = env::var("RUSTC_PLUGIN_LIB_TARGET").is_ok();
let run_plugin = primary_package && !normal_rustc && (!is_lib || plugin_lib_target);
let run_plugin = primary_package && !normal_rustc && !is_build_script && (!is_lib || plugin_lib_target);

if run_plugin {
let plugin_args: T::Args =
Expand Down

0 comments on commit 2cd31e5

Please sign in to comment.