From 6ec067da7800457de033cd05298e419ee4c048ea Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2023 10:37:16 -0700 Subject: [PATCH 1/4] Revert "workaround make -Otarget bug on windows" This reverts commit 899b18336b4ce3bd9328fd30c33621224c78a4d7. --- cue.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cue.py b/cue.py index 0f03bad..40ba7c6 100644 --- a/cue.py +++ b/cue.py @@ -452,9 +452,7 @@ def call_make(args=None, **kws): makeargs = [] else: makeargs = ['-j{0}'.format(parallel)] - if not is_make3 and ci['os'] != 'windows': - # not available until make 3 - # buggy on windows https://github.com/epics-base/ci-scripts/issues/84 + if not is_make3: makeargs += ['-Otarget'] if silent: makeargs += ['-s'] From afeb69564cb375e94a6d95ec7a846b19cec4da27 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2023 10:48:54 -0700 Subject: [PATCH 2/4] print tool location along with version --- cue.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cue.py b/cue.py index 40ba7c6..42eb5bc 100644 --- a/cue.py +++ b/cue.py @@ -13,6 +13,7 @@ import threading from glob import glob import subprocess as sp import distutils.util +import shutil logger = logging.getLogger(__name__) @@ -32,6 +33,11 @@ def log_modified(): sys.stdout.write(F.read()) sys.stdout.write(os.linesep) +def whereis(cmd): + if hasattr(shutil, 'which'): # >= py3.3 + loc = shutil.which(cmd) + print('{0}Found exec {1} at {2!r} {3}'.format(ANSI_CYAN, cmd, loc, ANSI_RESET)) + def prepare_env(): '''HACK github actions yaml configuration doesn't allow @@ -1246,23 +1252,28 @@ endif''') setup_for_build(args) print('{0}EPICS_HOST_ARCH = {1}{2}'.format(ANSI_CYAN, os.environ['EPICS_HOST_ARCH'], ANSI_RESET)) + whereis('make') print('{0}$ make --version{1}'.format(ANSI_CYAN, ANSI_RESET)) sys.stdout.flush() call_make(['--version'], parallel=0) + whereis('perl') print('{0}$ perl --version{1}'.format(ANSI_CYAN, ANSI_RESET)) sys.stdout.flush() sp.check_call(['perl', '--version']) if re.match(r'^vs', ci['compiler']): + whereis('cl') print('{0}$ cl{1}'.format(ANSI_CYAN, ANSI_RESET)) sys.stdout.flush() sp.check_call(['cl']) else: cc = ci['compiler'] + whereis(cc) print('{0}$ {1} --version{2}'.format(ANSI_CYAN, cc, ANSI_RESET)) sys.stdout.flush() sp.check_call([cc, '--version']) if cxx: + whereis(cxx) print('{0}$ {1} --version{2}'.format(ANSI_CYAN, cxx, ANSI_RESET)) sys.stdout.flush() sp.check_call([cxx, '--version']) From dffe32c23e8c54daa0f19a57b9de9bda015d73ea Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2023 11:39:54 -0700 Subject: [PATCH 3/4] finish PATH manipulation before probing "make" --- cue.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cue.py b/cue.py index 42eb5bc..3f23865 100644 --- a/cue.py +++ b/cue.py @@ -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, "") From f57c9d5930d2d033fd71d44539b72b191991e2b2 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2023 18:28:38 -0700 Subject: [PATCH 4/4] windows choose intended make.exe --- cue.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cue.py b/cue.py index 3f23865..a3d7a7d 100644 --- a/cue.py +++ b/cue.py @@ -693,8 +693,10 @@ def setup_for_build(args): if ci['os'] == 'windows': if os.path.exists(r'C:\Strawberry\perl\bin'): # Put strawberry perl in front of the PATH (so that Git Perl is further behind) + # Put Chocolatey\bin ahead to select correct make.exe logger.debug('Adding Strawberry Perl in front of the PATH') - os.environ['PATH'] = os.pathsep.join([r'C:\Strawberry\c\bin', + os.environ['PATH'] = os.pathsep.join([r'C:\ProgramData\Chocolatey\bin', + r'C:\Strawberry\c\bin', r'C:\Strawberry\perl\site\bin', r'C:\Strawberry\perl\bin', os.environ['PATH']])