You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(macos): enable out-of-the-box build and test on macOS
- add macOS prerequisites section to INSTALL.md (macFUSE cask, Homebrew deps)
- remove manual PKG_CONFIG_PATH/CPPFLAGS instructions; Makefile now handles them
- Makefile detects Darwin via uname, queries brew --prefix, and overrides
PKG_CONFIG to carry a pinned icu4c path inline — immune to shell env injection
(e.g. pkgx shadowing icu4c with the wrong version); exports PKG_CONFIG and
CPPFLAGS so all sub-makes inherit them; libzip and macFUSE need no special
handling as their .pc files are on the default pkg-config search path
- add #include <boost/container_hash/hash.hpp> to lib/node.h; Apple Clang does
not pull it in transitively, causing boost::hash_combine to be undefined
- guard <sys/sysmacros.h> with #ifndef __APPLE__ in extra_field_test.cc; the
header is Linux-only, makedev is available via <sys/types.h> on macOS
- use umount -f on Darwin instead of -l (lazy) in blackbox test runner; macOS
umount does not support the -l flag
- update DEVELOPMENT.md with macOS portability notes and build workflow
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-Off-By: Paal Øye-Strømme <paal.o.eye@gmail.com>
|`make all`| Build the `mount-zip` binary and the man page |
25
+
|`make check-fast`| Run the fast subset of tests |
26
+
|`make check`| Run the full test suite (includes slow tests) |
27
+
|`make doc`| Regenerate `mount-zip.1` from `README.md` via pandoc |
28
+
|`make clean`| Remove all build artefacts |
29
+
|`make debug`| Shorthand for `DEBUG=1 make all`|
30
+
|`make valgrind`| Run tests under Valgrind (Linux only) |
31
+
32
+
### macOS Environment
33
+
34
+
The `Makefile` detects macOS at parse time via `uname -s`, queries the
35
+
Homebrew prefix with `brew --prefix`, and overrides `PKG_CONFIG` to carry
36
+
pinned search paths for macFUSE (`/usr/local`), ICU, and libzip. `CPPFLAGS`
37
+
is extended with the Boost include directory. Both are exported so all
38
+
sub-makes inherit them.
39
+
40
+
```sh
41
+
make
42
+
make check-fast
43
+
```
21
44
22
45
## Documentation Pipeline
23
46
24
47
The `README.md` file serves as both the user guide and the source for the man page.
25
-
-**Generation**: `pandoc` converts `README.md` to `roff` format.
26
-
-**Formatting**: The `Makefile` uses `sed` post-processing on the `pandoc` output to ensure bulleted lists are rendered compactly (using `.PD 0`) in the man page.
27
-
-**Markdown requirement**: Bulleted lists in `README.md` should be preceded by a blank line for correct `pandoc` parsing.
48
+
49
+
***Generation**: `pandoc` converts `README.md` to `roff` format.
50
+
***Formatting**: The `Makefile` uses `sed` post-processing on the `pandoc` output to ensure bulleted lists are rendered compactly (using `.PD 0`) in the man page.
51
+
***Markdown requirement**: Bulleted lists in `README.md` should be preceded by a blank line for correct `pandoc` parsing.
28
52
29
53
## Technical Standards
30
54
31
55
### Memory Safety
56
+
32
57
The project aims for full **ASAN compliance**. Always verify changes with `ASAN=1 make check-fast`.
33
58
34
59
### Resource Management (RAII)
35
-
- Use RAII guards for resource cleanup (e.g., `ScopedFile`, `Cleanup`).
36
-
-**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.
60
+
61
+
* Use RAII guards for resource cleanup (e.g., `ScopedFile`, `Cleanup`).
62
+
***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.
37
63
38
64
### Portability
39
-
- The project is 32-bit compatible.
40
-
-**Year 2038**: Always build with `-D_TIME_BITS=64` (handled in `Makefile`) to ensure correct timestamp handling on 32-bit systems.
65
+
66
+
* The project is 32-bit compatible.
67
+
***Year 2038**: Always build with `-D_TIME_BITS=64` (handled in `Makefile`) to ensure correct timestamp handling on 32-bit systems.
68
+
***macOS**: The source guards Apple-specific differences with `#ifdef __APPLE__`. Notable divergences:
69
+
* No `memfd_create()` — `lib/reader.cc` uses a temp-file fallback.
70
+
*`typeof` must be undefined around the `fuse.h` include to satisfy `-pedantic`.
71
+
*`boost::hash_combine` requires an explicit `#include <boost/container_hash/hash.hpp>` because Apple Clang does not pull it in transitively.
41
72
42
73
## Testing
43
-
-**Main Runner**: `tests/blackbox/test.py`
44
-
-**Whitebox Tests**: C++ unit tests in `tests/whitebox/` using the [GoogleTest](https://github.com/google/googletest) framework.
74
+
75
+
***Main Runner**: `tests/blackbox/test.py`
76
+
***Whitebox Tests**: C++ unit tests in `tests/whitebox/` using the [GoogleTest](https://github.com/google/googletest) framework.
77
+
***Unmounting**: The blackbox test runner detects the host OS and uses `umount -f` on macOS and `umount -l` on Linux.
0 commit comments