Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
83818a5
Use runtime op if available to set platform for `std.process`
kylewlacy Jun 5, 2025
d519702
Update `std.toolchain()` to support native compilation on aarch64
kylewlacy Jun 15, 2025
f747fa6
Add `cargo_chef` package
kylewlacy Jun 16, 2025
bf18960
Update `rust` package to use `cargo_chef` package instead of bespoke …
kylewlacy Jun 16, 2025
d5aae8b
Update `rust` package to support aarch64-linux
kylewlacy Jun 16, 2025
12c2290
Update `go` package to support aarch64-linux
kylewlacy Jun 16, 2025
43fbf44
Update `nodejs` package to support aarch64-linux
kylewlacy Jun 16, 2025
55c972d
Update GitHub Actions workflow to build for x86_64 and aarch64
kylewlacy Jun 16, 2025
fb5a189
Merge branch `main` into `build/wip-aarch64-linux`
kylewlacy Jun 19, 2025
6327bb6
Update runtime utils
kylewlacy Jun 20, 2025
bf48943
Update GH Actions build workflow to skip platforms based on magic com…
kylewlacy Jun 20, 2025
5b6c033
Disable build of `bugstalker` for aarch64
kylewlacy Jun 20, 2025
e406f64
Fix `gitui` build for aarch64-linux
kylewlacy Jun 20, 2025
a335b6b
Fix `linux` build on aarch64 by adding missing `python` dependency
kylewlacy Jun 20, 2025
3f84937
Adjust LLVM build parallelism for aarch64
kylewlacy Jun 21, 2025
4e2e383
Fix `proot` build on aarch64
kylewlacy Jun 21, 2025
502476c
Fix `strace` build on aarch64
kylewlacy Jun 21, 2025
d6005b0
Update CI to continue build even if one platform fails
kylewlacy Jun 21, 2025
c57e961
Fix `xplr` build on aarch64
kylewlacy Jun 22, 2025
ce42359
Update GH Actions workflow to skip tests too when platform is disabled
kylewlacy Jun 22, 2025
e67d02c
Merge branch `main` into `build/wip-aarch64-linux`
kylewlacy Jun 22, 2025
720ab13
Upgrade runtime utils
kylewlacy Jun 22, 2025
fe6edaa
Bump up GH Actions workflow timeout to 24 hours
kylewlacy Jun 23, 2025
a57cace
Add "All builds passed" job
kylewlacy Jun 28, 2025
ac0d5bb
Update "Show failed processes" to show all failed process event files
kylewlacy Jun 28, 2025
76de683
Update "Show failed processes" to show more lines of output
kylewlacy Jun 28, 2025
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
67 changes: 49 additions & 18 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ on:

jobs:
build:
name: Build packages
name: Build packages [${{ matrix.host.platform }}]
if: inputs.enabled
runs-on: brioche-dev-builder-runner
timeout-minutes: 720
strategy:
fail-fast: false
matrix:
host:
- platform: x86_64-linux
runs-on: brioche-dev-builder-runner
- platform: aarch64-linux
runs-on: brioche-dev-builder-runner-aarch64

runs-on: ${{ matrix.host.runs-on }}
timeout-minutes: 1440
steps:
- name: Install system packages
run: |
Expand All @@ -24,9 +33,11 @@ jobs:
- name: Install Brioche
run: |
mkdir -p ~/.local/bin
curl -L https://development-content.brioche.dev/github.com/brioche-dev/brioche/branches/main/x86_64-linux/brioche -o ~/.local/bin/brioche
curl -L https://development-content.brioche.dev/github.com/brioche-dev/brioche/branches/main/$PLATFORM/brioche -o ~/.local/bin/brioche
chmod +x ~/.local/bin/brioche
echo "$HOME/.local/bin" >> $GITHUB_PATH
env:
PLATFORM: ${{ matrix.host.platform }}

- name: Build packages
run: |
Expand All @@ -36,11 +47,16 @@ jobs:
for package in "${packages[@]}"; do
label="$package ($n / ${#packages[@]})"
((n++))
echo "::group::$label"
brioche build -p "$package" --sync --locked --display plain-reduced
echo "::endgroup::"
if grep -q "@brioche-packages skip-platform $PLATFORM" "$package/project.bri"; then
echo "$label: skipping (does not support $PLATFORM)"
else
echo "::group::$label"
brioche build -p "$package" --sync --locked --display plain-reduced
echo "::endgroup::"
fi
done
env:
PLATFORM: ${{ matrix.host.platform }}
BRIOCHE_REGISTRY_PASSWORD: ${{ secrets.BRIOCHE_REGISTRY_PASSWORD }}
BRIOCHE_CACHE_URL: ${{ vars.BRIOCHE_CACHE_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.CACHE_AWS_ACCESS_KEY_ID }}
Expand All @@ -60,9 +76,13 @@ jobs:
((n++))

