-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Starting with nightly-2021-01-13 (1.51) rustc fails to build archives on Windows 7 #81051
Comments
Cannot reproduce on Windows target on CI. |
The failure happens on a Windows 7 x64 machine. I reproduced this on another machine running Windows 7 x86, this time with |
I don't have any Windows machine to test (left alone Windows 7 which not available on CI). Let's ping Windows group to see if any folks can verify the issue: |
Error: Only Rust team members can ping teams. Please let |
@rustbot ping windows |
Hey Windows Group! This bug has been identified as a good "Windows candidate". cc @arlosi @danielframpton @gdr-at-ms @kennykerr @luqmana @lzybkr @nico-abram @retep998 @rylev @sivadeilra |
Speaking for the Windows team at Microsoft, Windows 7 has reached End of Life. We're not interested in providing any further support for Win 7 development. We (and members of the Rust community) are also actively working on min_api_target_version RFC, which would officially deprecate some older Windows platforms (those that are EOL) for Rust. I realize that this position may not be satisfying. However, we have to draw the line somewhere on supporting old versions of OSes, and Windows 7 has reached its official EOL. You may still be able to target Windows 7, by cross-compiling (compiling on a modern Windows version, or by compiling on Linux targeting Windows). |
Also, you might check whether you have any anti-virus products installed. If so, try disabling them, or at least adding an exception that covers your development tree. Sometimes "permissions" problems are caused by anti-virus products opening and scanning executable files. |
Apparently, Windows 7 is still a Tier 1 target, so even though it's EOL for Microsoft, Rust still has to support it. It seems that maybe we should reduce Windows 7 to a lower tier at some point soon. |
I would like to point out that according to Firefox Hardware Across the Web report, Windows 7 is used by 23% of Firefox users. Microsoft also offers paid extended security updates through January 2023 for Windows 7 which may be actually used in enterprise environments. I think it's too early to drop support for Windows 7. That said, this particular issue feels like an issue with anti-virus. @MSxDOS, could you check whether this issue occurs with an antivirus product disabled? |
im having the same issue, i also use windows 7 x64. and don't have any anti virus installed |
I've already checked and eliminated that from the list of possible causes along with any possible system issues I could think of. The problem appears on two machines with different hardware and software, one of which had a fresh installation of Rust toolchain via rustup and the issue appeared instantly. There's not much I can draw from that cargo log. By the looks of it the issue happens with crates that depend on and use proc-macro crates. In some cases |
using RUSTC_LOG=debug |
@asaadmohammed74 and @MSxDOS just a blind shot, IIUC the error Does the user executing |
The commit range includes the update of LLVM submodule #80796, so it is probably caused by one of: |
Permission denied sometimes means another process has an open handle to the file. Process Monitor has been useful to me in tracking down similar issues, which turned out to be an antivirus product in my case. |
Downgraded to nightly-2021-01-12, compilation is successful again. |
@apiraino There are no issues with permissions on both machines... The error is always reproducible. |
|
The issue title downplaying the problem a bit. rustc +nightly src/lib.rs --crate-type lib on an empty lib.rs gives the same error: failed to build archive: permission denied
error: aborting due to previous error This makes rustc effectively unusable on windows 7. (except for binaries with zero non-proc-macro dependencies) Here's what's happening, per process monitor: I am neither windows, nor LLVM expert so i cannot really interpret it, but to transcribe what's happening (judging purely by the names of the winapi calls): On stable:
very straightforward On nightly many more things are happening and i'm not sure why:
Oh, and @tmiasko implied, but did not explicitly mention, the regression happened in #80960. |
(Not sure if i have permission to do this, but..) |
Let's @rustbot ping llvm |
I opened rust-lang/llvm-project#92 to start, a simple revert which reportedly fixes this issue -- #81051 (comment). |
… TempFile doesn't reside on a local drive" This reverts commit 79657e2. The change regressed on Windows 7 -- rust-lang/rust#81051
… TempFile doesn't reside on a local drive" This reverts commit 6ec777c, which was cherry picked to 11.x from 79657e2. The change regressed on Windows 7 -- rust-lang/rust#81051
… TempFile doesn't reside on a local drive" This reverts commit 79657e2. The change regressed on Windows 7 -- rust-lang/rust#81051
Revert LLVM D81803 because it broke Windows 7 This submodule update reverts <https://reviews.llvm.org/D81803>. While that change is meant to fix a real bug, [LLVM PR42623], it caused new permission errors on Windows 7 that make it unable to build any archives. This is probably the same root cause as [LLVM PR48378]. Fixes rust-lang#81051. We'll file a new Rust issue to track the LLVM resolution. [LLVM PR42623]: https://bugs.llvm.org/show_bug.cgi?id=42623 [LLVM PR48378]: https://bugs.llvm.org/show_bug.cgi?id=48378
I just want to confirm that the fix is in nightly, and it's working! Thanks, @cuviper! |
But while it not applied to beta, it can't build rust with |
Either setting your src/stage0.txt to have
or setting in your config.toml
should work P.s.: correction: for some reason Although now that I re-read your message, i'm not sure if |
I'm not sure how that download is updated, but the PR is beta-nominated, so once that's approved we can backport it to the beta branch and then update master |
Normally we only do so once a cycle, but we're happy to accept PRs if there's some reason to update it outside of that. |
See #82677 to track long-term resolution between Windows 7 and the reverted bug fix. |
This submodule update reverts <https://reviews.llvm.org/D81803>. While that change is meant to fix a real bug, [LLVM PR42623], it caused new permission errors on Windows 7 that make it unable to build any archives. This is probably the same root cause as [LLVM PR48378]. Fixes rust-lang#81051. We'll file a new Rust issue to track the LLVM resolution. [LLVM PR42623]: https://bugs.llvm.org/show_bug.cgi?id=42623 [LLVM PR48378]: https://bugs.llvm.org/show_bug.cgi?id=48378 (cherry picked from commit 31814c4)
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0 and here: rust-lang/rust#81051 since 79657e2, some programs such as llvm-ar don't work properly on Windows 7. The issue is shown in the snippet by Oleksandr Prodan: https://pastebin.com/v51m3uBU In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO, the file path can't be queried anymore with GetFinalPathNameByHandleW. This however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully. To workaround the issue, we simply reset the 'DeleteFile' flag before even checking if we're dealing with a network file. Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we cannot specifically add a test coverage for this, since it requres mounting a network drive.
Hello! I've fixed the issue in LLVM in llvm/llvm-project@64ab2b6 - please let me know if the issue is still there in the next code drop. |
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0 and here: rust-lang/rust#81051 since 79657e2, some programs such as llvm-ar don't work properly on Windows 7. The issue is shown in the snippet by Oleksandr Prodan: https://pastebin.com/v51m3uBU In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO, the file path can't be queried anymore with GetFinalPathNameByHandleW. This however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully. To workaround the issue, we simply reset the 'DeleteFile' flag before even checking if we're dealing with a network file. Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we cannot specifically add a test coverage for this, since it requres mounting a network drive. (cherry picked from commit 64ab2b6)
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0 and here: rust-lang/rust#81051 since 79657e2, some programs such as llvm-ar don't work properly on Windows 7. The issue is shown in the snippet by Oleksandr Prodan: https://pastebin.com/v51m3uBU In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO, the file path can't be queried anymore with GetFinalPathNameByHandleW. This however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully. To workaround the issue, we simply reset the 'DeleteFile' flag before even checking if we're dealing with a network file. Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we cannot specifically add a test coverage for this, since it requres mounting a network drive.
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0 and here: rust-lang/rust#81051 since 79657e2, some programs such as llvm-ar don't work properly on Windows 7. The issue is shown in the snippet by Oleksandr Prodan: https://pastebin.com/v51m3uBU In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO, the file path can't be queried anymore with GetFinalPathNameByHandleW. This however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully. To workaround the issue, we simply reset the 'DeleteFile' flag before even checking if we're dealing with a network file. Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we cannot specifically add a test coverage for this, since it requres mounting a network drive. (cherry picked from commit 64ab2b6)
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0 and here: rust-lang/rust#81051 since cf62b1d, some programs such as llvm-ar don't work properly on Windows 7. The issue is shown in the snippet by Oleksandr Prodan: https://pastebin.com/v51m3uBU In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO, the file path can't be queried anymore with GetFinalPathNameByHandleW. This however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully. To workaround the issue, we simply reset the 'DeleteFile' flag before even checking if we're dealing with a network file. Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we cannot specifically add a test coverage for this, since it requres mounting a network drive. (cherry picked from commit 1d96b47)
As reported here: https://bugs.llvm.org/show_bug.cgi?id=48378#c0 and here: rust-lang/rust#81051 since 79657e2339b58bc01fe1b85a448bb073d57d90bb, some programs such as llvm-ar don't work properly on Windows 7. The issue is shown in the snippet by Oleksandr Prodan: https://pastebin.com/v51m3uBU In essence, once the 'DeleteFile' flag has been set on FILE_DISPOSITION_INFO, the file path can't be queried anymore with GetFinalPathNameByHandleW. This however works on Windows 10, GetFinalPathNameByHandleW would return sucessfully. To workaround the issue, we simply reset the 'DeleteFile' flag before even checking if we're dealing with a network file. Tested with `llvm-ar r empty.a a.obj` ran on a network mount. At the moment, we cannot specifically add a test coverage for this, since it requres mounting a network drive.
E.g.
cargo check --verbose
on https://github.com/japaric/ufmtThe text was updated successfully, but these errors were encountered: