Skip to content

Commit

Permalink
fix external_project failing due to the drive letter in the path on W…
Browse files Browse the repository at this point in the history
…indows
  • Loading branch information
na-trium-144 committed Nov 17, 2024
1 parent 1985ad1 commit fdc35d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
11 changes: 11 additions & 0 deletions mesonbuild/modules/external_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ def _configure(self, state: 'ModuleState') -> None:
configure_path = Path(self.src_dir, self.configure_command)
configure_prog = state.find_program(configure_path.as_posix())
configure_cmd = configure_prog.get_command()
# On Windows the configure command should be converted to
# unix style path by cygpath command,
# because the colon in the drive letter breaks many configure scripts.
if (
configure_path.drive
and len(configure_cmd) >= 2
and configure_cmd[-1] == configure_path.as_posix()
):
cygpath = state.find_program('cygpath').get_command()
_p, o, _e = Popen_safe(cygpath + [configure_cmd[-1]])
configure_cmd = configure_cmd[:-1] + [Path(o.strip()).as_posix()]
workdir = self.build_dir
self.make = state.find_program('make').get_command()

Expand Down
9 changes: 9 additions & 0 deletions test cases/common/230 external project/libfoo/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#! /bin/sh

srcdir=$(dirname "$0")
IFS=:
for i in $srcdir
do
if [ "$i" != "$srcdir" ]
then
echo "srcdir $srcdir is not posix path"
exit 1
fi
done

for i in "$@"
do
Expand Down
4 changes: 0 additions & 4 deletions test cases/common/230 external project/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ if not find_program('make', required : false).found()
error('MESON_SKIP_TEST: make not found')
endif

if host_machine.system() == 'windows'
error('MESON_SKIP_TEST: The fake configure script is too dumb to work on Windows')
endif

if meson.is_cross_build()
# CI uses PKG_CONFIG_SYSROOT_DIR which breaks -uninstalled.pc usage.
error('MESON_SKIP_TEST: Cross build support is too limited for this test')
Expand Down

0 comments on commit fdc35d9

Please sign in to comment.