Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cue-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ def setUp(self):

def tearDown(self):
os.environ.pop('EPICS_HOST_ARCH', None)
os.environ.pop('MAKEFLAGS', None)
cue.clear_lists()

def test_AddPathsOption(self):
Expand Down Expand Up @@ -900,6 +901,29 @@ def test_StrawberryInPath(self):
'Strawberry Perl location not in PATH (found PATH = {0})'
.format(os.environ['PATH']))

@unittest.skipIf(ci_os != 'windows' or ci_service == 'appveyor',
'Make SHELL test only applies to windows (not AppVeyor)')
def test_MakeShellCmdForMinGW(self):
cue.ci['compiler'] = 'gcc'
os.environ['MAKEFLAGS'] = 'k'
cue.setup_for_build(self.args)
self.assertEqual(os.environ['MAKEFLAGS'], 'k SHELL=cmd',
'SHELL=cmd not added to MAKEFLAGS (found MAKEFLAGS = {0})'
.format(os.environ['MAKEFLAGS']))
cue.setup_for_build(self.args)
self.assertEqual(os.environ['MAKEFLAGS'], 'k SHELL=cmd',
'SHELL=cmd added to MAKEFLAGS twice (found MAKEFLAGS = {0})'
.format(os.environ['MAKEFLAGS']))
os.environ['MAKEFLAGS'] = 'SHELL=sh'
cue.setup_for_build(self.args)
self.assertEqual(os.environ['MAKEFLAGS'], 'SHELL=sh',
'User setting of SHELL in MAKEFLAGS overridden')
os.environ.pop('MAKEFLAGS', None)
cue.ci['compiler'] = 'vs2019'
cue.setup_for_build(self.args)
self.assertFalse('MAKEFLAGS' in os.environ,
'MAKEFLAGS set for Visual Studio compiler')

def setBase314(self, yesno):
cfg_base_version = os.path.join('configure', 'CONFIG_BASE_VERSION')
fout = open(cfg_base_version, 'w')
Expand Down
8 changes: 8 additions & 0 deletions cue.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,14 @@ def setup_for_build(args):
r'C:\Strawberry\perl\bin',
os.environ['PATH']])

if ci['service'] != 'appveyor' and ci['compiler'] == 'gcc':
# Git's sh.exe wrapper prepends Git's own MinGW runtime DLLs to PATH,
# which are incompatible with the Strawberry Perl compiler.
makeflags = os.environ.get('MAKEFLAGS', '')
if 'SHELL=' not in makeflags:
logger.debug('Setting SHELL=cmd in MAKEFLAGS')
os.environ['MAKEFLAGS'] = ' '.join(filter(None, [makeflags, 'SHELL=cmd']))

if ci['service'] == 'appveyor' and ci['compiler'] == 'gcc':
logger.debug('Adding AppVeyor MSYS2/MinGW installation to PATH and INCLUDE')
if 'INCLUDE' not in os.environ:
Expand Down
Loading