Skip to content

Commit d0945de

Browse files
committed
formula: mkpath bin before writing the launcher
Nothing creates <prefix>/bin in this formula — the payload goes to libexec — and Homebrew's Pathname#write does not create parent directories. (Its own write_env_script calls dirname.mkpath by hand for exactly this reason, extend/pathname.rb:347.) Without this, install dies on Errno::ENOENT at the very first user's `brew install`. Pathname#install is unaffected: install_p mkpaths its destination (extend/pathname.rb:487), so libexec/prefix/doc installs were already fine.
1 parent 1789e89 commit d0945de

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Formula/mcpp-m.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ def install
6060
# dir — `brew upgrade` would then silently drop every installed toolchain.
6161
# Pin the two env knobs the binary honors, deferring to values the user
6262
# already exported. Mirrors the Arch launcher (upstream scripts/aur).
63+
#
64+
# bin.mkpath first: nothing has created <prefix>/bin at this point (the
65+
# payload went to libexec), and Homebrew's Pathname#write does not make
66+
# parent directories — write_env_script mkpaths by hand for this reason.
67+
bin.mkpath
6368
(bin/"mcpp").write <<~SH
6469
#!/bin/sh
6570
export MCPP_HOME="${MCPP_HOME:-$HOME/.mcpp}"

0 commit comments

Comments
 (0)