Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with error due to errant compiler flag -Brepro on MSVC x64 platform #1565

Closed
MironAtHome opened this issue Nov 17, 2021 · 7 comments

Comments

@MironAtHome
Copy link

MironAtHome commented Nov 17, 2021

image

Anyone with knowledge how this call gets constructed during build?
I run search in the project and couldn't find it in the files, will have to retrace it.
Any assistance in the meantime greatly appreciated.

Microsoft C/C++ compiler version from Visual Studio 2017:
image

@MironAtHome
Copy link
Author

Additional information.
Per GitHub issue
vezel-dev/zig-sdk#38
/brepro is used as an command line argument to linker to make generated code deterministic. However, per this blog entry:
https://geoffchappell.com/studies/msvc/link/link/options/brepro.htm
this argument is not valid when generating object file, the case in this issue.
It's pretty difficult to retrace how the build is producing scripts and is invoking compiler. An assistance from feature owner would be very much apprecaited.

@sfackler
Copy link
Owner

I am not particularly familiar with how old versions of MSVC behave. However, systest is only used for testing, and shouldn't be needed to depend on the project.

@MironAtHome
Copy link
Author

MironAtHome commented Nov 20, 2021

@sfackler can you please advise what generates commands sent to cl.exe ( MSVC C/C++ compiler )?
I can fix it. That way I can keep tests.
Fix would be very strongly preferred because this would allow to retain existing makeup of the project, which really isn't self sufficient, but really an infrastructure library used by other rust projects. So, this would save everyone having to build dependency locally and then reference custom fixed up edition. The amount of fidgeting this saves is considerable.
Else the fix really is to create an opaque wrapper over cl.exe which would parse command and remove offending command line parameter. Which carries risk of one forgetting that cl.exe was modified. In other words options other than fixing build look too unappealing. Help is very much appreciated.

@MironAtHome
Copy link
Author

set CFG_DISABLE_CROSS_TESTS=1
prior
cargo build --target x86_64-pc-windows-msvc
unblocked.
Thanks for suggestion to disable test. Variable is provided in cargo repository
\crates\cargo-test-support\src\cross_compile.rs
line #25
block reads

    match env::var("CFG_DISABLE_CROSS_TESTS") {
        Ok(ref s) if *s == "1" => return true,
        _ => {}
    }

@MironAtHome
Copy link
Author

@sfackler still, please provide guidance how to get to that -Brepro to make it conditional.
So far couldn't find it anywhere.

@sfackler
Copy link
Owner

@sfackler
Copy link
Owner

The test runs successfully on MSVC in CI: https://github.com/sfackler/rust-openssl/runs/4273919752?check_suite_focus=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants