[PATCH] pg_regress.c: Fix "make check" on Mac OS X: Pass DYLD_LIBRARY_PATH

Поиск
Список
Период
Сортировка
От Evan Jones
Тема [PATCH] pg_regress.c: Fix "make check" on Mac OS X: Pass DYLD_LIBRARY_PATH
Дата
Msg-id CA+HWA9Zhz+QqaKrWkBd4UVfxL1FANJvRyCTFY5J_hq3AhDBpJQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] pg_regress.c: Fix "make check" on Mac OS X: Pass DYLD_LIBRARY_PATH  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
This makes "make check" work on Mac OS X. Without this patch, on Mac OS X a default "./configure; make; make check" fails with errors like:

dyld[65265]: Library not loaded: /usr/local/pgsql/lib/libpq.5.dylib
  Referenced from: <59A2EAF9-6298-3112-BEDB-EA9A62A9DB53> /Users/evan.jones/postgresql-clean/tmp_install/usr/local/pgsql/bin/initdb
  Reason: tried: '/usr/local/pgsql/lib/libpq.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/pgsql/lib/libpq.5.dylib' (no such file), '/usr/local/pgsql/lib/libpq.5.dylib' (no such file), '/usr/local/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5.dylib' (no such file, not in dyld cache)

The reason is that at some point, Mac OS X started removing the DYLD_LIBRARY_PATH environment variable for "untrusted" executables [1]: "Any dynamic linker (dyld) environment variables, such as DYLD_LIBRARY_PATH, are purged when launching protected processes."


One solution is to explicitly pass the DYLD_LIBRARY_PATH environment variable to to the sub-process shell scripts that are run by pg_regress. To do this, I created an extra_envvars global variable which is set to the empty string "", but on Mac OS X, is filled in with "DYLD_LIBRARY_PATH=%s", where the %s is the current environment variable. The "make check" Makefile sets this environment variable to the temporary install directory, so this fixes the above errors.

I tested this on Mac OS X and on Linux (Ubuntu 23.04).

Thanks!

Evan Jones

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Morris de Oryx
Дата:
Сообщение: Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function
Следующее
От: Hans Buschmann
Дата:
Сообщение: QUAL Pushdown causes ERROR on syntactically and semantically correct SQL Query