Skip to content

build passes invalid -nologo and -out: flags to ar tool if specified in AR env var. #762

@danakj

Description

@danakj

Found this here: https://chromium-review.googlesource.com/c/chromium/src/+/4087043/4//COMMIT_MSG#26

The AR env var can override the tool:

cc-rs/src/lib.rs

Lines 2651 to 2653 in 0e51f6d

if let Ok(p) = self.get_var("AR") {
return Ok((self.cmd(&p), p));
}

However the flags passed to it include "-nologo" and -out: which then fails with invalid flag.

cc-rs/src/lib.rs

Lines 2107 to 2111 in 0e51f6d

if target.contains("msvc") {
let (mut cmd, program) = self.get_ar()?;
let mut out = OsString::from("-out:");
out.push(dst);
cmd.arg(out).arg("-nologo");

It seems like if AR is specified in the env var, it shouldn't assume it can change the arguments based on the target being msvc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions