Describe the Bug
When building .NET 10 on some not-so-recent Linux distributions (RHEL 8 and 9), I get this error:
Copying file from "/dotnet/artifacts/staging/artifacts/assets/Release/Private.SourceBuilt.Artifacts.10.0.100-rtm.25523.111.rhel.9-x64.tar.gz" to "/dotnet/artifacts/assets/Release/Private.SourceBuilt.Artifacts.10.0.100-rtm.25523.111.rhel.9-x64.tar.gz".
37>Done Building Project "/dotnet/.packages/BootstrapPackages/microsoft.dotnet.arcade.sdk/10.0.0-beta.25502.107/tools/Publish.proj" (Publish target(s)).
1>Done Building Project "/dotnet/.packages/BootstrapPackages/microsoft.dotnet.arcade.sdk/10.0.0-beta.25502.107/tools/Build.proj" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:32:40.26
/dotnet/eng/common/tools.sh: line 1: tempDir: unbound variable
+ exit_code=1
+ [[ 1 != 0 ]]
+ [[ 0 != 0 ]]
+ set -e
+ return 1
As you can see, the entire build is done at this point, even the PSB artifacts are produced and then the build fails.
tools.sh doesn't contain any use of tempDir, so the error seems surprising.
The culprit seems to be this trap use:
https://github.com/dotnet/dotnet/blob/8ebb400ec2c5327a543f9f5a08f6f7acedd0803c/eng/source-build-toolset-init.sh#L74
local tempDir=""
...
tempDir="$(mktemp -d)"
trap 'rm -rf "${tempDir}"' EXIT
tempDir is a local variable, so it's probably not defined at the time this function has exited and trap is called when the build.sh is successful?
I am using this as a workaround before building:
sed -i -E 's/trap.*tempDir.*EXIT//' eng/source-build-toolset-init.sh
Steps to Reproduce
<TODO>
Other Information
Systems where I see this behaviour and build fails:
Systems where build works:
Describe the Bug
When building .NET 10 on some not-so-recent Linux distributions (RHEL 8 and 9), I get this error:
As you can see, the entire build is done at this point, even the PSB artifacts are produced and then the build fails.
tools.shdoesn't contain any use oftempDir, so the error seems surprising.The culprit seems to be this trap use:
https://github.com/dotnet/dotnet/blob/8ebb400ec2c5327a543f9f5a08f6f7acedd0803c/eng/source-build-toolset-init.sh#L74
tempDiris a local variable, so it's probably not defined at the time this function has exited andtrapis called when thebuild.shis successful?I am using this as a workaround before building:
Steps to Reproduce
<TODO>
Other Information
Systems where I see this behaviour and build fails:
4.4.20Systems where build works:
5.2.265.3.0