cc-rs: build passes invalid `-nologo` and `-out:` flags to `ar` tool if specified in `AR` env var.

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

The AR env var can override the tool: https://github.com/rust-lang/cc-rs/blob/0e51f6d8a05548bd9991bfd8184b45b77b261a17/src/lib.rs#L2651-L2653

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

https://github.com/rust-lang/cc-rs/blob/0e51f6d8a05548bd9991bfd8184b45b77b261a17/src/lib.rs#L2107-L2111

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?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 19 (11 by maintainers)

Commits related to this issue

Most upvoted comments

https://github.com/rust-lang/cc-rs/pull/763 has also worked to address this issue and should have tagged this probably. Specifically it now allows setting ARFLAGS to remove the -nologo flag which was not understood by the tool I was attempting to use at the time.