Skip to content

Commit

Permalink
ci: try to get linux cross-compilation working
Browse files Browse the repository at this point in the history
  • Loading branch information
stancl committed Jan 2, 2025
1 parent aca2359 commit 88855ec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Tests

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@ jobs:
Copy-Item sqlite-amalgamation-3470200\sqlite3.h .
Copy-Item sqlite-amalgamation-3470200\sqlite3ext.h .
- name: Debug uname -m
if: runner.os != 'Windows'
run: uname -m
- name: Set up QEMU (Linux cross-compilation)
if: runner.os == 'Linux' && matrix.arch == 'ARM64'
uses: docker/setup-qemu-action@v3

- name: Build C files
if: ! (runner.os == 'Linux' && matrix.arch == 'ARM64')
run: cd extensions && make

- name: Build C files (Linux cross-compilation)
if: runner.os == 'Linux' && matrix.arch == 'ARM64'
run:
cd extensions
docker run --platform linux/arm64 \
-v .:/extensions \
debian:slim \
bash -c "apt-get update && apt-get install -y make gcc && cd /extensions && make"

- name: Commit output files
shell: bash
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Validate code

on: [push, pull_request]

jobs:
Expand Down
4 changes: 2 additions & 2 deletions extensions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ OUTPUT :=

ifeq ($(OS),Windows_NT)
OUTPUT = lib/noattach.dll
CCFLAGS = -shared -Wl,--exclude-libs,ALL
CCFLAGS += -shared -Wl,--exclude-libs,ALL
CC = clang
else
UNAME := $(shell uname)
CCFLAGS = -fPIC -Os -shared
CCFLAGS += -fPIC -Os -shared
ifeq ($(UNAME),Darwin)
ifeq ($(shell uname -m),arm64)
OUTPUT = lib/arm/noattach.dylib
Expand Down

0 comments on commit 88855ec

Please sign in to comment.