Skip to content

Commit 0b1443f

Browse files
authored
Build static Linux arm64 binaries without docker (#6928)
1 parent 7e8b601 commit 0b1443f

File tree

1 file changed

+5
-44
lines changed

1 file changed

+5
-44
lines changed

.github/workflows/ci.yml

+5-44
Original file line numberDiff line numberDiff line change
@@ -89,49 +89,6 @@ jobs:
8989
name: rewatch-${{env.artifact_dir_name}}
9090
path: ${{ env.artifact_dir_name }}
9191

92-
# Build statically linked Linux binaries in an Alpine-based Docker container
93-
# See https://ocamlpro.com/blog/2021_09_02_generating_static_and_portable_executables_with_ocaml
94-
# for more info.
95-
# The container already comes with all required tools pre-installed
96-
# (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
97-
# Note: Static ARM64 binaries cannot be built directly on Ubuntu runner because of
98-
# https://github.com/ocaml/opam-repository/issues/26216
99-
build-compiler-linux-arm:
100-
runs-on: buildjet-2vcpu-ubuntu-2204-arm
101-
102-
steps:
103-
- name: Checkout
104-
uses: actions/checkout@v4
105-
106-
- name: Build compiler binaries
107-
uses: docker://ghcr.io/rescript-lang/rescript-ci-build:alpine-3.20-ocaml-5.2.0-01
108-
with:
109-
args: opam exec -- dune build --display quiet --profile static
110-
111-
- name: Build ninja binary
112-
uses: docker://ghcr.io/rescript-lang/rescript-ci-build:alpine-3.20-ocaml-5.2.0-01
113-
with:
114-
args: sh -c "cd ninja && LDFLAGS=-static python configure.py --bootstrap"
115-
116-
- name: Use Node.js
117-
uses: actions/setup-node@v4
118-
with:
119-
node-version: 18
120-
121-
- name: Get artifact dir name
122-
run: node .github/workflows/get_artifact_dir_name.js
123-
124-
- name: Copy exes to platform bin dir
125-
run: |
126-
node ./scripts/copyExes.js -compiler
127-
node ./scripts/copyExes.js -ninja
128-
129-
- name: "Upload artifacts: binaries"
130-
uses: actions/upload-artifact@v4
131-
with:
132-
name: binaries-${{ env.artifact_dir_name }}
133-
path: ${{ env.artifact_dir_name }}
134-
13592
build-compiler:
13693
strategy:
13794
fail-fast: false
@@ -143,6 +100,9 @@ jobs:
143100
upload_libs: true
144101
# Build the playground compiler on the fastest runner
145102
build_playground: true
103+
- os: buildjet-2vcpu-ubuntu-2204-arm # ARM
104+
ocaml_compiler: ocaml-variants.5.2.0+options,ocaml-option-static
105+
upload_binaries: true
146106
- os: macos-13 # x64
147107
ocaml_compiler: 5.2.0
148108
upload_binaries: true
@@ -224,6 +184,8 @@ jobs:
224184
uses: ocaml/[email protected]
225185
if: steps.cache-opam-env.outputs.cache-hit != 'true'
226186
with:
187+
opam-repositories: |
188+
default: https://github.com/rescript-lang/opam-repository.git
227189
ocaml-compiler: ${{matrix.ocaml_compiler}}
228190
opam-pin: false
229191

@@ -422,7 +384,6 @@ jobs:
422384
package:
423385
needs:
424386
- build-compiler
425-
- build-compiler-linux-arm
426387
- build-rewatch
427388

428389
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)