Skip to content

Commit ff34ae3

Browse files
committed
Support absolute bindir/libdir in regression tests with meson
Passing an absolute bindir/libdir will install the binaries and libraries to <build>/tmp_install/<bindir> and <build>/tmp_install/<libdir> respectively. This path is correctly passed to the regression test suite via configure/make, but not via meson, yet. This is because the "/" operator in the following expression throws away the whole left side when the right side is an absolute path: test_install_location / get_option('libdir') This was already correctly handled for dir_prefix, which is likely absolute as well. This patch handles both bindir and libdir in the same way - prefixing absolute paths with the tmp_install path correctly. Author: Wolfgang Walther Reviewed-by: Nazir Bilal Yavuz, Alvaro Herrera, Peter Eisentraut Reviewed-by: Tristan Partin Discussion: https://www.postgresql.org/message-id/ca8f37e1-a2c3-40e2-91f6-59c3d3652ad4@technowledgy.de Backpatch: 16-, where meson support was added
1 parent 4d8de28 commit ff34ae3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

meson.build

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,15 +3270,17 @@ test_install_destdir = meson.build_root() / 'tmp_install/'
32703270
if build_system != 'windows'
32713271
# On unixoid systems this is trivial, we just prepend the destdir
32723272
assert(dir_prefix.startswith('/')) # enforced by meson
3273-
test_install_location = '@0@@1@'.format(test_install_destdir, dir_prefix)
3273+
temp_install_bindir = '@0@@1@'.format(test_install_destdir, dir_prefix / dir_bin)
3274+
temp_install_libdir = '@0@@1@'.format(test_install_destdir, dir_prefix / dir_lib)
32743275
else
32753276
# drives, drive-relative paths, etc make this complicated on windows, call
32763277
# into a copy of meson's logic for it
32773278
command = [
32783279
python, '-c',
32793280
'import sys; from pathlib import PurePath; d1=sys.argv[1]; d2=sys.argv[2]; print(str(PurePath(d1, *PurePath(d2).parts[1:])))',
3280-
test_install_destdir, dir_prefix]
3281-
test_install_location = run_command(command, check: true).stdout().strip()
3281+
test_install_destdir]
3282+
temp_install_bindir = run_command(command, dir_prefix / dir_bin, check: true).stdout().strip()
3283+
temp_install_libdir = run_command(command, dir_prefix / dir_lib, check: true).stdout().strip()
32823284
endif
32833285

32843286
meson_install_args = meson_args + ['install'] + {
@@ -3315,7 +3317,6 @@ testport = 40000
33153317

33163318
test_env = environment()
33173319

3318-
temp_install_bindir = test_install_location / get_option('bindir')
33193320
test_initdb_template = meson.build_root() / 'tmp_install' / 'initdb-template'
33203321
test_env.set('PG_REGRESS', pg_regress.full_path())
33213322
test_env.set('REGRESS_SHLIB', regress_module.full_path())
@@ -3330,7 +3331,7 @@ test_env.set('PG_TEST_EXTRA', get_option('PG_TEST_EXTRA'))
33303331
# that works (everything but windows, basically). On windows everything
33313332
# library-like gets installed into bindir, solving that issue.
33323333
if library_path_var != ''
3333-
test_env.prepend(library_path_var, test_install_location / get_option('libdir'))
3334+
test_env.prepend(library_path_var, temp_install_libdir)
33343335
endif
33353336

33363337

0 commit comments

Comments
 (0)