Skip to content

Commit ffc7e71

Browse files
authored
Merge branch 'epics-base:master' into local-test
2 parents 2bdb5ce + fbbfced commit ffc7e71

File tree

10 files changed

+199
-188
lines changed

10 files changed

+199
-188
lines changed

.appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ skip_commits:
4545

4646
install:
4747
# fetch submodules (like ci-scripts)
48-
- cmd: git submodule update --init --recursive
48+
- git submodule update --init --recursive
4949
# for the sequencer
50-
- cinst re2c
50+
- choco install re2c
5151

5252
#---------------------------------#
5353
# build matrix configuration #

.github/workflows/build-and-test.yml

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,54 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
os: [ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019, macos-12, macos-11]
22+
os: [ubuntu-24.04, ubuntu-22.04, windows-2025, windows-2022, macos-15, macos-14]
2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525
- name: Show initial environment
2626
run: python3 cue-test.py env
2727
- name: Run unit tests
2828
run: python3 cue-test.py
2929

3030
build-linux:
31-
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
31+
name: B-${{ matrix.base }} ${{ matrix.cmp }} ${{ matrix.configuration }} @ ${{ matrix.os }}
3232
runs-on: ${{ matrix.os }}
3333
env:
3434
CMP: ${{ matrix.cmp }}
3535
BCFG: ${{ matrix.configuration }}
36+
BASE: ${{ matrix.base }}
3637
strategy:
3738
fail-fast: false
3839
matrix:
39-
os: [ubuntu-22.04, ubuntu-20.04]
40+
os: [ubuntu-24.04, ubuntu-22.04]
4041
cmp: [gcc, clang]
4142
configuration: [default, static, debug, static-debug]
43+
base: ["7.0"]
44+
include:
45+
- os: ubuntu-24.04
46+
cmp: gcc
47+
configuration: default
48+
base: "3.15"
49+
name: "B-3.15 Ub-24 gcc-13"
50+
51+
- os: ubuntu-24.04
52+
cmp: gcc
53+
configuration: static
54+
base: "3.15"
55+
name: "B-3.15 Ub-24 gcc-13, static"
56+
57+
- os: ubuntu-24.04
58+
cmp: gcc
59+
configuration: default
60+
base: "3.14"
61+
name: "B-3.14 Ub-24 gcc-13"
62+
63+
- os: ubuntu-24.04
64+
cmp: gcc
65+
configuration: static
66+
base: "3.14"
67+
name: "B-3.14 Ub-24 gcc-13, static"
4268
steps:
43-
- uses: actions/checkout@v3
69+
- uses: actions/checkout@v4
4470
- name: Prepare and compile dependencies
4571
run: python cue.py prepare
4672
- name: Build main module (example app)
@@ -51,19 +77,34 @@ jobs:
5177
run: python cue.py test-results
5278

5379
build-macos:
54-
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
80+
name: B-${{ matrix.base }} ${{ matrix.cmp }} ${{ matrix.configuration }} @ ${{ matrix.os }}
5581
runs-on: ${{ matrix.os }}
5682
env:
5783
CMP: ${{ matrix.cmp }}
5884
BCFG: ${{ matrix.configuration }}
85+
BASE: ${{ matrix.base }}
5986
strategy:
6087
fail-fast: false
6188
matrix:
62-
os: [macos-12, macos-11]
89+
os: [macos-15, macos-14]
6390
cmp: [clang]
6491
configuration: [default, debug]
92+
base: ["7.0"]
93+
include:
94+
- os: macos-15
95+
cmp: clang
96+
configuration: default
97+
base: "3.15"
98+
name: "B-3.15 Mac-15"
99+
100+
# Base 3.14 does not support MacOS-aarch64
101+
# - os: macos-15
102+
# cmp: clang
103+
# configuration: default
104+
# base: "3.14"
105+
# name: "B-3.14 Mac-15"
65106
steps:
66-
- uses: actions/checkout@v3
107+
- uses: actions/checkout@v4
67108
- name: Prepare and compile dependencies
68109
run: python cue.py prepare
69110
- name: Build main module (example app)
@@ -74,26 +115,33 @@ jobs:
74115
run: python cue.py test-results
75116

