From f9a7ac11f59927642a7df6beabec129fe463cb23 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 20 Mar 2025 12:27:21 +0000 Subject: [PATCH 1/4] gstdio: Add support for the `e` flag (O_CLOEXEC) to g_fopen() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds cross-platform support for it: on glibc, musl and BSD’s libc, the flag is natively supported. On Windows, convert it to the `N` flag, which similarly indicates that an open file shouldn’t be inherited by child processes. This allows us to unconditionally pass `e` to `g_fopen()` so `O_CLOEXEC` can easily be set on its FDs. Also do the same for `g_freopen()`, since it shares the same underlying mode handling code. Signed-off-by: Philip Withnall --- gio/gdbus-tool.c | 3 ++- gio/gdbusaddress.c | 8 +------ gio/gdbusprivate.c | 2 +- gio/glib-compile-resources.c | 4 ++-- gio/gunixmounts.c | 5 +++-- gio/tests/g-file-info.c | 6 +++--- gio/tests/live-g-file.c | 3 ++- girepository/compiler/compiler.c | 2 +- girepository/gdump.c | 5 +++-- girepository/girwriter.c | 2 +- glib/deprecated/gcompletion.c | 3 ++- glib/gcharset.c | 3 ++- glib/gfileutils.c | 4 ++-- glib/glib-mirroring-tab/gen-mirroring-tab.c | 3 ++- glib/grand.c | 3 ++- glib/gstdio.c | 23 ++++++++++++++++++++- glib/tests/fileutils.c | 6 +++--- glib/tests/unicode.c | 5 +++-- 18 files changed, 57 insertions(+), 33 deletions(-) diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c index 5e6c172dc..56597d3f2 100644 --- a/gio/gdbus-tool.c +++ b/gio/gdbus-tool.c @@ -34,6 +34,7 @@ #endif #include +#include #ifdef G_OS_WIN32 #include "glib/glib-private.h" @@ -71,7 +72,7 @@ completion_debug (const gchar *format, ...) s = g_strdup_vprintf (format, var_args); if (f == NULL) { - f = fopen ("/tmp/gdbus-completion-debug.txt", "a+"); + f = g_fopen ("/tmp/gdbus-completion-debug.txt", "a+e"); } fprintf (f, "%s\n", s); g_free (s); diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c index 1b62247fa..4db3fc3c1 100644 --- a/gio/gdbusaddress.c +++ b/gio/gdbusaddress.c @@ -53,12 +53,6 @@ #include #endif -#ifdef G_OS_WIN32 -#define FO_CLOEXEC "" -#else -#define FO_CLOEXEC "e" -#endif - #include "glibintl.h" /** @@ -720,7 +714,7 @@ g_dbus_address_connect (const gchar *address_entry, int errsv; /* be careful to read only 16 bytes - we also check that the file is only 16 bytes long */ - f = fopen (nonce_file, "rb" FO_CLOEXEC); + f = g_fopen (nonce_file, "rbe"); errsv = errno; if (f == NULL) { diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c index 28083e4ed..c68e3f620 100644 --- a/gio/gdbusprivate.c +++ b/gio/gdbusprivate.c @@ -2195,7 +2195,7 @@ unpublish_session_bus (void) static void wait_console_window (void) { - FILE *console = fopen ("CONOUT$", "w"); + FILE *console = g_fopen ("CONOUT$", "we"); SetConsoleTitleW (L"gdbus-daemon output. Type any character to close this window."); fprintf (console, _("(Type any character to close this window)\n")); diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c index 98721f392..f5444711c 100644 --- a/gio/glib-compile-resources.c +++ b/gio/glib-compile-resources.c @@ -1131,7 +1131,7 @@ main (int argc, char **argv) { FILE *file; - file = fopen (target, "w"); + file = g_fopen (target, "we"); if (file == NULL) { g_printerr ("can't write to file %s", target); @@ -1180,7 +1180,7 @@ main (int argc, char **argv) } g_unlink (binary_target); - file = fopen (target, "w"); + file = g_fopen (target, "we"); if (file == NULL) { g_printerr ("can't write to file %s", target); diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c index c0247227c..009d6855f 100644 --- a/gio/gunixmounts.c +++ b/gio/gunixmounts.c @@ -79,6 +79,7 @@ extern char* hasmntopt(const struct mntent* mnt, const char* opt); #include "gfilemonitor.h" #include "glibintl.h" #include "glocalfile.h" +#include "gstdio.h" #include "gthemedicon.h" #include "gcontextspecificgroup.h" @@ -202,7 +203,7 @@ static GSource *proc_mounts_watch_source = NULL; #endif #ifndef HAVE_SETMNTENT -#define setmntent(f,m) fopen(f,m) +#define setmntent(f,m) g_fopen (f, m) #endif #ifndef HAVE_ENDMNTENT #define endmntent(f) fclose(f) @@ -3965,7 +3966,7 @@ _resolve_dev_root (void) /* see if device with similar major:minor as /dev/root is mention * in /etc/mtab (it usually is) */ - f = fopen ("/etc/mtab", "re"); + f = g_fopen ("/etc/mtab", "re"); if (f != NULL) { struct mntent *entp; diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c index 9d97d5ac4..51e6aa534 100644 --- a/gio/tests/g-file-info.c +++ b/gio/tests/g-file-info.c @@ -792,7 +792,7 @@ test_internal_enhanced_stdio (void) g_remove (ps); - f = g_fopen (ps, "wb"); + f = g_fopen (ps, "wbe"); g_assert_nonnull (f); h = (HANDLE) _get_osfhandle (fileno (f)); @@ -875,7 +875,7 @@ test_internal_enhanced_stdio (void) g_assert_true (SystemTimeToFileTime (&st, &ft)); - f = g_fopen (p0, "w"); + f = g_fopen (p0, "we"); g_assert_nonnull (f); h = (HANDLE) _get_osfhandle (fileno (f)); @@ -888,7 +888,7 @@ test_internal_enhanced_stdio (void) fclose (f); - f = g_fopen (p1, "w"); + f = g_fopen (p1, "we"); g_assert_nonnull (f); fclose (f); diff --git a/gio/tests/live-g-file.c b/gio/tests/live-g-file.c index c96f9db94..5edc9b673 100644 --- a/gio/tests/live-g-file.c +++ b/gio/tests/live-g-file.c @@ -23,6 +23,7 @@ */ #include +#include #include #include #include @@ -305,7 +306,7 @@ test_create_structure (gconstpointer test_data) basename = g_path_get_basename (item.filename); path = g_build_filename (test_data, dir, ".hidden", NULL); - f = fopen (path, "a"); + f = g_fopen (path, "ae"); fprintf (f, "%s\n", basename); fclose (f); diff --git a/girepository/compiler/compiler.c b/girepository/compiler/compiler.c index dcbbbe66f..c8e837554 100644 --- a/girepository/compiler/compiler.c +++ b/girepository/compiler/compiler.c @@ -86,7 +86,7 @@ write_out_typelib (gchar *prefix, file_obj = g_file_new_for_path (filename); tmp_filename = g_strdup_printf ("%s.tmp", filename); tmp_file_obj = g_file_new_for_path (tmp_filename); - file = g_fopen (tmp_filename, "wb"); + file = g_fopen (tmp_filename, "wbe"); if (file == NULL) { diff --git a/girepository/gdump.c b/girepository/gdump.c index d96e558cb..520fc9d6e 100644 --- a/girepository/gdump.c +++ b/girepository/gdump.c @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -637,7 +638,7 @@ gi_repository_dump (const char *input_filename, return FALSE; } - input = fopen (input_filename, "rb"); + input = g_fopen (input_filename, "rbe"); if (input == NULL) { int saved_errno = errno; @@ -649,7 +650,7 @@ gi_repository_dump (const char *input_filename, return FALSE; } - output = fopen (output_filename, "wb"); + output = g_fopen (output_filename, "wbe"); if (output == NULL) { int saved_errno = errno; diff --git a/girepository/girwriter.c b/girepository/girwriter.c index b2bd6395d..9c36db0f7 100644 --- a/girepository/girwriter.c +++ b/girepository/girwriter.c @@ -1368,7 +1368,7 @@ gi_ir_writer_write (GIRepository *repository, full_filename = g_strdup_printf ("%s-%s", ns, filename); else full_filename = g_strdup (filename); - ofile = g_fopen (filename, "w"); + ofile = g_fopen (filename, "we"); if (ofile == NULL) { diff --git a/glib/deprecated/gcompletion.c b/glib/deprecated/gcompletion.c index 73192894f..fa09a97fb 100644 --- a/glib/deprecated/gcompletion.c +++ b/glib/deprecated/gcompletion.c @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -467,7 +468,7 @@ main (int argc, return 1; } - file = fopen (argv[1], "r"); + file = g_fopen (argv[1], "re"); if (!file) { g_warning ("Cannot open %s", argv[1]); diff --git a/glib/gcharset.c b/glib/gcharset.c index c384c4b53..13d6270a0 100644 --- a/glib/gcharset.c +++ b/glib/gcharset.c @@ -28,6 +28,7 @@ #include "ghash.h" #include "glib-private.h" #include "gmessages.h" +#include "gstdio.h" #include "gstrfuncs.h" #include "gthread.h" #include "gthreadprivate.h" @@ -447,7 +448,7 @@ read_aliases (const gchar *file, FILE *fp; char buf[256]; - fp = fopen (file, "re"); + fp = g_fopen (file, "re"); if (!fp) return; while (fgets (buf, 256, fp)) diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 1768358fe..c7d3339d1 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -938,7 +938,7 @@ get_contents_posix (const gchar *filename, FILE *f; gboolean retval; - f = fdopen (fd, "r"); + f = fdopen (fd, "re"); if (f == NULL) { @@ -969,7 +969,7 @@ get_contents_win32 (const gchar *filename, FILE *f; gboolean retval; - f = g_fopen (filename, "rb"); + f = g_fopen (filename, "rbe"); if (f == NULL) { diff --git a/glib/glib-mirroring-tab/gen-mirroring-tab.c b/glib/glib-mirroring-tab/gen-mirroring-tab.c index 19efbecf3..54935b4af 100644 --- a/glib/glib-mirroring-tab/gen-mirroring-tab.c +++ b/glib/glib-mirroring-tab/gen-mirroring-tab.c @@ -30,6 +30,7 @@ */ #include +#include #include #include @@ -156,7 +157,7 @@ read_data ( FILE *f; fprintf (stderr, "Reading '%s'\n", data_file_name); - if (!(f = fopen (data_file_name, "rt"))) + if (!(f = g_fopen (data_file_name, "rte"))) die2 ("error: cannot open '%s' for reading", data_file_name); if (!strcmp (data_file_type, "BidiMirroring.txt")) diff --git a/glib/grand.c b/glib/grand.c index 15d15ba5d..61b835b47 100644 --- a/glib/grand.c +++ b/glib/grand.c @@ -49,6 +49,7 @@ #include "genviron.h" #include "gmain.h" #include "gmem.h" +#include "gstdio.h" #include "gtestutils.h" #include "gthread.h" #include "gtimer.h" @@ -179,7 +180,7 @@ g_rand_new (void) do { - dev_urandom = fopen ("/dev/urandom", "rbe"); + dev_urandom = g_fopen ("/dev/urandom", "rbe"); } while G_UNLIKELY (dev_urandom == NULL && errno == EINTR); diff --git a/glib/gstdio.c b/glib/gstdio.c index 9a27324e0..f5c9448ed 100644 --- a/glib/gstdio.c +++ b/glib/gstdio.c @@ -145,11 +145,15 @@ w32_error_to_errno (DWORD error_code) * "wb+". The 'b' needs to be appended to "w+", i.e. "w+b". Note * that otherwise these 2 modes are supposed to be aliases, hence * swappable at will. TODO: Is this still true? + * + * It also doesn’t accept `e`, which Unix uses for O_CLOEXEC. This function + * rewrites that to `N` — see + * https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170 */ static void _g_win32_fix_mode (wchar_t *mode) { - wchar_t *ptr; + wchar_t *ptr, *e_ptr, *comma_ptr; wchar_t temp; ptr = wcschr (mode, L'+'); @@ -159,6 +163,13 @@ _g_win32_fix_mode (wchar_t *mode) mode[1] = *ptr; *ptr = temp; } + + /* Rewrite `e` (O_CLOEXEC) to `N`, if it occurs before any extended attributes + * (https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170#unicode-support) */ + e_ptr = wcschr (mode, L'e'); + comma_ptr = wcschr (mode, L','); + if (e_ptr != NULL && (comma_ptr == NULL || e_ptr < comma_ptr)) + *e_ptr = L'N'; } /* From @@ -1562,6 +1573,13 @@ g_rmdir (const gchar *filename) * used by GLib are different. Convenience functions like g_file_set_contents_full() * avoid this problem. * + * Since GLib 2.86, the `e` option is supported in @mode on all platforms. On + * Unix platforms it will set `O_CLOEXEC` on the opened file descriptor. On + * Windows platforms it will be converted to the + * [`N` modifier](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170). + * It is recommended to set `e` unconditionally, unless you know the returned + * file should be shared between this process and a new fork. + * * Returns: A `FILE*` if the file was successfully opened, or %NULL if * an error occurred * @@ -1618,6 +1636,9 @@ g_fopen (const gchar *filename, * * See your C library manual for more details about freopen(). * + * Since GLib 2.86, the `e` option is supported in @mode on all platforms. See + * the documentation for [func@GLib.fopen] for more details. + * * Returns: A FILE* if the file was successfully opened, or %NULL if * an error occurred. * diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c index 57e0a6f2e..f15029e98 100644 --- a/glib/tests/fileutils.c +++ b/glib/tests/fileutils.c @@ -705,7 +705,7 @@ test_mkdir_with_parents_1 (const gchar *base) if (g_file_test (p1, G_FILE_TEST_EXISTS)) g_error ("failed, did g_rmdir(%s), but %s is still there", p1, p1); - f = g_fopen (p1, "w"); + f = g_fopen (p1, "we"); if (f == NULL) g_error ("failed, couldn't create file %s", p1); fclose (f); @@ -1446,7 +1446,7 @@ test_get_contents (void) char *filename = g_build_filename (g_get_tmp_dir (), "file-test-get-contents", NULL); gsize bytes_written; - f = g_fopen (filename, "w"); + f = g_fopen (filename, "we"); bytes_written = fwrite (text, 1, strlen (text), f); g_assert_cmpint (bytes_written, ==, strlen (text)); fclose (f); @@ -2042,7 +2042,7 @@ test_read_link (void) g_free (newpath); g_free (badpath); - file = fopen (filename, "w"); + file = g_fopen (filename, "we"); g_assert_nonnull (file); fclose (file); diff --git a/glib/tests/unicode.c b/glib/tests/unicode.c index 00b4f5b65..9e587697a 100644 --- a/glib/tests/unicode.c +++ b/glib/tests/unicode.c @@ -33,6 +33,7 @@ #include #include "glib.h" +#include "glib/gstdio.h" #include "glib/gunidecomp.h" @@ -636,7 +637,7 @@ test_casemap_and_casefold (void) save_and_clear_env ("LANG", &old_lang); filename = g_test_build_filename (G_TEST_DIST, "casemap.txt", NULL); - infile = fopen (filename, "r"); + infile = g_fopen (filename, "re"); g_assert (infile != NULL); while (fgets (buffer, sizeof (buffer), infile)) @@ -700,7 +701,7 @@ test_casemap_and_casefold (void) g_free (filename); filename = g_test_build_filename (G_TEST_DIST, "casefold.txt", NULL); - infile = fopen (filename, "r"); + infile = g_fopen (filename, "re"); g_assert (infile != NULL); while (fgets (buffer, sizeof (buffer), infile)) From ac2ecb5a437c58c34548adc570a2d50530bad5cb Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 20 Mar 2025 12:30:08 +0000 Subject: [PATCH 2/4] tests: Add `e` flag to fdopen() calls in gsubprocess tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unlike the previous commit, there is no `g_fdopen()` wrapper where we can add cross-platform support for this. I’m not adding that now just for `O_CLOEXEC` support for these two calls, so pass the flag locally for now. If someone wanted to add a `g_fdopen()` wrapper in future, the `GLIB_FD_CLOEXEC` here could be refactored easily. Signed-off-by: Philip Withnall --- gio/tests/gsubprocess-testprog.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gio/tests/gsubprocess-testprog.c b/gio/tests/gsubprocess-testprog.c index 05fc526f3..b61ccc261 100644 --- a/gio/tests/gsubprocess-testprog.c +++ b/gio/tests/gsubprocess-testprog.c @@ -124,6 +124,12 @@ sleep_forever_mode (int argc, return 0; } +#ifdef G_OS_UNIX +#define GLIB_FD_CLOEXEC "e" +#else +#define GLIB_FD_CLOEXEC "" +#endif + static int write_to_fds (int argc, char **argv) { @@ -132,7 +138,7 @@ write_to_fds (int argc, char **argv) for (i = 2; i < argc; i++) { int fd = atoi (argv[i]); - FILE *f = fdopen (fd, "w"); + FILE *f = fdopen (fd, "w" GLIB_FD_CLOEXEC); const char buf[] = "hello world\n"; size_t bytes_written; @@ -170,7 +176,7 @@ read_from_fd (int argc, char **argv) return 1; } - f = fdopen (fd, "r"); + f = fdopen (fd, "r" GLIB_FD_CLOEXEC); if (f == NULL) { g_warning ("Failed to open fd %d: %s", fd, g_strerror (errno)); From 306abedea50cfb3a9c956f867f3e2f1bac8e2a3a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 20 Mar 2025 12:52:48 +0000 Subject: [PATCH 3/4] tests: Add tests for new `e` modes for g_fopen() Signed-off-by: Philip Withnall --- glib/tests/fileutils.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c index f15029e98..9cbf80f10 100644 --- a/glib/tests/fileutils.c +++ b/glib/tests/fileutils.c @@ -2219,7 +2219,36 @@ test_fopen_modes (void) "a+b", "wb+", "rb+", - "ab+" + "ab+", + "we", + "re", + "ae", + "w+e", + "r+e", + "a+e", + "wbe", + "rbe", + "abe", + "w+be", + "r+be", + "a+be", + "wb+e", + "rb+e", + "ab+e", + "web", + "reb", + "aeb", + "w+eb", + "r+eb", + "a+eb", + "web+", + "reb+", + "aeb+", +#ifdef G_OS_WIN32 + /* https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170#unicode-support */ + "w, ccs=utf-16le", + "we, ccs=utf-16le", +#endif }; g_test_bug ("https://gitlab.gnome.org/GNOME/glib/merge_requests/119"); From b2f0bb95922680953a233d70414bf8690cf1c695 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 22 May 2025 15:09:09 +0100 Subject: [PATCH 4/4] tests: Expand PATH for Python tests on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This works around a Meson bug (https://github.com/mesonbuild/meson/issues/4668). If we have a Python test which spawns a built native binary, that binary is listed in the `depends` argument of the `test()`. On Linux, this results in the directories containing the built libraries which the binary depends on being added to the `LD_LIBRARY_PATH` of the test invocation. On Windows, however, Meson currently doesn’t add those directories to `PATH` (which is the equivalent of `LD_LIBRARY_PATH`), so we have to do it manually. This takes the same approach as Christoph Reiter did in gobject-introspection (https://gitlab.gnome.org/GNOME/gobject-introspection/blob/13e8c7ff80f9ff2dc77e9d0da4b7396182c63612/tests/meson.build#L2). Signed-off-by: Philip Withnall --- gio/tests/meson.build | 3 +++ girepository/tests/meson.build | 3 +++ glib/tests/meson.build | 3 +++ gobject/tests/meson.build | 3 +++ meson.build | 20 ++++++++++++++++++++ 5 files changed, 32 insertions(+) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 26091b6e7..4663a7182 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -1176,6 +1176,9 @@ endforeach python_test_env = test_env python_test_env.prepend('PYTHONPATH', python_test_libraries_path) python_test_env.prepend('PYTHONPATH', python_test_libraries_built) +if python_test_env_common_path.length() > 0 + python_test_env.prepend('PATH', python_test_env_common_path) +endif foreach test_name, extra_args : python_tests depends = [extra_args.get('depends', [])] diff --git a/girepository/tests/meson.build b/girepository/tests/meson.build index 0697c9fa2..2a75aac57 100644 --- a/girepository/tests/meson.build +++ b/girepository/tests/meson.build @@ -187,6 +187,9 @@ endif python_test_env = test_env python_test_env.prepend('PYTHONPATH', python_test_libraries_path) python_test_env.prepend('PYTHONPATH', python_test_libraries_built) +if python_test_env_common_path.length() > 0 + python_test_env.prepend('PATH', python_test_env_common_path) +endif foreach test_name, extra_args : python_tests depends = [extra_args.get('depends', [])] diff --git a/glib/tests/meson.build b/glib/tests/meson.build index b101b061e..4364ee878 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -515,6 +515,9 @@ endif python_test_env = test_env python_test_env.prepend('PYTHONPATH', python_test_libraries_path) python_test_env.prepend('PYTHONPATH', python_test_libraries_built) +if python_test_env_common_path.length() > 0 + python_test_env.prepend('PATH', python_test_env_common_path) +endif foreach test_name, extra_args : python_tests depends = [extra_args.get('depends', [])] diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build index 0ae4e86ed..214df4845 100644 --- a/gobject/tests/meson.build +++ b/gobject/tests/meson.build @@ -235,6 +235,9 @@ endforeach python_test_env = test_env python_test_env.prepend('PYTHONPATH', python_test_libraries_path) python_test_env.prepend('PYTHONPATH', python_test_libraries_built) +if python_test_env_common_path.length() > 0 + python_test_env.prepend('PATH', python_test_env_common_path) +endif foreach test_name, extra_args : python_tests depends = [extra_args.get('depends', [])] diff --git a/meson.build b/meson.build index 48cb6cd3c..c10604ba4 100644 --- a/meson.build +++ b/meson.build @@ -2516,6 +2516,26 @@ if not python_version.version_compare(python_version_req) endif python_test_libraries_built = meson.project_build_root() / 'tests' / 'lib' +# FIXME: https://github.com/mesonbuild/meson/issues/4668 +# +# If we have a Python test which spawns a built native binary, that binary is +# listed in the `depends` argument of the `test()`. On Linux, this results in +# the directories containing the built libraries which the binary depends on +# being added to the `LD_LIBRARY_PATH` of the test invocation. On Windows, +# however, Meson currently doesn’t add those directories to `PATH` (which is the +# equivalent of `LD_LIBRARY_PATH`), so we have to do it manually. +python_test_env_common_path = [] +if host_system == 'windows' + build_root = meson.project_build_root() + python_test_env_common_path += [ + build_root / 'gmodule', + build_root / 'girepository', + build_root / 'gio', + build_root / 'glib', + build_root / 'gobject', + ] +endif + # Determine which user environment-dependent files that we want to install bash = find_program('bash', required : false) have_bash = bash.found() # For completion scripts