Skip to content

Commit

Permalink
Replace environment checks with check for builder container
Browse files Browse the repository at this point in the history
The builder container is now ABI versioned.  Assume that the v1 ABI has
cross-compilers that use the win32 thread model.

Also drop the Wine binfmt_misc check, which is probably irrelevant now
that we're building through Meson.  In any event, the container doesn't
have Wine, so attempts to run it via binfmt_misc will fail.

Signed-off-by: Benjamin Gilbert <[email protected]>
  • Loading branch information
bgilbert committed Sep 30, 2023
1 parent bf3c055 commit acdfbb8
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ updates() {

probe() {
# Probe the build environment and set up variables
if [ ! -e /etc/openslide-winbuild-builder-v1 ]; then
echo "Must run inside the builder container. See README.md."
exit 1
fi

build="${build_bits}/build"
root="$(pwd)/${build_bits}/root"

Expand All @@ -458,28 +463,6 @@ probe() {
ld=$(meson_config_key "${cross_file}" binaries ld | tr -d "'")
objcopy=$(meson_config_key "${cross_file}" binaries objcopy | tr -d "'")
objdump=$(meson_config_key "${cross_file}" binaries objdump | tr -d "'")
if ! type ${cc} >/dev/null 2>&1 ; then
echo "Couldn't find suitable compiler."
exit 1
fi
if ! ${cc} -v 2>&1 | grep -q "Thread model: win32" ; then
echo "Compiler doesn't use win32 thread model."
exit 1
fi

# Ensure Wine is not run via binfmt_misc, since some packages
# attempt to run programs after building them.
for hdr in PE MZ
do
echo $hdr > conftest
chmod +x conftest
if ./conftest >/dev/null 2>&1 || [ $? = 193 ]; then
rm conftest
echo "Wine is enabled in binfmt_misc. Please disable it."
exit 1
fi
rm conftest
done
}

fail_handler() {
Expand Down

0 comments on commit acdfbb8

Please sign in to comment.