8000 Prevent passing gmake's environment variables down through pg_regress. · lansz/postgres@9009ec0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9009ec0

Browse files
committed
Prevent passing gmake's environment variables down through pg_regress.
When we do "make install" to create a temp installation, we don't want that instance of make to try to communicate with any instance of make that might be calling us. This is known to cause problems if the upper make has a -jN flag, and in principle could cause problems even without that. Unset the relevant environment variables to prevent such issues. Andres Freund
1 parent b10b1fa commit 9009ec0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/regress/pg_regress.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,19 @@ initialize_environment(void)
767767
doputenv("PGPORT", s);
768768
}
769769

770+
/*
771+
* GNU make stores some flags in the MAKEFLAGS environment variable to
772+
* pass arguments to its own children. If we are invoked by make,
773+
* that causes the make invoked by us to think its part of the make
774+
* task invoking us, and so it tries to communicate with the toplevel
775+
* make. Which fails.
776+
*
777+
* Unset the variable to protect against such problems. We also reset
778+
* MAKELEVEL to be certain the child doesn't notice the make above us.
779+
*/
780+
unsetenv("MAKEFLAGS");
781+
unsetenv("MAKELEVEL");
782+
770783
/*
771784
* Adjust path variables to point into the temp-install tree
772785
*/

0 commit comments

Comments
 (0)
0