Skip to content

Commit a5d7bdc

Browse files
committed
Plumb the in-prefix tests into CI
(cherry picked from commit 9585ef9) (cherry picked from commit 53bb5a8) (cherry picked from commit 681df07)
1 parent c9c1af5 commit a5d7bdc

7 files changed

Lines changed: 73 additions & 13 deletions

File tree

.depend

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10620,7 +10620,6 @@ testsuite/tools/test_in_prefix.cmo : \
1062010620
driver/compmisc.cmi \
1062110621
testsuite/tools/cmdline.cmi \
1062210622
utils/clflags.cmi \
10623-
bytecomp/bytelink.cmi \
1062410623
testsuite/tools/test_in_prefix.cmi
1062510624
testsuite/tools/test_in_prefix.cmx : \
1062610625
otherlibs/unix/unix.cmx \
@@ -10638,7 +10637,6 @@ testsuite/tools/test_in_prefix.cmx : \
1063810637
driver/compmisc.cmx \
1063910638
testsuite/tools/cmdline.cmx \
1064010639
utils/clflags.cmx \
10641-
bytecomp/bytelink.cmx \
1064210640
testsuite/tools/test_in_prefix.cmi
1064310641
testsuite/tools/test_in_prefix.cmi :
1064410642
testsuite/tools/test_ld_conf.cmo : \

.github/workflows/build-msvc.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
// # Test Cygwin as well
5353
compilers.push('gcc');
5454
// # Test bytecode-only Cygwin
55-
include.push({cc: 'gcc', arch: 'x86_64', config_arg: '--disable-native-compiler'});
55+
include.push({cc: 'gcc', arch: 'x86_64', config_arg: '--disable-native-toplevel --disable-native-compiler'});
5656
}
5757
}
5858
return {config_arg: [''], arch: ['x86_64'], cc: compilers, include: include};
@@ -139,6 +139,8 @@ jobs:
139139
--prefix "${{ matrix.cc != 'gcc' && '$PROGRAMFILES/Бактріан🐫' || '$(cygpath "$PROGRAMFILES/Бактріан🐫")'}}"
140140
${{ matrix.cc != 'gcc' && format('--host={0}-pc-windows', matrix.arch) || '' }}
141141
${{ matrix.cc != 'gcc' && format('CC={0}', matrix.cc) || '' }}
142+
--enable-ocamltest
143+
${{ endsWith(matrix.arch, '64') && '--enable-native-toplevel' || '--disable-native-toplevel' }}
142144
${{ matrix.config_arg }}
143145
run: |
144146
eval $(tools/msvs-promote-path)
@@ -192,3 +194,8 @@ jobs:
192194
193195
- name: Install the compiler
194196
run: make install
197+
198+
- name: Test in prefix
199+
run: |
200+
eval $(tools/msvs-promote-path)
201+
make -f Makefile.test -C testsuite/in_prefix test-in-prefix

.github/workflows/build.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ jobs:
135135
if: matrix.id == 'normal'
136136
run: |
137137
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh install
138+
- name: Test in prefix
139+
if: matrix.id == 'normal'
140+
run: |
141+
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test-in-prefix
138142
- name: Build the manual
139143
if: matrix.id == 'normal' && needs.build.outputs.manual_changed == 'true'
140144
run: |
@@ -160,9 +164,12 @@ jobs:
160164
let jobs = [
161165
{name: 'linux-O0', os: 'ubuntu-latest',
162166
config_arg: "CFLAGS='-O0'"},
163-
{name: 'linux-arm64', os: 'ubuntu-24.04-arm'},
164-
{name: 'macos-x86_64', os: 'macos-15-intel'},
165-
{name: 'macos-arm64', os: 'macos-latest'}];
167+
{name: 'linux-arm64', os: 'ubuntu-24.04-arm',
168+
'test-in-prefix': true},
169+
{name: 'macos-x86_64', os: 'macos-15-intel',
170+
'test-in-prefix': true},
171+
{name: 'macos-arm64', os: 'macos-latest',
172+
'test-in-prefix': true}];
166173
// # If this is a pull request, see if the PR has the
167174
// # 'CI: Full matrix' label. This is done using an API request,
168175
// # rather than from context.payload.pull_request.labels, since we
@@ -178,9 +185,10 @@ jobs:
178185
// # Add "static" and "minimal" jobs
179186
jobs = jobs.concat([
180187
{name: 'static', os: 'ubuntu-latest',
181-
config_arg: '--disable-shared'},
188+
config_arg: '--disable-native-toplevel --disable-shared',
189+
'test-in-prefix': true},
182190
{name: 'minimal', os: 'ubuntu-latest',
183-
config_arg: '--disable-native-compiler --disable-shared --disable-debug-runtime --disable-instrumented-runtime --disable-systhreads --disable-str-lib --disable-unix-lib --disable-ocamldoc'}]);
191+
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'}]);
184192
}
185193
}
186194
return jobs;
@@ -234,6 +242,14 @@ jobs:
234242
for dir in $PARALLEL_TESTS; do \
235243
bash -cxe "SHOW_TIMINGS=1 tools/ci/actions/runner.sh test_prefix $dir"; \
236244
done
245+
- name: Install
246+
if: ${{ matrix.test-in-prefix }}
247+
run: |
248+
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh install
249+
- name: Test in prefix
250+
if: ${{ matrix.test-in-prefix }}
251+
run: |
252+
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test-in-prefix
237253
238254
i386:
239255
runs-on: ubuntu-latest
@@ -253,11 +269,17 @@ jobs:
253269
- name: configure tree
254270
run: |
255271
chown -R ocaml:ocaml .
256-
MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh configure"
272+
MAKE_ARG=-j CONFIG_ARG='--disable-native-toplevel' su ocaml -c "bash -xe tools/ci/actions/runner.sh configure"
257273
- name: Build
258274
run: |
259275
MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh build"
260276
- name: Run the testsuite
261277
if: ${{ needs.config.outputs.skip-testsuite != 'true' }}
262278
run: |
263279
su ocaml -c "bash -xe tools/ci/actions/runner.sh test"
280+
- name: Install
281+
run: |
282+
su ocaml -c "bash -xe tools/ci/actions/runner.sh install"
283+
- name: Test in prefix
284+
run: |
285+
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: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,18 @@ function set_configuration {
7474

7575
case "$1" in
7676
cygwin*)
77-
args+=('--disable-dependency-generation');;
77+
args+=('--disable-dependency-generation' '--enable-native-toplevel');;
7878
mingw32)
7979
args+=('--host=i686-w64-mingw32' '--disable-dependency-generation');;
8080
mingw64)
8181
args+=('--host=x86_64-w64-mingw32' '--disable-dependency-generation' \
82-
'--disable-stdlib-manpages');;
82+
'--disable-stdlib-manpages' '--enable-native-toplevel');;
8383
msvc32)
8484
args+=('--host=i686-pc-windows' '--disable-dependency-generation');;
8585
msvc64)
8686
# Explicitly test dependency generation on msvc64
87-
args+=('--host=x86_64-pc-windows' '--enable-dependency-generation');;
87+
args+=('--host=x86_64-pc-windows' '--enable-dependency-generation' \
88+
'--enable-native-toplevel');;
8889
esac
8990

9091
# Remove old configure cache if the configure script or the OS
@@ -194,6 +195,9 @@ case "$1" in
194195
make -C "$FULL_BUILD_PREFIX-$PORT/testsuite" SHOW_TIMINGS=1 all
195196
fi
196197
run "install $PORT" $MAKE -C "$FULL_BUILD_PREFIX-$PORT" install
198+
run "test $PORT in prefix" \
199+
$MAKE -f Makefile.test -C "$FULL_BUILD_PREFIX-$PORT/testsuite/in_prefix" \
200+
test-in-prefix
197201
if [[ $PORT = 'msvc64' ]] ; then
198202
run "$MAKE check_all_arches" \
199203
$MAKE -C "$FULL_BUILD_PREFIX-$PORT" check_all_arches

tools/ci/inria/main

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,16 @@ if test "$flambda" = "true"; then
287287
confoptions="$confoptions --enable-flambda --enable-flambda-invariants"
288288
fi
289289

290+
case $NODE_NAME in
291+
*-32|ocaml-ppc-64-be)
292+
# Native compilation not supported
293+
;;
294+
*)
295+
# Include ocamlnat (for the in-prefix tests) unless explicitly disabled:
296+
# a later --disable-native-toplevel will take precedence if present.
297+
confoptions="--enable-native-toplevel $confoptions";;
298+
esac
299+
290300
main_build() {
291301
eval ./configure "$CCOMP" $build $host --prefix='$instdir' $confoptions
292302

@@ -312,6 +322,18 @@ main_build() {
312322
fi
313323

314324
$make --warn-undefined-variables install
325+
case $confoptions in
326+
*--disable-unix-lib*) ;; # test-in-prefix needs Unix lib
327+
*--enable-tsan*) ;; # tsan currently breaks test-in-prefix
328+
# (see #14280)
329+
*)
330+
if ! $make -f Makefile.test -C testsuite/in_prefix test-in-prefix; then
331+
# Ensure the worker is cleaned up
332+
rm -rf "$instdir"
333+
exit 1
334+
fi
335+
;;
336+
esac
315337
rm -rf "$instdir"
316338
}
317339

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)