Fix Landlock Make so it can read pattern rule vars

It turned out that specifying all SRCS and INCS as dependencies on the
pattern rules for all headers, caused `make` memory usage to skyrocket
from 40mb ot 160mb. This change also reduces the build graph another 4%.
This commit is contained in:
Justine Tunney 2022-08-13 17:20:50 -07:00
parent 62ca1b0902
commit ead3fc2b31
53 changed files with 105 additions and 93 deletions

View file

@ -1773,7 +1773,11 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
(STRING_SIZE_TUPLE(".UNSANDBOXED"))) &&
(!c || !Vartoi (lookup_variable_in_set
(STRING_SIZE_TUPLE(".UNSANDBOXED"),
c->file->variables->set))));
c->file->variables->set))) &&
(!c || !c->file->pat_variables ||
!Vartoi (lookup_variable_in_set
(STRING_SIZE_TUPLE(".UNSANDBOXED"),
c->file->pat_variables->set))));
/* resolve command into executable path */
if (!g_strict || !sandboxed)
@ -1919,6 +1923,12 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
(lookup_variable_in_set
(STRING_SIZE_TUPLE (".UNVEIL"),
c->file->variables->set)));
if (c->file->pat_variables)
RETURN_ON_ERROR
(UnveilVariable
(lookup_variable_in_set
(STRING_SIZE_TUPLE (".UNVEIL"),
c->file->pat_variables->set)));
/* commit sandbox */
RETURN_ON_ERROR (Unveil (0, 0));