Relationships
↔ sibling #2844#3162 datastore setup filesystem --path .swamp copies .swamp onto itself and never writes the datastore block
Opened by stack72 · 10/7/2026· Shipped 10/7/2026
Found while reproducing swamp-club#2844.
What happens
In a repo with no datastore block in .swamp.yaml, running swamp datastore setup filesystem --path .swamp (the default datastore location) migrates .swamp into itself. Copying _catalog.db, _catalog.db-wal and _catalog.db-shm fails with: Source and destination paths refer to the same file. Because of those errors, setup never writes the datastore block to .swamp.yaml. It still exits 0, prints Relocated ... Moved from with the same path on both sides, and says re-run the same command to retry, which fails the same way every time.
Released binary 20261006.215416.0:
swamp repo init --tool none
swamp datastore setup filesystem --path .swampHazard
In datastoreSetupFilesystem (src/libswamp/datastores/setup.ts), cleanupSourceDirs runs after a migration with no errors and removes the migrated directories from the source. When the source and destination are the same directory, only the catalog copy failures stop cleanup from deleting the datastore contents.
Expected
When the destination resolves (realPath) to the migration source, setup skips the copy, verification and cleanup, and writes the datastore block. A destination nested inside .swamp (for example .swamp/store) already works.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.