- Core concepts
- Workflow
- Create snapshot
- Extract snapshot
- List packs, snapshots, files
- Write files to stdout
Important: Make sure you understand the following.
- Remember there is no warranty, per the license on this software!
- Do your own validation before using it in any situation where data loss would be a problem.
- We recommend working in an isolated directory which does not contain important files (you may want to copy files in).
- elfshaker excels at storing lots of very similar files.
Important: Understanding of the following concepts is critical to working with the tool.
- Snapshot
- Store a directory state (a set of files)
- Created by
elfshaker store
- Can be packed into a pack file by
elfshaker pack
(otherwise called a loose snapshot)
- Repository
- The parent directory of the directory
elfshaker_data
- The directory from which snapshots are created and into which they are extracted
- The parent directory of the directory
- Packs
- Store a set of snapshots
- Represented by
[packname].pack
+[packname].pack.idx
- Must reside under
./elfshaker_data/packs/
- Created by
elfshaker pack
- elfshaker_data
- Contains loose snapshots and pack files
- Put the
.pack
+.pack.idx
files under./elfshaker_data/packs
- Created automatically by
elfshaker store
on its first run - Can be created manually (if you plan to use existing packs; for example from manyclangs)
A basic workflow in elfshaker is to:
- Add some files
- Store them in a snapshot
- Make some changes to the files
- Store them again
- Repeat 2) and 3) a number of times
- Then, when you have lots of snapshots, they can be stored efficiently in pack, but will still be quickly accessible
elfshaker store <snapshot> [--files-from <file>] [--files0-from <file>]
elfshaker store my-snapshot
Creates the snapshot my-snapshot
containing all files in the elfshaker repository.
For full command usage, use the --help
option.
elfshaker store --help
- Compute the checksums for all input file names.
- Compare these checksums against the set of all loose objects (objects stored as part of a loose snapshot; not in a pack).
- Store any new files as objects in the loose object store.
- Create a loose pack index
<snapshot>.pack.idx
representing the snapshot in./elfshaker_data/packs/loose
. - Sets the current snapshot reference
elfshaker_data/HEAD
to the stringloose/<snapshot>:<snapshot>
.
elfshaker extract [<pack>:]<snapshot> [--reset] [--verify]
elfshaker extract my-pack:my-snapshot --verify
Extracts the snapshot my-snapshot
from the pack my-pack
(interpreted as elfshaker_data/packs/my-pack.pack
) into the repository directory and verifies the files checksums during the extraction process.
For full command usage, use the --help
option.
elfshaker extract --help
- Look-up the set of packs in
elfshaker_data/packs
to see which packs contain the specified snapshot (skipped if specified asmy-pack:my-snapshot
). - Read the corresponding pack index and find the set of files in the snapshot.
- Extract the files to the repository directory.
a. If
--reset
is NOT specified, do perform an incremental update of the repository directory by comparing the set of files against the last extracted snapshot (elfshaker_data/HEAD
). b. If--reset
is specified, ignoreelfshaker_data/HEAD
and extract everything, overwriting if file names clash.
elfshaker pack <pack> [--frames N]
elfshaker pack my-pack --frames 8
Creates the pack my-pack
(file is elfshaker_data/packs/my-pack.idx
) by packing all loose snapshots.
-
Enumerate all loose object files (belonging to loose snapshot) in
elfshaker_data/loose
. -
Preprocess, sort and compress the objects, producing a .pack file with 8 frames.
🛈 Our experiments indicate that 1 frame per 512 MiB is optimal for packing builds of LLVM and that is what omitting
--frames
does. -
Combine all snapshots into a
<pack>.pack.idx
.
(1) elfshaker list
(2) elfshaker list <pack>
(3) elfshaker list [<pack>:]<snapshot>
(1) - Lists the names of all available packs AND loose snapshots (identified by prefix loose/
).
(2) - Lists all snapshots available in <pack>
.
(3) - Lists all files stored in <snapshot>
.
elfshaker show [<pack>:]<snapshot> <path>...
elfshaker show my-pack:my-snapshot my-file some-dir/my-file-2
Writes the contents of the files specified by the given paths in the snapshot to stdout.