mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
meson: Prevent installation of test files during main install
Previously, meson installed modules under src/test/modules/ as part of a normal installation, even though these files are only meant for use by tests. This is because there is no way to set up up the build system to install extra things only when told. This patch fixes that with a workaround: We don't install these modules as part of meson install, but we create a new "test" that runs before the real tests whose action it is to install these files. The installation is done by manual copies using a small helper script. Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/2a039e8e-f31f-31e8-afe7-bab3130ad2de%40enterprisedb.com
This commit is contained in:
28
src/tools/install_test_files
Normal file
28
src/tools/install_test_files
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Helper to install additional files into the temporary installation
|
||||
# for tests, beyond those that are installed by meson/ninja install.
|
||||
|
||||
import argparse
|
||||
import shutil
|
||||
import os
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('--datadir', type=str)
|
||||
parser.add_argument('--libdir', type=str)
|
||||
parser.add_argument('--install-data', type=str, nargs='*')
|
||||
parser.add_argument('--install-libs', type=str, nargs='*')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
def copy_files(src_list: list, dest: str):
|
||||
os.makedirs(dest, exist_ok=True)
|
||||
|
||||
for src in src_list:
|
||||
shutil.copy2(src, dest)
|
||||
|
||||
|
||||
copy_files(args.install_data, args.datadir)
|
||||
copy_files(args.install_libs, args.libdir)
|
Reference in New Issue
Block a user