What happened?
make install tries to elevate at the install(1) subcommand If the PREFIX/DESTDIR doesn't exist, then fails anyways:
@if [ -w "$(PREFIX)/bin" ]; then \
install .build/release/$(BINARY) $(PREFIX)/bin/$(BINARY); \
else \
sudo install .build/release/$(BINARY) $(PREFIX)/bin/$(BINARY); \
fi
From test(1):
-w file True if file exists and is writable. True indicates only that the write flag is on. The file is not writable on a read-only file system even if this test indicates true.
What did you expect?
I'd expect that the install rule either creates the dest dir using inherited permissions, or fails without trying to install/proceed further. In any case, the alternative convention chosen should be documented.
Conventionally, elevating would be taken of by running make itself elevated, something like
make build && sudo make install
But see #83 for why this isn't currently practical.
Steps to reproduce
- Case 1 -- PREFIX doesn't exist leads to spurious elevation, then failure anyways
% make install PREFIX=${HOME}/.does_not_exist
0.9.20 → 0.9.21
swift build -c release
[1/1] Planning build
Building for production...
[5/5] Linking apfel
Build complete! (9.95s)
install: /Users/art/.does_not_exist/bin/INS@ogM8iL: No such file or directory
make: *** [install] Error 71
- Case 2 -- bin dir doesn't exist leads to spurious elevation, then failure anyways
% mkdir -p ~/.does_exist
% make install PREFIX=${HOME}/.does_exist
0.9.21 → 0.9.22
swift build -c release
[1/1] Planning build
Building for production...
[5/5] Linking apfel
Build complete! (9.43s)
install: /Users/art/.does_exist/bin/INS@ZA8LZD: No such file or directory
make: *** [install] Error 71
3) Case 3 -- bin dir exists leads user or admin install based on writeability:
% mkdir -p ~/.does_exist/bin
% make install PREFIX=${HOME}/.does_exist
0.9.22 → 0.9.23
swift build -c release
Building for production...
[5/5] Linking apfel
Build complete! (4.31s)
✓ installed: apfel v0.9.23
**Environment**
- macOS version: (`sw_vers`)
% sw_vers
ProductName: macOS
ProductVersion: 26.4
BuildVersion: 25E246
- apfel version: (`apfel --version`)
% apfel --version
apfel v0.9.22
% git log -1
commit 07b177f (tag: v0.9.18, origin/main, origin/HEAD, main)
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date: Sun Apr 12 11:37:02 2026 +0000
- Install method: built from source
- `apfel --model-info` output: N/A
What happened?
make installtries to elevate at theinstall(1)subcommand If the PREFIX/DESTDIR doesn't exist, then fails anyways:From
test(1):What did you expect?
I'd expect that the install rule either creates the dest dir using inherited permissions, or fails without trying to install/proceed further. In any case, the alternative convention chosen should be documented.
Conventionally, elevating would be taken of by running make itself elevated, something like
But see #83 for why this isn't currently practical.
Steps to reproduce
% mkdir -p ~/.does_exist
% make install PREFIX=${HOME}/.does_exist
0.9.21 → 0.9.22
swift build -c release
[1/1] Planning build
Building for production...
[5/5] Linking apfel
Build complete! (9.43s)
install: /Users/art/.does_exist/bin/INS@ZA8LZD: No such file or directory
make: *** [install] Error 71
% mkdir -p ~/.does_exist/bin
% make install PREFIX=${HOME}/.does_exist
0.9.22 → 0.9.23
swift build -c release
Building for production...
[5/5] Linking apfel
Build complete! (4.31s)
✓ installed: apfel v0.9.23
% sw_vers
ProductName: macOS
ProductVersion: 26.4
BuildVersion: 25E246
% apfel --version
apfel v0.9.22
% git log -1
commit 07b177f (tag: v0.9.18, origin/main, origin/HEAD, main)
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date: Sun Apr 12 11:37:02 2026 +0000