Skip to content

Commit f133c00

Browse files
committed
Test on Apple Silicon ARM64
1 parent de090c1 commit f133c00

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.github/scripts/ci_build_cairo.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,24 @@ def get_ld_library_path(prefix: Path) -> str:
9696
# <prefix>/lib/* or sometimes just <prefix>/lib
9797
# this function returns the path to the ld library path
9898

99-
# first, check if the ld library path exists at <prefix>/lib/*
100-
ld_library_paths = list(prefix.glob("lib/*"))
99+
# On macOS ARM64, libraries are typically installed directly to <prefix>/lib
100+
# On macOS Intel, they might be in <prefix>/lib/x86_64-darwin
101+
# On Linux, they might be in <prefix>/lib/x86_64-linux-gnu or similar
102+
103+
# First, check for architecture-specific subdirectories in <prefix>/lib/*
104+
# Filter to only include directories, not files
105+
ld_library_paths = [p for p in prefix.glob("lib/*") if p.is_dir()]
101106
if len(ld_library_paths) == 1:
102107
return ld_library_paths[0].absolute().as_posix()
103108

104-
# if the ld library path does not exist at <prefix>/lib/*,
105-
# return <prefix>/lib
109+
# If no single subdirectory, check if libraries exist directly in <prefix>/lib
106110
ld_library_path = prefix / "lib"
107111
if ld_library_path.exists():
112+
# Check if there are actual library files here
113+
lib_files = list(ld_library_path.glob("*.dylib")) + list(ld_library_path.glob("*.so*"))
114+
if lib_files:
115+
return ld_library_path.absolute().as_posix()
116+
# If lib/ exists but has no libraries, return it anyway as fallback
108117
return ld_library_path.absolute().as_posix()
109118
return ""
110119

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ jobs:
2424
matrix:
2525
os: [ubuntu-22.04, macos-15-intel, windows-latest]
2626
python: ["3.10", "3.11", "3.12", "3.13"]
27+
include:
28+
- os: macos-latest
29+
python: "3.13"
2730

2831
steps:
2932
- name: Checkout the repository
30-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
3134

3235
- name: Setup Python ${{ matrix.python }}
3336
uses: actions/setup-python@v6
@@ -76,6 +79,9 @@ jobs:
7679
path: ${{ github.workspace }}/third_party
7780
key: ${{ runner.os }}-dependencies-cairo-${{ hashFiles('.github/scripts/ci_build_cairo.py') }}
7881

82+
- if: runner.os == 'macOS' && runner.arch == 'ARM64'
83+
run: brew install lzo
84+
7985
- name: Build and install Cairo (Linux and macOS)
8086
if: (runner.os == 'Linux' || runner.os == 'macOS') && steps.cache-cairo.outputs.cache-hit != 'true'
8187
run: python .github/scripts/ci_build_cairo.py

0 commit comments

Comments
 (0)