Skip to content

Commit 115fc4e

Browse files
committed
Some
1 parent 36e642f commit 115fc4e

21 files changed

Lines changed: 8780 additions & 0 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target
2+
/cache
3+
/pkg-*.tar.gz
4+
/data/db.json

AGENTS.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# fx Agents Notes
2+
3+
These notes capture project-specific behavior that is easy to miss from
4+
the code alone.
5+
6+
## Product Rules
7+
8+
- `x` is Homebrew-only.
9+
- `i` checks compiled vendor packages first, then falls back to Homebrew.
10+
- `i ffmpeg` intentionally installs `ffmpeg-full`.
11+
- Real `i` installs must be run as root.
12+
13+
## Install Layout
14+
15+
- `x` installs ephemerally under `/tmp/x/<formula>`.
16+
- `i` installs into `/opt/<package>`.
17+
- `i` does not encode versions in the install directory name.
18+
- `i` does not create `/opt/<package>` symlinks to versioned dirs.
19+
- For `i`, Homebrew dependencies are merged into the main prefix rather than
20+
installed under `pkgs/`.
21+
- When merged files conflict during `i` staging, later files overwrite
22+
earlier ones.
23+
- For `i`, only the explicit package's executables should get stubs in
24+
`/usr/local/bin`.
25+
26+
## Stub Behavior
27+
28+
- Stub PATH entries are deduplicated.
29+
- Only add an `sbin` PATH entry if that directory exists.
30+
- For Homebrew `i` installs, the root executable set is tracked via
31+
`.pkg/root-executables.json`.
32+
- Python `i` installs also manage dispatcher stubs such as `python`,
33+
`pip`, `python3`, and `pip3`.
34+
35+
## Homebrew Rules
36+
37+
- Homebrew path relocation still rewrites `/opt/homebrew/...` references.
38+
- Rewrite `@@HOMEBREW_PREFIX@@/etc/openssl@3/cert.pem` to
39+
`OUR_PREFIX/ssl/cert.pem` before the generic `/etc` relocation rules.
40+
- When `openssl@3` is present, post-install moves
41+
`share/ca-certificates/` to `ssl/` and renames `cacert.pem` to
42+
`cert.pem` to keep rewritten binary paths short enough.
43+
- Homebrew formulas with `service` metadata are unsupported.
44+
- Homebrew formulas with `post_install` are unsupported except:
45+
`openssl@3`, `ca-certificates`, and `python@<major>.<minor>` during
46+
`i` installs.
47+
- Unsupported Homebrew formulas should fail with:
48+
`Unsupported formula: use \`brew install foo\``.
49+
50+
## Vendor Rules
51+
52+
- Vendor `version()` returns `Result<semver::Version, String>`.
53+
- Vendor code owns version normalization such as stripping a leading `v`.
54+
- Treat the vendor inventory as code, not documentation: list `./vendor`
55+
to see the current package modules, and check `src/vendor.rs` for the
56+
registry that is actually compiled in.
57+
- When adding or removing a vendor package, keep `src/vendor.rs` and its
58+
tests in sync with the files under `vendor/`.
59+
60+
## Vendor Package Notes
61+
62+
- `gh` downloads GitHub release zips from `cli/cli`.
63+
- `node` uses GitHub releases for version discovery from `nodejs/node`, but
64+
downloads tarballs from `https://nodejs.org/dist/...`.
65+
- `node` currently exposes `node`, `npm`, and `npx`.
66+
- `node` does not currently expose `corepack`.
67+
68+
## Local Tooling Notes
69+
70+
- In this environment, `cargo` may not be on `PATH`.
71+
- If that happens, use `/Users/mxcl/.cargo/bin/cargo`.

0 commit comments

Comments
 (0)