76117
build-windows:
77-
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
118+
name: B-${{ matrix.base }} ${{ matrix.cmp }} ${{ matrix.configuration }} @ ${{ matrix.os }}
78119
runs-on: ${{ matrix.os }}
79120
env:
80121
CMP: ${{ matrix.cmp }}
81122
BCFG: ${{ matrix.configuration }}
123+
BASE: ${{ matrix.base }}
82124
strategy:
83125
fail-fast: false
84126
matrix:
85-
os: [windows-2022, windows-2019]
86-
cmp: [gcc, vs2022, vs2019]
127+
os: [windows-2025, windows-2022]
128+
cmp: [gcc, vs2022]
87129
configuration: [default, static, debug, static-debug]
88-
exclude:
89-
- os: windows-2022
90-
cmp: vs2019
91-
92-
- os: windows-2019
130+
base: [ "7.0" ]
131+
include:
132+
- os: windows-2025
93133
cmp: vs2022
134+
configuration: static
135+
base: "3.15"
136+
name: "B-3.15 Win-25 MSC-22 static"
94137

138+
- os: windows-2025
139+
cmp: vs2022
140+
configuration: static
141+
base: "3.14"
142+
name: "B-3.14 Win-25 MSC-22 static"
95143
steps:
96-
- uses: actions/checkout@v3
144+
- uses: actions/checkout@v4
97145
- name: Prepare and compile dependencies
98146
run: python cue.py prepare
99147
- name: Build main module (example app)
@@ -132,7 +180,7 @@ jobs:
132180
- cross: RTEMS-pc386-qemu@4.10
133181
test: NO
134182
steps:
135-
- uses: actions/checkout@v3
183+
- uses: actions/checkout@v4
136184
- name: Prepare and compile dependencies
137185
run: python cue.py prepare
138186
- name: Build main module (example app)

appveyor/.appveyor.yml.example-full

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ skip_commits:
4141

4242
install:
4343
# fetch submodules (like ci-scripts)
44-
- cmd: git submodule update --init --recursive
44+
- git submodule update --init --recursive
4545
# for the sequencer
46-
- cinst re2c
46+
- choco install re2c
4747

4848
#---------------------------------#
4949
# build matrix configuration #

appveyor/.appveyor.yml.example-mini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ skip_commits:
1818
- '.travis.yml'
1919

2020
install:
21-
- cmd: git submodule update --init --recursive
21+
- git submodule update --init --recursive
2222

2323
image: Visual Studio 2022
2424

cue-test.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,12 @@ def setUp(self):
269269
cue.detect_context()
270270
if os.path.exists(cue.ci['cachedir']):
271271
shutil.rmtree(cue.ci['cachedir'], onerror=cue.remove_readonly)
272-
self.location = os.path.join(cue.ci['cachedir'], 'mcoreutils-master')
272+
self.location = os.path.join(cue.ci['cachedir'], 'mcoreutils-main')
273273
self.testfile = os.path.join(self.location, '.ci', 'LICENSE')
274-
os.path.join(cue.ci['cachedir'], 'mcoreutils-master')
274+
os.path.join(cue.ci['cachedir'], 'mcoreutils-main')
275275
cue.source_set('defaults')
276276
cue.complete_setup('MCoreUtils')
277-
cue.setup['MCoreUtils'] = 'master'
277+
cue.setup['MCoreUtils'] = 'main'
278278

279279
def test_Default(self):
280280
cue.add_dependency('MCoreUtils')
@@ -702,7 +702,7 @@ def test_MisspelledConfigurationGetsWarning(self):
702702

703703

704704
class TestSetupForBuild(unittest.TestCase):
705-
args = Namespace(paths=[])
705+
args = Namespace(extra_env_vars=[])
706706
if ci_os == 'windows':
707707
choco_installs = ['make']
708708
if ci_service != 'appveyor':
@@ -721,7 +721,7 @@ def tearDown(self):
721721

