Giter Site home page Giter Site logo

microsoft / buildxl Goto Github PK

View Code? Open in Web Editor NEW
891.0 48.0 140.0 93.56 MB

Microsoft Build Accelerator

License: MIT License

C# 89.02% C++ 3.90% C 0.25% Shell 0.14% Roff 0.01% Batchfile 0.22% Gnuplot 0.01% JavaScript 0.01% PowerShell 0.21% TypeScript 6.12% Smalltalk 0.01% ANTLR 0.01% Objective-C++ 0.07% Objective-C 0.01% DenizenScript 0.01% Bicep 0.04%
macos filesystem unix cli sandbox kernel orchestration xcode coreclr netstandard

buildxl's Introduction

BuildXL (Microsoft Build Accelerator)

BuildXL Icon

Introduction

BuildXL (Microsoft Build Accelerator) is a build engine originally developed for large internal teams at Microsoft. Internally at Microsoft, BuildXL runs 150,000+ builds per day on monorepo codebases up to a half-terabyte in size with a half-million process executions per build. It leverages distribution to thousands of data center machines and petabytes of source code, package, and build output caching. Thousands of developers use BuildXL on their desktops for faster builds.

BuildXL accelerates multiple build languages, including:

  • JavaScript
  • MSBuild
  • Ninja (CMake)
  • Its own internal scripting language, DScript, an experimental TypeScript based format used as an intermediate language by a small number of teams inside Microsoft

BuildXL has a command-line interface. There are currently no plans to integrate it into Visual Studio. The project is open source in the spirit of transparency of our engineering system. You may find our technology useful if you face similar issues of scale. Note that BuildXL is not intended as a replacement for MSBuild or to indicate any future direction of build languages from Microsoft.

OS compatibility:

  • Windows 10+
  • Ubuntu 20.04

Examples

See the Examples/ folder for basic project examples.

Documentation

The BuildXL documentation landing page is here and look at the developer guide in order to understand how to build and use BuildXL.

Build Status - Azure DevOps Pipelines

Build status

buildxl's People

Contributors

almilimsft avatar anirudhsanthiar avatar anniefu avatar blufugen avatar dannyvv avatar dcwuser avatar edgarrs avatar erickulcyk avatar erikmav avatar jbayardo avatar johnterickson avatar juancarlosgi avatar kewilli avatar kr1sso avatar ljcollins25 avatar marcelolynch avatar minglunli avatar mpysson avatar narasamdya avatar norahuang avatar olkononenko avatar one-qi avatar pgunasekara avatar plade avatar rijulluman-msft avatar schandr78 avatar semihokur avatar sergeyteplyakov avatar smera avatar surthumm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buildxl's Issues

Resharper annotations should point to the real ones (or just remove them all)

