4 Commits

Author SHA1 Message Date
joshua-spacetime 843993ff93 Isolate Godot NuGet restore from Unity package cache (#5136)
# Description of Changes

A follow-on to #5133 that fixes another Godot flake that was observed
after #5133 merged. Specifically a C# SDK regen flake where the Godot
package restore path reused `sdks/csharp/packages`, which is also the
Unity-visible package cache.

During `cargo regen csharp dlls`, the Godot flow previously did this:

- cleared `sdks/csharp/packages/godotsharp`
- cleared `sdks/csharp/obj~/godot`
- restored the Godot project back into `sdks/csharp/packages`
- packed the Godot project using that same Unity-visible package area

That meant a Godot-only cleanup could delete package content under the
Unity SDK package cache. If a previous GodotSharp restore was partial or
stale, regen tried to fix it by deleting `packages/godotsharp`, but that
path is visible to Unity and can cause dirty/missing package content
during regen.

With this change, Godot restore state is now isolated under
`sdks/csharp/obj~/godot/packages`, and the regen flow becomes:

- clear only `sdks/csharp/obj~/godot`
- restore the Godot project into `sdks/csharp/obj~/godot/packages`
- pack the Godot project under the same path

Clearing `obj~/godot` now removes both Godot intermediates and
Godot-only NuGet packages, while leaving the normal Unity SDK package
cache under `sdks/csharp/packages` untouched.

# API and ABI breaking changes

N/A

# Expected complexity level and risk

1

# Testing

- [x] `unity-testsuite` passes
2026-05-28 17:44:56 +00:00
joshua-spacetime 6e4b83abe9 fix unity-testsuite: clear intermediate Godot build state (#5133)
# Description of Changes

Harden `cargo regen csharp dlls` against flaky Godot restore/build state
in the Unity test suite.

I suspect this flake is runner specific. Some Unity runners appear to
have incomplete Godot package state, where
`sdks/csharp/packages/godotsharp` exists but is missing
`GodotSharp.dll`. In that state, NuGet can still report restore success
and generate a `project.assets.json` that contains `GodotSharp` metadata
but no usable compile asset.

The regen flow now removes the Godot MSBuild intermediate directory
(`sdks/csharp/obj~/godot`) before restoring
`SpacetimeDB.ClientSDK.Godot.csproj`. It also clears the targeted
`GodotSharp` package cache (`sdks/csharp/packages/godotsharp`) so NuGet
cannot reuse a partially restored package missing `GodotSharp.dll`.

After restore, `regen` parses `project.assets.json` and verifies that
`GodotSharp` is present and that the referenced `GodotSharp.dll` exists
before running `dotnet pack --no-restore`.

This should either prevent the flaky missing-`Godot` namespace failure,
or fail earlier with a clearer restore/package-state error.

NOTE/WARNING: This code was entirely AI generated.

# API and ABI breaking changes

N/A

# Expected complexity level and risk

~

# Testing

- [x] `unity-testsuite` passes (I ran it at least 5 times to try to get
it scheduled to different runners)
2026-05-28 00:53:18 +00:00
Lisandro Crespo b955d39a83 Godot SDK and Blackholio tutorial (#4920)
# Description of Changes
Very small additions to the C# SDK specific for Godot.
I wrote the Godot Blackholio tutorial and updated the Unity one.
I added the image assets necessary for the tutorial.
I added the files for the Godot demo.

# API and ABI breaking changes
No breaking changes.

# Expected complexity level and risk
1. There's really no risk for current systems or projects, it's all new
additions to support nicely(-ish) Godot, new Blackholio demo for Godot
and updates to the tutorials.

# Testing
- [X] Follow the tutorial and verify everything works.
- [X] Build for Windows and verify it works.
- [x] Build for Linux and verify it works.
- [x] Build SDK
- [x] Publish to Nuget

---------

Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-05-22 17:58:47 +00:00
Zeke Foppa 8df7df3270 cargo ci dlls -> cargo regen csharp dlls (#4972)
# Description of Changes

Just moving this command in preparation to create a lot more `cargo
regen` commands.

- `master`
  - **[This PR] `cargo ci dlls` -> `cargo regen csharp dlls`**
- [#4971 Translate some bash scripts to
Rust](https://github.com/clockworklabs/SpacetimeDB/pull/4971)
- [#4921 CI - `cargo test` runs C# and TypeScript
tests](https://github.com/clockworklabs/SpacetimeDB/pull/4921)
- [#4948 CI - Run unity tests through `cargo
test`](https://github.com/clockworklabs/SpacetimeDB/pull/4948)

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] CI still passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-05-08 12:48:22 +00:00