Skip to content

ci: generate Windows-on-ARM bindings on a windows-11-arm runner#267

Draft
CGMossa wants to merge 1 commit into
extendr:masterfrom
CGMossa:windows-arm-bindings-ci
Draft

ci: generate Windows-on-ARM bindings on a windows-11-arm runner#267
CGMossa wants to merge 1 commit into
extendr:masterfrom
CGMossa:windows-arm-bindings-ci

Conversation

@CGMossa

@CGMossa CGMossa commented Jun 30, 2026

Copy link
Copy Markdown
Member

TODO: replace this line with your own framing, in your own voice.

AI-written details

Summary

  • Adds Windows-on-ARM (aarch64-pc-windows-gnullvm) bindings support, which extendr/libR-sys does not ship today.
  • build.rs: get_r_library now handles the aarch64 arch on Windows (maps to bin/x64) instead of panicking with "Unknown architecture", so the crate can build on Windows-ARM once a bindings file exists.
  • New workflow_dispatch workflow generate-windows-arm-bindings.yml: regenerates the bindings natively on a windows-11-arm runner (GA 2025-08-07, free for public repos), pins the last pre-detach generator commit for build.rs to drive bindgen, validates with the layout tests, and uploads the result as an artifact.
  • Supersedes Add Windows ARM bindings #225, whose cross-compile approach predates the bindgen detach (Detach bindgen for next release #250) and relied on CI emit machinery that has since been removed.

Why a generation workflow instead of finishing #225

  • bindgen was detached from the crate in Detach bindgen for next release #250, so build.rs no longer has a generate_bindings path and the old pr_generated_bindings / artifact-emit CI flow is vestigial. The cross-compile-on-x86 approach in Add Windows ARM bindings #225 can no longer produce a file in-tree.
  • Running natively on a windows-11-arm runner avoids cross-sysroot wrangling entirely (the part where Add Windows ARM bindings #225 stalled), and lets the layout tests actually execute on the target rather than being skipped.

Test plan

  • Run the "Generate Windows ARM bindings" workflow from the Actions tab; confirm the bindgen build and the layout-test step both pass on the windows-11-arm runner.
  • Download the bindings-windows-aarch64 artifact, commit it into bindings/, and add the bindings-windows-aarch64.rs symlink (mirroring the other targets).
  • Confirm a fresh cargo build for aarch64-pc-windows-gnullvm picks up the committed file via retrieve_prebuild_bindings.

Notes

  • This PR has not been run in CI yet; it is the mechanism, not the generated file. Open as a draft until the workflow goes green.
  • Two values need a real run to confirm: the R bin subdirectory on ARM Windows (assumed bin/x64) and the exact aarch64 Rtools toolchain path. Both are isolated and easy to adjust if the first run disagrees.
  • The pinned generator commit is exposed as a workflow_dispatch input so it can be bumped without editing the workflow.

Drafted by Claude (claude-opus-4-8). Reviewed by the author.

Windows-ARM (aarch64-pc-windows-gnullvm) bindings do not ship yet, and
bindgen was detached from the crate in extendr#250 so build.rs can no longer
generate them. Supersedes the cross-compile approach in extendr#225, which
predates the detach and relied on the now-removed CI emit machinery.

- build.rs: handle the aarch64 arch on Windows in get_r_library instead
  of panicking ("Unknown architecture"), so the crate can build on
  Windows-ARM once a bindings file exists.
- new workflow (workflow_dispatch): regenerate the bindings natively on a
  windows-11-arm runner (GA 2025-08-07, free for public repos), pinning
  the last pre-detach generator commit for build.rs, then validate with
  the layout tests and upload the artifact to commit by hand.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CGMossa CGMossa mentioned this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant