···4141 matrix:
4242 - PORT: mingw64
4343 BOOTSTRAP_FLEXDLL: true
4444+ RELOCATABLE: true
4445# OCaml 5.0 does not yet support MSVC
4546# - PORT: msvc64
4647# BOOTSTRAP_FLEXDLL: false
+83
tools/ci/actions/runner.sh
···128128 $MAKE install
129129}
130130131131+target_libdir_is_relative='^ *TARGET_LIBDIR_IS_RELATIVE *= *false'
132132+131133Test-In-Prefix () {
134134+ { set +x
135135+ echo 'Checking that compilers invoked with alternate runtimes use their'
136136+ echo "configured location, not the alternate runtime's"
137137+ expected1="$(realpath "$PREFIX/lib/ocaml")"
138138+ } 2>/dev/null
139139+ if [[ ! -d "$PREFIX.new" ]]; then
140140+ # In Re-Test-In-Prefix, $PREFIX is the original compiler built by the
141141+ # workflow and then $PREFIX.new is the "alternate configuration". The first
142142+ # time round, we clone whichever compiler has just been built for this test.
143143+ cp -a "$PREFIX" "$PREFIX.new"
144144+ remove="$PREFIX.new"
145145+ if grep -q "$target_libdir_is_relative" Makefile.build_config; then
146146+ # Compiler configured absolutely - both should return the same answer
147147+ expected2="$expected1"
148148+ else
149149+ # Compiler configured relatively
150150+ expected2="$(realpath "$PREFIX").new/lib/ocaml"
151151+ fi
152152+ else
153153+ # The alternate configuration path should be returned, regardless of whether
154154+ # the runtime invoking it is an absolute or a relative one from another
155155+ # location.
156156+ expected2="$(realpath "$PREFIX").new/lib/ocaml-lib"
157157+ remove=''
158158+ fi
159159+ { set +x
160160+ lib1="$($PREFIX.new/bin/ocamlrun $PREFIX/bin/ocamlc.byte -where)"
161161+ lib2="$($PREFIX/bin/ocamlrun $PREFIX.new/bin/ocamlc.byte -where)"
162162+ echo "$PREFIX/bin/ocamlc.byte OSLD: $($PREFIX/bin/ocamlrun \
163163+ $PREFIX/bin/ocamlobjinfo.byte $PREFIX/bin/ocamlc.byte \
164164+ | sed -ne 's/^caml_standard_library_default: //p')"
165165+ echo -n "$PREFIX.new/bin/ocamlrun standard_library_default: "
166166+ $PREFIX.new/bin/ocamlrun -config | sed -ne 's/standard_library_default: //p'
167167+ echo "$PREFIX.new/bin/ocamlrun $PREFIX/bin/ocamlc.byte -where: $lib1"
168168+ if [[ $lib1 != $expected1 ]]; then
169169+ echo -e ' \e[31mEXPECTED\e[0m:' "$expected1"
170170+ fi
171171+ echo
172172+ echo "$PREFIX.new/bin/ocamlc.byte OSLD: $($PREFIX.new/bin/ocamlrun \
173173+ $PREFIX.new/bin/ocamlobjinfo.byte $PREFIX.new/bin/ocamlc.byte \
174174+ | sed -ne 's/^caml_standard_library_default: //p')"
175175+ echo -n "$PREFIX/bin/ocamlrun standard_library_default: "
176176+ $PREFIX/bin/ocamlrun -config | sed -ne 's/standard_library_default: //p'
177177+ echo "$PREFIX/bin/ocamlrun $PREFIX.new/bin/ocamlc.byte -where: $lib2"
178178+ if [[ $lib2 != $expected2 ]]; then
179179+ echo -e ' \e[31mEXPECTED\e[0m:' "$expected2"
180180+ fi
181181+ [[ $lib1 = $expected1 && $lib2 = $expected2 ]] && echo 'Correct.' || exit 1
182182+ } 2>/dev/null
183183+ [[ -z $remove ]] || rm -rf "$remove"
132184 $MAKE -C testsuite/in_prefix -f Makefile.test test-in-prefix
185185+}
186186+187187+Re-Test-In-Prefix () {
188188+ mkdir -p bak
189189+ mv Makefile.config Makefile.build_config config.status bak
190190+ git clean -dfX &>/dev/null
191191+ mv bak/Makefile.config bak/Makefile.build_config bak/config.status .
192192+ rmdir bak
193193+ # The libdir is configured to be $PREFIX.new/lib/ocaml-lib in order to
194194+ # "poison" the cross-runtime test (otherwise if $PREFIX/bin/ocamlc.byte is
195195+ # missing OSLD, then $PREFIX.new/bin/ocamlrun would still supply the correct
196196+ # ../lib/ocaml. This way, it supplies ../lib/ocaml-lib and the test correctly
197197+ # fails)
198198+ if grep -q "$target_libdir_is_relative" Makefile.build_config; then
199199+ # Compiler configured absolutely - reconfigure relatively
200200+ echo '::group::Re-building the compiler with a relative libdir'
201201+ $MAKE COMPUTE_DEPS=false reconfigure \
202202+ 'ADDITIONAL_CONFIGURE_ARGS=--with-relative-libdir=../lib/ocaml-lib \
203203+--prefix='"$PREFIX"'.new'
204204+ else
205205+ # Compiler configured relatively - reconfigure absolutely
206206+ echo '::group::Re-building the compiler with an absolute libdir'
207207+ $MAKE COMPUTE_DEPS=false reconfigure \
208208+ 'ADDITIONAL_CONFIGURE_ARGS=--without-relative-libdir \
209209+--prefix='"$PREFIX"'.new --libdir='"$PREFIX"'.new/lib/ocaml-lib'
210210+ fi
211211+ $MAKE
212212+ $MAKE install
213213+ echo '::endgroup::'
214214+ Test-In-Prefix
133215}
134216135217Checks () {
···223305api-docs) API_Docs;;
224306install) Install;;
225307test-in-prefix) Test-In-Prefix;;
308308+re-test-in-prefix) Re-Test-In-Prefix;;
226309manual) BuildManual;;
227310other-checks) Checks;;
228311basic-compiler) BasicCompiler;;
+3
tools/ci/appveyor/appveyor_build.sh
···7676 args+=('--host=x86_64-pc-windows' '--enable-dependency-generation' \
7777 '--enable-native-toplevel');;
7878 esac
7979+ if [[ $RELOCATABLE = 'true' ]]; then
8080+ args+=('--with-relative-libdir')
8181+ fi
79828083 # Remove old configure cache if the configure script or the OS
8184 # have changed