Skip to content

Conversation

oxalica
Copy link

@oxalica oxalica commented Jul 2, 2025

Fixes #830

The code mostly follows Zip implementations, using internal buffers for Seek requirement.

Unresolved questions:

  1. Which extension to mention in docs? .squashfs or .sqfs?

    I'm currently picking sqfs.

    There is not canonical extension for squashfs, but there are two semi-official ones:

  2. backhand depends liblzma, a maintained xz2 fork, which conflicts with our dependency xz2. I disabled the Xz support of backhand to mitigate this. How can we fix this?

  3. How to pass compression options for squashfs compressor? It is done inside squashfs format (per-chunk compression) thus does not use chained formats. We probably need a new CLI argument for it.

  4. Currently, during compression, it buffers the whole squashfs in memory but we can write directly into file (which supports Seek). We did a special case in decompression, but it causes some code duplication and we does not do this for Zip compression either. Is there a better way to do so, or should we also add a special case in compression?

  5. Do we want streaming compression support .sqfs.zstd (archive-then-compress instead or compress-per-chunk)? It could be done using some tricks like reserving spaces and emit ZSTD Literal Frame. Not sure about other compression formats. I don't think we want to support this, at least for now, given that decompression cannot be streamed anyway.

  6. How should we support multiple input paths? Typically squashfs has a single "root directory". Currently, it reports an error if the input is not a single path to a directory. It would be weird to either "merge" all paths into one tree, or put multiple directory under the root directory (What mode/permission should the root use? Surprising behavior difference between one and more than one paths.).

@oxalica
Copy link
Author

oxalica commented Jul 2, 2025

Seems the rest of clippy errors are on unrelated code.

The UI tests really tripped me. 😅 Seems a single cargo test ui - cargo insta review run will not fix all errors. It needs to be executed multiple times until there is no more. --no-default-features is also tested separately. We probably should document these better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Squashfs support
2 participants