finish PATH manipulation before probing "make"

This commit is contained in:
Michael Davidsaver
2023-10-24 11:39:54 -07:00
parent afeb69564c
commit dffe32c23e

20
cue.py
View File

@@ -762,14 +762,6 @@ def setup_for_build(args):
if re.match('^test-results:', line):
has_test_results = True
# Check make version
if re.match(r'^GNU Make 3', sp.check_output(['make', '-v']).decode('ascii')):
is_make3 = True
logger.debug('Check if make is a 3.x series: %s', is_make3)
# apparently %CD% is handled automagically
os.environ['TOP'] = os.getcwd()
addpaths = []
for path in args.paths:
try:
@@ -781,6 +773,18 @@ def setup_for_build(args):
os.environ['PATH'] = os.pathsep.join([os.environ['PATH']] + addpaths)
logger.debug('Final PATH')
for loc in os.environ['PATH'].split(os.pathsep):
logger.debug(' %r', loc)
# Check make version
if re.match(r'^GNU Make 3', sp.check_output(['make', '-v']).decode('ascii')):
is_make3 = True
logger.debug('Check if make is a 3.x series: %s', is_make3)
# apparently %CD% is handled automagically
os.environ['TOP'] = os.getcwd()
# Add EXTRA make arguments
for tag in ['EXTRA', 'EXTRA1', 'EXTRA2', 'EXTRA3', 'EXTRA4', 'EXTRA5']:
val = os.environ.get(tag, "")