Skip to content

flag_check.exe being generated in source tree #1411

@wmmc88

Description

@wmmc88

Under certain circumstances, a flag_check.exe appears in the root of crates using cc in their build scripts. This appears to be a regression of an issue that was fixed by #246. I've confirmed this issue is present in all versions starting from 1.2.7 to at least 1.2.15, so it seems like something in 1.2.7 is causing this regression.

In order to trigger this issue, I needed to have the following in my .cargo/config.toml:

[target.'cfg(target_os = "windows")']
rustflags = [
  # -Ccontrol-flow-guard: Enable Control Flow Guard (https://doc.rust-lang.org/rustc/codegen-options/index.html#control-flow-guard, https://learn.microsoft.com/en-us/cpp/build/reference/guard-enable-control-flow-guard).
  "-C",
  "control-flow-guard",
]

Given the diff of 1.2.7 and the fact I need to provide -Ccontrol-flow-guard to get this to trigger, I'm guessing something is causing is_flag_supported_inner to run, and that that is erroneously dropping the linked artifact in root of the crate

A minimal repro is available at https://github.com/wmmc88/minimal-repros/tree/cc-flag-check

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsWindows targets and toolchainsbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions