microsoft / BuildXL

Microsoft Build Accelerator
MIT License
917 stars 146 forks source link

Build process exited with ArgumentTransformationMetadataException #1308

Closed truemogician closed 2 years ago

truemogician commented 2 years ago

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.

marcelolynch commented 2 years ago

Thanks for the contribution @truemogician; our set-up is such that we can't take PRs from GitHub directly, but I pulled your commit and made it go through our validations, it was committed here: https://github.com/microsoft/BuildXL/commit/bafa6cc31bbefa6173e98dd142403914cdeee4a7

DotNetSparky commented 1 year ago

I surmised TF_BUILD is an environment variable used in Microsoft's internal environment, which doesn't exist on the environment of external users.

@truemogician - just as an FYI, "TF_BUILD" is a variable that exists (with a value of "true") when running under an ADO pipeline job (Azure DevOps used to be named "Team Foundation", hence the "TF").

https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml