Skip to content

Commit cd717a8

Browse files
committed
Plumb the in-prefix tests into CI
(cherry picked from commit 9585ef9) (cherry picked from commit 53bb5a8)
1 parent 8f0ceaf commit cd717a8

6 files changed

Lines changed: 67 additions & 9 deletions

File tree

.github/workflows/build-msvc.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
if (labels.some(label => label.name === 'CI: Full matrix')) {
5959
console.log('Full matrix requested');
6060
// # Test bytecode-only Cygwin
61-
include.push({cc: 'gcc', arch: 'x86_64', config_arg: '--disable-native-compiler'});
61+
include.push({cc: 'gcc', arch: 'x86_64', config_arg: '--disable-native-toplevel --disable-native-compiler'});
6262
}
6363
}
6464
return {config_arg: [''], arch: ['x86_64'], cc: compilers, include: include};
@@ -156,6 +156,8 @@ jobs:
156156
--prefix "${{ matrix.cc != 'gcc' && '$PROGRAMFILES/Бактріан🐫' || '$(cygpath "$PROGRAMFILES/Бактріан🐫")'}}"
157157
${{ matrix.cc != 'gcc' && format('--host={0}-pc-windows', matrix.arch) || '' }}
158158
${{ matrix.cc != 'gcc' && format('CC={0}', matrix.cc) || '' }}
159+
--enable-ocamltest
160+
${{ endsWith(matrix.arch, '64') && '--enable-native-toplevel' || '--disable-native-toplevel' }}
159161
${{ matrix.config_arg }}
160162
run: |
161163
eval $(tools/msvs-promote-path)
@@ -213,3 +215,9 @@ jobs:
213215
- name: Install the compiler
214216
run: make install
215217
if: needs.config.outputs.full-matrix == 'true'
218+
219+
- name: Test in prefix
220+
run: |
221+
eval $(tools/msvs-promote-path)
222+
make -f Makefile.test -C testsuite/in_prefix test-in-prefix
223+
if: needs.config.outputs.full-matrix == 'true'

.github/workflows/build.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ jobs:
118118
if: matrix.id == 'normal'
119119
run: |
120120
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh install
121+
- name: Test in prefix
122+
if: matrix.id == 'normal'
123+
run: |
124+
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test-in-prefix
121125
- name: Build the manual
122126
if: matrix.id == 'normal' && needs.build.outputs.manual_changed == 'true'
123127
run: |
@@ -143,9 +147,12 @@ jobs:
143147
let jobs = [
144148
{name: 'no-naked-pointers', os: 'ubuntu-latest',
145149
config_arg: '--disable-naked-pointers --disable-stdlib-manpages'},
146-
{name: 'linux-arm64', os: 'ubuntu-24.04-arm'},
147-
{name: 'macos-x86_64', os: 'macos-15-intel'},
148-
{name: 'macos-arm64', os: 'macos-latest'}];
150+
{name: 'linux-arm64', os: 'ubuntu-24.04-arm',
151+
'test-in-prefix': true},
152+
{name: 'macos-x86_64', os: 'macos-15-intel',
153+
'test-in-prefix': true},
154+
{name: 'macos-arm64', os: 'macos-latest',
155+
'test-in-prefix': true}];
149156
// # If this is a pull request, see if the PR has the
150157
// # 'CI: Full matrix' label. This is done using an API request,
151158
// # rather than from context.payload.pull_request.labels, since we
@@ -161,9 +168,10 @@ jobs:
161168
// # Add "static" and "minimal" jobs
162169
jobs = jobs.concat([
163170
{name: 'static', os: 'ubuntu-latest',
164-
config_arg: '--disable-shared'},
171+
config_arg: '--disable-native-toplevel --disable-shared',
172+
'test-in-prefix': true},
165173
{name: 'minimal', os: 'ubuntu-latest',
166-
config_arg: '--disable-native-compiler --disable-shared --disable-debug-runtime --disable-instrumented-runtime --disable-systhreads --disable-str-lib --disable-unix-lib --disable-ocamldoc'}]);
174+
config_arg: '--disable-native-toplevel --disable-native-compiler --disable-shared --disable-debug-runtime --disable-instrumented-runtime --disable-systhreads --disable-str-lib --disable-unix-lib --disable-ocamldoc'}]);
167175
}
168176
}
169177
return jobs;
@@ -208,6 +216,14 @@ jobs:
208216
if: ${{ matrix.name != 'linux-O0' && needs.config.outputs.skip-testsuite != 'true' }}
209217
run: |
210218
bash -c 'SHOW_TIMINGS=1 tools/ci/actions/runner.sh test'
219+
- name: Install
220+
if: ${{ matrix.test-in-prefix }}
221+
run: |
222+
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh install
223+
- name: Test in prefix
224+
if: ${{ matrix.test-in-prefix }}
225+
run: |
226+
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test-in-prefix
211227
212228
i386:
213229
runs-on: ubuntu-latest
@@ -227,11 +243,17 @@ jobs:
227243
- name: configure tree
228244
run: |
229245
chown -R ocaml:ocaml .
230-
MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh configure"
246+
MAKE_ARG=-j CONFIG_ARG='--disable-native-toplevel' su ocaml -c "bash -xe tools/ci/actions/runner.sh configure"
231247
- name: Build
232248
run: |
233249
MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh build"
234250
- name: Run the testsuite
235251
if: ${{ needs.config.outputs.skip-testsuite != 'true' }}
236252
run: |
237253
su ocaml -c "bash -xe tools/ci/actions/runner.sh test"
254+
- name: Install
255+
run: |
256+
su ocaml -c "bash -xe tools/ci/actions/runner.sh install"
257+
- name: Test in prefix
258+
run: |
259+
su ocaml -c "bash -xe tools/ci/actions/runner.sh test-in-prefix"

