Skip to content

Commit 2a58064

Browse files
committed
ci/docs: enforce uv checks and document strict uv requirement
1 parent f306b7b commit 2a58064

2 files changed

Lines changed: 50 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ env:
77
BUILD_TYPE: Release
88

99
jobs:
10+
guard-build-script-refs:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Ensure no stale Perl script references remain in active build paths
17+
shell: bash
18+
run: |
19+
! rg -n "genvarimp\\.perl|misc/genrc\\.perl" \
20+
CMakeLists.txt \
21+
cmake/GenerateVarImp.cmake \
22+
Makefile.in \
23+
misc/genrc.py
24+
! rg -n "PROG_PERL" configure.ac configure.ac.in configure
25+
1026
build-autoconf:
1127
runs-on: ${{ matrix.os }}
1228
strategy:
@@ -47,11 +63,18 @@ jobs:
4763
strategy:
4864
fail-fast: false
4965
matrix:
50-
os: [macos-latest, ubuntu-latest]
66+
include:
67+
- os: macos-latest
68+
regenerate_varimp: OFF
69+
- os: ubuntu-latest
70+
regenerate_varimp: ON
5171

5272
steps:
5373
- uses: actions/checkout@v4
5474

75+
- name: Install uv
76+
uses: astral-sh/setup-uv@v6
77+
5578
- name: Install Ubuntu build deps
5679
if: runner.os == 'Linux'
5780
shell: bash
@@ -68,6 +91,7 @@ jobs:
6891
run: >
6992
cmake $GITHUB_WORKSPACE
7093
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
94+
-DGECODE_REGENERATE_VARIMP=${{ matrix.regenerate_varimp }}
7195
7296
- name: Build
7397
working-directory: ${{github.workspace}}/build
@@ -95,8 +119,8 @@ jobs:
95119
steps:
96120
- uses: actions/checkout@v4
97121

98-
- name: Setup Perl
99-
uses: shogo82148/actions-setup-perl@v1
122+
- name: Install uv
123+
uses: astral-sh/setup-uv@v6
100124

101125
- name: Create Build Environment
102126
shell: pwsh
@@ -127,6 +151,9 @@ jobs:
127151
steps:
128152
- uses: actions/checkout@v4
129153

154+
- name: Install uv
155+
uses: astral-sh/setup-uv@v6
156+
130157
- name: Setup MSYS2
131158
uses: msys2/setup-msys2@v2
132159
with:
@@ -141,23 +168,36 @@ jobs:
141168
make
142169
m4
143170
libtool
144-
perl
145171
mingw-w64-ucrt-x86_64-gcc
146172
mingw-w64-ucrt-x86_64-gmp
147173
mingw-w64-ucrt-x86_64-mpfr
148174
175+
- name: Resolve uv path in MSYS2 shell
176+
shell: msys2 {0}
177+
run: |
178+
UV_DIR="$(cygpath "$USERPROFILE/.local/bin")"
179+
echo "UV_DIR=$UV_DIR" >> "$GITHUB_ENV"
180+
export PATH="$UV_DIR:$PATH"
181+
uv --version
182+
149183
- name: Stabilize generated configure script timestamp
150184
shell: msys2 {0}
151185
run: touch configure
152186

153187
- name: Configure
154188
shell: msys2 {0}
155-
run: CC=gcc CXX=g++ ./configure --with-host-os=Windows --disable-qt --disable-gist --disable-mpfr
189+
run: |
190+
export PATH="$UV_DIR:$PATH"
191+
CC=gcc CXX=g++ ./configure --with-host-os=Windows --disable-qt --disable-gist --disable-mpfr
156192
157193
- name: Build
158194
shell: msys2 {0}
159-
run: make test -j4
195+
run: |
196+
export PATH="$UV_DIR:$PATH"
197+
make test -j4
160198
161199
- name: Check
162200
shell: msys2 {0}
163-
run: make check
201+
run: |
202+
export PATH="$UV_DIR:$PATH"
203+
make check

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ including MPFR, allocator/audit toggles, visibility, and freelist sizes.
5555
By default, CMake uses checked-in `gecode/kernel/var-type.hpp` and
5656
`gecode/kernel/var-imp.hpp`; regeneration is opt-in via
5757
`-DGECODE_REGENERATE_VARIMP=ON`.
58+
Build-time script execution requires `uv` on `PATH`. Gecode does not check
59+
for Python directly; scripts are always run with `uv run --script ...`.
60+
When `-DGECODE_REGENERATE_VARIMP=ON` is set, CMake also requires `uv`.
5861

5962
Compatibility aliases are still accepted temporarily:
6063
`ENABLE_THREADS`, `ENABLE_GIST`, `BUILD_EXAMPLES`, `ENABLE_CPPROFILER`.

0 commit comments

Comments
 (0)