Description
At various points, rustc may use std::backtrace::Backtrace::capture()
to get a backtrace of the current thread such as if delay_span_bug()
or similar functions are called. On Windows, this results in dbghelp.dll
attempting to load the hardcoded path of rustc's PDB which, on normal user machines, never exists.
Normally, this is fine and we just simply don't have debug symbols, but in some environments like build systems such as BuildXL, filesystem accesses are monitored to enable fine-grained caching. If we try to load rustc's PDB in this environment, it will trigger build system errors:
[0:16] error DX0500: [Pip1D7E89323E41B40C, {Building Rust for: packages (x64_debug|C:\example\makefile.inc:50)}] - Disallowed file accesses were detected (R = read, W = write):
Disallowed file accesses performed by: C:\Users\wesleywiser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe
W C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\rustc_driver-55b43b400744bb3d.pdb
W C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\std-8d6706cb06448743.pdb
Since these paths won't generally resolve (unless you build rustc from source with debuginfo yourself), it would be nice to provide a way to turn this behavior off.