Skip to content

Commit 2882c1b

Browse files
committed
Build on ARM
Fixes #85
1 parent 8173d2a commit 2882c1b

4 files changed

Lines changed: 20 additions & 8 deletions

File tree

.github/actions/install-pgrx/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ runs:
4242
uses: actions/cache@v4
4343
with:
4444
path: ~/.cargo/bin/cargo-pgrx
45-
key: ${{runner.os}}-cargo-pgrx-${{ inputs.pgrx-version }}-pg${{ steps.pg-config.outputs.version }}-${{ steps.rustc.outputs.version }}
45+
key: ${{ runner.arch }}-${{runner.os}}-cargo-pgrx-${{ inputs.pgrx-version }}-pg${{ steps.pg-config.outputs.version }}-${{ steps.rustc.outputs.version }}
4646

4747
- name: Install cargo-pgrx ${{ inputs.pgrx-version }}
4848
if: steps.cache-cargo-pgrx.outputs.cache-hit != 'true'
@@ -63,7 +63,7 @@ runs:
6363
uses: actions/cache@v4
6464
with:
6565
path: ~/.cargo/bin/grcov
66-
key: ${{runner.os}}-cargo-grcov-${{ inputs.grcov-version }}-${{ steps.rustc.outputs.version }}
66+
key: ${{ runner.arch }}-${{runner.os}}-cargo-grcov-${{ inputs.grcov-version }}-${{ steps.rustc.outputs.version }}
6767

6868
- name: Install grcov
6969
if: steps.cache-cargo-grcov.outputs.cache-hit != 'true'

.github/actions/install-postgres/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
uses: actions/cache@v4
1919
with:
2020
path: ${{ inputs.pg-src-dir }}
21-
key: ${{ runner.os }}-postgresql-${{ inputs.pg-version }}
21+
key: ${{ runner.arch }}-${{ runner.os }}-postgresql-${{ inputs.pg-version }}
2222

2323
- name: Build PostgreSQL
2424
if: steps.cache-postgresql.outputs.cache-hit != 'true'

.github/workflows/deb-packager.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,20 @@ on:
2121

2222
jobs:
2323
packager:
24-
runs-on: ubuntu-latest
24+
runs-on: ${{ matrix.runs_on }}
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
platform: [ amd64, arm64 ]
30+
include:
31+
- platform: amd64
32+
runs_on: ubuntu-latest
33+
rustflags: '-C target-feature=+avx2,+fma'
34+
- platform: arm64
35+
runs_on: cloud-image-runner-arm64
36+
rustflags: ''
37+
2538
env:
2639
PG_VER: ${{ github.event.inputs.PG }}
2740
PG_MIN_VER: ${{ github.event.inputs.PG_MIN }}
@@ -42,7 +55,7 @@ jobs:
4255

4356
- name: Install Deb builder specific packages
4457
run: |
45-
sudo apt-get install dpkg-dev debhelper
58+
sudo apt-get install dpkg-dev debhelper build-essential
4659
4760
- name: Install PostgreSQL ${{ env.PG_VER }}
4861
uses: ./.github/actions/install-postgres
@@ -68,13 +81,13 @@ jobs:
6881
id: debbuild
6982
run: |
7083
export PATH=~/${{ env.PG_INSTALL_DIR }}/bin:$PATH
71-
(cd ${{ env.TAG_DIR }} && make package)
84+
(cd ${{ env.TAG_DIR }} && ${{ matrix.rustflags != '' && format('RUSTFLAGS="{0}"', matrix.rustflags) || '' }} make package)
7285
bash scripts/package-deb.sh "${{ env.TAG }}" "${PWD}/${{ env.TAG_DIR }}" "$RUNNER_OS" "${{ env.PG_VER }}"
7386
7487
# Use a GH artifact, then we can make use of the (quite limited) GH API https://docs.github.com/en/rest/actions/artifacts
7588
# The artifact will have a TTL of 90 days
7689
- name: Upload deb as Artifact
7790
uses: actions/upload-artifact@v4
7891
with:
79-
name: pgvectorscale-${{ env.TAG }}-pg${{ env.PG_VER }}
92+
name: pgvectorscale-${{ env.TAG }}-pg${{ env.PG_VER }}-${{ matrix.platform }}
8093
path: pkgdump/pgvectorscale-*${{ env.TAG }}*.deb

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ PG_REGRESS_OPTS_EXTRA=--create-role=superuser,tsdbadmin,test_role_1 --launcher=
2525
export TEST_OUTPUT_DIR:=$(ROOTDIR)/test_output
2626
export PG_ABS_SRCDIR:=$(ROOTDIR)/test
2727
export TEST_DBNAME:=regression
28-
export RUSTFLAGS:=-C target-feature=+avx2,+fma
2928

3029
### default collation settings on Cloud is C.UTF-8
3130
PG_DEFAULT_REGRESS_LOCALE=$(shell uname | grep -q 'Darwin' && echo 'en_US.UTF-8' || echo 'C.UTF-8')

0 commit comments

Comments
 (0)