This document provides project-specific context, conventions, and workflows for building and contributing to the mount-zip repository.
mount-zip is a read-only FUSE filesystem that mounts ZIP archives using the libzip and ICU libraries. The implementation is structured as a core library in lib/ and a CLI wrapper in mount-zip.cc.
The project uses C++23. Ensure you are using a modern compiler (e.g., GCC 13+ or Clang 16+) that supports the C++23 standard.
DEBUG=1: Enable debug symbols and disable optimizations.ASAN=1: Enable AddressSanitizer for memory safety checks.
make all: Build themount-zipbinary and the man page.make check-fast: Run the fast subset of tests.make check: Run the full test suite.make doc: Regenerate themount-zip.1man page fromREADME.md.make clean: Remove build artifacts.
The README.md file serves as both the user guide and the source for the man page.
- Generation:
pandocconvertsREADME.mdtoroffformat. - Formatting: The
Makefileusessedpost-processing on thepandocoutput to ensure bulleted lists are rendered compactly (using.PD 0) in the man page. - Markdown requirement: Bulleted lists in
README.mdshould be preceded by a blank line for correctpandocparsing.
The project aims for full ASAN compliance. Always verify changes with ASAN=1 make check-fast.
- Use RAII guards for resource cleanup (e.g.,
FileDescriptor,Cleanup). - Shutdown Performance: Global teardown of the virtual tree is wrapped in
#ifndef NDEBUG. It is only performed in debug builds to keep production shutdown nearly instant.
- The project is 32-bit compatible.
- Year 2038: Always build with
-D_TIME_BITS=64(handled inMakefile) to ensure correct timestamp handling on 32-bit systems.
- Main Runner:
tests/test.py - Unit Tests: C++ unit tests in
tests/using the GoogleTest framework. - Data Generation: Test archives are generated by scripts in the
tests/directory.