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

Disallowed file accesses #1282

Open
jyoungman19111 opened this issue Jan 22, 2021 · 4 comments
Open

Disallowed file accesses #1282

jyoungman19111 opened this issue Jan 22, 2021 · 4 comments

Comments

@jyoungman19111
Copy link

I have an msbuild project that is getting an error when creating a pdb file. How can I fix this? Thanks.

PS D:\Test\Code\src\oss\NtRegistrySupport> bxl /c:config.bc
Microsoft (R) Build Accelerator. Build: 0.1.0-devBuild, Version: [Developer Build]
Copyright (C) Microsoft Corporation. All rights reserved.

[0:04] error DX0064: [Pip07F4EBC59ED32C49, MSBuild.exe (NtRegistrySupport_VS2019 - D:\Test\Code\src\oss\NtRegistrySupport\NtRegistrySupport_VS2019.vcxproj), NtRegistrySupport_VS2019, NtRegistrySupport_VS2019.vcxproj, {}, D:\Test\Code\src\oss\NtRegistrySupport\NtRegistrySupport_VS2019.vcxproj, D:\Test\Code\src\oss\NtRegistrySupport] - failed with exit code 1
NtRegistrySupport.cpp
D:\Test\Code\src\oss\NtRegistrySupport.cpp : fatal error C1041: cannot open program database 'v:\code\win32\Debug\pdb\NtRegistrySupport_d.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS [D:\Test\Code\src\oss\NtRegistrySupport\NtRegistrySupport_VS2019.vcxproj]
[0:04] error DX0500: [Pip07F4EBC59ED32C49, MSBuild.exe (NtRegistrySupport_VS2019 - D:\Test\Code\src\oss\NtRegistrySupport\NtRegistrySupport_VS2019.vcxproj), NtRegistrySupport_VS2019, NtRegistrySupport_VS2019.vcxproj, {}] - Disallowed file accesses were detected (R = read, W = write):
Disallowed file accesses performed by: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\CL.exe
W v:\code\win32\Debug\pdb\NtRegistrySupport_d.pdb

W = Write
[0:04] 100.00% Processes:[1 done (0 hit), 0 succeeded, 1 failed, 0 skipped, 0 executing, 0 waiting]
[0:04] -- Cache savings: 0.00% of 1 included processes. 0 excluded via filtering.
Build FAILED
Log Directory: D:\Test\Code\src\oss\NtRegistrySupport\Out\Logs

@marcelolynch
Copy link
Contributor

BuildXL requires by default that all outputs (writes) be declared. Unfortunately symbol files are sometimes not considered "real outputs", so probably this write is not declared in the spec and you're getting these errors.

Some stuff you can try:

  • Use the /Z7 switch for cl to inject the debug symbols into the object file (which will be a declared output for the process) instead of outputting to a (non-declared) .pdb.
  • Untrack the cl.exe accesses to the v:\code\win32\Debug\pdb directory by adding it to an allowlist. Allow lists are meant for these cases but are a technically unsafe option because they may lead to non-deterministic builds. In your case the directory looks pretty safe to untrack because it looks only meant for symbol files anyways and will not affect the main build outputs.

@jyoungman19111
Copy link
Author

jyoungman19111 commented Jan 22, 2021 via email

@marcelolynch
Copy link
Contributor

Thanks for using and exploring BuildXL, it is much appreciated. Please send any valuable feedback our way so we can keep improving the user experience.

You last error looks more like a compilation error rather than being related to the build configuration, are you hitting it before the execution starts? Refer to the documentation for those headers: [1] [2] [3]

@jyoungman19111
Copy link
Author

jyoungman19111 commented Apr 2, 2021 via email

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