From e64ac455a37037322b3af0b2d40c9b24f314fab9 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 14 Aug 2026 17:22:46 +0000 Subject: [PATCH 1/7] Add support for Haiku R1/beta6 Build and release an R1/beta6 image alongside the R1/beta5 one. The installer boot steps are unchanged, since the Installer and DriveSetup flows are the same as in R1/beta5. R1/beta6 has not been released yet, so two release specific values are placeholders and need to be filled in once it ships: the SHA256 checksum of haiku-r1beta6-x86_64-anyboot.iso and the hrev used by the uname assertion in the build workflow. Both are marked with a TODO. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NksedEgMiTdqqBmtbmGKhM --- .github/workflows/build.yml | 5 +++++ changelog.md | 2 ++ readme.md | 1 + var_files/r1beta6/x86-64.pkrvars.hcl | 4 ++++ 4 files changed, 12 insertions(+) create mode 100644 var_files/r1beta6/x86-64.pkrvars.hcl diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8215e2c..08a18bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,11 @@ jobs: strategy: matrix: version: + # TODO: set `uname_version` to the hrev of the R1/beta6 release, + # once the release is out. + - name: 'r1beta6' + uname_version: hrev00000 + - name: 'r1beta5' uname_version: hrev57937 diff --git a/changelog.md b/changelog.md index 950a293..02e796d 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Add support for Haiku R1/beta6 ## [0.1.0] - 2026-04-29 ### Changed diff --git a/readme.md b/readme.md index cfe3b56..2364f86 100644 --- a/readme.md +++ b/readme.md @@ -18,6 +18,7 @@ The following architectures and versions are supported: | Version | x86-64 | |---------|--------| +| r1beta6 | ✓ | | r1beta5 | ✓ | ## Building Locally diff --git a/var_files/r1beta6/x86-64.pkrvars.hcl b/var_files/r1beta6/x86-64.pkrvars.hcl new file mode 100644 index 0000000..873c6eb --- /dev/null +++ b/var_files/r1beta6/x86-64.pkrvars.hcl @@ -0,0 +1,4 @@ +# TODO: R1/beta6 has not been released yet. Replace this with the SHA256 +# checksum of haiku-r1beta6-x86_64-anyboot.iso, published at +# https://www.haiku-os.org/get-haiku/r1beta6/, once the release is out. +checksum = "sha256:0000000000000000000000000000000000000000000000000000000000000000" From 5bd932e8fd1e65abf653ebe506015c12d5dffbd9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Aug 2026 06:08:35 +0000 Subject: [PATCH 2/7] Build R1/beta6 from the official test build R1/beta6 has not been officially released yet, so the ISO is not available on the release mirrors. Add an `iso_urls` variable that overrides where the installation ISO is downloaded from, and point R1/beta6 at the official test build, hrev59866_53. When the release is out, dropping `iso_urls` from the version's variable file and updating the checksum switches it back to the mirrors. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NksedEgMiTdqqBmtbmGKhM --- .github/workflows/build.yml | 4 +--- changelog.md | 6 +++++- main.pkr.hcl | 24 +++++++++++++++++------- readme.md | 3 +++ var_files/r1beta6/x86-64.pkrvars.hcl | 13 +++++++++---- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08a18bf..9a2bfb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,10 +18,8 @@ jobs: strategy: matrix: version: - # TODO: set `uname_version` to the hrev of the R1/beta6 release, - # once the release is out. - name: 'r1beta6' - uname_version: hrev00000 + uname_version: hrev59866_53 - name: 'r1beta5' uname_version: hrev57937 diff --git a/changelog.md b/changelog.md index 02e796d..dccbea3 100644 --- a/changelog.md +++ b/changelog.md @@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- Add support for Haiku R1/beta6 +- Add support for Haiku R1/beta6. Since it has not been officially released + yet, the image is built from the official test build, `hrev59866_53` +- Add an `iso_urls` variable, which overrides where the installation ISO is + downloaded from. This makes it possible to build versions that are not + available on the release mirrors yet ## [0.1.0] - 2026-04-29 ### Changed diff --git a/main.pkr.hcl b/main.pkr.hcl index 5f4c1b7..dbefa2b 100644 --- a/main.pkr.hcl +++ b/main.pkr.hcl @@ -74,6 +74,12 @@ variable "acceleration" { description = "Indicates if hardware acceleration should be enabled or not" } +variable "iso_urls" { + default = [] + type = list(string) + description = "Where to download the installation ISO from. When empty, the release mirrors are used. Set this for versions that haven't been released yet, since those are not available on the mirrors" +} + locals { iso_target_extension = "iso" iso_target_path = "packer_cache" @@ -81,6 +87,16 @@ locals { vm_name = "haiku-${var.os_version}-${var.architecture.name}.qcow2" iso_path = "${var.os_version}/haiku-${var.os_version}-${var.architecture.image}-anyboot.iso" + + release_iso_urls = [ + "http://mirror.rit.edu/haiku/${local.iso_path}", + "https://ftp.osuosl.org/pub/haiku/${local.iso_path}", + "https://s3.us-east-1.wasabisys.com/haiku-release/${local.iso_path}", + "https://cloudflare-ipfs.com/ipns/hpkg.haiku-os.org/release/${local.iso_path}", + "https://mirror.aarnet.edu.au/pub/haiku/${local.iso_path}", + ] + + iso_urls = length(var.iso_urls) > 0 ? var.iso_urls : local.release_iso_urls } source "qemu" "qemu" { @@ -128,13 +144,7 @@ source "qemu" "qemu" { iso_checksum = var.checksum iso_target_extension = local.iso_target_extension iso_target_path = local.iso_target_path - iso_urls = [ - "http://mirror.rit.edu/haiku/${local.iso_path}", - "https://ftp.osuosl.org/pub/haiku/${local.iso_path}", - "https://s3.us-east-1.wasabisys.com/haiku-release/${local.iso_path}", - "https://cloudflare-ipfs.com/ipns/hpkg.haiku-os.org/release/${local.iso_path}", - "https://mirror.aarnet.edu.au/pub/haiku/${local.iso_path}", - ] + iso_urls = local.iso_urls http_directory = "." output_directory = "output" diff --git a/readme.md b/readme.md index 2364f86..b911965 100644 --- a/readme.md +++ b/readme.md @@ -21,6 +21,9 @@ The following architectures and versions are supported: | r1beta6 | ✓ | | r1beta5 | ✓ | +Note, R1/beta6 has not been officially released yet. The image is built from +the official test build, `hrev59866_53`, until the release is out. + ## Building Locally ### Prerequisite diff --git a/var_files/r1beta6/x86-64.pkrvars.hcl b/var_files/r1beta6/x86-64.pkrvars.hcl index 873c6eb..a079808 100644 --- a/var_files/r1beta6/x86-64.pkrvars.hcl +++ b/var_files/r1beta6/x86-64.pkrvars.hcl @@ -1,4 +1,9 @@ -# TODO: R1/beta6 has not been released yet. Replace this with the SHA256 -# checksum of haiku-r1beta6-x86_64-anyboot.iso, published at -# https://www.haiku-os.org/get-haiku/r1beta6/, once the release is out. -checksum = "sha256:0000000000000000000000000000000000000000000000000000000000000000" +checksum = "sha256:f3b498dfd506c546cb7a3f04b869a6d63cd2e6b9e84612fdb47c15a3952adeae" + +# R1/beta6 has not been released yet, so the ISO is not available on the +# release mirrors. Build from the official test build in the meantime. Once the +# release is out, remove `iso_urls` and replace the checksum above with the +# checksum of the released ISO. +iso_urls = [ + "https://haiku-release.cdn.haiku-os.org/testing/r1beta6/x86_64/haiku-r1beta6-hrev59866_53-x86_64-anyboot.iso" +] From 7e0bcd552c710833cfdc4a9bce8e64b9f1ee2dce Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Aug 2026 08:47:17 +0000 Subject: [PATCH 3/7] Run the build workflow for branches containing a slash The `*` pattern doesn't match a slash, so pushes to branches like `feature/foo` didn't trigger the workflow. `**` matches across path separators. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NksedEgMiTdqqBmtbmGKhM --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a2bfb1..d72f578 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ env: on: push: - branches: '*' + branches: '**' tags: 'v*' pull_request: branches: From 3b6ce3b5f21ad72782ad1d5cc882b98c66370ca4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Aug 2026 06:20:50 +0000 Subject: [PATCH 4/7] Don't cancel the other versions when one build fails The matrix didn't set `fail-fast`, so the default cancelled every other version as soon as one of them failed. That's especially unhelpful here, where each version is an independent image that takes several minutes to build. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NksedEgMiTdqqBmtbmGKhM --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d72f578..db6e004 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,7 @@ jobs: name: ${{ matrix.version.name }}, ${{ matrix.architecture.name }} runs-on: ubuntu-latest strategy: + fail-fast: false matrix: version: - name: 'r1beta6' From 5f1577732d8ebc532836786ddb9f51f0d00ed11b Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Aug 2026 06:30:09 +0000 Subject: [PATCH 5/7] Retry the package downloads during provisioning `pkgman refresh` has started failing with an I/O error part way through fetching the HaikuPorts repository cache from the package servers, which fails the whole build. It has failed that way in two separate runs, on a build that is otherwise unchanged, so retry the downloads a few times before giving up. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NksedEgMiTdqqBmtbmGKhM --- resources/provision.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/resources/provision.sh b/resources/provision.sh index d4a1914..3a8b3a3 100755 --- a/resources/provision.sh +++ b/resources/provision.sh @@ -2,9 +2,25 @@ set -exu +# Downloading from the Haiku package servers intermittently fails with an I/O +# error part way through a transfer, which fails the whole build. +retry() { + attempt=1 + + while true; do + "$@" && return 0 + [ "$attempt" -ge 5 ] && return 1 + + delay=$((attempt * 10)) + echo "'$*' failed, retrying in ${delay}s" >&2 + sleep "$delay" + attempt=$((attempt + 1)) + done +} + install_extra_packages() { - pkgman refresh - pkgman install bash curl rsync -y + retry pkgman refresh + retry pkgman install bash curl rsync -y } add_sudo_shim() { From 678ce35d7cef8573d64de7374d28628ec559c41a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Aug 2026 07:15:34 +0000 Subject: [PATCH 6/7] Copy the R1/beta5 image from the previous release The Haiku project removed the R1/beta5 package repositories when releasing R1/beta6, so `pkgman refresh` fails with an I/O error while fetching the HaikuPorts repository, and the image can no longer be built. Reuse the image from `v0.1.0`, the last release that could build it, the same way freebsd-builder does for the versions it can no longer build. The copied image still goes through the image test on every build, it's just not rebuilt. This also reverts the retry added in 5f15777. The repositories are gone rather than flaky, so retrying only made the failure slower: all five attempts failed identically, in about five seconds each. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NksedEgMiTdqqBmtbmGKhM --- .github/workflows/build.yml | 15 +++++++++++++++ changelog.md | 6 ++++++ readme.md | 6 ++++++ resources/provision.sh | 20 ++------------------ 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db6e004..620489b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,13 @@ jobs: - name: 'r1beta6' uname_version: hrev59866_53 + # The Haiku project removed the R1/beta5 package repositories when + # releasing R1/beta6, which makes `pkgman` fail during + # provisioning. The image can no longer be built, so reuse the one + # from the last release that could build it. - name: 'r1beta5' uname_version: hrev57937 + copy_from_previous_release: v0.1.0 architecture: - name: x86-64 @@ -68,12 +73,22 @@ jobs: # limit-access-to-actor: true - name: Build Image + if: '!matrix.version.copy_from_previous_release' run: | PACKER_LOG=1 ./build.sh \ '${{ matrix.version.name }}' \ '${{ matrix.architecture.name }}' \ -var 'headless=true' + - name: Copy from previous release + if: matrix.version.copy_from_previous_release + run: | + curl -O -L \ + --retry 3 \ + --create-dirs \ + --output-dir output \ + https://github.com/cross-platform-actions/haiku-builder/releases/download/${{ matrix.version.copy_from_previous_release }}/haiku-${{ matrix.version.name }}-${{ matrix.architecture.name }}.qcow2 + - name: Start Local HTTP Server run: python3 -m http.server 8080 --directory output & diff --git a/changelog.md b/changelog.md index dccbea3..1173b95 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 downloaded from. This makes it possible to build versions that are not available on the release mirrors yet +### Changed +- The R1/beta5 image is copied from the `v0.1.0` release instead of being + rebuilt. The Haiku project removed the R1/beta5 package repositories when + releasing R1/beta6, which makes `pkgman` fail during provisioning. The + image is still tested on every build + ## [0.1.0] - 2026-04-29 ### Changed - Enable immutable releases ([action#140](https://github.com/cross-platform-actions/action/issues/140)) diff --git a/readme.md b/readme.md index b911965..13a4014 100644 --- a/readme.md +++ b/readme.md @@ -24,6 +24,12 @@ The following architectures and versions are supported: Note, R1/beta6 has not been officially released yet. The image is built from the official test build, `hrev59866_53`, until the release is out. +Note, the R1/beta5 image is no longer built. The Haiku project removed the +R1/beta5 package repositories when releasing R1/beta6, which makes `pkgman` +fail during provisioning. The image from the `v0.1.0` release, the last one +that could be built, is reused for every release instead. It's still tested on +every build, just not rebuilt. + ## Building Locally ### Prerequisite diff --git a/resources/provision.sh b/resources/provision.sh index 3a8b3a3..d4a1914 100755 --- a/resources/provision.sh +++ b/resources/provision.sh @@ -2,25 +2,9 @@ set -exu -# Downloading from the Haiku package servers intermittently fails with an I/O -# error part way through a transfer, which fails the whole build. -retry() { - attempt=1 - - while true; do - "$@" && return 0 - [ "$attempt" -ge 5 ] && return 1 - - delay=$((attempt * 10)) - echo "'$*' failed, retrying in ${delay}s" >&2 - sleep "$delay" - attempt=$((attempt + 1)) - done -} - install_extra_packages() { - retry pkgman refresh - retry pkgman install bash curl rsync -y + pkgman refresh + pkgman install bash curl rsync -y } add_sudo_shim() { From 2929892b26d1d1a27c660c867900d2ec0b1edba3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Aug 2026 07:26:59 +0000 Subject: [PATCH 7/7] Fail faster when the VM never becomes reachable When the boot steps don't match what the installer actually shows, SSH never becomes available and the build sits in the SSH retry loop until it times out. At `10000s` that's nearly three hours per attempt, which makes CI unusable for finding the problem. Six minutes is enough to reach SSH, so `15m` leaves plenty of room for a slow runner, and the job timeout bounds everything else. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NksedEgMiTdqqBmtbmGKhM --- .github/workflows/build.yml | 1 + main.pkr.hcl | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 620489b..083921d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,7 @@ jobs: build: name: ${{ matrix.version.name }}, ${{ matrix.architecture.name }} runs-on: ubuntu-latest + timeout-minutes: 30 strategy: fail-fast: false matrix: diff --git a/main.pkr.hcl b/main.pkr.hcl index dbefa2b..cb1642d 100644 --- a/main.pkr.hcl +++ b/main.pkr.hcl @@ -119,7 +119,10 @@ source "qemu" "qemu" { ssh_username = "user" ssh_password = var.root_password - ssh_timeout = "10000s" + # The installation takes around six minutes to reach SSH. When the boot + # steps don't match what the installer actually shows, SSH never becomes + # available, so keep the timeout just long enough to absorb a slow runner. + ssh_timeout = "15m" qemuargs = concat( [