Skip to content

Conversation

gefjon
Copy link
Contributor

@gefjon gefjon commented Oct 17, 2025

Description of Changes

Recently, my hacked-together env stopped working, probably due to our switching linkers. This pushed me to write a proper Nix packaging for SpacetimeDB, complete with flake and development environment.

Some things I haven't been able to figure out (or in some cases, just haven't bothered with):

  • Unreal.
  • C# WASI SDK.
  • Exposing Git commit hash for spacetime --version.
  • Making the Rust SDK's reauth test work. This test tries to write a file in the home directory, which is inaccessible in the Nix sandbox.

API and ABI breaking changes

It's a new thing we have to maintain if we're exposing it to users, but I need to maintain it anyways to be able to develop Spacetime, so...

Expected complexity level and risk

1

Testing

  • Ran nix flake check locally.
  • Ran nix build locally and then did spacetime start, got an apparently-responsive SpacetimeDB.
  • Ran nix develop locally, then cargo build and cargo test in the dev shell.

gefjon and others added 3 commits October 17, 2025 12:11
Recently, my hacked-together env stopped working, probably due to our switching linkers.
This pushed me to write a proper Nix packaging for SpacetimeDB,
complete with flake and development environment.
@mamcx
Copy link
Contributor

mamcx commented Oct 17, 2025

In my machine I get:

nix flake check

  >    Compiling reqwest v0.11.27
       > error: could not find native static library `rusty_v8`, perhaps an -L flag is missing?
       >
       > error: could not compile `v8` (lib) due to 1 previous error
       > warning: build failed, waiting for other jobs to finish...
       For full logs, run:
         nix log /nix/store/nm6mnvx3zsbpc33dfycvilaxbn4rsjvd-spacetimedb-test-1.6.0.drv
error: build of '/nix/store/nm6mnvx3zsbpc33dfycvilaxbn4rsjvd-spacetimedb-test-1.6.0.drv', '/nix/store/zs5myp6ws05nz94cjz1zkb2gzjw5a2s7-spacetimedb-clippy-1.6.0.drv' failed
SpacetimeDB on  HEAD (33ff957) via 🐳 orbstack is 📦 v1.6.0 via .NET v8.0.400 via  via 🦀 v1.90.0 via ❄️  impure (nix-shell-env)  🥋 wuur phoebe/nix-flake-and-env | ✅ took 33s
❯

@gefjon
Copy link
Contributor Author

gefjon commented Oct 20, 2025

@mamcx or @jsdt - what happens if you manually download and decompress the appropriate archive file, do export RUSTY_V8_ARCHIVE=./path/to/download, and then attempt to build SpacetimeDB manually (without Nix) via spacetime build?

@bfops bfops added release-any To be landed in any release window no runtime change This change does not affect the final binaries labels Oct 20, 2025
@gefjon
Copy link
Contributor Author

gefjon commented Oct 20, 2025

I've been able to reproduce locally on a MacOS Nix installation, but not by building without Nix on Mac. Doing the thing described above worked fine and didn't reproduce the issue. Given that I'm blocked on this PR, I think I'm going to make the flake error if built on Darwin with a note and move on.

Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

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

Rubber stamp!

Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

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

Low risk PR, let's get this in to fix issues with building on nix

@gefjon gefjon added this pull request to the merge queue Oct 20, 2025
Merged via the queue into master with commit ab35545 Oct 20, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no runtime change This change does not affect the final binaries release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants