dotnet / dotnet/arcade

eng/common/tools.ps1 defaults are wrong

Open
#15,859 0 comments 1 reaction 2 assignees Claimed by @ViktorHofer View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

https://github.com/dotnet/arcade/blob/b5c8d9f6ae7c14af9e5e162e55201d41ebc191f5/eng/common/tools.ps1#L4-L52

All the `bool` switch conditions are always true even if the switch isn't supplied to the eng/common/build.ps1 file.

Example: `if (Test-Path variable:binaryLog)` is always true as `binaryLog` is defined as a `switch` which defaults to false and therefore Test-Path is always true.

This mainly affects to switches: `binaryLog` and `nodeReuse`. I assume that for that reason, these two got explicitly set in eng/common/build.ps1:

https://github.com/dotnet/arcade/blob/b5c8d9f6ae7c14af9e5e162e55201d41ebc191f5/eng/common/build.ps1#L153-L158

### Repro

Remove L153-158 from build.ps1 and run `./eng/common/build.cmd -ci`

This affects all custom entry point scripts which import tools.ps1, i.e. aspnetcore, roslyn, fsharp.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.