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

Probabilistic compile failure on Windows Server 2016 for target i686-pc-windows-msvc #101

Open
Radar3 opened this issue Sep 3, 2021 · 2 comments

Comments

@Radar3
Copy link

Radar3 commented Sep 3, 2021

# version:
openssl-src-111.15.0+1.1.1k

run:
cargo build --release --target i686-pc-windows-msvc

may fail report:
{ code: 32, kind: Other, message: "The process cannot access the file because it is being used by another process." }
at
openssl-src-111.15.0+1.1.1k\src\lib.rs:456:40, which is:
fs::remove_dir_all(&inner_dir).unwrap();

detail:
created directoryC:/pipeline-255714-1/target/i686-pc-windows-msvc/release/build/openssl-sys-07fd305febe929f0/out/openssl-build/install/lib'
Copying: libcrypto.lib to C:/pipeline-255714-1/target/i686-pc-windows-msvc/release/build/openssl-sys-07fd305febe929f0/out/openssl-build/install/lib/libcrypto.lib
Copying: libssl.lib to C:/pipeline-255714-1/target/i686-pc-windows-msvc/release/build/openssl-sys-07fd305febe929f0/out/openssl-build/install/lib/libssl.lib
Copying: ossl_static.pdb to C:/pipeline-255714-1/target/i686-pc-windows-msvc/release/build/openssl-sys-07fd305febe929f0/out/openssl-build/install/lib/ossl_static.pdb

--- stderr

Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 32, kind: Other, message: "The process cannot access the file because it is being used by another process." }', C:\Windows\system32\config\systemprofile.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:456:40
[2021-09-02 19:22:06] note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[2021-09-02 19:22:06]The command "cargo build --release --target i686-pc-windows-msvc" exited with 101. `

Then I add a line before it to print var inner_dir :
panic!("inner_dir {:?}", inner_dir);
thread 'main' panicked at 'inner_dir "C:\\-pipeline-255714-1\\target\\i686-pc-windows-msvc\\release\\build\\openssl-sys-07fd305febe929f0\\out\\openssl-build\\build\\src"', C:\Users\Administrator\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\openssl-src-111.15.0+1.1.1k\src\lib.rs:456:9 note: run withRUST_BACKTRACE=1 environment variable to display a backtrace

That means program failed during removing build\src dir.

Then I add a line to sleep 1s before rm dir, it seems resolved. # #
std:: thread ::sleep(std::time::Duration::from_millis(1000));

@alexcrichton
Copy link
Owner

Thanks for the report. While I don't think adding a sleep is the right fix this is a known issue with MSVC's compilers where they'll run things in the background to generate things like debuginfo I believe. I think it should be fine to update the code here to either ignore the error or do something to try to resolve it.

@Radar3
Copy link
Author

Radar3 commented Sep 6, 2021

Thanks for the report. While I don't think adding a sleep is the right fix this is a known issue with MSVC's compilers where they'll run things in the background to generate things like debuginfo I believe. I think it should be fine to update the code here to either ignore the error or do something to try to resolve it.

Thank You.
I agree, so I just open this issue, and give my local fix, instead of commit it as a PR.

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