if grep -q 'export.*test' "$package/project.bri"; then
echo "::group::$label"
brioche build -p "$package" -e test --sync --locked
echo "::endgroup::"
if grep -q "@brioche-packages skip-platform $PLATFORM" "$package/project.bri"; then
echo "$label: skipping (does not support $PLATFORM)"
else
echo "::group::$label"
brioche build -p "$package" -e test --sync --locked
echo "::endgroup::"
fi
else
echo "$label: no tests found"
fi
Expand All @@ -89,19 +109,30 @@ jobs:
if: failure()
run: |
process_events=(~/.local/share/brioche/process-temp/*/events.bin.zst)
process_event="${process_events[0]}"

if [ -f "$process_event" ]; then
for process_event in "${process_events[@]}"; do
echo "::group::$process_event"

truncated_line_count="$(brioche jobs logs "$process_event" --limit 200 | wc -l)"
if [ "$truncated_line_count" -gt 190 ]; then
# Looks like the output might be long, so show the first 80
# lines and the last 80 lines
if [ "$truncated_line_count" -gt 1200 ]; then
# Looks like the output might be long, so show the first 500
# lines and the last 500 lines

brioche jobs logs "$process_event" --limit 80 | head -n80
brioche jobs logs "$process_event" --limit 500 | head -n500
echo "..."
brioche jobs logs "$process_event" | tail -n80
brioche jobs logs "$process_event" | tail -n500
else
# Looks like the output might be short, so show the whole file
brioche jobs logs "$process_event"
fi
fi

echo "::endgroup::"
done

# Extra job that succeeds when all build jobs succeed (useful for PR requirements)
all-builds-passed:
name: All builds passed
needs: [build]
runs-on: ubuntu-24.04
steps:
- run: ':'
7 changes: 7 additions & 0 deletions packages/bugstalker/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as std from "std";
import libunwind from "libunwind";
import { cargoBuild } from "rust";

// Currently, BugStalker only support x86-64 Linux
// @brioche-packages skip-platform aarch64-linux
export const project = {
name: "bugstalker",
version: "0.3.1",
Expand All @@ -14,6 +16,11 @@ const source = Brioche.gitCheckout({
});

export default function bugstalker(): std.Recipe<std.Directory> {
std.assert(
std.CURRENT_PLATFORM === "x86_64-linux",
`BugStalker does not currently support the platform '${std.CURRENT_PLATFORM}'`,
);

return cargoBuild({
source,
runnable: "bin/bs",
Expand Down
6 changes: 5 additions & 1 deletion packages/gitui/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export const project = {
const source = Brioche.gitCheckout({
repository: project.repository,
ref: `v${project.version}`,
});
})
// Remove upstream's custom Cargo `config.toml`, which overrides the linker
// for various targets (for cross-compilation). This can interfere with
// our default working linker configuration.
.remove(".cargo/config.toml");

export default function gitui(): std.Recipe<std.Directory> {
return cargoBuild({
Expand Down
4 changes: 4 additions & 0 deletions packages/go/brioche.lock

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

27 changes: 21 additions & 6 deletions packages/go/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,26 @@ export const project = {
version: "1.24.4",
};

const source = Brioche.download(
`https://go.dev/dl/go${project.version}.linux-amd64.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();
function goPrebuilt(): std.Recipe<std.Directory> {
switch (std.CURRENT_PLATFORM) {
case "x86_64-linux":
return Brioche.download(
`https://go.dev/dl/go${project.version}.linux-amd64.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();
case "aarch64-linux":
return Brioche.download(
`https://go.dev/dl/go${project.version}.linux-arm64.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();
default:
throw new Error(
`The platform '${std.CURRENT_PLATFORM}' is currently not supported by this version of the go package`,
);
}
}

/**
* The Go programming language.
Expand All @@ -27,7 +42,7 @@ const source = Brioche.download(
export default function go(): std.Recipe<std.Directory> {
return std
.directory({
go: source,
go: goPrebuilt(),
bin: std.directory({
go: std.symlink({ target: "../go/bin/go" }),
gofmt: std.symlink({ target: "../go/bin/gofmt" }),
Expand Down
10 changes: 9 additions & 1 deletion packages/linux/project.bri
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as std from "std";
import kmod from "kmod";
import openssl from "openssl";
import python from "python";
import nushell from "nushell";

export const project = {
Expand Down Expand Up @@ -107,7 +108,14 @@ export default function linux(
make modules_install
`
.workDir(source)
.dependencies(...dependencies, openssl, kmod, ldWrapper, std.toolchain)
.dependencies(
...dependencies,
kmod,
openssl,
python,
ldWrapper,
std.toolchain,
)
.env({
INSTALL_MOD_PATH: std.outputPath,

Expand Down
6 changes: 5 additions & 1 deletion packages/llvm/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export default function llvm(): std.Recipe<std.Directory> {
CMAKE_BUILD_TYPE: "Release",
},
env: {
CMAKE_BUILD_PARALLEL_LEVEL: "16",
// HACK: Building LLVM can use A LOT of memory, especially when building
// in parallel. These values are tuned based on the CI runners currently
// in use in the `brioche-packages` repo.
CMAKE_BUILD_PARALLEL_LEVEL:
std.CURRENT_PLATFORM === "x86_64-linux" ? "16" : "8",
},
dependencies: [std.toolchain, python],
}).pipe((recipe) =>
Expand Down
4 changes: 4 additions & 0 deletions packages/nodejs/brioche.lock

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

39 changes: 28 additions & 11 deletions packages/nodejs/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,41 @@ export const project = {
version: "24.2.0",
};

function nodejsPrebuilt(): std.Recipe<std.Directory> {
switch (std.CURRENT_PLATFORM) {
case "x86_64-linux":
return Brioche.download(
`https://nodejs.org/dist/v${project.version}/node-v${project.version}-linux-x64.tar.xz`,
)
.unarchive("tar", "xz")
.peel();
case "aarch64-linux":
return Brioche.download(
`https://nodejs.org/dist/v${project.version}/node-v${project.version}-linux-arm64.tar.xz`,
)
.unarchive("tar", "xz")
.peel();
default:
throw new Error(
`The platform '${std.CURRENT_PLATFORM}' is currently not supported by this version of the nodejs package`,
);
}
}

/**
* The main Node.js recipe. Returns a recipe containing the following:
*
* - `bin/node`
* - `bin/npm`
*/
export default function nodejs(): std.Recipe<std.Directory> {
let node = Brioche.download(
`https://nodejs.org/dist/v${project.version}/node-v${project.version}-linux-x64.tar.xz`,
)
.unarchive("tar", "xz")
.peel();

node = std.autopack(node, {
globs: ["bin/**"],
});

return std.withRunnableLink(node, "bin/node");
return nodejsPrebuilt()
.pipe((node) =>
std.autopack(node, {
globs: ["bin/**"],
}),
)
.pipe((node) => std.withRunnableLink(node, "bin/node"));
}

export async function test(): Promise<std.Recipe<std.File>> {
Expand Down
14 changes: 13 additions & 1 deletion packages/proot/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ const source = std.recipe(() => {

export default function proot(): std.Recipe<std.Directory> {
return std.runBash`
BRIOCHE_LD_AUTOPACK=false make -C src loader.elf loader-m32.elf build.h
case "$(uname -m)" in
x86_64)
BRIOCHE_LD_AUTOPACK=false make -C src loader.elf loader-m32.elf build.h
;;
aarch64)
BRIOCHE_LD_AUTOPACK=false make -C src loader.elf build.h
;;
*)
echo "Unhandled architecture for PRoot package"
exit 1
;;
esac

make -C src proot care
make -C src install PREFIX="$BRIOCHE_OUTPUT"
`
Expand Down
15 changes: 14 additions & 1 deletion packages/rust/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default async function rust(): Promise<std.Recipe<std.Directory>> {
throw new Error(`Rustup package ${pkgName} not found`);
}

const pkgTarget = pkg.target["x86_64-unknown-linux-gnu"];
const pkgTarget = pkg.target[targetTriple()];
if (pkgTarget?.available !== true) {
continue;
}
Expand Down Expand Up @@ -450,3 +450,16 @@ export function vendorCrate(

return crate;
}

function targetTriple(): string {
switch (std.CURRENT_PLATFORM) {
case "x86_64-linux":
return "x86_64-unknown-linux-gnu";
case "aarch64-linux":
return "aarch64-unknown-linux-gnu";
default:
throw new Error(
`The platform '${std.CURRENT_PLATFORM}' is currently not supported by this version of the rust package`,
);
}
}
24 changes: 22 additions & 2 deletions packages/std/brioche.lock

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

Loading