hn.today

What the heck is /pkg?

anderegg.ca30 points10 comments
Screenshot of What the heck is /pkg?

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.

Read on anderegg.ca10 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The Third Risk

The Third Risk

If AGI is perfectly aligned and controlled by a few private owners, humanity risks becoming economically irrelevant, with AI-driven systems serving only their interests. This could lead to a form of AI feudalism, where a small elite holds power over most of society, eroding collective agency and freedom. (thirdrisk.org)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.