Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

sdkLine=$(grep -m 1 'dotnet' "$scriptroot/global.json")
sdkLine=$(grep -m 1 '"dotnet"' "$scriptroot/global.json")
sdkPattern="\"dotnet\" *: *\"(.*)\""
if [[ $sdkLine =~ $sdkPattern ]]; then
export SDK_VERSION=${BASH_REMATCH[1]}
Expand Down
9 changes: 9 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"sdk": {
"version": "9.0.112",
"rollForward": "latestPatch",
"paths": [
".dotnet",
"$host$"
],
"errorMessage": "The required .NET SDK wasn't found."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why this is needed/beneficial over the default?

Copy link
Member Author

@ellahathaway ellahathaway Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures that the builds are more consistent and portable across different machines. It prevents errors like what’s described in dotnet/source-build#5428 from occurring.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am specifically referring to the errorMessage. I ask because when I have seen this in the past, it typically contains something custom like "Please run ./eng/common/dotnet.cmd/sh to install it.". Doesn't the default message already convey the required SDK was not found?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Those dotnet scripts don't exist in this branch (only 10.0+), so I think the default message is appropriate. Addressed in c95b757

},
"tools": {
"dotnet": "9.0.112"
},
Expand Down