-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Having rust-analyzer open causes linker errors for pyo3 #9932
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
Comments
We don't do much more than running
I guess that's not the problem, though. |
I think this might have to do with running nightly rust - I tried some more things but can't reproduce it on stable.
|
Hmm. We make a copy of the proc macro DLL and load that, so we avoid stepping on |
According to https://docs.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger?view=vs-2019 the linker by default embeds the full path to the |
But still, does the loader really lock the PDB? Or was that a red herring? |
It affected me too. Using stable MSVC toolchain. It mostly happens when frequently modify proc macro during developing. Restaring VSC or RA only helping. Linker just cannot write to proc macro's pdb file. |
It works on my machine ™️: Windows 11 x64 & VS2022 toolchain. @mejrs could you please run the same commands and send us the output? > cargo test
test result: ok. 341 passed; 0 failed; 47 ignored; 0 measured; 0 filtered out; finished in 36.70s
> rust-analyzer.exe --version
rust-analyzer 24cf95762 2022-04-11 stable
> rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: checking for self-updates
stable-x86_64-pc-windows-msvc unchanged - rustc 1.60.0 (7737e0b5c 2022-04-04)
nightly-x86_64-pc-windows-msvc unchanged - rustc 1.62.0-nightly (1f7fb6413 2022-04-10)
info: cleaning up downloads & tmp directories
> listdlls 26420
Listdlls v3.2 - Listdlls
Copyright (C) 1997-2016 Mark Russinovich
Sysinternals
------------------------------------------------------------------------------
rust-analyzer.exe pid: 26420
Command line: "c:\Users\\.vscode\extensions\matklad.rust-analyzer-0.2.1010-win32-x64\server\rust-analyzer.exe" proc-macro
Base Size Path
0x0000000016060000 0x1975000 c:\Users\\.vscode\extensions\matklad.rust-analyzer-0.2.1010-win32-x64\server\rust-analyzer.exe
0x000000006efc0000 0x209000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x000000006e600000 0xbd000 C:\WINDOWS\System32\KERNEL32.DLL
0x000000006cae0000 0x374000 C:\WINDOWS\System32\KERNELBASE.dll
0x000000006cf40000 0x7ae000 C:\WINDOWS\System32\shell32.dll
0x000000006c7c0000 0x9d000 C:\WINDOWS\System32\msvcp_win.dll
0x000000006c6a0000 0x111000 C:\WINDOWS\System32\ucrtbase.dll
0x000000006e890000 0x1ac000 C:\WINDOWS\System32\USER32.dll
0x000000006cab0000 0x26000 C:\WINDOWS\System32\win32u.dll
0x000000006cf10000 0x29000 C:\WINDOWS\System32\GDI32.dll
0x000000006c8d0000 0x112000 C:\WINDOWS\System32\gdi32full.dll
0x000000006df80000 0x8000 C:\WINDOWS\System32\PSAPI.DLL
0x000000006be90000 0x27000 C:\WINDOWS\SYSTEM32\bcrypt.dll
0x000000005fcf0000 0x1b000 C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll
0x000000006e030000 0x31000 C:\WINDOWS\System32\IMM32.DLL
0x000000006c4b0000 0x7f000 C:\WINDOWS\System32\bcryptprimitives.dll
0x000000006ce60000 0xae000 C:\WINDOWS\System32\advapi32.dll
0x000000006de50000 0xa3000 C:\WINDOWS\System32\msvcrt.dll
0x000000006df90000 0x9e000 C:\WINDOWS\System32\sechost.dll
0x000000006ebd0000 0x120000 C:\WINDOWS\System32\RPCRT4.dll
0x0000000069e20000 0x34000 C:\WINDOWS\SYSTEM32\ntmarta.dll
0x000000002d2c0000 0x5f000 C:\Users\\AppData\Local\Temp\16578131557812546816indoc-f4c9a4dbd503caad.dll
0x000000000f9a0000 0x91000 C:\Users\\AppData\Local\Temp\5949480503956475169proc_macro_error_attr-c561d03c93d0e8bb.dll
0x00000000f5460000 0x3fa000 C:\Users\\AppData\Local\Temp\2161299095135425567pyo3_macros-f9f2db4b2516e123.dll
0x0000000003190000 0x76000 C:\Users\\AppData\Local\Temp\3142464688797423265rustversion-a3785f1caada41da.dll
0x00000000ef780000 0x3be000 C:\Users\\AppData\Local\Temp\14672087416760959905serde_derive-b1699c950b45c143.dll
0x0000000051590000 0x18000 C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2203.5-0\MpDetoursCopyAccelerator.dll
0x000000006e5a0000 0x5d000 C:\WINDOWS\System32\SHLWAPI.dll
0x00000000fa2f0000 0x2ee000 C:\Users\\AppData\Local\Temp\13785480067089490867structopt_derive-d47d9012ce1a23a7.dll
> handle64 -p 26420
Nthandle v4.22 - Handle viewer
Copyright (C) 1997-2019 Mark Russinovich
Sysinternals - www.sysinternals.com
1B4: File (RW-) C:\Rust\pyo3
2A0: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\exthost1\output_logging_20220411T211832\4-Rust Analyzer Client.log
3B4: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\exthost1\exthost.log
3F8: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\exthost1\output_logging_20220411T211832\1-Microsoft Authentication.log
3FC: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\exthost1\output_logging_20220411T211832\6-GitHub Authentication.log
418: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\exthost1\output_logging_20220411T211832\2-EditorConfig.log
420: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\exthost1\output_logging_20220411T211832\5-Debug.log
43C: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\exthost1\output_logging_20220411T211832\3-Git.log
6C8: Section \Sessions\1\BaseNamedObjects\C:*ProgramData*Microsoft*Windows*Caches*{6AF0698E-D558-4F6E-9B3C-3716689AF493}.2.ver0x0000000000000009.db
8C8: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\main.log
A4C: File (RW-) C:\Users\\AppData\Roaming\Code\logs\20220411T211830\renderer1.log
A60: Section \Sessions\1\BaseNamedObjects\SessionImmersiveColorPreference
A68: Section \Sessions\1\BaseNamedObjects\C:*ProgramData*Microsoft*Windows*Caches*cversions.2.ro
AB8: Section \Sessions\1\BaseNamedObjects\C:*ProgramData*Microsoft*Windows*Caches*cversions.2.ro
AC4: Section \Sessions\1\BaseNamedObjects\C:*ProgramData*Microsoft*Windows*Caches*{DDF571F2-BE98-426D-8288-1A9A39C3FDA2}.2.ver0x0000000000000001.db |
This is caused by rust-lang/backtrace-rs#470. It happens when a proc macro panics and prints a backtrace. There's probably no way to fix it from our side. A workaround is to disable backtrace by setting the "rust-analyzer.server.extraEnv": {
"RUST_BACKTRACE": "0"
}, |
When compiling
pyo3
having rust-analyzer open causes the build to fail.I can reliably reproduce this by just opening vscode, letting rust analyzer run whatever it does on start, and then trying
cargo test
in another terminal. Closing vscode or disabling rust-analyzer fixes this issue.Error message
The text was updated successfully, but these errors were encountered: