Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ crate.from_cargo(
)

# audiopus_sys builds its vendored opus via the `cmake` crate. cmake + ninja
# come from @cmake_tools (pinned release binaries, first PATH entry below), so
# come from @cmake_tools (pinned release binaries, first PATH entries below), so
# the build no longer cares what the runner image ships — which is also what
# lets it run on BuildBuddy RBE workers. The host directories stay behind them
# as a fallback. The policy override is what its old CMakeLists needs under
Expand Down Expand Up @@ -182,9 +182,11 @@ crate.annotation(
# the UBSan runtime. Opus shipped without sanitizers under
# cargo-zigbuild too.
"CFLAGS": "-fno-sanitize=undefined",
# Canonical repo path of @cmake_tools first — keep in sync with the
# cmake tools section below.
"PATH": "$${pwd}/external/+cmake_tools_repository+cmake_tools/bin:/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:/run/current-system/sw/bin",
# Canonical repo paths of @cmake_tools first — keep in sync with the
# cmake tools section below. cmake and ninja sit in separate directories
# because bin/ is the notarized CMake.app bundle on macOS and macOS
# deletes that bundle if anything is written into it; see tools.bzl.
"PATH": "$${pwd}/external/+cmake_tools_repository+cmake_tools/bin:$${pwd}/external/+cmake_tools_repository+cmake_tools/ninja-bin:/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:/run/current-system/sw/bin",
},
# Stages the pinned cmake/ninja binaries into the build-script action's
# sandbox (the PATH entry alone would not make them inputs). Canonical
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 28 additions & 9 deletions bazel/toolchains/cmake/tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ script's PATH. Historically that PATH pointed at host directories, which made
the build depend on whatever the runner image shipped — and broke remote
execution outright (BuildBuddy workers carry no cmake). This repo pins the
official CMake and Ninja release binaries for the exec host and exposes them
under a single `bin/` directory that the audiopus_sys annotation prepends to
the build-script PATH (see MODULE.bazel).
under `bin/` (cmake) and `ninja-bin/` (ninja), both of which the audiopus_sys
annotation prepends to the build-script PATH (see MODULE.bazel).

The two directories are not cosmetic. On macOS `bin/` is a symlink into the
Apple-notarized CMake.app, and writing ninja into that bundle makes macOS treat
it as tampered — the write fails and the bundle is deleted, leaving cmake to die
with SIGKILL ("damaged"). ninja therefore gets a directory of its own.

Like @llvm_msvc_tools, the archive choice keys off the *host* running the
repository rule: with remote execution the exec platform is linux-x64, so
Expand Down Expand Up @@ -42,7 +47,7 @@ package(default_visibility = ["//visibility:public"])

filegroup(
name = "tools",
srcs = glob(["bin/**", "share/**", "CMake.app/**"], allow_empty = True),
srcs = glob(["bin/**", "ninja-bin/**", "share/**", "CMake.app/**"], allow_empty = True),
)
"""

Expand Down Expand Up @@ -77,23 +82,37 @@ def _cmake_tools_impl(rctx):
# The macOS archive is an app bundle; surface its bin/ (cmake, and the
# share/ data it locates relative to the binary) at the repo top level so
# the PATH entry is the same on every host.
#
# CMake.app is Apple-notarized and its resources are sealed, so nothing may
# ever be written *into* it: adding an executable to a signed bundle reads
# as malware persistence, and macOS answers by refusing the write (EPERM)
# and deleting the bundle outright. The symlinked bin/ then dangles, and the
# `cmake` the audiopus_sys build script resolves from PATH either fails
# signature validation — killed with SIGKILL, reported as "damaged" — or is
# simply gone. That is why ninja lands in its own ninja-bin/ below rather
# than joining cmake in bin/, and why doc/man are only pruned when they are
# real top-level directories (linux); on macOS they live inside the bundle.
if key.startswith("macos-"):
rctx.symlink("CMake.app/Contents/bin", "bin")
rctx.symlink("CMake.app/Contents/share", "share")

# Drop the bundled GUI/docs where present; only bin/ + share/cmake-* (the
# Modules/ tree cmake refuses to run without) matter to build scripts.
for name in ("doc", "man"):
entry = rctx.path(name)
if entry.exists:
rctx.delete(entry)

if not key.startswith("macos-"):
for name in ("doc", "man"):
entry = rctx.path(name)
if entry.exists:
rctx.delete(entry)

# ninja-bin/ on every host, not bin/: on macOS bin/ is the notarized bundle
# (see above), and a uniform layout keeps the PATH annotation in MODULE.bazel
# host-independent.
ninja_asset, ninja_sha256 = _NINJA_DISTS[key]
rctx.report_progress("Downloading Ninja {} ({})".format(_NINJA_VERSION, ninja_asset))
rctx.download_and_extract(
url = "https://github.com/ninja-build/ninja/releases/download/v{}/{}".format(_NINJA_VERSION, ninja_asset),
sha256 = ninja_sha256,
output = "bin",
output = "ninja-bin",
)

rctx.file("BUILD.bazel", _BUILD.format(
Expand Down
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions docs/aura/FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ changes the template sources.
- `packages/coding-agent/src/cli/version-identity.ts` — `--version` identity line
(`<app>/<version>` + runtime protocol version)
- `scripts/build-relocatable-runtime-bundle.ts`,
`scripts/build-relocatable-runtime-bundle.test.ts` — fork-owned Linux x64/glibc
packager and behavioral contract tests for a relocatable standalone Aura binary,
`scripts/build-relocatable-runtime-bundle.test.ts` — fork-owned host packager
(Linux x64/glibc and macOS arm64) and behavioral contract tests for a relocatable
standalone Aura binary,
complete Elide distribution, embedded-library sidecars, runtime overlay, launcher,
archive, checksum, and post-extraction verification; the launcher resolves relative, absolute, and chained installation symlinks before deriving its bundle root; the release compiler is the Bun pinned by root `packageManager`, taken from the running interpreter when it already matches and otherwise installed under `$XDG_CACHE_HOME/aura/pinned-bun/<version>` with `bun` trusted so its postinstall materializes a real binary
archive, checksum, and post-extraction verification; the launcher resolves relative, absolute, and chained installation symlinks before deriving its bundle root; the release compiler is the Bun pinned by root `packageManager`, taken from the running interpreter when it already matches and otherwise installed under `$XDG_CACHE_HOME/aura/pinned-bun/<version>` with `bun` trusted so its postinstall materializes a real binary; the host decides the bundle name, library suffix, and linkage probe — `ldd` on Linux, `otool -l` on macOS, where `@rpath` expansion must resolve inside the bundle and archives fall back from GNU tar to bsdtar's narrower reproducibility flags
- `packages/metaharness/src/inherent-capability-benchmark.ts`,
`src/inherent-capability-benchmark.test.ts`, and
`packages/coding-agent/scripts/runtime-telemetry-preflight.ts` — focused current
Expand Down
Loading
Loading