I noticed that snapshots created on Linux were getting huge (> 600 MB), compared to snapshots created on Mac (~ 130 MB).
Inspecting the contents, it turned out that the snapshot includes full installations of all versions of dfx present on the system.
Changes
Include .local/share/dfx/network/local in the archive instead of all of .local/share/dfx. This matches having Library/Application Support/org.dfinity.dfx/network/local on Mac, rather than all of Library/Application Support/org.dfinity.dfx.
Fix bin/dfx-snapshot-restore to not delete all of .local/share/dfx.
Tested
CI still passes and runs on Linux.
Manually created a snapshot on DevEnv and was able to use it. Checked its size and it was 124 MB.
Motivation
I noticed that snapshots created on Linux were getting huge (> 600 MB), compared to snapshots created on Mac (~ 130 MB). Inspecting the contents, it turned out that the snapshot includes full installations of all versions of
dfx
present on the system.Changes
.local/share/dfx/network/local
in the archive instead of all of.local/share/dfx
. This matches havingLibrary/Application Support/org.dfinity.dfx/network/local
on Mac, rather than all ofLibrary/Application Support/org.dfinity.dfx
.bin/dfx-snapshot-restore
to not delete all of.local/share/dfx
.Tested