722722
def test_AddPathsOption(self):
723723
os.environ['FOOBAR'] = 'BAR'
724-
args = Namespace(paths=['/my/{FOOBAR}/dir', '/my/foobar'])
724+
args = Namespace(extra_env_vars=['PATH=/my/{FOOBAR}/dir', 'PATH=/my/foobar'])
725725
cue.setup_for_build(args)
726726
self.assertTrue(re.search('/my/BAR/dir', os.environ['PATH']), 'Expanded path not in PATH')
727727
self.assertTrue(re.search('/foobar', os.environ['PATH']), 'Plain path not in PATH')
@@ -863,7 +863,8 @@ def setUp(self):
863863
pass
864864
with open(self.bla_file, 'w') as f:
865865
f.write('''LINE1=YES
866-
LINE2=NO''')
866+
LINE2=NO
867+
''')
867868

868869
def test_patchfile(self):
869870
hook = os.path.join(builddir, 'test.patch')
@@ -887,7 +888,7 @@ def test_archive7z(self):
887888

888889
@unittest.skipIf(ci_os != 'linux', 'CrossCompatibilityHandling tests only apply to linux')
889890
class TestCrossCompatibilityHandling(unittest.TestCase):
890-
args = Namespace(paths=[])
891+
args = Namespace(extra_env_vars=[])
891892

892893
def setUp(self):
893894
cue.clear_lists()

cue.py

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
import sysconfig
1616
import shutil
1717

18+
try:
19+
from os import cpu_count
20+
except ImportError:
21+
def cpu_count():
22+
pass # undetermined
23+
1824
logger = logging.getLogger(__name__)
1925

2026
# Keep track of all files we write/append for later logging
@@ -141,7 +147,10 @@ def detect_context():
141147
ci['cachedir'] = os.environ['CACHEDIR']
142148

143149
if 'CHOCO' in os.environ:
144-
ci['choco'].extend(os.environ['CHOCO'].split())
150+
if os.environ['CHOCO'] == 'NO':
151+
ci['choco'] = []
152+
else:
153+
ci['choco'].extend(os.environ['CHOCO'].split())
145154

146155
if 'APT' in os.environ:
147156
ci['apt'].extend(os.environ['APT'].split())
@@ -153,7 +162,7 @@ def detect_context():
153162
if 'TEST' in os.environ and os.environ['TEST'].lower() == 'no':
154163
ci['test'] = False
155164

156-
ci['parallel_make'] = 2
165+
ci['parallel_make'] = cpu_count() or 2
157166
if 'PARALLEL_MAKE' in os.environ:
158167
ci['parallel_make'] = int(os.environ['PARALLEL_MAKE'])
159168

@@ -433,9 +442,11 @@ def update_release_local(var, location):
433442
def set_setup_from_env(dep):
434443
for postf in ['', '_DIRNAME', '_REPONAME', '_REPOOWNER', '_REPOURL',
435444
'_VARNAME', '_RECURSIVE', '_DEPTH', '_HOOK']:
436-
if dep + postf in os.environ:
437-
setup[dep + postf] = os.environ[dep + postf]
438-
logger.debug('ENV assignment: %s = %s', dep + postf, setup[dep + postf])
445+
env = dep + postf
446+
val = os.environ.get(env)
447+
if val:
448+
setup[env] = val
449+
logger.debug('ENV assignment: %s = %s', env, setup[env])
439450

440451

441452
def call_git(args, **kws):
@@ -612,6 +623,13 @@ def add_dependency(dep):
612623
sys.stdout.flush()
613624
sp.check_call(['patch', '-p1', '-i', os.path.join(ci['scriptsdir'], 'add-msi-to-314.patch')],
614625
cwd=place)
626+
627+
# Post 3.14 we have checks for readline.h
628+
print('Patching COMMANDLINE_LIBRARY to EPICS')
629+
sys.stdout.flush()
630+
sp.check_call(['patch', '-p1', '-i', os.path.join(ci['scriptsdir'], 'dont_use_readline_314.patch')],
631+
cwd=place)
632+
615633
else:
616634
# force including RELEASE.local for non-base modules by overwriting their configure/RELEASE
617635
release = os.path.join(place, "configure", "RELEASE")
@@ -771,17 +789,33 @@ def setup_for_build(args):
771789

772790
# apparently %CD% is handled automagically, so use getcwd() instead
773791
os.environ['TOP'] = os.getcwd()
792+
os.environ['MAKE'] = 'make'
793+
os.environ['EPICS_BASE'] = places['EPICS_BASE']
774794

775-
addpaths = []
776-
for path in args.paths:
795+
changed_vars = set()
796+
797+
for extra_env_var in args.extra_env_vars:
777798
try:
778-
addpaths.append(path.format(**os.environ))
799+
key_value = extra_env_var.split('=')
800+
key = key_value[0]
801+
value = key_value[1]
802+
expanded_value = value.format(**os.environ)
803+
804+
# Update the environment right now so later variables have access
805+
if key in os.environ:
806+
old_value = [os.environ[key]]
807+
else:
808+
old_value = []
809+
810+
os.environ[key] = os.pathsep.join(old_value + [expanded_value])
811+
changed_vars.add(key)
779812
except KeyError:
780813
print('Environment')
781814
[print(' ', K, '=', repr(V)) for K, V in os.environ.items()]
782815
raise
783816

784-
os.environ['PATH'] = os.pathsep.join([os.environ['PATH']] + addpaths)
817+
for key in changed_vars:
818+
print("{0}{2} = {3}{1}".format(ANSI_CYAN, ANSI_RESET, key, os.environ[key]))
785819

786820
# os.environ completely updated at this point
787821

@@ -849,9 +883,8 @@ def handle_old_cross_variables():
849883
os.environ["CI_CROSS_TARGETS"] = ""
850884

851885
if "RTEMS" in os.environ:
852-
if 'RTEMS_TARGET' in os.environ:
853-
rtems_target = os.environ['RTEMS_TARGET']
854-
else:
886+
rtems_target = os.environ.get('RTEMS_TARGET')
887+
if not rtems_target:
855888
if os.environ['RTEMS'] == '5':
856889
rtems_target = 'RTEMS-pc686-qemu'
857890
else:
@@ -875,8 +908,10 @@ def handle_old_cross_variables():
875908
if "WINE" in os.environ:
876909
if os.environ['WINE'] == '32':
877910
new_cross_target = ":win32-x86-mingw"
878-
else:
911+
elif os.environ['WINE'] == '64':
879912
new_cross_target = ":windows-x64-mingw"
913+
else:
914+
raise RuntimeError("Invalid $WINE, must be 32/64")
880915
os.environ["CI_CROSS_TARGETS"] += new_cross_target
881916

882917
print(
@@ -1359,8 +1394,6 @@ def test_results(args):
13591394
def doExec(args):
13601395
'exec user command with vcvars'
13611396
setup_for_build(args)
1362-
os.environ['MAKE'] = 'make'
1363-
os.environ['EPICS_BASE'] = places['EPICS_BASE']
13641397
fold_start('exec.command', 'Execute command {}'.format(args.cmd))
13651398
sp.check_call(' '.join(args.cmd), shell=True)
13661399
fold_end('exec.command', 'Execute command {}'.format(args.cmd))
@@ -1430,8 +1463,10 @@ def timespec(s):
14301463
p = ArgumentParser()
14311464
p.add_argument('--no-vcvars', dest='vcvars', default=True, action='store_false',
14321465
help='Assume vcvarsall.bat has already been run')
1433-
p.add_argument('--add-path', dest='paths', default=[], action='append',
1434-
help='Append directory to $PATH or %%PATH%%. Expands {ENVVAR}')
1466+
p.add_argument('--add-path', dest='extra_env_vars', type=lambda x: "PATH={}".format(x), default=[], action='append',
1467+
help='Append directory to $PATH or %%PATH%%. Expands {ENVVAR}. Equivalent to: "--add-env PATH=<PATHS>"')
1468+
p.add_argument('--add-env', dest='extra_env_vars', default=[], action='append',
1469+
help='Append directory to the specified $ENVVAR or %%ENVVAR%%. Expands {OTHER_ENVVAR}. Example: "--add-env \'LD_LIBRARY_PATH={EPICS_BASE}/lib/{EPICS_HOST_ARCH}\'"')
14351470
p.add_argument('-T', '--timeout', type=timespec, metavar='DLY',
14361471
help='Terminate make after delay. DLY interpreted as second, or may be qualified with "S", "M", or "H". (default no timeout)')
14371472
subp = p.add_subparsers()

0 commit comments

Comments
 (0)