The author discovered an unexpected /pkg/env/global/bin entry in the PATH on macOS 27.0 while troubleshooting, which led to tracing how macOS manages PATH entries. Since OS X 10.5 Apple’s path_helper reads /etc/paths and files in /etc/paths.d; most users still add entries in shell config files. Apple has previously used /etc/paths.d to add utilities (rvictl in 10.15) and support Cryptexes (13.3). In 27.0 a file named 10-pmk-global was added that inserts /pkg/env/global/bin into the PATH, and Howard Oakley documented that /pkg was introduced on the Data volume in 26.4 and added to the Signed System Volume in 27.0.
The /pkg directory at root contains four subdirectories - env, etc, inv, and var - and there is no public explanation for its purpose. The author speculates it could be scaffolding for a first-party package management facility, although Apple’s takeover of the Swift Package Index appears unrelated; the meaning of “pmk” in the filename is unexplained. The practical takeaway is that users seeing /pkg in their PATH should not panic, but Apple changed filesystem structure and PATH behavior without documented rationale, so more details are needed to understand the change fully. Files in /etc/paths.d are prioritized by filename numeric prefixes, hence “10-” gives this entry higher PATH priority.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.