We have a “ResharperAnnotations” folder under Utilities where we mimicked many JetBrains annotations (mirroring exact namespaces as well). I guess this was so we could use all the usual annotations without referring the real JetBrains package. (https://github.com/Microsoft/BuildXL/blob/master/src/Utilities/Utilities/ResharperAnnotations/ResharperAnnotations.cs)

There are many consumers of these annotations. We should use the real ones or remove all.

Anti-Virus Scanning for Symantec Endpoint Protection (sysfer)?

[6:44] warning DX0268: [Pip60EF7993CD54B656, dotnet.exe, BuildXL.Cache.ContentStore, DistributedTest.dll, {configuration:"debug", targetFramework:"netcoreapp3.1", targetRuntime:"win-x64"}, acquires semaphores (BuildXL.xunit_semaphore:1)] Pip completed successfully, but with file monitoring violations. It will not be stored to the cache, since its declared inputs or outputs may be inaccurate. [6:44] error DX0500: [Pip60EF7993CD54B656, dotnet.exe, BuildXL.Cache.ContentStore, DistributedTest.dll, {configuration:"debug", targetFramework:"netcoreapp3.1", targetRuntime:"win-x64"}, acquires semaphores (BuildXL.xunit_semaphore:1)] - Disallowed file accesses were detected (R = read, W = write): Disallowed file accesses performed by: F:\p\BuildXL\Out\Objects\w\j\bdxe7pnjz9j84qy53zby9nvw\testRun\redisServer\redis-server.exe W C:\Bld_area\SEP_14.2-RU2-MP1\Output\SEPClientProtection\Bin64.iru\sysfer.pdb

Disallowed file accesses

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

Provide way of adjusting output format?

When I run bxl.sh on macOS in the in-box Terminal app, the output is not formatted properly. See the following screenshot for an example:

Screen Shot of BuildXL output

Instead of overwriting the previous output (as happens on Windows), bits and pieces of old outputs scroll up the terminal buffer. There does not appear to be a flag I can use to disable whatever ANSI codes are emitted that attempt to do this. Is there anything I can try to attempt to fix this output issue? Thanks!

Linux sandboxing and build support

Regarding the Linux question from #28: We definitely know it's needed, but it's not the max priority for some time yet. It would be ideal to have parity across all three OSes but for internal teams that we support it has not bubbled up to the top of the ask list.

AppVerif found this issue "Microsoft.BuildXL.win-x64 / 0.1.0-20190912.1" in DetoursServices!Detoured_NtCreateFile

<avrf:logfile xmlns:avrf="Application Verifier">
<avrf:logSession TimeStarted="2019-11-18 : 03:15:27" PID="1888" Version="2">
<avrf:logEntry Time="2019-11-18 : 03:15:30" LayerName="Heaps" StopCode="0x13" Severity="Error">
avrf:messageFirst chance access violation for current stack trace.</avrf:message>
avrf:parameter110 - Invalid address causing the exception.</avrf:parameter1>
avrf:parameter27ff83c709c15 - Code address executing the invalid access.</avrf:parameter2>
avrf:parameter38f0e4b0 - Exception record.</avrf:parameter3>
avrf:parameter48f0dfc0 - Context record.</avrf:parameter4>
avrf:stackTrace
avrf:tracevrfcore!VerifierDisableVerifier+700 ( @ 0)</avrf:trace>
avrf:traceverifier!VerifierStopMessage+b9 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlApplicationVerifierStop+96 ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff836982669 ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff83698335a ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff8369829aa ( @ 0)</avrf:trace>
avrf:tracentdll!RtlInitializeCriticalSectionAndSpinCount+1c6 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlWalkFrameChain+1119 ( @ 0)</avrf:trace>
avrf:tracentdll!KiUserExceptionDispatcher+2e ( @ 0)</avrf:trace>
avrf:traceDetoursServices!Detoured_NtCreateFile+75 (b:\public\src\sandbox\windows\detoursservices\detouredfunctions.cpp @ 5344)</avrf:trace>
avrf:traceDetoursServices!Detoured_NtOpenFile+3e (b:\public\src\sandbox\windows\detoursservices\detouredfunctions.cpp @ 5926)</avrf:trace>
avrf:traceKERNEL32!CreateActCtxWWorker+11b9 ( @ 0)</avrf:trace>
avrf:traceKERNEL32!CreateActCtxWWorker+39f ( @ 0)</avrf:trace>
avrf:traceKERNELBASE!CreateActCtxW+20 ( @ 0)</avrf:trace>
avrf:traceKERNEL32!QueryPerformanceCounter+112 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlIsCriticalSectionLockedByThread+7ea ( @ 0)</avrf:trace>
avrf:tracentdll!RtlActivateActivationContextUnsafeFast+f3 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlIsCriticalSectionLockedByThread+38b ( @ 0)</avrf:trace>
avrf:tracentdll!RtlImageNtHeader+3d5 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlGetSuiteMask+28e ( @ 0)</avrf:trace>
avrf:tracentdll!RtlDosPathNameToNtPathName_U_WithStatus+3ef ( @ 0)</avrf:trace>
avrf:tracentdll!RtlDosPathNameToNtPathName_U_WithStatus+2b3 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlInitializeCriticalSection+1f0 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlReleaseSRWLockExclusive+694 ( @ 0)</avrf:trace>
avrf:traceKERNEL32!BaseThreadInitThunk+14 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlUserThreadStart+21 ( @ 0)</avrf:trace>
</avrf:stackTrace>
</avrf:logEntry>
<avrf:logEntry Time="2019-11-18 : 03:15:30" LayerName="Heaps" StopCode="0x13" Severity="Error">
avrf:messageFirst chance access violation for current stack trace.</avrf:message>
avrf:parameter10 - Invalid address causing the exception.</avrf:parameter1>
avrf:parameter2140f05e7a - Code address executing the invalid access.</avrf:parameter2>
avrf:parameter38f0bab0 - Exception record.</avrf:parameter3>
avrf:parameter48f0b5c0 - Context record.</avrf:parameter4>
avrf:stackTrace
avrf:tracevrfcore!VerifierDisableVerifier+700 ( @ 0)</avrf:trace>
avrf:traceverifier!VerifierStopMessage+b9 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlApplicationVerifierStop+96 ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff836982669 ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff83698335a ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff8369829aa ( @ 0)</avrf:trace>
avrf:tracentdll!RtlInitializeCriticalSectionAndSpinCount+1c6 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlWalkFrameChain+1119 ( @ 0)</avrf:trace>
avrf:tracentdll!KiUserExceptionDispatcher+2e ( @ 0)</avrf:trace>
avrf:traceSCRUBBED_APP!+140f05e7a ( @ 0)</avrf:trace>
avrf:traceSCRUBBED_APP!+14027a7ae ( @ 0)</avrf:trace>
avrf:traceSCRUBBED_APP!+1418a3bd8 ( @ 0)</avrf:trace>
avrf:traceSCRUBBED_APP!+1418adc7e ( @ 0)</avrf:trace>
avrf:traceSCRUBBED_APP!+1418b0f48 ( @ 0)</avrf:trace>
avrf:traceKERNELBASE!UnhandledExceptionFilter+1bc ( @ 0)</avrf:trace>
avrf:tracentdll!TpDbgDumpHeapUsage+129 ( @ 0)</avrf:trace>
avrf:tracentdll!TpDbgDumpHeapUsage+bda ( @ 0)</avrf:trace>
avrf:tracentdll!memset+136e ( @ 0)</avrf:trace>
avrf:tracentdll!_C_specific_handler+96 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlRaiseStatus+7e2 ( @ 0)</avrf:trace>
avrf:tracentdll!_chkstk+11f ( @ 0)</avrf:trace>
avrf:tracentdll!RtlWalkFrameChain+14bf ( @ 0)</avrf:trace>
avrf:tracentdll!KiUserExceptionDispatcher+2e ( @ 0)</avrf:trace>
avrf:tracevrfcore!VerifierStopMessageEx+7dc ( @ 0)</avrf:trace>
avrf:tracevrfcore!VerifierDisableVerifier+700 ( @ 0)</avrf:trace>
avrf:traceverifier!VerifierStopMessage+b9 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlApplicationVerifierStop+96 ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff836982669 ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff83698335a ( @ 0)</avrf:trace>
avrf:tracevfbasics!+7ff8369829aa ( @ 0)</avrf:trace>
avrf:tracentdll!RtlInitializeCriticalSectionAndSpinCount+1c6 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlWalkFrameChain+1119 ( @ 0)</avrf:trace>
avrf:tracentdll!KiUserExceptionDispatcher+2e ( @ 0)</avrf:trace>
avrf:traceDetoursServices!Detoured_NtCreateFile+75 (b:\public\src\sandbox\windows\detoursservices\detouredfunctions.cpp @ 5344)</avrf:trace>
avrf:traceDetoursServices!Detoured_NtOpenFile+3e (b:\public\src\sandbox\windows\detoursservices\detouredfunctions.cpp @ 5926)</avrf:trace>
avrf:traceKERNEL32!CreateActCtxWWorker+11b9 ( @ 0)</avrf:trace>
avrf:traceKERNEL32!CreateActCtxWWorker+39f ( @ 0)</avrf:trace>
avrf:traceKERNELBASE!CreateActCtxW+20 ( @ 0)</avrf:trace>
avrf:traceKERNEL32!QueryPerformanceCounter+112 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlIsCriticalSectionLockedByThread+7ea ( @ 0)</avrf:trace>
avrf:tracentdll!RtlActivateActivationContextUnsafeFast+f3 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlIsCriticalSectionLockedByThread+38b ( @ 0)</avrf:trace>
avrf:tracentdll!RtlImageNtHeader+3d5 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlGetSuiteMask+28e ( @ 0)</avrf:trace>
avrf:tracentdll!RtlDosPathNameToNtPathName_U_WithStatus+3ef ( @ 0)</avrf:trace>
avrf:tracentdll!RtlDosPathNameToNtPathName_U_WithStatus+2b3 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlInitializeCriticalSection+1f0 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlReleaseSRWLockExclusive+694 ( @ 0)</avrf:trace>
avrf:traceKERNEL32!BaseThreadInitThunk+14 ( @ 0)</avrf:trace>
avrf:tracentdll!RtlUserThreadStart+21 ( @ 0)</avrf:trace>
</avrf:stackTrace>
</avrf:logEntry>
</avrf:logSession>
</avrf:logfile>

BuildXL fails with vcxproj and ProjectReferences

When I point BuildXL at an MSBuild C++ project that contains a <ProjectReference> element, it fails with the following error message (line-wrapped for readability):

D:\Projects\BuildXL Demo\config.dsc(3,9): error DX11401: An error occurred while parsing
MsBuild spec files: Errors found during target prediction. Project 'D:\Projects\BuildXL
Demo\bxl.demo\bxl.demo.vcxproj' is not specifying its project reference protocol. For more
details see https://github.com/Microsoft/msbuild/blob/master/documentation/specs/static-graph.md

As I understand it, this is because the vcxproj infrastructure lacks the content in Microsoft.Managed.targets that provides information required by BuildXL. Unfortunately, I do not know enough about BuildXL to provide the correct metadata myself.

Migrate VS extension to AsyncPackage

Per this documentation, the VS IDE extension should be migrated to use AsyncPackage and background autoloading. I tried to do this myself, but it would not compile (and I suspect that even if it did, I would introduce subtle threading bugs). If this could be addressed, I would appreciate it, because VS2019 nags me at launch about using the deprecated synchronous load mechanism. Thanks!

Quickbuild cannot be found in the PATH env variable after VSIX install

Got tipped inside Visual Studio to install the 1ES Build Assistant, so I did. But after downloading and installing the VSIX package and running a build, the following message shows up in the 1ES Build Assistant log in VS:

1ES Build Assistant is being initialized.
1ES Build Assistant is not supported. Quickbuild cannot be found in the PATH env variable.

Example MSBuild fails to build

[0:02.459] -- Done parsing MSBuild specs.
C:\BuildXL-master\Examples\MsBuildHelloWorld\config.bc(3,9): error DX11410: An internal error occurred when computing the MsBuild graph. This shouldn't have happened! Tool standard error: 'Unexpected exception: System.MissingMethodException: Method not found: 'System.Collections.Generic.IReadOnlyDictionary2<Microsoft.Build.Graph.ProjectGraphNode,System.Collections.Immutable.ImmutableList1<System.String>> Microsoft.Build.Graph.ProjectGraph.GetTargetLists(System.Collections.Generic.ICollection`1<System.String>)'.

Unable to build from source: cl.exe not found

Here is the error message:

error DX0011: [PipFF41B2EE49D777E3, cl.exe (Microsoft C/C++ compiler), BuildXL.Sandbox.Windows, Detours.Lib.lib, {configuration:"release", platform:"x64"}] Process start failed with error code 00000002: File 'C:\Users\jie\GitHub\BuildXL\out\frontend\Nuget\pkgs\VisualCppTools.Community.VS2017Layout.14.11.25506\lib\native\bin\Hostx64\x64\cl.exe' was not found on disk. The tool is referred in 'C:\Users\jie\GitHub\BuildXL\Public\Src\Sandbox\Windows\Detours\Lib\Detours.dsc(17)'.

I went to check the C:\Users\jie\GitHub\BuildXL\Out\frontend\Nuget\pkgs\VisualCppTools.Community.VS2017Layout.14.11.25506\lib\native folder. there is only atlmfc folder, no bin folder.

Which folder should I delete or run any command to force bxl/nuget to redownload VS2017?

Building bxl fails with missing VisualCppTools NuGet package

Hi,

I've tried building the most recent tag of BuildXL and every single time I get the following error message:

Microsoft (R) Build Accelerator. Build: 0.1.0-20210514.2, Version:
[refs/heads/master:72d7d2d0ac4773e6c674fc7bba035e3b91411162]
Copyright (C) Microsoft Corporation. All rights reserved.

[0:02] -- Telemetry is enabled. SessionId: cae8eac1-0000-0000-bd07-34637fb90a41
[22:41] error DX11331: Nuget failed to download package 'VisualCppTools.Community.VS2017Layout': Package nuget://VisualCppTools.Community.VS2017Layout/14.11.25506 could not be restored: the package is not found.
Build FAILED
    Log Directory: C:\Users\kjczarne\Desktop\BuildXL\Out\Logs\20210521-165538
The BuildXL build failed with exit code 3

The error appears when running a full install as well as with the -minimal flag. Am I missing something configuration-wise? I followed the Developer Guide and used bxl.cmd in Windows Command Line.

error DX0064: [Pip56CACF840947E197, DBS.QTest.exe (CloudBuild QTest), ...

I am building Office project with using 'ohome build debug x64 nosmart corephase nobackup nosync maxdomino', but I hit a error message as below. Could anyone help to look at the issue and how can I fix the issue? Thanks in advance.

============================== Domino ProductBuild ==============================
error DX0064: [Pip56CACF840947E197, DBS.QTest.exe (CloudBuild QTest), oneservice_x64_debug, qtest.qtest.rn.18047653495166817346, {} || {Running QTest for D:\Office\Target\x64\debug\oneservice\x-none\hierarchy\microsoft.office.onenote.sync.hierarchy.unittests.dll (QTest|oneservice|x64_debug|oneservice\sync\hierarchy\src\unittests)}, D:\Office\Build\ProductBuild\dsc\oneservice_x64_debug\spec.1.dsc, D:\Office\Build\DominoTemp\y\1\ka4zb00xvkgc6c5h86je519c\sandbox] - failed with exit code 1
Running Dbs.QTest.exe --testBinary D:\Office\Target\x64\debug\oneservice\x-none\hierarchy\microsoft.office.onenote.sync.hierarchy.unittests.dll --runner MsTest_150 --qTestLogsDir D:\Office\Logs\QTest\oneservice_x64_debug\qtest_qtest_rn_18047653495166817346 --qtestPlatform X64 --buildPlatform X64 --qtestDotNetFramework Framework45 --qTestRetryOnFailureMode Full --qTestBuildType agnostic --testSourceDir oneservice\sync\hierarchy\src\unittests --buildSystem BuildXL --qTestExcludeCcTargetsFile D:\Office\dev\otools\inc\test\qTestExcludeCcTargets-mstest.txt --QTestFlakyTestManagementSuppressionFile D:\Office\dev\otools\inc\test\CloudBuild.FlakyTests.json --sandbox D:\Office\Build\DominoTemp\y\1\ka4zb00xvkgc6c5h86je519c\sandbox\qtest --copyToSandbox D:\Office\Build\x64\debug\oneservice\sync\Hierarchy\src\UnitTests\objd\x64 --qCodeCoverageEnumType None
Skipping results upload.
Log directory: D:\Office\Logs\QTest\oneservice_x64_debug\qtest_qtest_rn_18047653495166817346\attempt1

Catastrophic BuildXL Failure: Assertion failed at \.\Public\Src\Cache\VerticalStore\MemoizationStoreAdapter\MemoizationStoreAdapterCacheReadOnlySession.cs:142

https://onedrive.visualstudio.com/SharePoint%20Online/_build/results?buildId=7275453&view=logs&j=1d356963-1a5c-5183-b7ea-363445694ca2&t=eb2b7b2f-a0db-4a9a-a7e4-0a604a230bc1&l=414

##[warning][Pip57C73D62233BA0B7, cmd.exe, intl_dlcserverforms_x64_ship_el-gr, nrn_17191720706123099859, {} || {Hashing d:\dbs\el\spop\Target\x64\ship\intl_dlcserverforms\el-gr\workflow\forms\reviewfeedback_task.xsn.lct (NMake|intl_dlcserverforms|x64_ship_el-gr|d:\dbs\el\spop\src\intl\dlcserverforms\el-gr)}] Querying for a batch of prior executions (for weak fingerprint F49A0BDC0FB96615E3454F3BE064F295F96228C9) failed: AdaptPublishedEntry failed due to timeout: 10 minutes. Since some cached results may be unavailable, this process may have to re-run.
##[warning][Pip0D6508F6025FF0C7, cmd.exe, search_foundation_x64_ship, nrn_12217690502119615859, {} || {Hashing d:\dbs\el\spop\Target\x64\ship\search_foundation\x-none\contentengine\datamodel\recordserializer-tests\microsoft.ceres.contentengine.datamodel.recordserializer-tests.dll (NMake|search_foundation|x64_ship|d:\dbs\el\spop\src\search\foundation\copyfiletotarget)}] Querying for a batch of prior executions (for weak fingerprint 5D43608298294F27342E9F3B4BD3D0E309E660A1) failed: AdaptPublishedEntry failed due to timeout: 10 minutes. Since some cached results may be unavailable, this process may have to re-run.
##[warning][PipDE4DC1D3C20AD914, cmd.exe, dlc_x64_ship, nrn_9759497226244055004, {} || {Hashing d:\dbs\el\spop\Target\x64\ship\dlc\x-none\eaworkflow\eawf\features\eawfsite\resources\resources.ko-kr.resx (NMake|dlc|x64_ship|d:\dbs\el\spop\src\dlc\eaworkflow\eawf\features\eawfsite\resources)}] Querying for a batch of prior executions (for weak fingerprint 955F5D015B7E4E5D451E8C1764689345C4742829) failed: AdaptPublishedEntry failed due to timeout: 10 minutes. Since some cached results may be unavailable, this process may have to re-run.
##[warning][Pip906A0D024278D8CD, cmd.exe, search_foundation_x64_ship, nrn_13693435589244301143, {} || {Hashing d:\dbs\el\spop\Target\x64\ship\search_foundation\x-none\common\constants\microsoft.ceres.common.constants.pdb (NMake|search_foundation|x64_ship|d:\dbs\el\spop\src\search\foundation\copyfiletotarget)}] Querying for a batch of prior executions (for weak fingerprint 48B1CE351FDABBAC8F3A1F02E715D9C5ABB376C1) failed: AdaptPublishedEntry failed due to timeout: 10 minutes. Since some cached results may be unavailable, this process may have to re-run.
##[error]Catastrophic BuildXL Failure.
##[error]Build:[0.1.0-20200828.6.2][refs/heads/releases/0.1.0-20200828.6.1:bbd7da4d4a550a4e3f1a89fb0ec7c290d65075bd].
##[error]Exception:System.Diagnostics.ContractsLight.ContractException: Assertion failed.
##[error]	at \.\Public\Src\Cache\VerticalStore\MemoizationStoreAdapter\MemoizationStoreAdapterCacheReadOnlySession.cs:142
##[error]   at void System.Diagnostics.ContractsLight.ContractRuntimeHelper.TriggerFailure(ContractFailureKind kind, string msg, string userMessage, string conditionTxt)
##[error]   at void System.Diagnostics.ContractsLight.ContractRuntimeHelper.ReportFailure(ContractFailureKind kind, string msg, string conditionTxt, Provenance provenance)
##[error]   at IEnumerable<Task<Possible<StrongFingerprint, Failure>>> BuildXL.Cache.MemoizationStoreAdapter.MemoizationStoreAdapterCacheReadOnlySession.EnumerateStrongFingerprints(WeakFingerprintHash weak, UrgencyHint urgencyHint, Guid activityId)+MoveNext() in \.\Public\Src\Cache\VerticalStore\MemoizationStoreAdapter\MemoizationStoreAdapterCacheReadOnlySession.cs:line 148
##[error]   at IEnumerable<Task<Possible<PublishedEntryRef, Failure>>> BuildXL.Engine.Cache.Plugin.CacheCore.CacheCoreFingerprintStore.ListPublishedEntriesByWeakFingerprint(WeakContentFingerprint weak)+MoveNext() in \.\Public\Src\Engine\Cache.Plugin.CacheCore\CacheCoreFingerprintStore.cs:line 60
##[error]   at IEnumerable<Task<Possible<PublishedEntryRef, Failure>>> BuildXL.Scheduler.Cache.PipTwoPhaseCache.ListPublishedEntriesByWeakFingerprint(OperationContext operationContext, WeakContentFingerprint weak)+MoveNext() in \.\Public\Src\Engine\Scheduler\Caching\PipTwoPhaseCache.cs:line 359
##[error]   at IEnumerable<Task<Possible<PublishedEntryRef, Failure>>> BuildXL.Scheduler.Cache.HistoricMetadataCache.ListPublishedEntriesByWeakFingerprint(OperationContext operationContext, WeakContentFingerprint weak)+MoveNext() in \.\Public\Src\Engine\Scheduler\Caching\HistoricMetadataCache.cs:line 293
##[error]   at void BuildXL.Scheduler.PipExecutor+<>c__DisplayClass38_0+<<TryCheckProcessRunnableFromCacheAsync>g__innerCheckRunnableFromCacheAsync|0>d.MoveNext() in \.\Public\Src\Engine\Scheduler\PipExecutor.cs:line 2734
##[error]   at async Task<RunnableFromCacheResult> BuildXL.Scheduler.PipExecutor.TryCheckProcessRunnableFromCacheAsync(ProcessRunnablePip processRunnable, PipScopeState state, CacheableProcess cacheableProcess, Func<WeakContentFingerprint> computeWeakFingerprint, BoxRef<PipCacheMissEventData> pipCacheMiss, BoxRef<ProcessFingerprintComputationEventData> processFingerprintComputationResult, List<BoxRef<ProcessStrongFingerprintComputationData>> strongFingerprintComputationList, bool canAugmentWeakFingerprint, bool isWeakFingerprintAugmented) in \.\Public\Src\Engine\Scheduler\PipExecutor.cs:line 2735
##[error]   at async Task<RunnableFromCacheResult> BuildXL.Scheduler.PipExecutor.TryCheckProcessRunnableFromCacheAsync(ProcessRunnablePip processRunnable, PipScopeState state, CacheableProcess cacheableProcess) in \.\Public\Src\Engine\Scheduler\PipExecutor.cs:line 2147
##[error]   at async Task<ValueTuple<RunnableFromCacheResult, PipResultStatus>> BuildXL.Scheduler.Distribution.LocalWorker.CacheLookupAsync(ProcessRunnablePip runnablePip, PipScopeState state, CacheableProcess cacheableProcess) in \.\Public\Src\Engine\Scheduler\Distribution\LocalWorker.cs:line 169
##[error]   at async Task<PipExecutionStep> BuildXL.Scheduler.Scheduler.ExecutePipStep(RunnablePip runnablePip) in \.\Public\Src\Engine\Scheduler\Scheduler.cs:line 4444
##[error]   at async Task BuildXL.Scheduler.Scheduler.ExecutePip(RunnablePip runnablePip) in \.\Public\Src\Engine\Scheduler\Scheduler.cs:line 3589
##[error]   at async Task BuildXL.Scheduler.WorkDispatcher.DispatcherQueue.RunCoreAsync(RunnablePip runnablePip) in \.\Public\Src\Engine\Scheduler\WorkDispatcher\DispatcherQueue.cs:line 178
##[error]   at async void BuildXL.Scheduler.WorkDispatcher.DispatcherQueue.StartRunTaskAsync(RunnablePip runnablePip) in \.\Public\Src\Engine\Scheduler\WorkDispatcher\DispatcherQueue.cs:line 148
##[error]   at void System.Threading.Tasks.Task.ThrowAsync(Exception exception, SynchronizationContext targetContext)+(object state) => { }
##[error]   at bool System.Threading.ThreadPoolWorkQueue.Dispatch()

FileContentTable does not work optimally when file belongs to more than one FileContentTable

Imagine that I have some shared file and I have 2 different BuildXL projects but they both include that shared file as input.
When I started a first BuildXL project, it will call FileContentTable.RecordContentHash on that shared file and that in turn will create close record and return its USN.

Then I will start second BuildXL project, it will call FileContentTable.RecordContentHash on that shared file and that in turn will create new close record and return new USN. Please note that this USN is different from USN we get for this file when I started first project.

Now if I start first BuildXL project, USN stored in FileContentTable became "stale" and as result, it will be re-hashed again and added by FileContentTable.RecordContentHash and that will add new close record and as result generate new USN that is different from what second project is record.

I think you already see that pattern here. File is not changed but it constantly re-hashing because I run first project and then second.

It is possible to reproduce just by using project and switching cacheDirectory between 2 different directories.

In my case 2 small C++ projects are using boost source code as shared input and it constantly re-hashing and it takes considerable time.

C# Intellisense for VSCode

It seems like the VSCode plugin built by bxl -deployconfig release out\bin\release\ide\* only does DScript language support. The official VSCode C# extension by Microsoft does not understand the files generated by bxl /vs.

Pip fails due to .mui loading

I grabbed head as of right now and I get lots of instances of the following when building. Perhaps this happens because I'm on a non-US version of Windows and end up pulling some localization packages which the file system tracking isn't expecting?

[1:08] error DX0500: [Pip47370E23192652B2, cl.exe (Microsoft C/C++ compiler), BuildXL.Sandbox.Windows, Core.nativesDll, {configuration:"debug", platform:"x64"}] - Disallowed file accesses were detected (R = read, W = write):
Disallowed file accesses performed by: C:\github\BuildXL\out\frontend\Nuget\pkgs\VisualCppTools.Community.VS2017Layout.14.11.25506\lib\native\bin\Hostx64\x64\cl.exe
 R  C:\Program Files\WindowsApps\Microsoft.LanguageExperiencePacken-US_18362.9.10.0_neutral__8wekyb3d8bbwe\Windows\SYSTEM32\en-US\tzres.dll.mui

R  = Read

FWIW I ran into this when I tried BuildXL right at the time when it was announced as well, but figured it would get reported by someone else.

File opening/creating with Nt/Zw APIs are ignored by sandbox

Detoured Win32 APIs handle file opening/creating, but detoured Nt/Zw APIs seem to not handle it. Msys2/Cygwin C runtime implementation use Nt APIs instead of Win32 APIs to implement POSIX functions, which means programs linked to Msys2/Cygwin runtime are not constrained by the sandbox at all.

Any timeline that this can be fixed? I wonder if the change will look similar to how Detoured Win32 implementation? If the change is not too complicated, will the team accept external PR?

// TODO: As part of gradually turning on NtCreateFile detour reports, we currently only enforce deletes (some cmd builtins delete this way),

NuGet package deployment

When would you consider to publish NuGet packages for the sandboxing implementation? As a side question: currently it seems this only supports Windows and macOS. Any plans for Linux?

PS: It's great to see something like this is being worked on. Thanks!

CMake support or example

Maybe there is something I am missing, but do I understand correctly that BuildXML could injest CMakeLists.txt and accelerate the builds for the products described there? If yes, how? Is there any "hello world" example for CMake?

SDK not getting fully packaged

Hi, I'm trying to use BuildXL external to Microsoft, and given the lightness of the documentation I've been running into a lot of confusing areas, one such area is the Sdks directory.

So, it appears to me that Sdks is supposed to be the dscript binding of a lot of internal functionality, is that correct?

So, to even get access to Sdk.Transformers, it seems that I have to:

  1. Install BuildXL as a sub-directory to my project,
  2. Set an environment variable so I have access to that directory: i.e. $env:BUILDXL_BIN=(Get-Item ".\Microsoft.BuildXL.win-x64.0.1.0-20200711.0").FullName
  3. add something like f`${Environment.getPathValue("BUILDXL_BIN")}/Sdk/Sdk.Transformers/package.config.dsc`, to my config.dsc.

So, that already seems suspect, so let me know if I'm just misunderstanding the setup, but this comes mostly from the HelloWorld example project, and seems to be the only real example of doing a DScript build.

So, the problem is, now when I try to use any additional functionality, such as Json, I run into some problems.

I try to import from Sdk.Json
import * as Json from "Sdk.Json";

And I get the error:
[0:03] error DX11230: C:\Temp\SetupBin\Git.Package.dsc(2,23): No resolver was found that owns module 'Sdk.Json'. Known modules are: [Sdk.Transformers, git.package], [Sdk.Prelude]

So, as I look into the distribution, the vast majority of the Sdk directory does not seem to be included, is that intentional? Is it intended I import the Sdk into my project?

Additional samples of using advanced functionality in DScript would greatly improve the experience of working-out how to properly use BuildXL.

NLog AzureBlobStorageLogTarget and OptimizeBufferReuse

Instead of doing this:

protected override void Write(LogEventInfo logEvent)
{
_log.Write(Layout.Render(logEvent));
}

Then it should be like this:

public AzureBlobStorageLogTarget(AzureBlobStorageLog log)
{
     _log = log;
     _log.OnFileOpen = WriteHeaderAsync;
     _log.OnFileClose = WriteFooterAsync;
     this.OptimizeBufferReuse = true;
}

protected override void Write(LogEventInfo logEvent) 
{ 
     // RenderLogEvent() + OptimizeBufferReuse = true will skip StringBuilder-allocation
     _log.Write(RenderLogEvent(this.Layout, logEvent));
} 

Then you can remove LowAllocationSimpleLayout. See also: https://github.com/NLog/NLog/wiki/How-to-write-a-custom-target

Also notice that NLog 4.7.7 reduces memory-allocation with 10-20 pct (Compared to older versions of NLog).

Also notice that NLog 4.6.8 has better support for async-api by introducing AsyncTaskTarget. See also https://github.com/NLog/NLog/wiki/How-to-write-a-custom-async-target

Trying to build BuildXL myself and get error DX0500

I am trying to build BuildXL myself and I am getting following output with error code DX0500:

bxl.cmd -all

Preparing to build.

BuildXL Selfhost wrapper - run 'domino -SelfhostHelp' for more info
Building using the LKG (published NuGet package) version of BuildXL.
Server mode enabled.
C:\Users\RustedWizard\Downloads\BuildXL-master\BuildXL-master\Out\BootStrap\Microsoft.BuildXL.win-x64.0.1.0-20191115.0\RunInSubst.exe B=C:\Users\RustedWizard\Downloads\BuildXL-master\BuildXL-master B:\Out\BootStrap\Microsoft.BuildXL.win-x64.0.1.0-20191115.0\bxl.exe /config:B:\config.dsc /IncrementalScheduling /nowarn:909 /nowarn:11318 /nowarn:11319 /unsafe_IgnorePreloadedDlls- /historicMetadataCache+ /cachemiss /cacheSessionName:20191116_17220258-RUSTEDLAPTOP-RustedWizard@RUSTEDLAPTOP /remotetelemetry /reuseOutputsOnDisk+ /scrubDirectory:B:\out\objects /storeFingerprints /cacheMiss /p:[Sdk.BuildXL]useQTest=true /logsToRetain:20 /environment:SelfhostLKG /unsafe_GlobalUntrackedScopes:B:\Shared\Tools /unsafe_GlobalPassthroughEnvVars:NUGET_CREDENTIALPROVIDERS_PATH /generateCgManifestForNugets:B:\cg\nuget\cgmanifest.json /cacheConfigFilePath:B:\Out\Cache\CacheCore.json /server /serverDeploymentDir:B:\Out\Selfhost\LKG.ServerDeployment /Interactive+ /f:~(tag='LongRunningTest') /substTarget:B:\ /substSource:C:\Users\RustedWizard\Downloads\BuildXL-master\BuildXL-master\ /logProcessDetouringStatus+ /logProcessData+ /logProcesses+
Microsoft (R) Build Accelerator. Build: 0.1.0-20191115.0, Version: [refs/heads/master:8d3b4b7ab856660441964431129d5815e9cb9acb]
Copyright (C) Microsoft Corporation. All rights reserved.

[0:00] -- Telemetry is enabled. SessionId: a3571f3d-0000-0000-bd07-15dbb7160fcb
[0:00] -- Using pip filter: ~(tag='LongRunningTest')
[2:22] warning DX0268: [PipC9BDB264245A25D5, pwsh.exe, BuildXL.Explorer, App.app, {targetRuntime:"win-x64"}] Pip completed successfully, but with file monitoring violations. It will not be stored to the cache, since its declared inputs or outputs may be inaccurate.
[2:40] error DX0500: [PipC9BDB264245A25D5, pwsh.exe, BuildXL.Explorer, App.app, {targetRuntime:"win-x64"}] - Disallowed file accesses were detected (R = read, W = write):
Disallowed file accesses performed by: C:\Users\RustedWizard\Downloads\BuildXL-master\BuildXL-master\out\frontend\Download\PowerShell.Core.win-x64\c\pwsh.exe
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Accounts\1.6.2\Az.Accounts.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Advisor\1.0.1\Az.Advisor.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Aks\1.0.2\Az.Aks.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.AnalysisServices\1.1.1\Az.AnalysisServices.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.ApiManagement\1.3.1\Az.ApiManagement.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.ApplicationInsights\1.0.2\Az.ApplicationInsights.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Automation\1.3.3\Az.Automation.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Batch\1.1.1\Az.Batch.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Billing\1.0.1\Az.Billing.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Cdn\1.3.1\Az.Cdn.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.CognitiveServices\1.2.1\Az.CognitiveServices.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Compute\2.6.0\Az.Compute.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.ContainerInstance\1.0.1\Az.ContainerInstance.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.ContainerRegistry\1.1.0\Az.ContainerRegistry.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.DataFactory\1.3.0\Az.DataFactory.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.DataLakeAnalytics\1.0.1\Az.DataLakeAnalytics.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.DataLakeStore\1.2.2\Az.DataLakeStore.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.DeploymentManager\1.0.1\Az.DeploymentManager.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.DevTestLabs\1.0.0\Az.DevTestLabs.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Dns\1.1.1\Az.Dns.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.EventGrid\1.2.2\Az.EventGrid.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.EventHub\1.4.0\Az.EventHub.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.FrontDoor\1.1.1\Az.FrontDoor.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.HDInsight\2.0.2\Az.HDInsight.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.IotHub\1.3.0\Az.IotHub.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.KeyVault\1.3.1\Az.KeyVault.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.LogicApp\1.3.1\Az.LogicApp.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.MachineLearning\1.1.1\Az.MachineLearning.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.ManagedServices\1.0.1\Az.ManagedServices.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.MarketplaceOrdering\1.0.1\Az.MarketplaceOrdering.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Media\1.1.0\Az.Media.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Monitor\1.3.0\Az.Monitor.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Network\1.14.0\Az.Network.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.NotificationHubs\1.1.0\Az.NotificationHubs.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.OperationalInsights\1.3.3\Az.OperationalInsights.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.PolicyInsights\1.1.3\Az.PolicyInsights.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.PowerBIEmbedded\1.1.0\Az.PowerBIEmbedded.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.RecoveryServices\1.4.5\Az.RecoveryServices.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.RedisCache\1.1.0\Az.RedisCache.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Relay\1.0.2\Az.Relay.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Resources\1.7.0\Az.Resources.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.ServiceBus\1.4.0\Az.ServiceBus.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.ServiceFabric\1.2.0\Az.ServiceFabric.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.SignalR\1.1.0\Az.SignalR.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Sql\1.14.2\Az.Sql.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.StorageSync\1.2.0\Az.StorageSync.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Storage\1.7.0\Az.Storage.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.StreamAnalytics\1.0.0\Az.StreamAnalytics.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.TrafficManager\1.0.2\Az.TrafficManager.psd1
R C:\Users\RustedWizard\Documents\PowerShell\Modules\Az.Websites\1.4.2\Az.Websites.psd1

R = Read
[4:28] 100.00% Processes:[989 done (944 hit), 985 succeeded, 1 failed, 3 skipped, 0 executing, 0 waiting] Files:[36432/36432]
[4:28] -- Cache savings: 95.45% of 989 included processes. 0 excluded via filtering.
Build FAILED
Log Directory: C:\Users\RustedWizard\Downloads\BuildXL-master\BuildXL-master\out\Logs\20191116-172203
The BuildXL build failed with exit code 1

Any form of help/tip are appreciated!

Build scripts incorrectly report that Visual Studio 2017 build tools are required

When running bxl.cmd without appropriate prerequisites installed a user receives an error message that "Prerequisite Visual Studio 2017 build tools not found at any of the following locations: ..."

However the DScript Public\Sdk\Experimental\Msvc\VisualCpp\visualCpp.dsc is actually checking for Visual Studio 2019 build tools, as documented in the developer guide.

Here's a simple diff to resolve the issue:

--- a/Public/Sdk/Experimental/Msvc/VisualCpp/visualCpp.dsc
+++ b/Public/Sdk/Experimental/Msvc/VisualCpp/visualCpp.dsc
@@ -77,7 +77,7 @@ function createMsvcTool(exe: PathAtom, description: string) : Transformer.ToolDe

 /**
  * When building internally, returns the VisualCppTools.Internal.VS2017Layout package.
- * When building externally, search for the Visual Studio 2017 build tools directory.
+ * When building externally, search for the Visual Studio 2019 build tools directory.
  */
 function getMsvcPackage() : StaticDirectory {
     // The VisualCppTools.Community.VS2017Layout package has been deprecated for external users.
@@ -114,6 +114,6 @@ function getMsvcPackage() : StaticDirectory {
             }
         }

-        Contract.fail(`Prerequisite Visual Studio 2017 build tools not found at any of the following locations: '${buildToolsDirectories}'. Please see BuildXL/Documentation/Wiki/DeveloperGuide.md on how to acquire these tools for building externally.`);
+        Contract.fail(`Prerequisite Visual Studio 2019 build tools not found at any of the following locations: '${buildToolsDirectories}'. Please see BuildXL/Documentation/Wiki/DeveloperGuide.md on how to acquire these tools for building externally.`);
     }
 }
