mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 787600 - Pymake: Shell commands in submakes don't honour exported PATH and don't receive exported envvars. r=gps
This commit is contained in:
parent
117a49819e
commit
1a35d991f1
@ -773,7 +773,8 @@ class ShellFunction(Function):
|
||||
log.debug("%s: running shell command '%s'" % (self.loc, cline))
|
||||
if msys:
|
||||
cline = [shell, "-c", cline]
|
||||
p = subprocess.Popen(cline, shell=not msys, stdout=subprocess.PIPE, cwd=makefile.workdir)
|
||||
p = subprocess.Popen(cline, env=makefile.env, shell=not msys,
|
||||
stdout=subprocess.PIPE, cwd=makefile.workdir)
|
||||
stdout, stderr = p.communicate()
|
||||
|
||||
stdout = stdout.replace('\r\n', '\n')
|
||||
|
11
build/pymake/tests/submake-path.makefile2
Normal file
11
build/pymake/tests/submake-path.makefile2
Normal file
@ -0,0 +1,11 @@
|
||||
# -*- Mode: Makefile -*-
|
||||
|
||||
shellresult := $(shell pathtest)
|
||||
ifneq (2f7cdd0b-7277-48c1-beaf-56cb0dbacb24,$(filter $(shellresult),2f7cdd0b-7277-48c1-beaf-56cb0dbacb24))
|
||||
$(error pathtest not found in submake shell function)
|
||||
endif
|
||||
|
||||
all:
|
||||
@pathtest
|
||||
@pathtest | grep -q 2f7cdd0b-7277-48c1-beaf-56cb0dbacb24
|
||||
@echo TEST-PASS
|
16
build/pymake/tests/submake-path.mk
Normal file
16
build/pymake/tests/submake-path.mk
Normal file
@ -0,0 +1,16 @@
|
||||
#T gmake skip
|
||||
#T grep-for: "2f7cdd0b-7277-48c1-beaf-56cb0dbacb24"
|
||||
|
||||
ifdef __WIN32__
|
||||
PS:=;
|
||||
else
|
||||
PS:=:
|
||||
endif
|
||||
|
||||
export PATH := $(TESTPATH)/pathdir$(PS)$(PATH)
|
||||
|
||||
# This is similar to subprocess-path.mk, except we also check $(shell)
|
||||
# invocations since they're affected by exported environment variables too,
|
||||
# but only in submakes!
|
||||
all:
|
||||
$(MAKE) -f $(TESTPATH)/submake-path.makefile2
|
@ -4,6 +4,11 @@ $(info MAKEFLAGS = '$(MAKEFLAGS)')
|
||||
$(info MAKE = '$(MAKE)')
|
||||
$(info value MAKE = "$(value MAKE)")
|
||||
|
||||
shellresult := $(shell echo -n $$EVAR)
|
||||
ifneq ($(shellresult),eval)
|
||||
$(error EVAR should be eval, is instead $(shellresult))
|
||||
endif
|
||||
|
||||
all:
|
||||
env
|
||||
test "$(MAKELEVEL)" = "1"
|
||||
|
Loading…
Reference in New Issue
Block a user