Fix spacetime dev ignoring top-level module-path for generate entries#4656
Fix spacetime dev ignoring top-level module-path for generate entries#4656clockwork-labs-bot wants to merge 1 commit intomasterfrom
spacetime dev ignoring top-level module-path for generate entries#4656Conversation
When spacetime.json has a top-level module-path and generate entries, `spacetime dev` passed the generate entries to exec_from_entries without inheriting the top-level module-path. This caused the generate step to fall back to the hardcoded 'spacetimedb' default, failing with: Could not find module source at '.../spacetimedb' The standalone `spacetime generate` command already handled this correctly via collect_all_targets_with_inheritance(), but `spacetime dev` bypassed that path. Fix: inject the top-level module-path into generate entries that don't specify their own before passing them to exec_from_entries. Fixes #4651
|
To clarify the approach here: the The mutation inherits the top-level That said — happy to refactor this to resolve at read time instead (a helper that checks entry-level first, then falls back to top-level) if mutating a cloned config feels too smelly. |
Fixes #4651
When
spacetime.jsonhas a top-levelmodule-pathandgenerateentries:{ "module-path": "./server", "generate": [ { "language": "rust", "out-dir": "./game_client/src/bindings" } ] }spacetime devpassed the generate entries toexec_from_entrieswithout inheriting the top-levelmodule-path. The generate step then fell back to the hardcodedspacetimedbdefault, failing with:The standalone
spacetime generatecommand already handled this correctly viacollect_all_targets_with_inheritance()(which merges entity fields into generate entries), butspacetime devbypassed that path and readconfig.generatedirectly.Fix: Inject the top-level
module-pathinto generate entries that do not specify their own, before passing them toexec_from_entries.