From: | Jörg Westheide <joerg(dot)westheide(at)sparkpost(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | [PATCH] make check with Apple's SIP enabled |
Date: | 2018-01-19 14:54:06 |
Message-ID: | 18012hGLG6HJ9pQDkHAMYuwQKg@sparkpost.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi!
When doing a "make check" on Mac OS X with SIP (aka rootless mode)
enabled it will fail like this:
----- >8 snip 8< -----
rm -rf ./testtablespace
mkdir ./testtablespace
PATH="/Volumes/Home/arbeit/port25/postgresql-clean/tmp_install/usr/local/pgsql/bin:$PATH"
DYLD_LIBRARY_PATH="/<path_to_postgresql_dir>/tmp_install/usr/local/pgsql/lib"
../../../src/test/regress/pg_regress --temp-instance=./tmp_check
--inputdir=. --bindir= --dlpath=. --max-concurrent-tests=20
--schedule=./parallel_schedule
============== creating temporary instance ==============
============== initializing database system ==============
============== starting postmaster ==============
sh: line 1: 81758 Trace/BPT trap: 5 "psql" -X postgres <
/dev/null 2> /dev/null
sh: line 1: 81762 Trace/BPT trap: 5 "psql" -X postgres <
/dev/null 2> /dev/null
sh: line 1: 81765 Trace/BPT trap: 5 "psql" -X postgres <
/dev/null 2> /dev/null
sh: line 1: 81768 Trace/BPT trap: 5 "psql" -X postgres <
/dev/null 2> /dev/null
sh: line 1: 81771 Trace/BPT trap: 5 "psql" -X postgres <
/dev/null 2> /dev/null
^Cmake[1]: *** [check] Interrupt: 2
make: *** [check] Interrupt: 2
----- >8 snap 8< -----
The problem is that the psql links to libpq which it cannot find (at
least not the one from the postgres you're building). The usual
approach to set an environment variable pointing to the correct
location (DYLD_LIBRARY_PATH on Mac OS X/darwin, see above) does not
work since Apple's SIP prevents it from getting passed to psql (see
https://developer.apple.com/library/content/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html
)
What I do in the attached patch is changing the install name of libpq
in the psql binary of the temp install (used by "make check") to point
to libpq of the temp install so the (correct) lib is found.
For not duplicating the information I created a new file
"Makefile.libdefs" to where I extracted the information needed to do
the install name change
This patch has only been tested on Mac OS X El Capitan (10.11.6) since
I currently have no other OS available
Please let me know what you think of it
Jörg
Attachment | Content-Type | Size |
---|---|---|
SIP.v1.patch | application/octet-stream | 2.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2018-01-19 14:55:08 | pgsql: Local partitioned indexes |
Previous Message | Robert Haas | 2018-01-19 14:52:00 | Re: [HACKERS] Refactor handling of database attributes between pg_dump and pg_dumpall |