Skip to content

chore: Accumulated ports to next - #25187

Open
AztecBot wants to merge 3 commits into
nextfrom
port-to-next-staging
Open

chore: Accumulated ports to next#25187
AztecBot wants to merge 3 commits into
nextfrom
port-to-next-staging

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Backport staging PR. Body will be updated with commit list.

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 8 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot
AztecBot added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
@AztecBot
AztecBot enabled auto-merge August 14, 2026 18:16
@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 8 hours of inactivity. This PR will be merged automatically once all checks pass.

## Problem

foundryup changed where it puts binaries. `foundryup -i <version>` now
unpacks the real executables into
`$FOUNDRY_DIR/versions/foundry-rs/foundry/v<version>/` and leaves
`$FOUNDRY_DIR/bin/{forge,cast,anvil,chisel}` as absolute symlinks
pointing at them. Nothing in this repo changed to trigger it: the
installer is fetched unpinned from `foundry.paradigm.xyz` at runtime, so
every toolchain install picked the new layout up at once.

Our install scripts relocated those `bin/` entries with `mv` and then
deleted the tree they came from — `rm -rf` on the mktemp directory in
the CLI installer, on `$HOME/.foundry` in the container setup script.
`mv` moves the symlink itself rather than its target, and the link
stores an absolute path, so deleting the source left four dangling links
behind. Every existence check that follows dereferences, so they all saw
nothing: the CLI installer aborted with `Error: expected bundled binary
'forge' missing from ~/.aztec/versions/<version>/internal-bin`, which is
what broke `aztec-up` for users and failed the release acceptance job on
both Linux and macOS.

## Fix

Copy instead of move. Copying resolves the link and writes the real
executable at the destination, so the result no longer depends on the
source tree outliving it — the property the old code silently relied on.
`-L` states the dereference explicitly (it is already the default for a
plain file copy, but flips to preserving links under `-r`/`-a`), and
`-p` keeps the source's mode, since a freshly created `cp` destination
otherwise takes its permissions from the caller's umask and can land
non-executable for other users.

The CLI installer also unlinks each destination before copying, because
`cp` refuses to write through a path that is currently executing or is
itself a dangling symlink — the two states a re-install can legitimately
encounter, and both of which a rename handled for free.

The same move-then-delete pattern existed in four places: the `aztec-up`
CLI installer, the dev container setup script, the CI build image, and
the spartan dependency installer. All four are fixed together since they
consume the same foundryup output. The spartan one copies without `-p`,
as it is the only site crossing a `sudo` boundary and preserving
ownership there would leave a user-writable binary in `/usr/local/bin`.
@AztecBot
AztecBot requested a review from charlielye as a code owner August 25, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants