Skip to content

Commit

Permalink
Check for source only properties before tool restore (#75161)
Browse files Browse the repository at this point in the history
'dotnet' is not ambiently available, and we don't want the extra tool restore here (in case it brings in prebuilts).
Check for passed in properties that would indicate a source only build from the VMR as well as the dev switch.
  • Loading branch information
mmitche committed Sep 18, 2024
1 parent 2c8a815 commit 9fe9c65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ if [[ "$restore" == true || "$test_core_clr" == true ]]; then
install=true
fi
InitializeDotNetCli $install
if [[ "$restore" == true && "$source_build" != true ]]; then
# Check the dev switch --source-build as well as ensure that source only switches were not passed in via extra properties
# Source only builds would not have 'dotnet' ambiently available.
if [[ "$restore" == true && "$source_build" != true && $properties != *"DotNetBuildSourceOnly=true"* ]]; then
dotnet tool restore
fi

Expand Down

0 comments on commit 9fe9c65

Please sign in to comment.