SDK tests: "CesiumLib.ceproj.nuget.g.targets\u0027 already exists"
- Dominant language
- C#
- Stars
- 451
- Forks
- 49
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 6
Description
SDK tests are quite unstable lately, with errors like this:
```
20:19:26 [DBG] A total of 1 test files matched the specified pattern.
Error: [xUnit.net 00:00:19.88] Cesium.Sdk.Tests.CesiumCompileTests.CesiumPublish_Core_ExeWithDeps_ShouldSucceed [FAIL]
20:19:46 [ERR] [xUnit.net 00:00:19.88] Cesium.Sdk.Tests.CesiumCompileTests.CesiumPublish_Core_ExeWithDeps_ShouldSucceed [FAIL]
20:19:46 [DBG] Failed Cesium.Sdk.Tests.CesiumCompileTests.CesiumPublish_Core_ExeWithDeps_ShouldSucceed [3 s]
20:19:46 [DBG] Error Message:
20:19:46 [DBG] Assert.True() Failure
20:19:46 [DBG] Expected: True
20:19:46 [DBG] Actual: False
20:19:46 [DBG] Stack Trace:
20:19:46 [DBG] at Cesium.Sdk.Tests.CesiumCompileTests.CesiumPublish_Core_ExeWithDeps_ShouldSucceed() in /Users/runner/work/Cesium/Cesium/Cesium.Sdk.Tests/CesiumCompileTests.cs:line 187
20:19:46 [DBG] --- End of stack trace from previous location ---
20:19:46 [DBG] Standard Output Messages:
20:19:46 [DBG] Test projects folder: /var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq
20:19:46 [DBG] Copying TestProjects to /var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq...
20:19:46 [DBG] Local NuGet feed: /Users/runner/work/Cesium/Cesium/artifacts/package/debug.
20:19:46 [DBG] Running MSBuild: dotnet msbuild /var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/App_WithCesiumLib.slnx /t:Restore;Publish /bl:/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/build_result_App_WithCesiumLib_2026-22-8_20-19-43.binlog /nr:false /p:SelfContained=true
20:19:46 [DBG] Environment[NUGET_PACKAGES] = /var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/package-cache
20:19:46 [DBG] [stdout]: Determining projects to restore...
20:19:46 [DBG] [stdout]: Restored /var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/CesiumLib/CesiumLib.ceproj (in 823 ms).
20:19:46 [DBG] [stdout]: /Users/runner/.dotnet/sdk/10.0.204/NuGet.targets(196,5): error : The file '/private/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/CesiumLib/obj/CesiumLib.ceproj.nuget.g.targets' already exists. [/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/App_WithCesiumLib.slnx]
20:19:46 [DBG] Build failed with exit code 1
20:19:46 [DBG] $ dotnet msbuild "/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/ConsoleApp_Net10/ConsoleApp_Net10.csproj" -getProperty:IntermediateOutputPath,PublishDir /nr:false /p:SelfContained=true
20:19:46 [DBG] {
20:19:46 [DBG] "Properties": {
20:19:46 [DBG] "IntermediateOutputPath": "obj\\Debug/net10.0/osx-arm64/",
20:19:46 [DBG] "PublishDir": "bin\\Debug/net10.0/osx-arm64/publish/"
20:19:46 [DBG] }
20:19:46 [DBG] }
20:19:46 [DBG]
20:19:46 [DBG] Command exit code: 0
20:19:46 [DBG] Properties request result: {"IntermediateOutputPath":"obj\\Debug/net10.0/osx-arm64/","PublishDir":"bin\\Debug/net10.0/osx-arm64/publish/"}
20:19:46 [DBG] Collecting artifacts from '/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/ConsoleApp_Net10/bin/Debug/net10.0/osx-arm64/publish/' folder
20:19:46 [DBG] Collecting artifacts from '/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/ConsoleApp_Net10/obj/Debug/net10.0/osx-arm64/' folder
20:19:46 [DBG] Build result: {
20:19:46 [DBG] "ExitCode": 1,
20:19:46 [DBG] "StdOutOutput": " Determining projects to restore...\n Restored /var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/CesiumLib/CesiumLib.ceproj (in 823 ms).\n/Users/runner/.dotnet/sdk/10.0.204/NuGet.targets(196,5): error : The file \u0027/private/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/CesiumLib/obj/CesiumLib.ceproj.nuget.g.targets\u0027 already exists. [/var/folders/df/djsxfhc17x95674wsm_g8s980000gn/T/oqhrknbi.iyq/App_WithCesiumLib/App_WithCesiumLib.slnx]\n",
20:19:46 [DBG] "StdErrOutput": "",
20:19:46 [DBG] "OutputArtifacts": [],
20:19:46 [DBG] "IntermediateArtifacts": []
```
Contributor guide
Research direction
Start with Cesium.Sdk.Tests/CesiumCompileTests.cs, especially line 187, and reproduce CesiumPublish_Core_ExeWithDeps_ShouldSucceed using the App_WithCesiumLib test project. Inspect the logged dotnet msbuild restore and publish steps, including the generated .nuget.g.targets path. Done means the SDK test no longer fails intermittently with the existing-file error and the relevant test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, compilers, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 48/100