tools/ci/actions/runner.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ EOF
5858
call-configure --prefix="$PREFIX" \
5959
--enable-flambda-invariants \
6060
--enable-ocamltest \
61+
--enable-native-toplevel \
6162
--disable-dependency-generation \
6263
$CONFIG_ARG
6364
}
@@ -127,6 +128,10 @@ Install () {
127128
$MAKE install
128129
}
129130

131+
Test-In-Prefix () {
132+
$MAKE -C testsuite/in_prefix -f Makefile.test test-in-prefix
133+
}
134+
130135
Checks () {
131136
if fgrep 'SUPPORTS_SHARED_LIBRARIES=true' Makefile.config &>/dev/null ; then
132137
echo Check the code examples in the manual
@@ -217,6 +222,7 @@ test_sequential) Test sequential;;
217222
test_prefix) TestPrefix $2;;
218223
api-docs) API_Docs;;
219224
install) Install;;
225+
test-in-prefix) Test-In-Prefix;;
220226
manual) BuildManual;;
221227
other-checks) Checks;;
222228
basic-compiler) BasicCompiler;;

tools/ci/appveyor/appveyor_build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ function set_configuration {
7070
CACHE_FILE_PREFIX="$CACHE_DIRECTORY/config.cache-$1"
7171
CACHE_FILE="$CACHE_FILE_PREFIX-$CACHE_KEY"
7272

73-
args=('--cache-file' "$CACHE_FILE" '--prefix' "$2" '--enable-ocamltest')
73+
args=('--cache-file' "$CACHE_FILE" '--prefix' "$2" \
74+
'--enable-native-toplevel' '--enable-ocamltest')
7475

7576
case "$1" in
7677
cygwin*)
@@ -172,6 +173,9 @@ case "$1" in
172173
run "test $PORT" $MAKE -C "$FULL_BUILD_PREFIX-$PORT" tests
173174
fi
174175
run "install $PORT" $MAKE -C "$FULL_BUILD_PREFIX-$PORT" install
176+
run "test $PORT in prefix" \
177+
$MAKE -f Makefile.test -C "$FULL_BUILD_PREFIX-$PORT/testsuite/in_prefix" \
178+
test-in-prefix
175179
if [[ $PORT = 'msvc64' ]] ; then
176180
run "$MAKE check_all_arches" \
177181
$MAKE -C "$FULL_BUILD_PREFIX-$PORT" check_all_arches

tools/ci/inria/main

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ if $flambda; then
260260
--disable-naked-pointers"
261261
fi
262262

263+
case $NODE_NAME in
264+
*)
265+
# Include ocamlnat (for the in-prefix tests) unless explicitly disabled:
266+
# a later --disable-native-toplevel will take precedence if present.
267+
confoptions="--enable-native-toplevel $confoptions";;
268+
esac
269+
263270
main_build() {
264271
eval ./configure "$CCOMP" $build $host --prefix='$instdir' $confoptions
265272

@@ -282,6 +289,16 @@ main_build() {
282289
fi
283290

284291
$make --warn-undefined-variables install
292+
case $confoptions in
293+
*--disable-unix-lib*) ;; # test-in-prefix needs Unix lib
294+
*)
295+
if ! $make -f Makefile.test -C testsuite/in_prefix test-in-prefix; then
296+
# Ensure the worker is cleaned up
297+
rm -rf "$instdir"
298+
exit 1
299+
fi
300+
;;
301+
esac
285302
rm -rf "$instdir"
286303
}
287304

tools/ci/inria/other-configs/script

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ build() {
3737
# The "MIN_BUILD" (formerly on Travis) builds with everything disabled (apart
3838
# from ocamltest). Its goals:
3939
# - Ensure that the system builds correctly without native compilation
40-
# - Ensure ocamltest builds correctly with Unix
40+
# - Ensure ocamltest builds correctly without Unix
4141
# - Ensure the testsuite runs correctly with everything switched off
4242
build "minimal build" \
4343
-conf --disable-native-compiler \
44+
-conf --disable-native-toplevel \
4445
-conf --disable-shared \
4546
-conf --disable-debug-runtime \
4647
-conf --disable-instrumented-runtime \

0 commit comments

Comments
 (0)