With bind mounts, the directories we bind mount to get recorded as
the meson source and build directories. This means meson will complain
if we later try to run meson install -C /work/build in the virtual
machine or container. If we use symlinks, the directories we symlink to
will be recorded as the meson source and build directories, which means
meson install -C /work/build will work when executed after booting the
VM or container.
I tried to do the same for debian as well but the debian package tooling
changes directory into the build directory and then does meson setup ..
which is completely broken when switching to a symlink.
exit 1
fi
-# We can't configure the source or build directory so we use bind mounts instead to make sure they are in the
+# We can't configure the source or build directory so we use symlinks instead to make sure they are in the
# expected locations.
-mount --mkdir --bind "$SRCDIR" "pkg/$ID/systemd-stable/"
-mount --mkdir --bind "$BUILDDIR" "pkg/$ID/build/"
+ln --symbolic "$SRCDIR" "pkg/$ID/systemd-stable"
+ln --symbolic "$BUILDDIR" "pkg/$ID/build"
# Because we run with --noextract we are responsible for making sure the source files appear in src/.
-mount --mkdir --rbind "$PWD/pkg/$ID" "pkg/$ID/src/"
+ln --symbolic . "pkg/$ID/src"
# shellcheck source=/dev/null
. /etc/makepkg.conf