Skip to content

Commit a51aa40

Browse files
committed
Plumb the in-prefix tests into CI
(cherry picked from commit 9585ef9) (cherry picked from commit 53bb5a8)
1 parent 762891d commit a51aa40

6 files changed

Lines changed: 66 additions & 8 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: 26 additions & 4 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: false
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,7 +168,8 @@ 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-shared',
172+
'test-in-prefix': true},
165173
{name: 'minimal', os: 'ubuntu-latest',
166174
config_arg: '--disable-native-compiler --disable-shared --disable-debug-runtime --disable-instrumented-runtime --disable-systhreads --disable-str-lib --disable-unix-lib --disable-ocamldoc'}]);
167175
}
@@ -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
@@ -235,3 +251,9 @@ jobs:
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ Install () {
143143
$MAKE install
144144
}
145145

146+
Test-In-Prefix () {
147+
$MAKE -C testsuite/in_prefix -f Makefile.test test-in-prefix
148+
}
149+
146150
Checks () {
147151
if fgrep 'SUPPORTS_SHARED_LIBRARIES=true' Makefile.config &>/dev/null ; then
148152
echo Check the code examples in the manual
@@ -232,6 +236,7 @@ test_sequential) Test sequential;;
232236
test_prefix) TestPrefix $2;;
233237
api-docs) API_Docs;;
234238
install) Install;;
239+
test-in-prefix) Test-In-Prefix;;
235240
manual) BuildManual;;
236241
other-checks) Checks;;
237242
basic-compiler) BasicCompiler;;

tools/ci/appveyor/appveyor_build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ case "$1" in
173173
run "test $PORT" $MAKE -C "$FULL_BUILD_PREFIX-$PORT" tests
174174
fi
175175
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
176179
if [[ $PORT = 'msvc64' ]] ; then
177180
run "$MAKE check_all_arches" \
178181
$MAKE -C "$FULL_BUILD_PREFIX-$PORT" check_all_arches
@@ -228,7 +231,8 @@ case "$1" in
228231
"( test "$BOOTSTRAP_FLEXDLL" = 'false' || "\
229232
"$MAKE -C ../$BUILD_PREFIX-$PORT flexdll ) && "\
230233
"if ! $MAKE -j $build; then $MAKE $build; exit 1; fi && "\
231-
"$MAKE -C ../$BUILD_PREFIX-$PORT flexlink.opt" \
234+
"$MAKE -C ../$BUILD_PREFIX-$PORT flexlink.opt && "\
235+
"$MAKE -C ../$BUILD_PREFIX-$PORT ocamlnat" \
232236
"../$BUILD_PREFIX-$PORT/build.log" |
233237
sed --unbuffered \
234238
-e 's/\d027\[K//g' \
@@ -241,7 +245,8 @@ case "$1" in
241245
run "$MAKE world" $MAKE world
242246
run "$MAKE bootstrap" $MAKE bootstrap
243247
run "$MAKE opt" $MAKE opt
244-
run "$MAKE opt.opt" $MAKE opt.opt;;
248+
run "$MAKE opt.opt" $MAKE opt.opt
249+
run "$MAKE ocamlnat" $MAKE ocamlnat;;
245250
C)
246251
run "$MAKE world" $MAKE world
247252
run "$MAKE runtimeopt" $MAKE runtimeopt

tools/ci/inria/main

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ main_build() {
268268
eval ./configure "$CCOMP" $build $host --prefix='$instdir' $confoptions
269269

270270
grep -q '^NATIVE_COMPILER=false' Makefile.config && make_native=false
271+
make_ocamlnat=$make_native
272+
grep -q '^NATDYNLINK=false' Makefile.config && make_ocamlnat=false
271273

272274
if $init_submodule; then
273275
$make $jobs --warn-undefined-variables flexdll
@@ -278,6 +280,9 @@ main_build() {
278280
$make $jobs --warn-undefined-variables coreboot
279281
if $make_native; then
280282
$make $jobs --warn-undefined-variables opt.opt
283+
if $make_ocamlnat; then
284+
$make $jobs --warn-undefined-variables ocamlnat
285+
fi
281286
if $init_submodule; then
282287
$make $jobs --warn-undefined-variables flexlink.opt
283288
fi
@@ -286,6 +291,9 @@ main_build() {
286291
fi
287292
else
288293
$make $jobs --warn-undefined-variables
294+
if $make_ocamlnat; then
295+
$make $jobs --warn-undefined-variables ocamlnat
296+
fi
289297
if $make_native && $init_submodule; then
290298
$make $jobs --warn-undefined-variables flexlink.opt
291299
fi
@@ -296,6 +304,16 @@ main_build() {
296304
fi
297305

298306
$make --warn-undefined-variables install
307+
case $confoptions in
308+
*--disable-unix-lib*) ;; # test-in-prefix needs Unix lib
309+
*)
310+
if ! $make -f Makefile.test -C testsuite/in_prefix test-in-prefix; then
311+
# Ensure the worker is cleaned up
312+
rm -rf "$instdir"
313+
exit 1
314+
fi
315+
;;
316+
esac
299317
rm -rf "$instdir"
300318
}
301319

tools/ci/inria/other-configs/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ 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 \

0 commit comments

Comments
 (0)