Skip to content

Commit 0aa63fa

Browse files
committed
Cross
1 parent 203530e commit 0aa63fa

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

.github/workflows/dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ jobs:
185185

186186
- name: Install deps
187187
run: |
188+
python -m pip --disable-pip-version-check install ninja
188189
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
189190
190191
- name: Install numpy (needed for stubgen but broken in raspbian CI)
@@ -290,13 +291,12 @@ jobs:
290291
- name: Install deps
291292
shell: bash
292293
run: |
293-
/build/venv/bin/build-pip --disable-pip-version-check install ninja pkgconf
294294
/build/venv/bin/cross-pip --disable-pip-version-check install -r rdev_requirements.txt
295295
296296
- name: Build wheels
297297
shell: bash
298298
run: |
299-
/build/venv/bin/cross-python -m devtools ci build-meson-wheels --no-test
299+
/build/venv/bin/cross-python -m devtools ci build-meson-wheels --no-test --cross=cross.txt
300300
301301
302302
- uses: actions/upload-artifact@v4

devtools/ci.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# CI commands
33
#
44

5+
import pathlib
56
import sys
7+
import typing as T
68

79
import click
810
from packaging.requirements import Requirement
@@ -55,15 +57,17 @@ def build_other_wheels(ctx: Context, no_test: bool):
5557
wheel_path=ctx.wheel_path,
5658
other_wheel_path=ctx.other_wheel_path,
5759
install=True,
60+
config_settings=[],
5861
)
5962
if not no_test:
6063
project.test(install_requirements=True)
6164

6265

6366
@ci.command()
6467
@click.option("--no-test", default=False, is_flag=True)
68+
@click.option("--cross", type=pathlib.Path, help="meson cross.txt file")
6569
@click.pass_obj
66-
def build_meson_wheels(ctx: Context, no_test: bool):
70+
def build_meson_wheels(ctx: Context, no_test: bool, cross: T.Optional[pathlib.Path]):
6771
"""
6872
Builds wheels that use meson, runs tests.
6973
@@ -81,6 +85,10 @@ def build_meson_wheels(ctx: Context, no_test: bool):
8185
# Check that the build dependencies match the versions of the projects
8286
# that we're building
8387

88+
config_settings = []
89+
if cross:
90+
config_settings.append("setup-args=--cross-file=" + str(cross.absolute()))
91+
8492
for project in ctx.subprojects.values():
8593
if not project.is_meson_project():
8694
continue
@@ -93,6 +101,7 @@ def build_meson_wheels(ctx: Context, no_test: bool):
93101
wheel_path=ctx.wheel_path,
94102
other_wheel_path=ctx.other_wheel_path,
95103
install=True,
104+
config_settings=config_settings,
96105
)
97106
if not no_test:
98107
project.test(install_requirements=True)

devtools/subproject.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import shutil
55
import sys
66
import tempfile
7+
import typing as T
78

89
from packaging.requirements import Requirement
910
import tomli
@@ -104,10 +105,17 @@ def test(self, *, install_requirements=False):
104105
)
105106

106107
def build_wheel(
107-
self, *, wheel_path: pathlib.Path, other_wheel_path: pathlib.Path, install: bool
108+
self,
109+
*,
110+
wheel_path: pathlib.Path,
111+
other_wheel_path: pathlib.Path,
112+
install: bool,
113+
config_settings: T.List[str],
108114
):
109115
wheel_path.mkdir(parents=True, exist_ok=True)
110116

117+
config_args = [f"--config-setting={setting}" for setting in config_settings]
118+
111119
# TODO: eventually it would be nice to use build isolation
112120

113121
with tempfile.TemporaryDirectory() as td:
@@ -119,6 +127,7 @@ def build_wheel(
119127
"--no-isolation",
120128
"--outdir",
121129
td,
130+
*config_args,
122131
cwd=self.path,
123132
)
124133

rdev_requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ semiwrap @ git+https://github.com/robotpy/robotpy-build@semiwrap
1414
hatch-meson
1515
hatch-robotpy @ git+https://github.com/robotpy/hatch-robotpy@main
1616
hatch-nativelib @ git+https://github.com/robotpy/hatch-nativelib@rm-macos-relink
17-
ninja
1817
msvc-runtime>=14.42.34433; platform_system == 'Windows'

0 commit comments

Comments
 (0)