\ No newline at end of file

Catastrophic error when running sample

Hello, I tried running an almost exact version of the MsBuildHelloWorld sample, but I get the following crash:

[0:10] critical DX0059: Catastrophic BuildXL Failure.
Build:[Developer Build].
Exception:BuildXL.Utilities.BuildXLException: Process creation failed ---> BuildXL.Native.IO.NativeWin32Exception: Native: 0x2: The system cannot find the file specified.

(full error log at the end of the post)

My folder structure is as follows:

C:\Users\Borgleader\Documents\BuildXL\helloworld
    |---> build.bat
    |---> config.bc
    |---> helloworld.vcxproj
    |---> main.cpp

main.cpp is your canonical c++ hello world
helloworld.vcxproj is nearly the same as "BuildXL\Examples\MsBuildHelloWorld\Example.vcxproj" but I "rolled back" to v141 toolchain and ToolsVersion 15.0 (I don't have VS2019 installed, only VS2017 Community), and I only tried doing that because it failed to launch a process which I suspected might be the VS2019 toolchain
config.bc is exactly the same as "BuildXL\Examples\MsBuildHelloWorld\config.bc"
build.bat contains:

SET BUILDXL_BIN=C:\GitHub\BuildXL\Out\Bin\debug\win-x64
%BUILDXL_BIN%\bxl.exe /c:config.bc /disableProcessRetryOnResourceExhaustion+

Is there anything I can do to debug this on my end? I tried opening the exe as a project/solution in Visual Studio and running it with essentially the same setup as the batch file, but it wouldn't break on the exception being thrown nor did I have any symbols if I paused the execution (even though the PDB for bxl.exe is right there).

Full error log:

[0:02] critical DX0059: Catastrophic BuildXL Failure.
Build:[Developer Build].
Exception:BuildXL.Utilities.BuildXLException: Process creation failed ---> BuildXL.Native.IO.NativeWin32Exception: Native: 0x2: The system cannot find the file specified.
   --- End of inner exception stack trace ---
   at void BuildXL.Processes.Internal.DetouredProcess.Start(Guid payloadGuid, ArraySegment<byte> payloadData, SafeFileHandle inheritableReportHandle, string dllNameX64, string dllNameX86) in \.\Public\Src\Engine\Processes\Internal\DetouredProcess.cs:line 513
   at void BuildXL.Processes.SandboxedProcess.Start() in \.\Public\Src\Engine\Processes\SandboxedProcess.cs:line 325
   at ISandboxedProcess BuildXL.Processes.SandboxedProcessFactory.ProcessStart(object state) in \.\Public\Src\Engine\Processes\SandboxedProcessFactory.cs:line 145
   at void System.Threading.Tasks.Task.s_ecCallback(object obj)
   at void System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, object state)
   at void System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, object state)
   at async Task<SandboxedProcessResult> BuildXL.FrontEnd.Utilities.FrontEndUtilities.RunSandboxedToolAsync(FrontEndContext context, string pathToTool, string buildStorageDirectory, FileAccessManifest fileAccessManifest, string arguments, string workingDirectory, string description, IBuildParameters buildParameters, Action beforeLaunch, Action onResult) in \.\Public\Src\FrontEnd\Utilities\FrontEndUtilities.cs:line 106
   at async Task<Possible<ProjectGraphWithPredictionsResult<AbsolutePath>>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.ComputeBuildGraphAsync(AbsolutePath responseFile, IEnumerable<AbsolutePath> projectEntryPoints, AbsolutePath outputFile, IEnumerable<AbsolutePath> searchLocations, IBuildParameters buildParameters) in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 436
   at async Task<Possible<ProjectGraphResult>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.TryComputeBuildGraphAsync(IEnumerable<AbsolutePath> searchLocations, IEnumerable<AbsolutePath> parsingEntryPoints, IBuildParameters buildParameters) in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 336
   at async Task<Possible<ProjectGraphResult>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.TryComputeBuildGraphIfNeededAsync() in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 254
   at async ValueTask<Possible<HashSet<ModuleDescriptor>>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.GetAllKnownModuleDescriptorsAsync() in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 152
   at TResult System.Threading.Tasks.ValueTask<TResult>.get_Result()
   at async Task<Possible<IReadOnlyCollection<ModuleDefinition>>> BuildXL.FrontEnd.Workspaces.WorkspaceResolverExtensionMethods.GetAllModuleDefinitionsAsync(IWorkspaceModuleResolver moduleResolver) in \.\Public\Src\FrontEnd\Sdk\Workspaces\IWorkspaceModuleResolver.cs:line 106
   at async Task<Possible<HashSet<ModuleDefinition>>> BuildXL.FrontEnd.Workspaces.Core.WorkspaceProvider.GetModuleDefinitionsForAllResolversAsync() in \.\Public\Src\FrontEnd\Sdk\Workspaces\Core\WorkspaceProvider.cs:line 649
   at async Task<Possible<WorkspaceDefinition>> BuildXL.FrontEnd.Workspaces.Core.WorkspaceProvider.GetWorkspaceDefinitionForAllResolversAsync() in \.\Public\Src\FrontEnd\Sdk\Workspaces\Core\WorkspaceProvider.cs:line 191
   at async Task<Possible<WorkspaceDefinition>> BuildXL.FrontEnd.Core.FrontEndHostController.TryGetWorkspaceDefinitionAsync(IWorkspaceProvider workspaceProvider) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.Workspace.cs:line 386
   at async Task<Workspace> BuildXL.FrontEnd.Core.FrontEndHostController.BuildAndFilterWorkspaceAsync(IWorkspaceProvider workspaceProvider, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.Workspace.cs:line 153
   at async Task<T> BuildXL.Utilities.Tasks.TaskUtilities.WithCancellationHandlingAsync<T>(LoggingContext loggingContext, Task<T> evaluationTask, Action<LoggingContext> errorLogEvent, T errorValue, CancellationToken cancellationToken) in \.\Public\Src\Utilities\Utilities\Tasks\TaskUtilities.cs:line 486
   at Workspace BuildXL.FrontEnd.Core.FrontEndHostController.DoPhaseBuildWorkspace(IConfiguration configuration, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, QualifierId[] requestedQualifiers) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.Workspace.cs:line 103
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.BuildXL.FrontEnd.Sdk.IFrontEndController.PopulateGraph(Task<Possible<EngineCache>> cacheTask, IPipGraph graph, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, IConfiguration configuration, IStartupConfiguration startupConfiguration)+(LoggingContext nestedLoggingContext, ref WorkspaceStatistics statistics) => { } [3] in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 391
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.ProcessPhase<TStatistics>(EnginePhases phase, IConfiguration configuration, Action<LoggingContext> startPhaseLogMessage, Action<LoggingContext, TStatistics> endPhaseLogMessage, PhaseLogicHandler<TStatistics> phaseLogicHandler) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 983
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.BuildXL.FrontEnd.Sdk.IFrontEndController.PopulateGraph(Task<Possible<EngineCache>> cacheTask, IPipGraph graph, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, IConfiguration configuration, IStartupConfiguration startupConfiguration) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 384
   at bool BuildXL.Engine.BuildXLEngine.ConstructAndEvaluateGraph(LoggingContext loggingContext, FrontEndEngineAbstraction frontEndEngineAbstration, CacheInitializationTask engineCacheTask, MountsTable mountsTable, EvaluationFilter evaluationFilter, GraphReuseResult reuseResult, out PipGraph pipGraph) in \.\Public\Src\Engine\Dll\Engine.FrontEnd.cs:line 78
   at ConstructScheduleResult BuildXL.Engine.BuildXLEngine.ConstructSchedule(LoggingContext loggingContext, int maxDegreeOfParallelism, CacheInitializationTask cacheInitializationTask, JournalState journalState, EngineState engineState, out EngineSchedule engineSchedule, out RootFilter rootFilter) in \.\Public\Src\Engine\Dll\Engine.cs:line 2685
   at BuildXLEngineResult BuildXL.Engine.BuildXLEngine.DoRun(LoggingContext loggingContext, EngineState engineState, bool disposeFrontEnd) in \.\Public\Src\Engine\Dll\Engine.cs:line 1698
   at BuildXLEngineResult BuildXL.Engine.BuildXLEngine.Run(LoggingContext loggingContext, EngineState engineState) in \.\Public\Src\Engine\Dll\Engine.cs:line 1417
   at EngineState BuildXL.BuildXLApp.RunEngine(EngineContext engineContext, FrontEndControllerFactory factory, TrackingEventListener trackingEventListener, EngineState engineState, out EngineLiveVisualizationInformation visualizationInformation) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 1899
   at EngineState BuildXL.BuildXLApp.RunEngineWithDecorators(LoggingContext loggingContext, CancellationToken cancellationToken, AppLoggers appLoggers, EngineState engineState, PerformanceCollector collector, out EngineLiveVisualizationInformation visualizationInformation) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 737
   at AppResult BuildXL.BuildXLApp.RunInternal(PerformanceMeasurement pm, CancellationToken cancellationToken, AppLoggers appLoggers, EngineState engineState) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 616
   at AppResult BuildXL.BuildXLApp.Run(EngineState engineState)+(PerformanceMeasurement pm) => { } in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 468
   at AppResult BuildXL.BuildXLApp.RunWithLoggingScope(Func<PerformanceMeasurement, AppResult> run, Action sendFinalStatistics, Action<LoggingContext> configureLogging) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 974
   at AppResult BuildXL.BuildXLApp.Run(EngineState engineState) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 415
   at bool BuildXL.AppServer.RunAppInstance(BufferedStream bufferedStream) in \.\Public\Src\App\Bxl\AppServer.cs:line 276
   at ExitKind BuildXL.AppServer.Run(StartupParameters startupParameters) in \.\Public\Src\App\Bxl\AppServer.cs:line 138
   at ExitKind BuildXL.Program.RunAppServer(StartupParameters startupParameters) in \.\Public\Src\App\Bxl\Program.cs:line 211
   at int BuildXL.Program.Run() in \.\Public\Src\App\Bxl\Program.cs:line 81
   at int BuildXL.Program.Main(string[] rawArgs) in \.\Public\Src\App\Bxl\Program.cs:line 47
Terminating BuildXL client process because communication with the server has been lost: Error while writing data to server process. Inner exception reason: Pipe is broken.

Common MSBuild sandboxing

Hi everyone,

it's a while back that I've discovered BuildXL, and due to its sandboxing infrastructure, my initial thought was that this could be used as a common sandboxing approach when cloning third-party repositories without worrying about security too much (at least file access). I'm not entirely sure if that's the scope of the project. Back then I at least had to install some system component to make it work on macOS.

Could someone give some clarification and a few pointers?

BuildXL with MSBuild fails on macOS

I am attempting to run BuildXL with an MsBuildResolver, pointing to exactly one csproj file (dotnet new console, unaltered), on a Mac. (The provided MsBuildHelloWorld sample won't work because it contains a vcxproj.) However, the following exception is always thrown:

critical DX0059: Catastrophic BuildXL Failure.
Build:[0.1.0-20190803.1][refs/heads/master:f23a88a5c54c8bc3b4d6c6748767e0ce0b26db83].
Exception:System.Diagnostics.ContractsLight.ContractException: Assertion failed: Invalid path ''.
	at \.\Public\Src\Utilities\Utilities\AbsolutePath.cs:316
   at void System.Diagnostics.ContractsLight.ContractRuntimeHelper.ReportFailure(ContractFailureKind kind, string msg, string conditionTxt, Provenance provenence)
   at AbsolutePath BuildXL.Utilities.AbsolutePath.Create(PathTable table, StringSegment absolutePath) in \.\Public\Src\Utilities\Utilities\AbsolutePath.cs:line 319
   at AbsolutePath BuildXL.Utilities.AbsolutePath.Create(PathTable table, string absolutePath) in \.\Public\Src\Utilities\Utilities\AbsolutePath.cs:line 297
   at FileAccessManifest BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.GenerateFileAccessManifest(AbsolutePath toolDirectory, AbsolutePath outputFile) in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 736
   at Task<SandboxedProcessResult> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.RunMsBuildGraphBuilderAsync(AbsolutePath responseFile, IEnumerable<AbsolutePath> projectEntryPoints, AbsolutePath outputFile, IEnumerable<AbsolutePath> msBuildSearchLocations, AbsolutePath dotnetExeLocation, IBuildParameters buildParameters) in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 653
   at async Task<Possible<ProjectGraphWithPredictionsResult<AbsolutePath>>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.ComputeBuildGraphAsync(AbsolutePath responseFile, IEnumerable<AbsolutePath> projectEntryPoints, AbsolutePath outputFile, IEnumerable<AbsolutePath> msBuidSearchLocations, IEnumerable<AbsolutePath> dotnetSearchLocations, IBuildParameters buildParameters) in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 511
   at async Task<Possible<ProjectGraphResult>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.TryComputeBuildGraphAsync(IEnumerable<AbsolutePath> msBuildSearchLocations, IEnumerable<AbsolutePath> dotnetSearchLocations, IEnumerable<AbsolutePath> parsingEntryPoints, IBuildParameters buildParameters) in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 381
   at async Task<Possible<ProjectGraphResult>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.TryComputeBuildGraphIfNeededAsync() in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 300
   at async ValueTask<Possible<HashSet<ModuleDescriptor>>> BuildXL.FrontEnd.MsBuild.MsBuildWorkspaceResolver.GetAllKnownModuleDescriptorsAsync() in \.\Public\Src\FrontEnd\MsBuild\MsBuildWorkspaceResolver.cs:line 186
   at async Task<Possible<IReadOnlyCollection<ModuleDefinition>>> BuildXL.FrontEnd.Workspaces.WorkspaceResolverExtensionMethods.GetAllModuleDefinitionsAsync(IWorkspaceModuleResolver moduleResolver) in \.\Public\Src\FrontEnd\Sdk\Workspaces\IWorkspaceModuleResolver.cs:line 106
   at async Task<Possible<HashSet<ModuleDefinition>>> BuildXL.FrontEnd.Workspaces.Core.WorkspaceProvider.GetModuleDefinitionsForAllResolversAsync() in \.\Public\Src\FrontEnd\Sdk\Workspaces\Core\WorkspaceProvider.cs:line 649
   at async Task<Possible<WorkspaceDefinition>> BuildXL.FrontEnd.Workspaces.Core.WorkspaceProvider.GetWorkspaceDefinitionForAllResolversAsync() in \.\Public\Src\FrontEnd\Sdk\Workspaces\Core\WorkspaceProvider.cs:line 191
   at async Task<Possible<WorkspaceDefinition>> BuildXL.FrontEnd.Core.FrontEndHostController.TryGetWorkspaceDefinitionAsync(IWorkspaceProvider workspaceProvider) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.Workspace.cs:line 386
   at async Task<Workspace> BuildXL.FrontEnd.Core.FrontEndHostController.BuildAndFilterWorkspaceAsync(IWorkspaceProvider workspaceProvider, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.Workspace.cs:line 153
   at async Task<T> BuildXL.Utilities.Tasks.TaskUtilities.WithCancellationHandlingAsync<T>(LoggingContext loggingContext, Task<T> evaluationTask, Action<LoggingContext> errorLogEvent, T errorValue, CancellationToken cancellationToken)
   at Workspace BuildXL.FrontEnd.Core.FrontEndHostController.DoPhaseBuildWorkspace(IConfiguration configuration, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, QualifierId[] requestedQualifiers) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.Workspace.cs:line 103
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.BuildXL.FrontEnd.Sdk.IFrontEndController.PopulateGraph(Task<Possible<EngineCache>> cacheTask, IPipGraph graph, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, IConfiguration configuration, IStartupConfiguration startupConfiguration)+(LoggingContext nestedLoggingContext, ref WorkspaceStatistics statistics) => { } [3] in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 393
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.ProcessPhase<TStatistics>(EnginePhases phase, IConfiguration configuration, Action<LoggingContext> startPhaseLogMessage, Action<LoggingContext, TStatistics> endPhaseLogMessage, PhaseLogicHandler<TStatistics> phaseLogicHandler) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 994
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.BuildXL.FrontEnd.Sdk.IFrontEndController.PopulateGraph(Task<Possible<EngineCache>> cacheTask, IPipGraph graph, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, IConfiguration configuration, IStartupConfiguration startupConfiguration) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 386
   at bool BuildXL.Engine.BuildXLEngine.ConstructAndEvaluateGraph(LoggingContext loggingContext, FrontEndEngineAbstraction frontEndEngineAbstration, CacheInitializationTask engineCacheTask, MountsTable mountsTable, EvaluationFilter evaluationFilter, GraphReuseResult reuseResult, out PipGraph pipGraph) in \.\Public\Src\Engine\Dll\Engine.FrontEnd.cs:line 72
   at ConstructScheduleResult BuildXL.Engine.BuildXLEngine.ConstructSchedule(LoggingContext loggingContext, int maxDegreeOfParallelism, CacheInitializationTask cacheInitializationTask, JournalState journalState, EngineState engineState, out EngineSchedule engineSchedule, out RootFilter rootFilter) in \.\Public\Src\Engine\Dll\Engine.cs:line 2721
   at BuildXLEngineResult BuildXL.Engine.BuildXLEngine.DoRun(LoggingContext loggingContext, EngineState engineState, bool disposeFrontEnd) in \.\Public\Src\Engine\Dll\Engine.cs:line 1730
   at EngineState BuildXL.BuildXLApp.RunEngine(EngineContext engineContext, FrontEndControllerFactory factory, TrackingEventListener trackingEventListener, EngineState engineState, out EngineLiveVisualizationInformation visualizationInformation) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 1942
   at EngineState BuildXL.BuildXLApp.RunEngineWithDecorators(LoggingContext loggingContext, CancellationToken cancellationToken, AppLoggers appLoggers, EngineState engineState, PerformanceCollector collector, out EngineLiveVisualizationInformation visualizationInformation) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 744
   at AppResult BuildXL.BuildXLApp.RunInternal(PerformanceMeasurement pm, CancellationToken cancellationToken, AppLoggers appLoggers, EngineState engineState) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 624
   at AppResult BuildXL.BuildXLApp.Run(EngineState engineState)+(PerformanceMeasurement pm) => { } in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 480
   at AppResult BuildXL.BuildXLApp.RunWithLoggingScope(Func<PerformanceMeasurement, AppResult> run, Action sendFinalStatistics, Action<LoggingContext> configureLogging) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 978
   at AppResult BuildXL.BuildXLApp.Run(EngineState engineState) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 425
   at ExitKind BuildXL.Program.RunSingleInstance(IReadOnlyCollection<string> rawArgs, Nullable<ServerModeStatusAndPerf> serverModeStatusAndPerf) in \.\Public\Src\App\Bxl\Program.cs:line 167
   at int BuildXL.Program.Run() in \.\Public\Src\App\Bxl\Program.cs:line 127
   at int BuildXL.Program.Main(string[] rawArgs) in \.\Public\Src\App\Bxl\Program.cs:line 47

I have traced the issue to here. Presumably, Environment.SpecialFolder.Windows is returning an empty string (completely understandable, since Macs don't have a C:\Windows directory), which is then causing AbsolutePath.Create() to choke. This prevents the use of any MSBuild-based project with BuildXL when run on a non-Windows platform. I don't quite know enough about BuildXL's internals to be able to fix this myself. Thanks!

How to debug some module?

Hi

Is there any document on how to debug particular module? For example BuildXL.Utilities.Collections.dsc?

I followed this document and I generated VS projects and installed BuildXL plugin. After that I was able to navigate source code, but I'm not able to build it from VS.
It looks like it doing something, but if I delete output files, it will not re-create them. Obviously if I put breakpoint it will not stop.

I found Debugging section at the end of document but it looks quite inconvenient. Do I really need to add System.Diagnostics.Debugger.Launch(); to line I want to debug, then build BuildXL from command line, then run it from command line and then attach debugger? And if I need to put breakpoint somewhere earlier in loading process then I have to repeat whole process?

Is there any better way to do it?

Thank you,
Vlad

Tests get stuck in Azure Pipeline (Windows)

All PR and rolling builds get stuck when running tests. From the logs it's not clear which test is running at the time. We need to find a way to enable verbose trace on the test runner and see which test started when it gets stuck. We can disable the test and get PRs flowing again, then come back with a fix that reenables the test later.

Example for MSBuild support

Similarly to #282, I would appreciate an example on how to integrate MSBuild projects (both csproj and vcxproj, if possible) into BuildXL. Thanks!

BuildXL will sends requests for additional files back to the originating machine?

I read
"Remote execution in BuildXL sends the files it thinks the command will need,
augments the file system to block if other files are accessed, and sends requests for additional files
back to the originating machine
" from "Build Scripts with Perfect Dependencies".

But i can't find any information from the BuildXL about the above.
thanks

Unclear how to build BuildXL for Linux

Hi,

The documentation states that one needs a Windows machine in order to build BuildXL for Linux and then it refers to a broken link.
I'm talking specifically about this section.

The broken link that is being referred to is: https://github.com/microsoft/BuildXL/blob/master/Documentation/Wiki/Wiki/LinuxDevelopment/How_to_test.md

Is the support for Linux completely not there? Can I get some basic instructions on whether and how I could test distributed builds on Linux?

Build fails with missing System.Net.Http package

I just discovered this project and tried to build it without success.

I'm on a Windows 10 machine with VS2017 installed.

Any ideas? I would love to get this running and test it out on our large codebase.

> .\bxl -minimal
Preparing to build.
'REM' is not recognized as an internal or external command,
operable program or batch file.
BUILDXL-Init: Using nuget to Pull package 'Microsoft.BuildXL.net472' version '0.1.0-20190426.9'
Feeds used:
  C:\Users\XXXXX\.nuget\packages\
  https://dotnet.myget.org/F/buildxl-selfhost/api/v3/index.json



Attempting to gather dependency information for package 'Microsoft.BuildXL.net472.0.1.0-20190426.9' with respect to project 'C:\projects\temp\BuildXL\Out\BootStrap', targeting 'Any,Version=v0.0'
Gathering dependency information took 230.06 ms
Attempting to resolve dependencies for package 'Microsoft.BuildXL.net472.0.1.0-20190426.9' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.BuildXL.net472.0.1.0-20190426.9'
Resolved actions to install package 'Microsoft.BuildXL.net472.0.1.0-20190426.9'
Retrieving package 'Microsoft.BuildXL.net472 0.1.0-20190426.9' from 'C:\Users\XXXXX\.nuget\packages\'.
Adding package 'Microsoft.BuildXL.net472.0.1.0-20190426.9' to folder 'C:\projects\temp\BuildXL\Out\BootStrap'
Added package 'Microsoft.BuildXL.net472.0.1.0-20190426.9' to folder 'C:\projects\temp\BuildXL\Out\BootStrap'
Successfully installed 'Microsoft.BuildXL.net472 0.1.0-20190426.9' to C:\projects\temp\BuildXL\Out\BootStrap
Executing nuget actions took 37.48 sec
> BuildXL Selfhost wrapper - run 'domino -SelfhostHelp' for more info
Building using the LKG (published NuGet package) version of BuildXL.
Server mode enabled.
The newly-built BuildXL will not be fully validated because you are running with -Minimal.
C:\projects\temp\BuildXL\Out\BootStrap\Microsoft.BuildXL.net472.0.1.0-20190426.9\RunInSubst.exe B=C:\projects\temp\BuildXL B:\Out\BootStrap\Microsoft.BuildXL.net472.0.1.0-20190426.9\bxl.exe /config:B:\config.dsc /IncrementalScheduling /nowarn:909 /nowarn:11318 /nowarn:11319 /unsafe_IgnorePreloadedDlls- /historicMetadataCache+ /cachemiss /cacheSessionName:20190501_13390709-XXXXX-XXXXX@XXXXX /remotetelemetry /reuseOutputsOnDisk+ /scrubDirectory:B:\out\objects /storeFingerprints /cacheMiss /p:[Sdk.BuildXL]useQTest=true /logsToRetain:20 /environment:SelfhostLKG /cacheConfigFilePath:B:\Out\Cache\CacheCore.json /server /serverDeploymentDir:B:\Out\Selfhost\LKG.ServerDeployment /f:(output='B:\Out\Bin\Debug\net472\*'or(output='out\bin\Debug\Sdk\*')or(output='out\bin\Debug\cache\net472\*'))and~(tag='LongRunningTest') /substTarget:B:\ /substSource:C:\projects\temp\BuildXL\  /logProcessDetouringStatus+ /logProcessData+ /logProcesses+
Microsoft (R) Build Accelerator. Build: 0.1.0-20190426.9, Version:
[refs/heads/master:69a8b253c73fc24fb26b3f4c11613cfeffbf24c2]
Copyright (C) Microsoft Corporation. All rights reserved.

[0:03] -- Telemetry is enabled. SessionId: 4bcdd321-5052-417e-9915-f932ff0a0db0
[0:06] warning DX2841: Virus scanning software is enabled for 'C:\projects\temp\BuildXL\out\Cache' which is used in this build. Build performance is potentially greatly impacted unless a directory exclusion is configured.
[0:06] warning DX2841: Virus scanning software is enabled for 'C:\projects\temp\BuildXL\out\objects' which is used in this build. Build performance is potentially greatly impacted unless a directory exclusion is configured.
[0:06] warning DX2841: Virus scanning software is enabled for 'C:\projects\temp\BuildXL\out' which is used in this build. Build performance is potentially greatly impacted unless a directory exclusion is configured.
[0:06] warning DX2841: Virus scanning software is enabled for 'C:\projects\temp\BuildXL\' which is used in this build. Build performance is potentially greatly impacted unless a directory exclusion is configured.
[0:09] critical DX0731: A runtime dependency was not found. This usually indicates one or more assemblies were not correctly copied with the bxl.exe deployment. Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Task<Possible<string>> BuildXL.FrontEnd.Core.FrontEndHostController.DownloadFile(LoggingContext loggingContext, string friendlyName, string url, string targetFilePath)
   at async Task<Possible<ContentHash>> BuildXL.FrontEnd.Core.FrontEndHostController.DownloadFile(string url, AbsolutePath targetLocation, Nullable<ContentHash> expectedContentHash, string friendlyName) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.Nuget.cs
   at async Task<Possible<AbsolutePath[]>> BuildXL.FrontEnd.Nuget.WorkspaceNugetModuleResolver.TryDownloadNugetAsync(INugetConfiguration configuration, AbsolutePath targetFolder) in \.\Public\Src\FrontEnd\Nuget\WorkspaceNugetModuleResolver.cs:line 1528
   at async Task<Possible<NugetGenerationResult>> BuildXL.FrontEnd.Nuget.WorkspaceNugetModuleResolver.DownloadPackagesAndGenerateSpecsAsync() in \.\Public\Src\FrontEnd\Nuget\WorkspaceNugetModuleResolver.cs:line 424
   at async Task<Possible<IEnumerable<Package>>> BuildXL.FrontEnd.Nuget.WorkspaceNugetModuleResolver.GetAllKnownPackagesAsync() in \.\Public\Src\FrontEnd\Nuget\WorkspaceNugetModuleResolver.cs:line 224
   at async Task<bool> BuildXL.FrontEnd.Script.NugetResolver.InitResolverAsync(IResolverSettings resolverSettings, object workspaceResolver) in \.\Public\Src\FrontEnd\Nuget\NugetResolver.cs:line 55
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.TryInitializeFrontEndsAndResolvers(IConfiguration configuration, QualifierId[] requestedQualifiers) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 1139
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.BuildXL.FrontEnd.Sdk.IFrontEndController.PopulateGraph(Task<Possible<EngineCache>> cacheTask, IPipGraph graph, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, IConfiguration configuration, IStartupConfiguration startupConfiguration)+(LoggingContext nestedLoggingContext, ref InitializeResolversStatistics statistics) => { } [2] in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 373
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.ProcessPhase<TStatistics>(EnginePhases phase, IConfiguration configuration, Action<LoggingContext> startPhaseLogMessage, Action<LoggingContext, TStatistics> endPhaseLogMessage, PhaseLogicHandler<TStatistics> phaseLogicHandler) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 983
   at bool BuildXL.FrontEnd.Core.FrontEndHostController.BuildXL.FrontEnd.Sdk.IFrontEndController.PopulateGraph(Task<Possible<EngineCache>> cacheTask, IPipGraph graph, FrontEndEngineAbstraction engineAbstraction, EvaluationFilter evaluationFilter, IConfiguration configuration, IStartupConfiguration startupConfiguration) in \.\Public\Src\FrontEnd\Core\FrontEndHostController.cs:line 365
   at bool BuildXL.Engine.BuildXLEngine.ConstructAndEvaluateGraph(LoggingContext loggingContext, FrontEndEngineAbstraction frontEndEngineAbstration, CacheInitializationTask engineCacheTask, MountsTable mountsTable, EvaluationFilter evaluationFilter, GraphReuseResult reuseResult, out PipGraph pipGraph) in \.\Public\Src\Engine\Dll\Engine.FrontEnd.cs:line 72
   at ConstructScheduleResult BuildXL.Engine.BuildXLEngine.ConstructSchedule(LoggingContext loggingContext, int maxDegreeOfParallelism, CacheInitializationTask cacheInitializationTask, JournalState journalState, EngineState engineState, out EngineSchedule engineSchedule, out RootFilter rootFilter) in \.\Public\Src\Engine\Dll\Engine.cs:line 2673
   at BuildXLEngineResult BuildXL.Engine.BuildXLEngine.DoRun(LoggingContext loggingContext, EngineState engineState, bool disposeFrontEnd) in \.\Public\Src\Engine\Dll\Engine.cs:line 1686
   at EngineState BuildXL.BuildXLApp.RunEngine(EngineContext engineContext, FrontEndControllerFactory factory, TrackingEventListener trackingEventListener, EngineState engineState, out EngineLiveVisualizationInformation visualizationInformation) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 1894
   at EngineState BuildXL.BuildXLApp.RunEngineWithDecorators(LoggingContext loggingContext, CancellationToken cancellationToken, AppLoggers appLoggers, EngineState engineState, PerformanceCollector collector, out EngineLiveVisualizationInformation visualizationInformation) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 733
   at AppResult BuildXL.BuildXLApp.RunInternal(PerformanceMeasurement pm, CancellationToken cancellationToken, AppLoggers appLoggers, EngineState engineState) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 613
   at AppResult BuildXL.BuildXLApp.Run(EngineState engineState)+(PerformanceMeasurement pm) => { } in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 469
   at AppResult BuildXL.BuildXLApp.RunWithLoggingScope(Func<PerformanceMeasurement, AppResult> run, Action sendFinalStatistics, Action<LoggingContext> configureLogging) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 973
   at AppResult BuildXL.BuildXLApp.Run(EngineState engineState) in \.\Public\Src\App\Bxl\BuildXLApp.cs:line 414
   at bool BuildXL.AppServer.RunAppInstance(BufferedStream bufferedStream) in \.\Public\Src\App\Bxl\AppServer.cs:line 278
   at ExitKind BuildXL.AppServer.Run(StartupParameters startupParameters) in \.\Public\Src\App\Bxl\AppServer.cs:line 138   at ExitKind BuildXL.Program.RunAppServer(StartupParameters startupParameters) in \.\Public\Src\App\Bxl\Program.cs:line 211
   at int BuildXL.Program.Run() in \.\Public\Src\App\Bxl\Program.cs:line 81
   at int BuildXL.Program.Main(string[] rawArgs) in \.\Public\Src\App\Bxl\Program.cs:line 47

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
The BuildXL build failed with exit code 3

Build process exited with ArgumentTransformationMetadataException

When I followed the Developer Guide to build BuildXL, the process exited with the following message:

C:\Code\BuildXL\Shared\Scripts\Bxl.ps1 : Cannot convert value "" to type "System.Boolean". Boolean parameters accept
only Boolean values and numbers, such as $True, $False, 1 or 0.
At line:1 char:1
+ C:\Code\BuildXL\Shared\Scripts\\Bxl.ps1 -DefaultConfig C:\Code\BuildX ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [Bxl.ps1], ArgumentTransformationMetadataException
    + FullyQualifiedErrorId : RuntimeException,Bxl.ps1

I looked into bxl.ps1 and found the statement that caused this error. I surmised TF_BUILD is an environment variable used in Microsoft's internal environment, which doesn't exist on the environment of external users.
Everything goes well after I added some handling of this missing environment variable.

BuildXL Visual Studio Integration doesn't support multi-target project

Steps to reproduce

  1. Have a multi-target C# project with csproj file of SDK style, including:
<TargetFrameworks>net48;net5.0</TargetFrameworks>

And there is one build.cmd file in the same directory as .sln file.

  1. Right click the project in Solution Explorer and click Build

Expected behavior

The build process got redirected to build.cmd and process the script.

Actual behavior

The build process seems takes over by vanilla MSBuild.

Some thought

I think this is caused by the project type support status of BuildXL. From this code I see that currently CsProj and VcxProj are supported. For multi-target project, or in other words, .NET Core project, has a different project GUID 9A19103F-16F7-4668-BE54-9A1E7A4F7556 as claimed in this page. We want BuildXL to remain its behavior for .NET Core projects. Is there any backlog to do this?

Better examples

I would appreciate some better examples of an msbuild project with multiple modules. I have not been able to put together a C++ build based on the current documentation.

DScript Documentation.

I've been using BuildXL to run some local builds on our CMake project. And it's been helpful, I'd like to further explore BuildXL and it seems that DScript has the most expressive bindings into the system. However there seems to be nearly zero public documentation on DScript, and few samples. Additional documentation for getting started with DScript would be greatly appreciated.

Remove all occurrences of 'domino'

There are still some remnants of ‘Domino’ under the Mac OS sandbox (that one probably escaped my renames because I never had MacOS as part of the solution)

How to write to Partial sealed directory

Hi

I'm trying to run a tool from BuildXL that consumes files from some directory and writes new files to the same directory.
For what I read, it looks like I have to use partial sealed directory but I can't figure out how to specify that output of that tool should be that partial sealed directory.

For example:

const sealedDir = Transformer.sealPartialDirectory(dir1, globR(dir1));

I cannot specify sealedDir in outputs because it is not compatible. If I try to use sealedDir.root there, then BuildXL got some internal error.
If I try to use dir1 in outputs, I got error that dir1 coincides with the sealed directory.

What is correct way to use it?

Thank you,
Vlad

Example Cmake project fails to build

Attaching the error log. I guess cmakerunner.exe is missing, or something along those lines. I built bxl using bxl.cmd -minimal. I also tried with -all but still the same error. Anything else I should do to make it work?
error.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.