Compare commits
201 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20f8e05393 | ||
|
|
2246ee79e4 | ||
|
|
7def04dc0e | ||
|
|
c153c10a11 | ||
|
|
a133e160ee | ||
|
|
f57c9d5930 | ||
|
|
dffe32c23e | ||
|
|
afeb69564c | ||
|
|
6ec067da78 | ||
|
|
899b18336b | ||
|
|
8e0cb61c12 | ||
|
|
4028a10be9 | ||
|
|
b61f5079b7 | ||
| e79a7fbf1e | |||
|
|
e0a7c52160 | ||
|
|
6e190542d6 | ||
|
|
a8bffdcfb7 | ||
|
|
8ea51154c0 | ||
|
|
4248dffeca | ||
| 9721faa716 | |||
|
|
c8b2773316 | ||
|
|
1e0e326f74 | ||
|
|
bd0cd5434c | ||
|
|
819c2abba0 | ||
|
|
6491f0116f | ||
|
|
f47280547b | ||
|
|
e32822b9a3 | ||
|
|
918feccf51 | ||
|
|
fd925d83b6 | ||
|
|
cd21488ec7 | ||
|
|
aea7906839 | ||
|
|
c6bc90b06a | ||
|
|
af1ecbabae | ||
|
|
22b2e3f796 | ||
|
|
d36800b2e0 | ||
|
|
b6723d0be4 | ||
|
|
db7677a48e | ||
|
|
ee9d6b3497 | ||
|
|
89a16e4499 | ||
|
|
91fb22b79a | ||
|
|
514737a106 | ||
|
|
f7e21c7c9d | ||
|
|
e065445f76 | ||
|
|
93062ba941 | ||
|
|
75d2911498 | ||
|
|
3a1d04914f | ||
|
|
75bae77c1d | ||
|
|
d675de24e6 | ||
|
|
e703210fad | ||
|
|
5764601630 | ||
|
|
0c2f903516 | ||
|
|
822293de04 | ||
|
|
6702a8a19c | ||
|
|
7c29683ad5 | ||
|
|
2bcd84a01c | ||
|
|
c6df7df2bd | ||
|
|
8bf77eba0c | ||
|
|
5b123f4e88 | ||
|
|
349eb9434d | ||
|
|
2464284271 | ||
|
|
13b7f097c1 | ||
|
|
2464f82ce6 | ||
|
|
9a94f4712b | ||
|
|
028b752cb2 | ||
|
|
3db08b5977 | ||
|
|
99057a5ff6 | ||
|
|
c734d558c2 | ||
|
|
b047a6c641 | ||
|
|
9183238f9d | ||
|
|
3ff483a1bb | ||
|
|
495f8622cd | ||
|
|
e7b1214d09 | ||
|
|
2016cb2ae7 | ||
|
|
cef930dd06 | ||
|
|
fa2a1e1d39 | ||
|
|
aa25701c58 | ||
|
|
5d7e82256c | ||
|
|
ad8dd4a136 | ||
|
|
fe8a9f5953 | ||
|
|
7d9d426629 | ||
|
|
2929ee2a03 | ||
|
|
1a227516c5 | ||
|
|
bfb9f77db8 | ||
|
|
12a0656fd2 | ||
|
|
984fa5e355 | ||
|
|
43e52b5f6f | ||
|
|
3c1cf15dac | ||
|
|
506af3932d | ||
|
|
85a34ceefb | ||
|
|
705f50449e | ||
|
|
d6136de065 | ||
|
|
33cac7c965 | ||
|
|
1c748ae291 | ||
|
|
7744772be6 | ||
|
|
682f92941d | ||
|
|
032ef83502 | ||
|
|
cfd8a88488 | ||
|
|
54a104e0a6 | ||
|
|
884d017650 | ||
|
|
fd71e94dd4 | ||
|
|
eb5edd3055 | ||
|
|
87942a7c29 | ||
|
|
0bf7d23a6f | ||
|
|
b592ab053c | ||
|
|
e10326b129 | ||
|
|
bd7612dcab | ||
|
|
1b066feacc | ||
|
|
ee362d84aa | ||
|
|
9942f81988 | ||
|
|
ce99ab4e52 | ||
|
|
08d2f23295 | ||
|
|
a439d7aa64 | ||
|
|
6eefee8d18 | ||
|
|
c7a134e1fb | ||
|
|
ba5173a494 | ||
|
|
b568ca982b | ||
|
|
04f99fe6c4 | ||
|
|
0b54ff61c4 | ||
|
|
074a7ab617 | ||
|
|
5a0acc2228 | ||
|
|
1c0f786eeb | ||
|
|
4b76e0623d | ||
|
|
e8508cb658 | ||
|
|
388cc57533 | ||
|
|
5beeada73f | ||
|
|
348a7dc851 | ||
|
|
ab52808c63 | ||
|
|
3a99f3c9d6 | ||
|
|
6c645363b3 | ||
|
|
2dbd777852 | ||
|
|
576b5a4caf | ||
|
|
031a756941 | ||
|
|
f324cd3bdd | ||
|
|
0ba02c5b03 | ||
|
|
b0c910c1cc | ||
|
|
59304f83c2 | ||
|
|
b3091e6d6f | ||
|
|
1a996e5407 | ||
|
|
f927e475ff | ||
|
|
fbd6bac81a | ||
|
|
12d769835e | ||
|
|
4690a977df | ||
|
|
cf1224524f | ||
|
|
9c89437dac | ||
|
|
3931ff04fc | ||
|
|
7585b573d3 | ||
|
|
22652da198 | ||
|
|
ce4ef0b577 | ||
|
|
769a8ad08d | ||
|
|
3dff483254 | ||
|
|
35f5befa9d | ||
|
|
4de8c6240d | ||
|
|
fd4bc0397a | ||
|
|
590e0e4d26 | ||
|
|
99619b5b90 | ||
|
|
e3d6ee16a9 | ||
|
|
e867277f6e | ||
|
|
2ea3e36eda | ||
|
|
e4dd66fd5c | ||
|
|
d4d094e2bb | ||
|
|
c53bfa090e | ||
|
|
1f8acec2ac | ||
|
|
6ce24870e5 | ||
|
|
be4674e641 | ||
|
|
5f97600612 | ||
|
|
158bacd256 | ||
|
|
0a4a845ff1 | ||
|
|
424fae7d53 | ||
|
|
4ca9efe4cf | ||
|
|
dd23c6a91f | ||
|
|
64908b18ba | ||
|
|
eaffc82e36 | ||
|
|
f57b063f68 | ||
|
|
58cebdd7dd | ||
|
|
a0f1c7e96e | ||
|
|
cdfea8ec70 | ||
|
|
9ea849eed3 | ||
|
|
f456e47904 | ||
|
|
772fc3a09a | ||
|
|
d3b36cac74 | ||
|
|
4f01e9039b | ||
|
|
5c8d3c20e8 | ||
|
|
28ef822dd5 | ||
|
|
03d1a5456a | ||
|
|
9bd635d058 | ||
|
|
bb5c73ae08 | ||
|
|
9f6995c441 | ||
|
|
25517c35d1 | ||
|
|
b7d282fe3b | ||
|
|
e1a52130a7 | ||
|
|
7d9b5985c6 | ||
|
|
5106e1d753 | ||
|
|
98cf1e709f | ||
|
|
91aba0df5c | ||
|
|
044ff8fa88 | ||
|
|
488053cea4 | ||
|
|
c3920bc499 | ||
|
|
44c441c436 | ||
|
|
55038b7315 | ||
|
|
bb9b59156c | ||
|
|
e66c1f748c |
@@ -37,6 +37,7 @@ skip_commits:
|
|||||||
- '**/*.html'
|
- '**/*.html'
|
||||||
- '**/*.md'
|
- '**/*.md'
|
||||||
- '.travis.yml'
|
- '.travis.yml'
|
||||||
|
- '.github/workflows/*'
|
||||||
|
|
||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
# additional packages #
|
# additional packages #
|
||||||
@@ -55,11 +56,11 @@ install:
|
|||||||
# Default build worker image
|
# Default build worker image
|
||||||
image: Visual Studio 2015
|
image: Visual Studio 2015
|
||||||
|
|
||||||
# Build Configurations: dll/static, regular/debug
|
# Build Configurations: shared/static, optimized/debug
|
||||||
configuration:
|
configuration:
|
||||||
- dynamic
|
- default
|
||||||
- static
|
- static
|
||||||
- dynamic-debug
|
- debug
|
||||||
- static-debug
|
- static-debug
|
||||||
|
|
||||||
# Environment variables: compiler toolchain, base version, setup file, ...
|
# Environment variables: compiler toolchain, base version, setup file, ...
|
||||||
@@ -71,41 +72,52 @@ environment:
|
|||||||
VV: 1
|
VV: 1
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
- CMP: vs2019
|
- CMP: vs2022
|
||||||
SET: test00
|
SET: test00
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||||
- CMP: mingw
|
- CMP: gcc
|
||||||
- CMP: vs2019
|
- CMP: vs2022
|
||||||
VV: 0
|
VV: 0
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||||
- CMP: vs2019
|
- CMP: vs2022
|
||||||
BASE: 3.15
|
BASE: 3.15
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
CLEAN_DEPS: NO
|
||||||
- CMP: vs2019
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||||
|
- CMP: vs2022
|
||||||
BASE: 3.14
|
BASE: 3.14
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||||
|
- CMP: vs2019
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
- CMP: vs2017
|
- CMP: vs2017
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
|
EXTRA: EXTRA_DEF="extra"
|
||||||
|
EXTRA1: EXTRA1_DEF="extra 1"
|
||||||
|
EXTRA2: EXTRA2_DEF="extra 2"
|
||||||
- CMP: vs2015
|
- CMP: vs2015
|
||||||
- CMP: vs2013
|
- CMP: vs2013
|
||||||
- CMP: vs2012
|
- CMP: vs2012
|
||||||
- CMP: vs2010
|
- CMP: vs2010
|
||||||
- CMP: vs2008
|
|
||||||
|
|
||||||
# Platform: architecture
|
# Platform: architecture
|
||||||
platform:
|
platform:
|
||||||
- x86
|
- x86
|
||||||
- x64
|
- x64
|
||||||
|
|
||||||
# Matrix configuration: allow specific failing jobs
|
# Matrix configuration: allow/exclude specific failing jobs
|
||||||
matrix:
|
matrix:
|
||||||
|
# The MSI tool generated from that builds segfaults (*shrug*)
|
||||||
|
allow_failures:
|
||||||
|
- platform: x64
|
||||||
|
configuration: static-debug
|
||||||
|
CMP: vs2019
|
||||||
|
BASE: 3.14
|
||||||
exclude:
|
exclude:
|
||||||
# Run test00 only once: x64 dynamic
|
# Run test00 only once: x64 dynamic
|
||||||
- platform: x86
|
- platform: x86
|
||||||
SET: test00
|
SET: test00
|
||||||
- configuration: static
|
- configuration: static
|
||||||
SET: test00
|
SET: test00
|
||||||
- configuration: dynamic-debug
|
- configuration: debug
|
||||||
SET: test00
|
SET: test00
|
||||||
- configuration: static-debug
|
- configuration: static-debug
|
||||||
SET: test00
|
SET: test00
|
||||||
@@ -114,8 +126,6 @@ matrix:
|
|||||||
CMP: vs2012
|
CMP: vs2012
|
||||||
- platform: x64
|
- platform: x64
|
||||||
CMP: vs2010
|
CMP: vs2010
|
||||||
- platform: x64
|
|
||||||
CMP: vs2008
|
|
||||||
|
|
||||||
# Run test script for unit tests (SET = test00)
|
# Run test script for unit tests (SET = test00)
|
||||||
for:
|
for:
|
||||||
@@ -124,7 +134,7 @@ for:
|
|||||||
only:
|
only:
|
||||||
- SET: test00
|
- SET: test00
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: python appveyor-test.py
|
- cmd: python cue-test.py
|
||||||
test_script:
|
test_script:
|
||||||
- cmd: echo Tests have been run in the build phase
|
- cmd: echo Tests have been run in the build phase
|
||||||
|
|
||||||
@@ -133,11 +143,12 @@ for:
|
|||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: python appveyor/do.py prepare
|
- cmd: python cue.py prepare
|
||||||
- cmd: python appveyor/do.py build
|
- cmd: python cue.py build
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cmd: python appveyor/do.py test
|
- cmd: python cue.py -T 15M test
|
||||||
|
- cmd: python cue.py test-results
|
||||||
|
|
||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
# debugging #
|
# debugging #
|
||||||
|
|||||||
143
.github/workflows/build-and-test.yml
vendored
Normal file
143
.github/workflows/build-and-test.yml
vendored
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
name: ci-scripts build/test
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
env:
|
||||||
|
SETUP_PATH: .:.ci
|
||||||
|
SET: test01
|
||||||
|
VV: 1
|
||||||
|
BASE_RECURSIVE: NO
|
||||||
|
CMP: gcc
|
||||||
|
APT: re2c
|
||||||
|
CHOCO: re2c
|
||||||
|
BREW: re2c
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
unit-test:
|
||||||
|
name: Unit tests on ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019, macos-12, macos-11]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Show initial environment
|
||||||
|
run: python3 cue-test.py env
|
||||||
|
- name: Run unit tests
|
||||||
|
run: python3 cue-test.py
|
||||||
|
|
||||||
|
build-linux:
|
||||||
|
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
CMP: ${{ matrix.cmp }}
|
||||||
|
BCFG: ${{ matrix.configuration }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-22.04, ubuntu-20.04]
|
||||||
|
cmp: [gcc, clang]
|
||||||
|
configuration: [default, static, debug, static-debug]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Prepare and compile dependencies
|
||||||
|
run: python cue.py prepare
|
||||||
|
- name: Build main module (example app)
|
||||||
|
run: python cue.py build
|
||||||
|
- name: Run main module tests
|
||||||
|
run: python cue.py -T 15M test
|
||||||
|
- name: Collect and show test results
|
||||||
|
run: python cue.py test-results
|
||||||
|
|
||||||
|
build-macos:
|
||||||
|
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
CMP: ${{ matrix.cmp }}
|
||||||
|
BCFG: ${{ matrix.configuration }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-12, macos-11]
|
||||||
|
cmp: [clang]
|
||||||
|
configuration: [default, debug]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Prepare and compile dependencies
|
||||||
|
run: python cue.py prepare
|
||||||
|
- name: Build main module (example app)
|
||||||
|
run: python cue.py build
|
||||||
|
- name: Run main module tests
|
||||||
|
run: python cue.py -T 15M test
|
||||||
|
- name: Collect and show test results
|
||||||
|
run: python cue.py test-results
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
name: ${{ matrix.cmp }} / ${{ matrix.configuration }} / ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
CMP: ${{ matrix.cmp }}
|
||||||
|
BCFG: ${{ matrix.configuration }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [windows-2022, windows-2019]
|
||||||
|
cmp: [gcc, vs2022, vs2019]
|
||||||
|
configuration: [default, static, debug, static-debug]
|
||||||
|
exclude:
|
||||||
|
- os: windows-2022
|
||||||
|
cmp: vs2019
|
||||||
|
|
||||||
|
- os: windows-2019
|
||||||
|
cmp: vs2022
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Prepare and compile dependencies
|
||||||
|
run: python cue.py prepare
|
||||||
|
- name: Build main module (example app)
|
||||||
|
run: python cue.py build
|
||||||
|
- name: Run main module tests
|
||||||
|
run: python cue.py -T 15M test
|
||||||
|
- name: Collect and show test results
|
||||||
|
run: python cue.py test-results
|
||||||
|
|
||||||
|
build-cross:
|
||||||
|
name: cross ${{ matrix.cross }} / ${{ matrix.cmp }} / ${{ matrix.configuration }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
CMP: gcc
|
||||||
|
BCFG: default
|
||||||
|
CI_CROSS_TARGETS: ${{ matrix.cross }}
|
||||||
|
TEST: ${{ matrix.test }}
|
||||||
|
APT: re2c
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
# configuration: [default, static, debug, static-debug]
|
||||||
|
configuration: [default]
|
||||||
|
cross:
|
||||||
|
- linux-aarch64
|
||||||
|
- linux-arm@arm-linux-gnueabi
|
||||||
|
- linux-arm@arm-linux-gnueabihf
|
||||||
|
- linux-ppc
|
||||||
|
- linux-ppc64
|
||||||
|
- win32-x86-mingw
|
||||||
|
- windows-x64-mingw
|
||||||
|
- RTEMS-pc386-qemu@4.9
|
||||||
|
- RTEMS-pc386-qemu@4.10
|
||||||
|
- RTEMS-pc686-qemu@5
|
||||||
|
include:
|
||||||
|
- cross: RTEMS-pc386-qemu@4.10
|
||||||
|
test: NO
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Prepare and compile dependencies
|
||||||
|
run: python cue.py prepare
|
||||||
|
- name: Build main module (example app)
|
||||||
|
run: python cue.py build
|
||||||
|
- name: Run main module tests
|
||||||
|
run: python cue.py -T 15M test
|
||||||
|
- name: Collect and show test results
|
||||||
|
run: python cue.py test-results
|
||||||
180
.gitlab-ci.yml
Normal file
180
.gitlab-ci.yml
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
# .gitlab-ci.yml for testing EPICS Base ci-scripts
|
||||||
|
# (see: https://github.com/epics-base/ci-scripts)
|
||||||
|
|
||||||
|
# Note:
|
||||||
|
# Paths to scripts are different in this test configuration
|
||||||
|
# (your module has one more directory level: .ci)
|
||||||
|
|
||||||
|
image: ubuntu:bionic
|
||||||
|
|
||||||
|
cache:
|
||||||
|
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
||||||
|
paths:
|
||||||
|
- .cache/
|
||||||
|
|
||||||
|
variables:
|
||||||
|
GIT_SUBMODULE_STRATEGY: "recursive"
|
||||||
|
SETUP_PATH: ".:.ci"
|
||||||
|
BASE_RECURSIVE: "NO"
|
||||||
|
APT: "libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c"
|
||||||
|
DEBIAN_FRONTEND: "noninteractive"
|
||||||
|
CMP: "gcc"
|
||||||
|
BGFC: "default"
|
||||||
|
VV: "1"
|
||||||
|
SET: test01
|
||||||
|
|
||||||
|
# Unit tests
|
||||||
|
unit_test:
|
||||||
|
stage: build
|
||||||
|
variables:
|
||||||
|
SET: test00
|
||||||
|
before_script:
|
||||||
|
- apt-get update -qq && apt-get install -y -qq make git python curl p7zip-full
|
||||||
|
- python cue-test.py env
|
||||||
|
script:
|
||||||
|
- python cue-test.py
|
||||||
|
|
||||||
|
# Template job for test builds (hidden)
|
||||||
|
.build:
|
||||||
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full
|
||||||
|
- python cue.py prepare
|
||||||
|
script:
|
||||||
|
- python cue.py build
|
||||||
|
- python cue.py test
|
||||||
|
- python cue.py test-results
|
||||||
|
|
||||||
|
# gcc builds using four configurations (shared/static, optimized/debug)
|
||||||
|
gcc_default:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
|
gcc_static:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BCFG: "static"
|
||||||
|
|
||||||
|
gcc_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BCFG: "debug"
|
||||||
|
|
||||||
|
gcc_static_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BCFG: "static-debug"
|
||||||
|
|
||||||
|
# clang builds using four configurations (shared/static, optimized/debug)
|
||||||
|
clang_default:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
CMP: "clang"
|
||||||
|
|
||||||
|
clang_static:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
CMP: "clang"
|
||||||
|
BCFG: "static"
|
||||||
|
|
||||||
|
clang_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
CMP: "clang"
|
||||||
|
BCFG: "debug"
|
||||||
|
|
||||||
|
clang_static_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
CMP: "clang"
|
||||||
|
BCFG: "static-debug"
|
||||||
|
|
||||||
|
# WINE based cross-builds to Windows 32bit and 64bit
|
||||||
|
wine32_default:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "32"
|
||||||
|
|
||||||
|
wine32_static:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "32"
|
||||||
|
BCFG: "static"
|
||||||
|
|
||||||
|
wine32_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "32"
|
||||||
|
BCFG: "debug"
|
||||||
|
|
||||||
|
wine32_static_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "32"
|
||||||
|
BCFG: "static-debug"
|
||||||
|
|
||||||
|
wine64_default:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "64"
|
||||||
|
|
||||||
|
wine64_static:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "64"
|
||||||
|
BCFG: "static"
|
||||||
|
|
||||||
|
wine64_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "64"
|
||||||
|
BCFG: "debug"
|
||||||
|
|
||||||
|
wine64_static_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
WINE: "64"
|
||||||
|
BCFG: "static-debug"
|
||||||
|
|
||||||
|
# Cross-builds to RTEMS 4.9 and 4.10
|
||||||
|
rtems4.9_default:
|
||||||
|
extends: .build
|
||||||
|
image: ubuntu:focal
|
||||||
|
variables:
|
||||||
|
RTEMS: "4.9"
|
||||||
|
BASE: "3.15"
|
||||||
|
|
||||||
|
rtems4.9_debug:
|
||||||
|
extends: .build
|
||||||
|
image: ubuntu:focal
|
||||||
|
variables:
|
||||||
|
RTEMS: "4.9"
|
||||||
|
BASE: "3.15"
|
||||||
|
BCFG: "debug"
|
||||||
|
|
||||||
|
rtems4.10_default:
|
||||||
|
extends: .build
|
||||||
|
image: ubuntu:focal
|
||||||
|
variables:
|
||||||
|
RTEMS: "4.10"
|
||||||
|
|
||||||
|
rtems4.10_debug:
|
||||||
|
extends: .build
|
||||||
|
image: ubuntu:focal
|
||||||
|
variables:
|
||||||
|
RTEMS: "4.10"
|
||||||
|
BCFG: "debug"
|
||||||
|
|
||||||
|
rtems5_default:
|
||||||
|
extends: .build
|
||||||
|
image: ubuntu:focal
|
||||||
|
variables:
|
||||||
|
RTEMS: "5"
|
||||||
|
RTEMS_TARGET: "RTEMS-pc686-qemu"
|
||||||
|
|
||||||
|
rtems5_debug:
|
||||||
|
extends: .build
|
||||||
|
image: ubuntu:focal
|
||||||
|
variables:
|
||||||
|
RTEMS: "5"
|
||||||
|
RTEMS_TARGET: "RTEMS-pc686-qemu"
|
||||||
|
BCFG: "debug"
|
||||||
226
.travis.yml
226
.travis.yml
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
dist: xenial
|
dist: bionic
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
@@ -16,6 +16,9 @@ cache:
|
|||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- SETUP_PATH=.:.ci
|
- SETUP_PATH=.:.ci
|
||||||
|
- VV=1
|
||||||
|
- CHOCO=re2c
|
||||||
|
- BASE_RECURSIVE=NO
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@@ -27,17 +30,19 @@ addons:
|
|||||||
- g++-mingw-w64-i686
|
- g++-mingw-w64-i686
|
||||||
- g++-mingw-w64-x86-64
|
- g++-mingw-w64-x86-64
|
||||||
- qemu-system-x86
|
- qemu-system-x86
|
||||||
|
- p7zip-full
|
||||||
homebrew:
|
homebrew:
|
||||||
packages:
|
packages:
|
||||||
- re2c
|
- re2c
|
||||||
- bash
|
- p7zip
|
||||||
update: true
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ./travis/prepare.sh
|
- python cue.py prepare
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./travis-test.sh
|
- python cue.py build
|
||||||
|
- python cue.py test
|
||||||
|
- python cue.py test-results
|
||||||
|
|
||||||
# If you need to do more during install and build,
|
# If you need to do more during install and build,
|
||||||
# add a local directory to your module and do e.g.
|
# add a local directory to your module and do e.g.
|
||||||
@@ -46,136 +51,129 @@ script:
|
|||||||
# Define build jobs
|
# Define build jobs
|
||||||
|
|
||||||
# Well-known variables to use
|
# Well-known variables to use
|
||||||
# SET source setup file
|
# SET source setup file
|
||||||
# EXTRA content will be added to make command line
|
# ADD_MODULES extra modules (for a specific job)
|
||||||
# STATIC set to YES for static build (default: NO)
|
# EXTRA content will be added to make command line
|
||||||
# TEST set to NO to skip running the tests (default: YES)
|
# BCFG build configuration (static/debug/static-debug;
|
||||||
# VV set to make build scripts verbose (default: unset)
|
# default: shared-optimized)
|
||||||
|
# TEST set to NO to skip running the tests (default: YES)
|
||||||
|
# VV set to make build scripts verbose (default: unset)
|
||||||
|
|
||||||
# Usually from setup files, but may be specified or overridden
|
# Usually from setup files, but may be specified or overridden
|
||||||
# on a job line
|
# on a job line
|
||||||
# MODULES list of dependency modules
|
# MODULES list of dependency modules
|
||||||
# BASE branch or release tag name of the EPICS Base to use
|
# BASE branch or release tag name of the EPICS Base to use
|
||||||
# <MODULE> branch or release tag for a specific module
|
# <MODULE> branch or release tag for a specific module
|
||||||
# ... see README for setup file syntax description
|
# ... see README for setup file syntax description
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
|
|
||||||
# Run unit tests on Linux and Mac
|
# Run unit tests
|
||||||
|
|
||||||
- env: SET=test00
|
- env: SET=test00
|
||||||
|
install: python cue-test.py env
|
||||||
|
script: python cue-test.py
|
||||||
|
|
||||||
|
- env: SET=test00 TRAVIS_COMPILER=gcc
|
||||||
|
language: python
|
||||||
|
python: "3.7"
|
||||||
|
install: python cue-test.py env
|
||||||
|
script: python cue-test.py
|
||||||
|
|
||||||
- env: SET=test00
|
- env: SET=test00
|
||||||
os: osx
|
os: osx
|
||||||
|
osx_image: xcode11.3
|
||||||
|
install: python cue-test.py env
|
||||||
|
script: python cue-test.py
|
||||||
|
|
||||||
# Compile the example application
|
- env: SET=test00
|
||||||
# using the build configurations from full makeBaseApp example
|
os: windows
|
||||||
|
install: python cue-test.py env
|
||||||
|
script: python cue-test.py
|
||||||
|
|
||||||
|
# Compile example
|
||||||
|
|
||||||
- env: SET=test01
|
- env: SET=test01
|
||||||
|
dist: focal
|
||||||
|
|
||||||
# On the side: test ADD_MODULES
|
- env: SET=test01 BCFG=static-debug
|
||||||
- env: SET=test01 ADD_MODULES=ipac
|
dist: focal
|
||||||
compiler: clang
|
|
||||||
|
|
||||||
- env: VV="" SET=test01
|
- env: SET=test01 CLEAN_DEPS=NO
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
- env: SET=test01 BCFG=static-debug
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
- env: SET=test01 TRAVIS_COMPILER=gcc
|
||||||
|
language: python
|
||||||
|
python: "3.7"
|
||||||
|
|
||||||
- env: SET=test01 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
- env: SET=test01 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
||||||
|
- env: SET=test01 BCFG=static
|
||||||
- env: SET=test01 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
- env: SET=test01 BCFG=debug
|
||||||
compiler: clang
|
- env: SET=test01 BCFG=static-debug
|
||||||
|
|
||||||
# trusty is pretty close to RHEL7
|
|
||||||
- env: SET=test01
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
- env: SET=test01 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
# Cross-compilation to Windows using MinGW and WINE
|
|
||||||
|
|
||||||
- env: SET=test01 WINE=32 TEST=NO STATIC=YES
|
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
- env: SET=test01 WINE=64 TEST=NO STATIC=YES
|
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
# dynamic (DLL) builds are broken on xenial
|
|
||||||
- env: SET=test01 WINE=32 TEST=NO STATIC=NO
|
|
||||||
dist: bionic
|
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
- env: SET=test01 WINE=64 TEST=NO STATIC=NO
|
|
||||||
dist: bionic
|
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
# Cross-compilation to RTEMS
|
|
||||||
# (needs EPICS Base >= 3.16.2)
|
|
||||||
|
|
||||||
- env: SET=test01 RTEMS=4.10
|
|
||||||
|
|
||||||
- env: SET=test01 RTEMS=4.9
|
|
||||||
|
|
||||||
# Other gcc versions (adding as an extra package)
|
|
||||||
|
|
||||||
- env: SET=test01
|
- env: SET=test01
|
||||||
compiler: gcc-6
|
compiler: clang
|
||||||
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
|
|
||||||
|
- env: SET=test01 BCFG=static-debug
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode11.3
|
||||||
|
env:
|
||||||
|
- SET=test01
|
||||||
|
- EXTRA=CMD_CFLAGS="-mmacosx-version-min=10.7"
|
||||||
|
- EXTRA1=CMD_CXXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++"
|
||||||
|
- EXTRA2=CMD_LDXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++"
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
|
- env: SET=test01 BCFG=debug
|
||||||
|
os: osx
|
||||||
|
osx_image: xcode11.3
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
|
- env: SET=test01 WINE=32 TEST=NO
|
||||||
|
- env: SET=test01 WINE=32 TEST=NO BCFG=static
|
||||||
|
- env: SET=test01 WINE=32 TEST=NO BCFG=debug
|
||||||
|
- env: SET=test01 WINE=32 TEST=NO BCFG=static-debug
|
||||||
|
|
||||||
|
- env: SET=test01 WINE=64 TEST=NO
|
||||||
|
- env: SET=test01 WINE=64 TEST=NO BCFG=static
|
||||||
|
- env: SET=test01 WINE=64 TEST=NO BCFG=debug
|
||||||
|
- env: SET=test01 WINE=64 TEST=NO BCFG=static-debug
|
||||||
|
|
||||||
|
- env: SET=test01 RTEMS=4.9 BASE=3.15 TEST=NO APT=usrmerge
|
||||||
|
- env: SET=test01 RTEMS=4.9 BASE=3.15 TEST=NO BCFG=debug APT=usrmerge
|
||||||
|
|
||||||
|
- env: SET=test01 RTEMS=4.10 APT=usrmerge
|
||||||
|
- env: SET=test01 RTEMS=4.10 BCFG=debug APT=usrmerge
|
||||||
|
|
||||||
|
- env: SET=test01 RTEMS=5 RTEMS_TARGET=RTEMS-pc686-qemu
|
||||||
|
dist: focal
|
||||||
|
- env: SET=test01 RTEMS=5 RTEMS_TARGET=RTEMS-pc686-qemu BCFG=debug
|
||||||
|
dist: focal
|
||||||
|
|
||||||
- env: SET=test01
|
- env: SET=test01
|
||||||
compiler: gcc-7
|
os: windows
|
||||||
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
|
- env: SET=test01 BCFG=static
|
||||||
|
os: windows
|
||||||
|
- env: SET=test01 BCFG=debug
|
||||||
|
os: windows
|
||||||
|
- env: SET=test01 BCFG=static-debug
|
||||||
|
os: windows
|
||||||
|
|
||||||
# MacOS build
|
- env: SET=test01
|
||||||
|
compiler: vs2017
|
||||||
# SNCSEQ 2.2.7 fails to build on MacOS; currently needs master
|
os: windows
|
||||||
- env: SET=test01 SNCSEQ=master
|
- env: SET=test01 BCFG=static
|
||||||
os: osx
|
compiler: vs2017
|
||||||
compiler: clang
|
os: windows
|
||||||
|
- env: SET=test01 BCFG=debug
|
||||||
# Base 3.15 builds
|
compiler: vs2017
|
||||||
# ================
|
os: windows
|
||||||
|
- env: SET=test01 BCFG=static-debug
|
||||||
- env: BASE=R3.15.7 SET=test01
|
compiler: vs2017
|
||||||
|
os: windows
|
||||||
- env: BASE=R3.15.7 SET=test01 WINE=64 TEST=NO STATIC=YES
|
|
||||||
dist: bionic
|
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
# The DLL build for this Base version is known to fail
|
|
||||||
# - env: BASE=R3.15.7 SET=test01 WINE=64 TEST=NO STATIC=NO
|
|
||||||
# dist: bionic
|
|
||||||
# compiler: mingw
|
|
||||||
|
|
||||||
# Cross-compilation to RTEMS
|
|
||||||
# (needs EPICS Base >= 3.16.2)
|
|
||||||
|
|
||||||
- env: BASE=R3.16.2 SET=test01 RTEMS=4.10
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
- env: BASE=R3.16.2 SET=test01 RTEMS=4.9
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
# SNCSEQ 2.2.7 fails to build on MacOS; currently needs master
|
|
||||||
- env: BASE=R3.15.7 SET=test01 SNCSEQ=master
|
|
||||||
os: osx
|
|
||||||
compiler: clang
|
|
||||||
|
|
||||||
# Base 3.14 builds
|
|
||||||
# ================
|
|
||||||
|
|
||||||
- env: BASE=R3.14.12.8 SET=test01
|
|
||||||
|
|
||||||
- env: BASE=R3.14.12.8 SET=test01 WINE=64 TEST=NO STATIC=YES
|
|
||||||
dist: bionic
|
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
# The DLL build for this Base version is known to fail
|
|
||||||
# - env: BASE=R3.14.12.8 SET=test01 WINE=64 TEST=NO STATIC=NO
|
|
||||||
# dist: bionic
|
|
||||||
# compiler: mingw
|
|
||||||
|
|
||||||
# SNCSEQ 2.2.7 fails to build on MacOS; currently needs master
|
|
||||||
- env: BASE=R3.14.12.8 SET=test01 SNCSEQ=master
|
|
||||||
os: osx
|
|
||||||
compiler: clang
|
|
||||||
|
|||||||
350
README.md
350
README.md
@@ -1,8 +1,10 @@
|
|||||||
<a target="_blank" href="http://semver.org">![Version][badge.version]</a>
|
<a target="_blank" href="http://semver.org">![Version][badge.version]</a>
|
||||||
<a target="_blank" href="https://travis-ci.org/epics-base/ci-scripts">![Travis status][badge.travis]</a>
|
<a target="_blank" href="https://travis-ci.org/epics-base/ci-scripts">![Travis status][badge.travis]</a>
|
||||||
<a target="_blank" href="https://ci.appveyor.com/project/epics-base/ci-scripts">![AppVeyor status][badge.appveyor]</a>
|
<a target="_blank" href="https://ci.appveyor.com/project/epics-base/ci-scripts">![AppVeyor status][badge.appveyor]</a>
|
||||||
|
<a target="_blank" href="https://github.com/epics-base/ci-scripts/actions">![GitHub Actions status][badge.gh-actions]</a>
|
||||||
|
<a target="_blank" href="https://gitlab.com/epics-base/ci-scripts/-/pipelines">![GitLab CI/CD status][badge.gitlab]</a>
|
||||||
|
|
||||||
# Continuous Integration Scripts for EPICS Modules
|
# Continuous Integration for EPICS Modules
|
||||||
|
|
||||||
The scripts inside this repository are intended to provide a common,
|
The scripts inside this repository are intended to provide a common,
|
||||||
easy-to-use and flexible way to add Continuous Integration to EPICS
|
easy-to-use and flexible way to add Continuous Integration to EPICS
|
||||||
@@ -16,66 +18,121 @@ including a way to specify sets of dependent modules
|
|||||||
By using the submodule mechanism, your module will always use an
|
By using the submodule mechanism, your module will always use an
|
||||||
explicit commit, i.e. a fixed version of the scripts.
|
explicit commit, i.e. a fixed version of the scripts.
|
||||||
This ensures that any further development of the ci-scripts will
|
This ensures that any further development of the ci-scripts will
|
||||||
never break existing use.
|
never break your existing use.
|
||||||
|
|
||||||
## This Repository
|
## This Repository
|
||||||
|
|
||||||
In addition to the scripts themselves (in the subdirectories),
|
In addition to the script that runs the builds and tests, this repository
|
||||||
this repository contains the test suite that is used to verify
|
contains service specific documentation and example configuration files
|
||||||
functionality and features of the ci-scripts.
|
(in the subdirectories), and a small test suite that is used to verify
|
||||||
|
functionality and features of the ci-scripts module itself
|
||||||
|
|
||||||
You are welcome to use the test suite as a reference, but keep in
|
The example files are your best reference. They are kept up-to-date and
|
||||||
mind that in your module the path to the scripts has one level more
|
show a fully-featured and a minimal setup.
|
||||||
(e.g., `./travis/abc` here would be `./.ci/travis/abc` in your
|
|
||||||
|
You are welcome to use the test suite as a secondary reference, but keep in
|
||||||
|
mind that in your main module the path to the scripts has one level more
|
||||||
|
(e.g., `./abc` here would be `./.ci/abc` in your
|
||||||
module).
|
module).
|
||||||
Also, a test suite might not show the same level of quality as an
|
Also, the test suite does not show the same quality and documentation
|
||||||
example.
|
levels as the example files.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Compile against different branches or releases of EPICS Base and
|
- Compile against different branches or releases of EPICS Base and
|
||||||
additional dependencies (modules like asyn, std, etc.).
|
additional dependencies (modules like asyn, std, sequencer, etc.).
|
||||||
|
|
||||||
- Define settings files that declare sets of dependencies
|
- Define setup files that declare sets of dependencies with their
|
||||||
with their versions and locations.
|
versions and locations.
|
||||||
|
|
||||||
- Define hook scripts for any dependency.
|
- Define hooks for any dependency.
|
||||||
Hooks are run on the dependency module before it is compiled, so
|
Hooks are run on the dependency module before it is compiled, so
|
||||||
the module can be patched or further configured.
|
the module can be patched or further configured.
|
||||||
|
|
||||||
- Define static or shared builds (executables, libraries).
|
- Define shared (default) or static builds (for executables and libraries).
|
||||||
|
|
||||||
- Run tests (using the EPICS unit test suite).
|
- Define optimized (default) or debug builds.
|
||||||
|
|
||||||
|
- Run tests (using the EPICS build system, i.e., `make runtests`
|
||||||
|
and friends).
|
||||||
|
|
||||||
## Supported CI Services
|
## Supported CI Services
|
||||||
|
|
||||||
### [Travis-CI](https://travis-ci.org/)
|
The listed properties and instructions for the CI services apply to
|
||||||
- Use different compilers (gcc, clang)
|
their free tiers for open source projects, hosted in the cloud on
|
||||||
- Use different gcc versions
|
their infrastructure.
|
||||||
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
|
||||||
- Cross-compile for RTEMS 4.9 and 4.10 (Base >= 3.16.2)
|
|
||||||
- Compile on MacOS
|
|
||||||
- Built dependencies are cached (for faster builds)
|
|
||||||
|
|
||||||
See specific **[ci-scripts on Travis-CI README](travis/README.md)** for more details.
|
The companies behind these services also offer "enterprise" installations
|
||||||
|
on customer infrastructure, which will have different performance
|
||||||
|
and limitations.
|
||||||
|
|
||||||
|
### [Travis-CI](https://travis-ci.org/)
|
||||||
|
- Two parallel runners on Linux/Windows (two runners on MacOS)
|
||||||
|
- Ubuntu 14/16/18/20, MacOS 10.13/14/15, Windows Server v1809
|
||||||
|
- Compile natively on Linux (different versions of gcc, clang)
|
||||||
|
- Compile natively on MacOS (clang)
|
||||||
|
- Compile natively on Windows (gcc/MinGW, Visual Studio 2017)
|
||||||
|
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
||||||
|
- Cross-compile for RTEMS 4.9 and 4.10 (pc386, Base >= 3.15)
|
||||||
|
- Cross-compile for RTEMS 5 (10 BSPs, Base >= 7.0.5.1)
|
||||||
|
- Built dependencies are cached (for faster builds).
|
||||||
|
|
||||||
|
See specific
|
||||||
|
**[ci-scripts on Travis-CI README](travis/README.md)**
|
||||||
|
for more details.
|
||||||
|
|
||||||
### [AppVeyor](https://www.appveyor.com/)
|
### [AppVeyor](https://www.appveyor.com/)
|
||||||
- Use different compilers (Visual Studio, MinGW)
|
- One parallel runner (all builds are sequential)
|
||||||
- Use different Visual Studio versions: \
|
- Windows Server 2012/2016/2019
|
||||||
2008, 2010, 2012, 2013, 2015, 2017, 2019
|
- Compile using gcc/MinGW or different Visual Studio versions: \
|
||||||
|
2010, 2012, 2013, 2015, 2017, 2019, 2022
|
||||||
- Compile for Windows 32bit and 64bit
|
- Compile for Windows 32bit and 64bit
|
||||||
|
- No useful caching available.
|
||||||
|
|
||||||
See specific **[ci-scripts on AppVeyor README](appveyor/README.md)** for more details.
|
See specific
|
||||||
|
**[ci-scripts on AppVeyor README](appveyor/README.md)**
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
### [GitHub Actions](https://github.com/)
|
||||||
|
- 20 parallel runners on Linux/Windows (5 runners on MacOS)
|
||||||
|
- Ubuntu 18/20/22, MacOS 11/12, Windows Server 2019/2022
|
||||||
|
- Compile natively on Linux (gcc, clang)
|
||||||
|
- Compile natively on MacOS (clang)
|
||||||
|
- Compile natively on Windows (gcc/MinGW, Visual Studio 2019/2022)
|
||||||
|
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
||||||
|
- Cross-compile for RTEMS 4.9 and 4.10 (pc386, Base >= 3.15)
|
||||||
|
- Cross-compile for RTEMS 5 (10 BSPs, Base >= 7.0.5.1)
|
||||||
|
- Caching not supported by ci-scripts yet.
|
||||||
|
|
||||||
|
See specific
|
||||||
|
**[ci-scripts on GitHub Actions README](github-actions/README.md)**
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
### [GitLab CI/CD](https://gitlab.com/)
|
||||||
|
|
||||||
|
- Docker-based runners on Linux (one VM instance per job)
|
||||||
|
- Can use any Docker image from Dockerhub (the examples use
|
||||||
|
`ubuntu:bionic`)
|
||||||
|
- Compile natively using different compilers (gcc, clang)
|
||||||
|
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
||||||
|
- Cross-compile for RTEMS 4.9 and 4.10 (pc386, Base >= 3.15)
|
||||||
|
- Cross-compile for RTEMS 5 (10 BSPs, Base >= 7.0.5.1)
|
||||||
|
- Built dependencies are cached (for faster builds).
|
||||||
|
|
||||||
|
See specific
|
||||||
|
**[ci-scripts on GitLab CI/CD README](gitlab/README.md)**
|
||||||
|
for more details.
|
||||||
|
|
||||||
## How to Use the CI-Scripts
|
## How to Use the CI-Scripts
|
||||||
|
|
||||||
1. Get an account on a supported CI service provider platform.
|
1. Get an account on a supported CI service provider platform
|
||||||
(e.g. [Travis-CI](https://travis-ci.org/),
|
(e.g. [Travis-CI](https://travis-ci.org/),
|
||||||
[AppVeyor](https://www.appveyor.com/), Azure Pipelines...)
|
[AppVeyor](https://www.appveyor.com/), ...).
|
||||||
|
GitHub Actions does not require a separate account.
|
||||||
|
|
||||||
(More details in the specific README of the subdirectory.)
|
(More details in the specific README of the subdirectory.)
|
||||||
|
|
||||||
2. In your Support Module, add this ci-scripts repository
|
2. In your module, add this ci-scripts repository
|
||||||
as a Git Submodule (name suggestion: `.ci`).
|
as a Git Submodule (name suggestion: `.ci`).
|
||||||
```bash
|
```bash
|
||||||
git submodule add https://github.com/epics-base/ci-scripts .ci
|
git submodule add https://github.com/epics-base/ci-scripts .ci
|
||||||
@@ -94,8 +151,8 @@ See specific **[ci-scripts on AppVeyor README](appveyor/README.md)** for more de
|
|||||||
```
|
```
|
||||||
will compile against the EPICS Base 3.15 branch, the Sequencer
|
will compile against the EPICS Base 3.15 branch, the Sequencer
|
||||||
release 2.2.8 and release 4.34 of asyn.
|
release 2.2.8 and release 4.34 of asyn.
|
||||||
(Any settings can be overridden from the specific job configuration
|
(Any settings can be overridden from the specific job line
|
||||||
in e.g. `.travis.yml`.)
|
in the service configuration, e.g., `.travis.yml`.)
|
||||||
|
|
||||||
4. Create a configuration for the CI service by copying one of
|
4. Create a configuration for the CI service by copying one of
|
||||||
the examples provided in the service specific subdirectory
|
the examples provided in the service specific subdirectory
|
||||||
@@ -105,14 +162,54 @@ See specific **[ci-scripts on AppVeyor README](appveyor/README.md)** for more de
|
|||||||
|
|
||||||
5. Push your changes and check the CI service for your build results.
|
5. Push your changes and check the CI service for your build results.
|
||||||
|
|
||||||
|
## Calling the cue.py Script
|
||||||
|
|
||||||
|
Independent from CI service and platform, the runner script is called
|
||||||
|
from your main configuration as:
|
||||||
|
|
||||||
|
`python .ci/cue.py <action>`
|
||||||
|
|
||||||
|
where `<action>` is one of:
|
||||||
|
|
||||||
|
`prepare`\
|
||||||
|
Prepare the build by cloning Base and the configured dependency modules,
|
||||||
|
set up the EPICS build system, then
|
||||||
|
compile Base and these modules in the order they appear in the `MODULES`
|
||||||
|
setting.
|
||||||
|
|
||||||
|
`build`\
|
||||||
|
Build your main module.
|
||||||
|
|
||||||
|
`test`\
|
||||||
|
Run the tests of your main module.
|
||||||
|
|
||||||
|
`test-results`\
|
||||||
|
Collect the results of your tests and print a summary.
|
||||||
|
|
||||||
|
`exec`\
|
||||||
|
Execute the remainder of the line using the default command shell.
|
||||||
|
|
||||||
|
## Extra arguments to `make`
|
||||||
|
|
||||||
|
You can add additional arguments to the make runs that the `cue.py` script
|
||||||
|
starts. Put your additional arguments into environment variables named
|
||||||
|
`EXTRA`, `EXTRA1`, ... `EXTRA5`.
|
||||||
|
|
||||||
|
The variables may contain multiple arguments, separated by whitespace.
|
||||||
|
Use regular shell script quoting (single/double quotes, backslash escapes)
|
||||||
|
if you need spaces inside an extra argument.
|
||||||
|
|
||||||
|
The YAML syntax needed to set environment variables depends on the CI
|
||||||
|
service and platform. (See the full example configuration file.)
|
||||||
|
|
||||||
## Setup Files
|
## Setup Files
|
||||||
|
|
||||||
Your module might depend on EPICS Base and a few other support modules.
|
Your module might depend on EPICS Base and a few other support modules.
|
||||||
(E.g., a specific driver might need StreamDevice, ASYN and the Sequencer.)
|
(E.g., a specific driver might need StreamDevice, ASYN and the Sequencer.)
|
||||||
In that case, building against every possible combination of released
|
In that case, building against every possible combination of released
|
||||||
versions of those dependencies is not possible:
|
versions of those dependencies is not possible:
|
||||||
Base (37) x StreamDevice (50) x ASYN (40) x Sequencer (51) would produce
|
Base (39) x StreamDevice (50) x ASYN (40) x Sequencer (52) would produce
|
||||||
more than 3.7 million different combinations, i.e. build jobs.
|
more than 4 million different combinations, i.e. build jobs.
|
||||||
|
|
||||||
A more reasonable approach is to create a few setups, each being a
|
A more reasonable approach is to create a few setups, each being a
|
||||||
combination of dependency releases, that do a few scans of the available
|
combination of dependency releases, that do a few scans of the available
|
||||||
@@ -120,19 +217,23 @@ combination of dependency releases, that do a few scans of the available
|
|||||||
for stable versions that many of your users have in production, one for the
|
for stable versions that many of your users have in production, one for the
|
||||||
latest released versions and one for the development branches.
|
latest released versions and one for the development branches.
|
||||||
|
|
||||||
|
A job uses a setup file if `SET=<setup>` (without the `.set` extension
|
||||||
|
of the setup file) is set for the job in the main configuration file.
|
||||||
|
|
||||||
## Setup File Syntax
|
## Setup File Syntax
|
||||||
|
|
||||||
Setup files are loaded by the build scripts. They are found by searching
|
Setup files are loaded by the build script. They are found by searching
|
||||||
the locations in `SETUP_PATH` (space or colon separated list of directories,
|
the locations in `SETUP_PATH` (space or colon separated list of directories,
|
||||||
relative to your module's root directory).
|
relative to your module's root directory).
|
||||||
|
|
||||||
Setup files can include other setup files by calling `include <setup>`
|
Setup files can include other setup files by calling `include <setup>`
|
||||||
(omitting the `.set` extension of the setup file). The configured
|
(again omitting the `.set` extension of the setup file). The configured
|
||||||
`SETUP_PATH` is searched for the include.
|
`SETUP_PATH` is searched for the include.
|
||||||
|
|
||||||
Any `VAR=value` setting of a variable is only executed if `VAR` is unset or
|
Any `VAR=value` setting of a variable in a setup file is only executed if
|
||||||
empty. That way any settings can be overridden by settings in the main
|
`VAR` is unset or empty.
|
||||||
configuration (e.g., `.travis.yml`).
|
That way any settings can be overridden by setting them in the job
|
||||||
|
description inside the main configuration file (e.g., `.travis.yml`).
|
||||||
|
|
||||||
Empty lines or lines starting with `#` are ignored.
|
Empty lines or lines starting with `#` are ignored.
|
||||||
|
|
||||||
@@ -141,8 +242,9 @@ by using their well-known slugs, separated by spaces.
|
|||||||
EPICS Base (slug: `base`) will always be a dependency and will be added and
|
EPICS Base (slug: `base`) will always be a dependency and will be added and
|
||||||
compiled first. The other dependencies are added and compiled in the order
|
compiled first. The other dependencies are added and compiled in the order
|
||||||
they are defined in `MODULES`.
|
they are defined in `MODULES`.
|
||||||
|
|
||||||
Modules needed only for specific jobs (e.g., on specific architectures)
|
Modules needed only for specific jobs (e.g., on specific architectures)
|
||||||
can be added in the main configuration file by setting `ADD_MODULES`
|
can be added from the main configuration file by setting `ADD_MODULES`
|
||||||
for the specific job(s).
|
for the specific job(s).
|
||||||
|
|
||||||
`REPOOWNER=<name>` sets the default GitHub owner (or organization) for all
|
`REPOOWNER=<name>` sets the default GitHub owner (or organization) for all
|
||||||
@@ -178,10 +280,11 @@ recursing into submodules. [default is including submodules: `YES`]
|
|||||||
be always be extended by the release or branch name as `<name>-<version>`.
|
be always be extended by the release or branch name as `<name>-<version>`.
|
||||||
[default is the slug in lower case: `foo`]
|
[default is the slug in lower case: `foo`]
|
||||||
|
|
||||||
`FOO_HOOK=<script>` Set the name of a script that will be run after cloning
|
`FOO_HOOK=<hook>` Set the name of a `.patch` file, a `.zip` or `.7z` archive
|
||||||
the module, before compiling it. Working directory when running the script
|
or a script that will be applied (using `-p1`), extracted or run after cloning
|
||||||
is the root of the targeted module (e.g. `.../.cache/foo-1.2`).
|
the module, before compiling it.
|
||||||
[default: no hooks are run]
|
Working directory is the root of the targeted module,
|
||||||
|
e.g., `.../.cache/foo-1.2`). [default: no hook]
|
||||||
|
|
||||||
`FOO_VARNAME=<name>` Set the name that is used for the module when creating
|
`FOO_VARNAME=<name>` Set the name that is used for the module when creating
|
||||||
the `RELEASE.local` files. [default is the slug in upper case: `FOO`]
|
the `RELEASE.local` files. [default is the slug in upper case: `FOO`]
|
||||||
@@ -191,6 +294,58 @@ that usually it is sufficient to set `FOO=<version>`.
|
|||||||
You can find the list of supported (and tested) modules in `defaults.set`.
|
You can find the list of supported (and tested) modules in `defaults.set`.
|
||||||
Feel free to suggest more default settings using a Pull Request.
|
Feel free to suggest more default settings using a Pull Request.
|
||||||
|
|
||||||
|
## RTEMS
|
||||||
|
|
||||||
|
Cross-compiling to RTEMS versions 4.9, 4.10 or 5 is supported
|
||||||
|
on supported CI services. For configuration see below.
|
||||||
|
Tests can also be run cross-platform, using `qemu`.
|
||||||
|
|
||||||
|
The RTEMS 5 builds now include most of the BSPs with configuration in Base:
|
||||||
|
|
||||||
|
- beatnik
|
||||||
|
- gen68360
|
||||||
|
- mcp750
|
||||||
|
- mvme167
|
||||||
|
- mvme2100
|
||||||
|
- mvme3100
|
||||||
|
- pc686 w/ libbsd
|
||||||
|
- qoriq_e500 w/ libbsd
|
||||||
|
- uC5282
|
||||||
|
- xilinx_zynq_a9_qemu w/ libbsd
|
||||||
|
|
||||||
|
Build configuration [can be found here][ref.rtems5build].
|
||||||
|
Set `RSB_BUILD` to select the RTEMS toolchain release name/data from
|
||||||
|
https://github.com/mdavidsaver/rsb/releases.
|
||||||
|
|
||||||
|
RTEMS 5 builds need to be switched to ubuntu version >= 20
|
||||||
|
(aka. **os: ubuntu-20.04** with GitHub Actions,
|
||||||
|
**dist: focal** with Travis-CI or
|
||||||
|
**image: ubuntu:focal** with GitLab CI/CD).
|
||||||
|
|
||||||
|
## Cross Compilation
|
||||||
|
|
||||||
|
Setting the `CI_CROSS_TARGETS` environment variable enables cross-compiling
|
||||||
|
from Linux to the provided targets architectures.
|
||||||
|
The value of the environment variable must contain the EPICS architecture
|
||||||
|
and - depending on the target - may contain additional information like
|
||||||
|
the compiler prefix to be used or the version of the target OS.
|
||||||
|
|
||||||
|
Multiple cross-targets can be added to the `CI_CROSS_TARGETS` variable
|
||||||
|
by separating them with a colon (`:`) character.
|
||||||
|
|
||||||
|
For example, possible values are:
|
||||||
|
|
||||||
|
- linux-aarch64
|
||||||
|
- linux-arm@arm-linux-gnueabi
|
||||||
|
- linux-arm@arm-linux-gnueabihf
|
||||||
|
- linux-ppc
|
||||||
|
- linux-ppc64
|
||||||
|
- win32-x86-mingw
|
||||||
|
- windows-x64-mingw
|
||||||
|
- RTEMS-pc386-qemu@4.9
|
||||||
|
- RTEMS-pc386-qemu@4.10
|
||||||
|
- RTEMS-pc686-qemu@5
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
Setting `VV=1` in your service configuration (e.g., `.travis.yml`) for a
|
Setting `VV=1` in your service configuration (e.g., `.travis.yml`) for a
|
||||||
@@ -201,51 +356,118 @@ builds to higher verbosity.
|
|||||||
For debugging on your local machine, you may set `CACHEDIR` to change the
|
For debugging on your local machine, you may set `CACHEDIR` to change the
|
||||||
location for the dependency builds. [default is `$HOME/.cache`]
|
location for the dependency builds. [default is `$HOME/.cache`]
|
||||||
|
|
||||||
|
Set `PARALLEL_MAKE` to the number of parallel make jobs that you want your
|
||||||
|
build to use. [default is the number of CPUs on the runner]
|
||||||
|
|
||||||
|
Set `CLEAN_DEPS` to `NO` if you want to leave the object file directories
|
||||||
|
(`**/O.*`) in the cached dependencies. [default is to run `make clean`
|
||||||
|
after building a dependency]
|
||||||
|
|
||||||
|
Service specific options are described in the README files
|
||||||
|
in the service specific subdirectories:
|
||||||
|
|
||||||
|
- [Travis-CI README](travis/README.md)
|
||||||
|
- [AppVeyor README](appveyor/README.md)
|
||||||
|
- [GitHub Actions README](github-actions/README.md)
|
||||||
|
- [GitLab README](gitlab/README.md)
|
||||||
|
|
||||||
## References: EPICS Modules Using ci-scripts
|
## References: EPICS Modules Using ci-scripts
|
||||||
|
|
||||||
[EPICS Base](https://github.com/epics-base/epics-base) and its submodules
|
[EPICS Base](https://github.com/epics-base/epics-base) and its submodules
|
||||||
[pvData](https://github.com/epics-base/pvDataCPP),
|
[pvData](https://github.com/epics-base/pvDataCPP),
|
||||||
[pvAccess](https://github.com/epics-base/pvAccessCPP),
|
[pvAccess](https://github.com/epics-base/pvAccessCPP),
|
||||||
[pva2pva](https://github.com/epics-base/pva2pva)
|
[pva2pva](https://github.com/epics-base/pva2pva),
|
||||||
|
[PVXS](https://github.com/mdavidsaver/pvxs)
|
||||||
|
|
||||||
EPICS Modules:
|
EPICS Modules:
|
||||||
[ASYN](https://github.com/epics-modules/asyn),
|
[ASYN](https://github.com/epics-modules/asyn),
|
||||||
|
[autosave](https://github.com/epics-modules/autosave),
|
||||||
|
[busy](https://github.com/epics-modules/busy),
|
||||||
[devlib2](https://github.com/epics-modules/devlib2),
|
[devlib2](https://github.com/epics-modules/devlib2),
|
||||||
[ecmc](https://github.com/epics-modules/ecmc),
|
[ecmc](https://github.com/epics-modules/ecmc),
|
||||||
|
[gtest](https://github.com/epics-modules/gtest),
|
||||||
[ip](https://github.com/epics-modules/ip),
|
[ip](https://github.com/epics-modules/ip),
|
||||||
[lua](https://github.com/epics-modules/lua),
|
[lua](https://github.com/epics-modules/lua),
|
||||||
[MCoreUtils](https://github.com/epics-modules/MCoreUtils),
|
[MCoreUtils](https://github.com/epics-modules/MCoreUtils),
|
||||||
[modbus](https://github.com/epics-modules/modbus),
|
[modbus](https://github.com/epics-modules/modbus),
|
||||||
[motor](https://github.com/epics-modules/motor),
|
[motor](https://github.com/epics-modules/motor),
|
||||||
|
[mrfioc2](https://github.com/epics-modules/mrfioc2),
|
||||||
|
[OPCUA](https://github.com/ralphlange/opcua),
|
||||||
[PCAS](https://github.com/epics-modules/pcas),
|
[PCAS](https://github.com/epics-modules/pcas),
|
||||||
|
[softGlueZync](https://github.com/epics-modules/softGlueZynq),
|
||||||
[sscan](https://github.com/epics-modules/sscan),
|
[sscan](https://github.com/epics-modules/sscan),
|
||||||
[vac](https://github.com/epics-modules/vac)
|
[std](https://github.com/epics-modules/std),
|
||||||
|
[vac](https://github.com/epics-modules/vac),
|
||||||
|
[xxx](https://github.com/epics-modules/xxx)
|
||||||
|
|
||||||
ESS: [EtherCAT MC Motor Driver][ref.ethercatmc]
|
ESS: [EtherCAT MC Motor Driver][ref.ethercatmc]
|
||||||
|
|
||||||
ITER: [OPC UA Device Support](https://github.com/ralphlange/opcua)
|
## Migration Hints
|
||||||
|
|
||||||
|
Look for changes in the example configuration files, and check how they
|
||||||
|
apply to your module.
|
||||||
|
|
||||||
|
If comments in the example have changed, copy them to your configuration
|
||||||
|
to always have up-to-date documentation in your file.
|
||||||
|
|
||||||
|
### 2.x to 3.x Migration
|
||||||
|
|
||||||
|
Update the script and test settings in your configuration to call the
|
||||||
|
new script, following the example file.
|
||||||
|
|
||||||
|
`python .ci/cue.py <action>`
|
||||||
|
|
||||||
|
#### AppVeyor
|
||||||
|
|
||||||
|
The `configuration:` setting options have changed; they are now
|
||||||
|
`default`, `static`, `debug` and `static-debug`.
|
||||||
|
|
||||||
|
MinGW builds are now using the `CMP: gcc` compiler setting.
|
||||||
|
|
||||||
|
Adding arguments to make is supported through the `EXTRA` .. `EXTRA5`
|
||||||
|
variables. Each variable value will be passed as one argument.
|
||||||
|
|
||||||
|
#### Travis
|
||||||
|
|
||||||
|
The new `BCFG` (build configuration) variable accepts the same options as
|
||||||
|
the AppVeyor `configuration:` setting. Replace any`STATIC=YES` settings with
|
||||||
|
`BCFG=static`.
|
||||||
|
|
||||||
|
Remove `bash` in the `homebrew:` section of `addons:`. There are no more
|
||||||
|
bash scripts.
|
||||||
|
|
||||||
|
MinGW builds (cross-builds using WINE as well as native builds on Windows)
|
||||||
|
are now using the `gcc` compiler setting.
|
||||||
|
Since `gcc` is the default, you can simply remove `compiler: mingw` lines.
|
||||||
|
|
||||||
|
For Windows, Travis offers native MinGW and Visual Studio 2017 compilers.
|
||||||
|
Use `os: windows` and set `compiler:` to `gcc` or `vs2017`
|
||||||
|
for those builds.
|
||||||
|
|
||||||
|
Chocolatey packages to be installed for the Windows jobs are set by adding
|
||||||
|
them to the environment variable `CHOCO`.
|
||||||
|
|
||||||
## Frequently Asked Questions
|
## Frequently Asked Questions
|
||||||
|
|
||||||
**How can I see what the dependency building jobs are actually doing?**
|
##### How can I see what the dependency building jobs are actually doing?
|
||||||
|
|
||||||
Set `VV=1` in the configuration line of the job you are interested in.
|
Set `VV=1` in the configuration line of the job you are interested in.
|
||||||
This will make all builds (not just for your module) verbose.
|
This will make all builds (not just for your module) verbose.
|
||||||
|
|
||||||
**How do I update my module to use a newer release of ci-scripts?**
|
##### How do I update my module to use a newer minor release of ci-scripts?
|
||||||
|
|
||||||
Update the submodule in `.ci` first, then change your CI configuration
|
Update the submodule in `.ci` first, then change your CI configuration
|
||||||
(if needed) and commit both to your module. E.g., to update your Travis
|
(if needed) and commit both to your module. E.g., to update your Travis
|
||||||
setup to release 2.3.5 of ci-scripts:
|
setup to release 3.3.0 of ci-scripts:
|
||||||
```bash
|
```bash
|
||||||
cd .ci
|
cd .ci
|
||||||
git pull origin v2.3.5
|
git pull origin v3.3.0
|
||||||
cd -
|
cd -
|
||||||
git add .ci
|
git add .ci
|
||||||
# if needed:
|
# if needed:
|
||||||
edit .travis.yml
|
edit .travis.yml # and/or other CI service configurations
|
||||||
git add .travis.yml
|
git add .travis.yml
|
||||||
git commit -m "Update ci-scripts submodule to v2.3.5"
|
git commit -m "Update ci-scripts submodule to v3.3.0"
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the example configuration files inside ci-scripts (and their
|
Check the example configuration files inside ci-scripts (and their
|
||||||
@@ -257,12 +479,16 @@ be advisable to clear the CI caches after updating ci-scripts. E.g.,
|
|||||||
a change in setting up EPICS Base will not be applied if Base is found
|
a change in setting up EPICS Base will not be applied if Base is found
|
||||||
in the cache.
|
in the cache.
|
||||||
|
|
||||||
**Why does running the scripts locally on my MacOS machine fail?**
|
##### How do I add a dependency module only for a specific job?
|
||||||
|
|
||||||
The ci-scripts for Travis-CI require Bash version 4.
|
Add the additional dependency in the main configuration file by setting
|
||||||
As Apple ships an older Bash for [political reasons][reddit.bash],
|
`ADD_MODULES` for the specific job(s).
|
||||||
you need to install a more recent Bash, e.g. using MacPorts
|
|
||||||
or Homebrew.
|
##### Why the name _cue_?
|
||||||
|
|
||||||
|
The noun _cue_ is defined as "_a signal (such as a word, phrase, or bit of
|
||||||
|
stage business) to a performer to begin a specific speech or action_".
|
||||||
|
(Merriam-Webster)
|
||||||
|
|
||||||
## Release Numbering of this Module
|
## Release Numbering of this Module
|
||||||
|
|
||||||
@@ -277,6 +503,7 @@ is created.
|
|||||||
|
|
||||||
Minor release numbers refer to additions and enhancements that do not
|
Minor release numbers refer to additions and enhancements that do not
|
||||||
require the configuration inside an existing user module to be changed.
|
require the configuration inside an existing user module to be changed.
|
||||||
|
(Unless for using a new feature.)
|
||||||
|
|
||||||
Again: using the git submodule mechanism to include these scripts means
|
Again: using the git submodule mechanism to include these scripts means
|
||||||
that user modules always work with a fixed, frozen version.
|
that user modules always work with a fixed, frozen version.
|
||||||
@@ -291,10 +518,13 @@ This module is distributed subject to a Software License Agreement found
|
|||||||
in file LICENSE that is included with this distribution.
|
in file LICENSE that is included with this distribution.
|
||||||
|
|
||||||
<!-- Links -->
|
<!-- Links -->
|
||||||
[badge.version]: https://badge.fury.io/gh/epics-base%2Fci-scripts.svg
|
[badge.version]: https://img.shields.io/github/v/release/epics-base/ci-scripts?sort=semver
|
||||||
[badge.travis]: https://travis-ci.org/epics-base/ci-scripts.svg?branch=master
|
[badge.travis]: https://travis-ci.org/epics-base/ci-scripts.svg?branch=master
|
||||||
[badge.appveyor]: https://ci.appveyor.com/api/projects/status/8b578alg974axvux?svg=true
|
[badge.appveyor]: https://ci.appveyor.com/api/projects/status/8b578alg974axvux?svg=true
|
||||||
|
[badge.gh-actions]: https://github.com/epics-base/ci-scripts/workflows/ci-scripts%20build/test/badge.svg
|
||||||
|
[badge.gitlab]: https://gitlab.com/epics-base/ci-scripts/badges/master/pipeline.svg
|
||||||
|
|
||||||
[reddit.bash]: https://www.reddit.com/r/bash/comments/393oqv/why_is_the_version_of_bash_included_in_os_x_so_old/
|
[reddit.bash]: https://www.reddit.com/r/bash/comments/393oqv/why_is_the_version_of_bash_included_in_os_x_so_old/
|
||||||
|
|
||||||
[ref.ethercatmc]: https://github.com/EuropeanSpallationSource/m-epics-ethercatmc
|
[ref.ethercatmc]: https://github.com/EuropeanSpallationSource/m-epics-ethercatmc
|
||||||
|
[ref.rtems5build]: https://github.com/mdavidsaver/rsb/blob/3911854462e74838e3e5f33a9e8f936fd0f1d95d/.github/workflows/build-5.yml#L98-L137
|
||||||
|
|||||||
437
appveyor-test.py
437
appveyor-test.py
@@ -1,437 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
"""Module ci-scripts AppVeyor unit tests
|
|
||||||
"""
|
|
||||||
|
|
||||||
# SET=test00 in the environment (.appveyor.yml) runs the tests in this script
|
|
||||||
# all other jobs are started as compile jobs
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import sys, os, shutil, fileinput
|
|
||||||
import distutils.util
|
|
||||||
import re
|
|
||||||
import subprocess as sp
|
|
||||||
import unittest
|
|
||||||
import logging
|
|
||||||
from argparse import Namespace
|
|
||||||
|
|
||||||
builddir = os.getcwd()
|
|
||||||
|
|
||||||
def find_in_file(regex, filename):
|
|
||||||
file = open (filename, "r")
|
|
||||||
for line in file:
|
|
||||||
if re.search(regex, line):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def getStringIO():
|
|
||||||
if (sys.version_info > (3, 0)):
|
|
||||||
import io
|
|
||||||
return io.StringIO()
|
|
||||||
else:
|
|
||||||
import StringIO
|
|
||||||
return StringIO.StringIO()
|
|
||||||
|
|
||||||
sys.path.append('appveyor')
|
|
||||||
import do
|
|
||||||
|
|
||||||
# we're working with tags (detached heads) a lot: suppress advice
|
|
||||||
do.call_git(['config', '--global', 'advice.detachedHead', 'false'])
|
|
||||||
|
|
||||||
class TestSourceSet(unittest.TestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
os.environ['SETUP_PATH'] = '.:appveyor'
|
|
||||||
if 'BASE' in os.environ:
|
|
||||||
del os.environ['BASE']
|
|
||||||
do.clear_lists()
|
|
||||||
os.chdir(builddir)
|
|
||||||
|
|
||||||
def test_EmptySetupDirsPath(self):
|
|
||||||
del os.environ['SETUP_PATH']
|
|
||||||
self.assertRaisesRegexp(NameError, '\(SETUP_PATH\) is empty', do.source_set, 'test01')
|
|
||||||
|
|
||||||
def test_InvalidSetupName(self):
|
|
||||||
self.assertRaisesRegexp(NameError, 'does not exist in SETUP_PATH', do.source_set, 'xxdoesnotexistxx')
|
|
||||||
|
|
||||||
def test_ValidSetupName(self):
|
|
||||||
capturedOutput = getStringIO()
|
|
||||||
sys.stdout = capturedOutput
|
|
||||||
do.source_set('test01')
|
|
||||||
sys.stdout = sys.__stdout__
|
|
||||||
self.assertEqual(do.setup['BASE'], '7.0', 'BASE was not set to \'7.0\'')
|
|
||||||
|
|
||||||
def test_SetupDoesNotOverridePreset(self):
|
|
||||||
os.environ['BASE'] = 'foo'
|
|
||||||
capturedOutput = getStringIO()
|
|
||||||
sys.stdout = capturedOutput
|
|
||||||
do.source_set('test01')
|
|
||||||
sys.stdout = sys.__stdout__
|
|
||||||
self.assertEqual(do.setup['BASE'], 'foo',
|
|
||||||
'Preset BASE was overridden by test01 setup (expected \'foo\' got {0})'
|
|
||||||
.format(do.setup['BASE']))
|
|
||||||
|
|
||||||
def test_IncludeSetupFirstSetWins(self):
|
|
||||||
capturedOutput = getStringIO()
|
|
||||||
sys.stdout = capturedOutput
|
|
||||||
do.source_set('test02')
|
|
||||||
sys.stdout = sys.__stdout__
|
|
||||||
self.assertEqual(do.setup['BASE'], 'foo',
|
|
||||||
'BASE set in test02 was overridden by test01 setup (expected \'foo\' got {0})'
|
|
||||||
.format(do.setup['BASE']))
|
|
||||||
self.assertEqual(do.setup['FOO'], 'bar', 'Setting of single word does not work')
|
|
||||||
self.assertEqual(do.setup['FOO2'], 'bar bar2', 'Setting of multiple words does not work')
|
|
||||||
self.assertEqual(do.setup['FOO3'], 'bar bar2', 'Indented setting of multiple words does not work')
|
|
||||||
self.assertEqual(do.setup['SNCSEQ'], 'R2-2-7', 'Setup test01 was not included')
|
|
||||||
|
|
||||||
def test_DoubleIncludeGetsIgnored(self):
|
|
||||||
capturedOutput = getStringIO()
|
|
||||||
sys.stdout = capturedOutput
|
|
||||||
do.source_set('test03')
|
|
||||||
sys.stdout = sys.__stdout__
|
|
||||||
self.assertRegexpMatches(capturedOutput.getvalue(), 'Ignoring already included setup file')
|
|
||||||
|
|
||||||
class TestUpdateReleaseLocal(unittest.TestCase):
|
|
||||||
|
|
||||||
release_local = os.path.join(do.cachedir, 'RELEASE.local')
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
if os.path.exists(self.release_local):
|
|
||||||
os.remove(self.release_local)
|
|
||||||
os.chdir(builddir)
|
|
||||||
|
|
||||||
def test_SetModule(self):
|
|
||||||
do.update_release_local('MOD1', '/foo/bar')
|
|
||||||
found = 0
|
|
||||||
for line in fileinput.input(self.release_local, inplace=1):
|
|
||||||
if 'MOD1=' in line:
|
|
||||||
self.assertEqual(line.strip(), 'MOD1=/foo/bar', 'MOD1 not set correctly')
|
|
||||||
found += 1
|
|
||||||
fileinput.close()
|
|
||||||
self.assertEqual(found, 1, 'MOD1 not written once to RELEASE.local (found {0})'.format(found))
|
|
||||||
|
|
||||||
def test_SetBaseAndMultipleModules(self):
|
|
||||||
do.update_release_local('EPICS_BASE', '/bar/foo')
|
|
||||||
do.update_release_local('MOD1', '/foo/bar')
|
|
||||||
do.update_release_local('MOD2', '/foo/bar2')
|
|
||||||
do.update_release_local('MOD1', '/foo/bar1')
|
|
||||||
found = {}
|
|
||||||
foundat = {}
|
|
||||||
for line in fileinput.input(self.release_local, inplace=1):
|
|
||||||
if 'MOD1=' in line:
|
|
||||||
self.assertEqual(line.strip(), 'MOD1=/foo/bar1',
|
|
||||||
'MOD1 not set correctly (expected \'MOD1=/foo/bar1\' found \'{0}\')'
|
|
||||||
.format(line))
|
|
||||||
if 'mod1' in found:
|
|
||||||
found['mod1'] += 1
|
|
||||||
else:
|
|
||||||
found['mod1'] = 1
|
|
||||||
foundat['mod1'] = fileinput.filelineno()
|
|
||||||
if 'MOD2=' in line:
|
|
||||||
self.assertEqual(line.strip(), 'MOD2=/foo/bar2',
|
|
||||||
'MOD2 not set correctly (expected \'MOD2=/foo/bar2\' found \'{0}\')'
|
|
||||||
.format(line))
|
|
||||||
if 'mod2' in found:
|
|
||||||
found['mod2'] += 1
|
|
||||||
else:
|
|
||||||
found['mod2'] = 1
|
|
||||||
foundat['mod2'] = fileinput.filelineno()
|
|
||||||
if 'EPICS_BASE=' in line:
|
|
||||||
self.assertEqual(line.strip(), 'EPICS_BASE=/bar/foo',
|
|
||||||
'EPICS_BASE not set correctly (expected \'EPICS_BASE=/bar/foo\' found \'{0}\')'
|
|
||||||
.format(line))
|
|
||||||
if 'base' in found:
|
|
||||||
found['base'] += 1
|
|
||||||
else:
|
|
||||||
found['base'] = 1
|
|
||||||
foundat['base'] = fileinput.filelineno()
|
|
||||||
fileinput.close()
|
|
||||||
self.assertEqual(found['mod1'], 1,
|
|
||||||
'MOD1 does not appear once in RELEASE.local (found {0})'.format(found['mod1']))
|
|
||||||
self.assertEqual(found['mod2'], 1,
|
|
||||||
'MOD2 does not appear once in RELEASE.local (found {0})'.format(found['mod2']))
|
|
||||||
self.assertEqual(found['base'], 1,
|
|
||||||
'EPICS_BASE does not appear once in RELEASE.local (found {0})'.format(found['base']))
|
|
||||||
self.assertGreater(foundat['base'], foundat['mod2'],
|
|
||||||
'EPICS_BASE (line {0}) appears before MOD2 (line {1})'
|
|
||||||
.format(foundat['base'], foundat['mod2']))
|
|
||||||
self.assertGreater(foundat['mod2'], foundat['mod1'],
|
|
||||||
'MOD2 (line {0}) appears before MOD1 (line {1})'.format(foundat['mod2'], foundat['mod1']))
|
|
||||||
|
|
||||||
class TestAddDependencyUpToDateCheck(unittest.TestCase):
|
|
||||||
|
|
||||||
hash_3_15_6 = "ce7943fb44beb22b453ddcc0bda5398fadf72096"
|
|
||||||
location = os.path.join(do.cachedir, 'base-R3.15.6')
|
|
||||||
licensefile = os.path.join(location, 'LICENSE')
|
|
||||||
checked_file = os.path.join(location, 'checked_out')
|
|
||||||
release_file = os.path.join(location, 'configure', 'RELEASE')
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
os.environ['SETUP_PATH'] = '.:appveyor'
|
|
||||||
if os.path.exists(self.location):
|
|
||||||
shutil.rmtree(self.location, onerror=do.remove_readonly)
|
|
||||||
do.clear_lists()
|
|
||||||
os.chdir(builddir)
|
|
||||||
do.source_set('defaults')
|
|
||||||
do.complete_setup('BASE')
|
|
||||||
|
|
||||||
def test_MissingDependency(self):
|
|
||||||
do.setup['BASE'] = 'R3.15.6'
|
|
||||||
do.add_dependency('BASE')
|
|
||||||
self.assertTrue(os.path.exists(self.licensefile), 'Missing dependency was not checked out')
|
|
||||||
self.assertTrue(os.path.exists(self.checked_file), 'Checked-out commit marker was not written')
|
|
||||||
with open(self.checked_file, 'r') as bfile:
|
|
||||||
checked_out = bfile.read().strip()
|
|
||||||
bfile.close()
|
|
||||||
self.assertEqual(checked_out, self.hash_3_15_6,
|
|
||||||
'Wrong commit of dependency checked out (expected=\"{0}\" found=\"{1}\")'
|
|
||||||
.format(self.hash_3_15_6, checked_out))
|
|
||||||
self.assertFalse(find_in_file('include \$\(TOP\)/../RELEASE.local', self.release_file),
|
|
||||||
'RELEASE in Base includes TOP/../RELEASE.local')
|
|
||||||
|
|
||||||
def test_UpToDateDependency(self):
|
|
||||||
do.setup['BASE'] = 'R3.15.6'
|
|
||||||
do.add_dependency('BASE')
|
|
||||||
os.remove(self.licensefile)
|
|
||||||
do.add_dependency('BASE')
|
|
||||||
self.assertFalse(os.path.exists(self.licensefile), 'Check out on top of existing up-to-date dependency')
|
|
||||||
|
|
||||||
def test_OutdatedDependency(self):
|
|
||||||
do.setup['BASE'] = 'R3.15.6'
|
|
||||||
do.add_dependency('BASE')
|
|
||||||
os.remove(self.licensefile)
|
|
||||||
with open(self.checked_file, "w") as fout:
|
|
||||||
print('XXX not the right hash XXX', file=fout)
|
|
||||||
fout.close()
|
|
||||||
do.add_dependency('BASE')
|
|
||||||
self.assertTrue(os.path.exists(self.licensefile), 'No check-out on top of out-of-date dependency')
|
|
||||||
with open(self.checked_file, 'r') as bfile:
|
|
||||||
checked_out = bfile.read().strip()
|
|
||||||
bfile.close()
|
|
||||||
self.assertEqual(checked_out, self.hash_3_15_6,
|
|
||||||
"Wrong commit of dependency checked out (expected='{0}' found='{1}')"
|
|
||||||
.format(self.hash_3_15_6, checked_out))
|
|
||||||
|
|
||||||
def is_shallow_repo(place):
|
|
||||||
check = sp.check_output(['git', 'rev-parse', '--is-shallow-repository'], cwd=place).strip()
|
|
||||||
if check == '--is-shallow-repository':
|
|
||||||
if os.path.exists(os.path.join(place, '.git', 'shallow')):
|
|
||||||
check = 'true'
|
|
||||||
else:
|
|
||||||
check = 'false'
|
|
||||||
return check == 'true'
|
|
||||||
|
|
||||||
class TestAddDependencyOptions(unittest.TestCase):
|
|
||||||
|
|
||||||
location = os.path.join(do.cachedir, 'mcoreutils-master')
|
|
||||||
testfile = os.path.join(location, '.ci', 'LICENSE')
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
os.environ['SETUP_PATH'] = '.:appveyor'
|
|
||||||
if os.path.exists(do.cachedir):
|
|
||||||
shutil.rmtree(do.cachedir, onerror=do.remove_readonly)
|
|
||||||
do.clear_lists()
|
|
||||||
do.source_set('defaults')
|
|
||||||
do.complete_setup('MCoreUtils')
|
|
||||||
do.setup['MCoreUtils'] = 'master'
|
|
||||||
|
|
||||||
def test_Default(self):
|
|
||||||
do.add_dependency('MCoreUtils')
|
|
||||||
self.assertTrue(os.path.exists(self.testfile),
|
|
||||||
'Submodule (.ci) not checked out recursively (requested: default=YES')
|
|
||||||
self.assertTrue(is_shallow_repo(self.location),
|
|
||||||
'Module not checked out shallow (requested: default=5)')
|
|
||||||
|
|
||||||
def test_SetRecursiveNo(self):
|
|
||||||
do.setup['MCoreUtils_RECURSIVE'] = 'NO'
|
|
||||||
do.add_dependency('MCoreUtils')
|
|
||||||
self.assertFalse(os.path.exists(self.testfile), 'Submodule (.ci) checked out recursively')
|
|
||||||
|
|
||||||
def test_SetDepthZero(self):
|
|
||||||
do.setup['MCoreUtils_DEPTH'] = '0'
|
|
||||||
do.add_dependency('MCoreUtils')
|
|
||||||
self.assertFalse(is_shallow_repo(self.location), 'Module checked out shallow (requested full)')
|
|
||||||
|
|
||||||
def test_SetDepthThree(self):
|
|
||||||
do.setup['MCoreUtils_DEPTH'] = '3'
|
|
||||||
do.add_dependency('MCoreUtils')
|
|
||||||
self.assertTrue(is_shallow_repo(self.location),
|
|
||||||
'Module not checked out shallow (requested: default=5)')
|
|
||||||
|
|
||||||
def test_AddMsiTo314(self):
|
|
||||||
do.complete_setup('BASE')
|
|
||||||
do.setup['BASE'] = 'R3.14.12.1'
|
|
||||||
msifile = os.path.join(do.cachedir, 'base-R3.14.12.1', 'src', 'dbtools', 'msi.c')
|
|
||||||
do.add_dependency('BASE')
|
|
||||||
self.assertTrue(os.path.exists(msifile), 'MSI was not added to Base 3.14')
|
|
||||||
|
|
||||||
def repo_access(dep):
|
|
||||||
do.set_setup_from_env(dep)
|
|
||||||
do.setup.setdefault(dep + "_DIRNAME", dep.lower())
|
|
||||||
do.setup.setdefault(dep + "_REPONAME", dep.lower())
|
|
||||||
do.setup.setdefault('REPOOWNER', 'epics-modules')
|
|
||||||
do.setup.setdefault(dep + "_REPOOWNER", do.setup['REPOOWNER'])
|
|
||||||
do.setup.setdefault(dep + "_REPOURL", 'https://github.com/{0}/{1}.git'
|
|
||||||
.format(do.setup[dep + '_REPOOWNER'], do.setup[dep + '_REPONAME']))
|
|
||||||
with open(os.devnull, 'w') as devnull:
|
|
||||||
return do.call_git(['ls-remote', '--quiet', '--heads', do.setup[dep + '_REPOURL']],
|
|
||||||
stdout=devnull, stderr=devnull)
|
|
||||||
|
|
||||||
class TestDefaultModuleURLs(unittest.TestCase):
|
|
||||||
|
|
||||||
modules = ['BASE', 'PVDATA', 'PVACCESS', 'NTYPES',
|
|
||||||
'SNCSEQ', 'STREAM', 'ASYN', 'STD',
|
|
||||||
'CALC', 'AUTOSAVE', 'BUSY', 'SSCAN',
|
|
||||||
'IOCSTATS', 'MOTOR', 'IPAC', ]
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
os.environ['SETUP_PATH'] = '.:appveyor'
|
|
||||||
do.clear_lists()
|
|
||||||
os.chdir(builddir)
|
|
||||||
do.source_set('defaults')
|
|
||||||
|
|
||||||
def test_Repos(self):
|
|
||||||
for mod in self.modules:
|
|
||||||
self.assertEqual(repo_access(mod), 0, 'Defaults for {0} do not point to a valid git repository at {1}'
|
|
||||||
.format(mod, do.setup[mod + '_REPOURL']))
|
|
||||||
|
|
||||||
class TestVCVars(unittest.TestCase):
|
|
||||||
def test_vcvars(self):
|
|
||||||
if ('CMP' in os.environ and os.environ['CMP'] in ('mingw',)) \
|
|
||||||
or distutils.util.get_platform() != "win32":
|
|
||||||
raise unittest.SkipTest()
|
|
||||||
|
|
||||||
do.with_vcvars('env')
|
|
||||||
|
|
||||||
class TestSetupForBuild(unittest.TestCase):
|
|
||||||
configuration = os.environ['CONFIGURATION']
|
|
||||||
platform = os.environ['PLATFORM']
|
|
||||||
cc = os.environ['CMP']
|
|
||||||
args = Namespace(paths=[])
|
|
||||||
do.building_base = True
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
os.environ.pop('EPICS_HOST_ARCH', None)
|
|
||||||
do.clear_lists()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
os.environ['CONFIGURATION'] = self.configuration
|
|
||||||
os.environ['PLATFORM'] = self.platform
|
|
||||||
os.environ['CMP'] = self.cc
|
|
||||||
|
|
||||||
def test_AddPathsOption(self):
|
|
||||||
os.environ['FOOBAR'] = 'BAR'
|
|
||||||
args = Namespace(paths=['/my/{FOOBAR}/dir', '/my/foobar'])
|
|
||||||
do.setup_for_build(args)
|
|
||||||
self.assertTrue(re.search('/my/BAR/dir', os.environ['PATH']), 'Expanded path not in PATH')
|
|
||||||
self.assertTrue(re.search('/foobar', os.environ['PATH']), 'Plain path not in PATH')
|
|
||||||
os.environ.pop('FOOBAR', None)
|
|
||||||
|
|
||||||
def test_HostArchConfiguration(self):
|
|
||||||
for config in ['dynamic', 'dynamic-debug', 'static', 'static-debug']:
|
|
||||||
os.environ['CONFIGURATION'] = config
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertTrue('EPICS_HOST_ARCH' in os.environ,
|
|
||||||
'EPICS_HOST_ARCH is not set for Configuration={0}'.format(config))
|
|
||||||
if re.search('static', config):
|
|
||||||
self.assertTrue(re.search('-static$', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is not -static for Configuration={0}'.format(config))
|
|
||||||
self.assertFalse(re.search('debug', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is -debug for Configuration={0}'.format(config))
|
|
||||||
elif re.search('debug', config):
|
|
||||||
self.assertFalse(re.search('static', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is -static for Configuration={0}'.format(config))
|
|
||||||
self.assertTrue(re.search('-debug$', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is not -debug for Configuration={0}'.format(config))
|
|
||||||
else:
|
|
||||||
self.assertFalse(re.search('static', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is -static for Configuration={0}'.format(config))
|
|
||||||
self.assertFalse(re.search('debug', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is -debug for Configuration={0}'.format(config))
|
|
||||||
|
|
||||||
def test_HostArchPlatform(self):
|
|
||||||
for platform in ['x86', 'x64', 'X64']:
|
|
||||||
for cc in ['vs2019', 'mingw']:
|
|
||||||
os.environ['PLATFORM'] = platform
|
|
||||||
os.environ['CMP'] = cc
|
|
||||||
os.environ['CONFIGURATION'] = 'dynamic'
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertTrue('EPICS_HOST_ARCH' in os.environ,
|
|
||||||
'EPICS_HOST_ARCH is not set for {0} / {1}'.format(cc, platform))
|
|
||||||
if platform == 'x86':
|
|
||||||
self.assertTrue(re.search('^win32-x86', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is not win32-x86 for {0} / {1}'.format(cc, platform))
|
|
||||||
else:
|
|
||||||
self.assertTrue(re.search('^windows-x64', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is not windows-x64 for {0} / {1}'.format(cc, platform))
|
|
||||||
if cc == 'mingw':
|
|
||||||
self.assertTrue(re.search('-mingw$', os.environ['EPICS_HOST_ARCH']),
|
|
||||||
'EPICS_HOST_ARCH is not -mingw for {0} / {1}'.format(cc, platform))
|
|
||||||
if platform == 'x86':
|
|
||||||
pattern = 'mingw32'
|
|
||||||
else:
|
|
||||||
pattern = 'mingw64'
|
|
||||||
self.assertTrue(re.search(pattern, os.environ['PATH']),
|
|
||||||
'Binary location for {0} not in PATH'.format(pattern))
|
|
||||||
self.assertTrue(re.search(pattern, os.environ['INCLUDE']),
|
|
||||||
'Include location for {0} not in INCLUDE'.format(pattern))
|
|
||||||
|
|
||||||
def test_StrawberryInPath(self):
|
|
||||||
os.environ['CMP'] = 'vs2019'
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertTrue(re.search('strawberry', os.environ['PATH'], flags=re.IGNORECASE),
|
|
||||||
'Strawberry Perl location not in PATH for vs2019')
|
|
||||||
|
|
||||||
def setBase314(self, yesno):
|
|
||||||
cfg_base_version = os.path.join('configure', 'CONFIG_BASE_VERSION')
|
|
||||||
fout = open(cfg_base_version, 'w')
|
|
||||||
print('# test file for base version detection', file=fout)
|
|
||||||
print('BASE_3_14={0}'.format(yesno), file=fout)
|
|
||||||
fout.close()
|
|
||||||
|
|
||||||
def setTestResultsTarget(self, target):
|
|
||||||
rules_build = os.path.join('configure', 'RULES_BUILD')
|
|
||||||
fout = open(rules_build, 'w')
|
|
||||||
print('# test file for target detection', file=fout)
|
|
||||||
print('{0}: something'.format(target), file=fout)
|
|
||||||
fout.close()
|
|
||||||
|
|
||||||
def test_DetectionBase314No(self):
|
|
||||||
self.setBase314('NO')
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertFalse(do.isbase314, 'Falsely detected Base 3.14')
|
|
||||||
|
|
||||||
def test_DetectionBase314Yes(self):
|
|
||||||
self.setBase314('YES')
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertTrue(do.isbase314, 'Base 3.14 = YES not detected')
|
|
||||||
|
|
||||||
def test_DetectionTestResultsTarget314No(self):
|
|
||||||
self.setBase314('YES')
|
|
||||||
self.setTestResultsTarget('nottherighttarget')
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertFalse(do.has_test_results, 'Falsely detected test-results target')
|
|
||||||
|
|
||||||
def test_DetectionTestResultsTarget314Yes(self):
|
|
||||||
self.setBase314('YES')
|
|
||||||
self.setTestResultsTarget('test-results')
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertFalse(do.has_test_results, 'Falsely found test-results on Base 3.14')
|
|
||||||
|
|
||||||
def test_DetectionTestResultsTargetNot314Yes(self):
|
|
||||||
self.setBase314('NO')
|
|
||||||
self.setTestResultsTarget('test-results')
|
|
||||||
do.setup_for_build(self.args)
|
|
||||||
self.assertTrue(do.has_test_results, 'Target test-results not detected')
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if 'VV' in os.environ and os.environ['VV'] == '1':
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
do.silent_dep_builds = False
|
|
||||||
|
|
||||||
do.host_info()
|
|
||||||
if sys.argv[1:]==['env']:
|
|
||||||
# testing with_vcvars
|
|
||||||
[print(K,'=',V) for K, V in os.environ.items()]
|
|
||||||
else:
|
|
||||||
unittest.main()
|
|
||||||
@@ -56,23 +56,45 @@ install:
|
|||||||
# Default build worker image
|
# Default build worker image
|
||||||
image: Visual Studio 2015
|
image: Visual Studio 2015
|
||||||
|
|
||||||
# Build Configurations: dll/static, regular/debug
|
# Build Configurations: shared/static, optimized/debug
|
||||||
configuration:
|
configuration:
|
||||||
- dynamic
|
- default
|
||||||
- static
|
- static
|
||||||
- dynamic-debug
|
- debug
|
||||||
- static-debug
|
- static-debug
|
||||||
|
|
||||||
# Environment variables: compiler toolchain, base version, setup file, ...
|
# Environment variables
|
||||||
|
|
||||||
|
# Well-known variables to use
|
||||||
|
# CMP compiler to use ('gcc' for native MinGW, 'vs...' for Visual Studio)
|
||||||
|
# SET source setup file
|
||||||
|
# ADD_MODULES extra modules (for a specific job)
|
||||||
|
# TEST set to NO to skip running the tests (default: YES)
|
||||||
|
# VV set VV=1 to make build scripts verbose (default: unset)
|
||||||
|
# EXTRA content will be added to make command line
|
||||||
|
# EXTRA1..5 more additional arguments for the make command
|
||||||
|
# (one argument per variable)
|
||||||
|
|
||||||
|
# Usually from setup files, but may be specified or overridden
|
||||||
|
# on a job line
|
||||||
|
# MODULES list of dependency modules
|
||||||
|
# BASE branch or release tag name of the EPICS Base to use
|
||||||
|
# <MODULE> branch or release tag for a specific module
|
||||||
|
# ... see README for setup file syntax description
|
||||||
|
|
||||||
|
# AppVeyor specific
|
||||||
|
# APPVEYOR_BUILD_WORKER_IMAGE run job using specified VM image
|
||||||
|
# (not the one from the image: line above)
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
# common / default variables for all jobs
|
# common / default variables for all jobs
|
||||||
SETUP_PATH: .ci-local:.ci
|
SETUP_PATH: .ci-local:.ci
|
||||||
|
BASE: 7.0
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
- CMP: vs2019
|
- CMP: vs2022
|
||||||
SET: test00
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
- CMP: gcc
|
||||||
- CMP: mingw
|
|
||||||
- CMP: vs2019
|
- CMP: vs2019
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
- CMP: vs2019
|
- CMP: vs2019
|
||||||
@@ -87,7 +109,6 @@ environment:
|
|||||||
- CMP: vs2013
|
- CMP: vs2013
|
||||||
- CMP: vs2012
|
- CMP: vs2012
|
||||||
- CMP: vs2010
|
- CMP: vs2010
|
||||||
- CMP: vs2008
|
|
||||||
|
|
||||||
# Platform: processor architecture
|
# Platform: processor architecture
|
||||||
platform:
|
platform:
|
||||||
@@ -102,8 +123,6 @@ matrix:
|
|||||||
CMP: vs2012
|
CMP: vs2012
|
||||||
- platform: x64
|
- platform: x64
|
||||||
CMP: vs2010
|
CMP: vs2010
|
||||||
- platform: x64
|
|
||||||
CMP: vs2008
|
|
||||||
# Exclude more jobs to reduce build time
|
# Exclude more jobs to reduce build time
|
||||||
# E.g., skip 32-bit for newer compilers
|
# E.g., skip 32-bit for newer compilers
|
||||||
#- platform: x86
|
#- platform: x86
|
||||||
@@ -116,15 +135,15 @@ matrix:
|
|||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: python .ci/appveyor/do.py prepare
|
- cmd: python .ci/cue.py prepare
|
||||||
- cmd: python .ci/appveyor/do.py build
|
- cmd: python .ci/cue.py build
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cmd: python .ci/appveyor/do.py test
|
- cmd: python .ci/cue.py test
|
||||||
|
|
||||||
on_finish:
|
on_finish:
|
||||||
- ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
- ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||||
- cmd: python .ci/appveyor/do.py build test-results -s
|
- cmd: python .ci/cue.py test-results
|
||||||
|
|
||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
# debugging #
|
# debugging #
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# .appveyor.yml for use with EPICS Base ci-scripts
|
# .appveyor.yml for use with EPICS Base ci-scripts
|
||||||
# (see: https://github.com/epics-base/ci-scripts)
|
# (see: https://github.com/epics-base/ci-scripts)
|
||||||
|
|
||||||
# This is YAML - indentation levels are crucial
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
- C:\Users\appveyor\.tools
|
- C:\Users\appveyor\.tools
|
||||||
|
|
||||||
@@ -22,13 +20,13 @@ skip_commits:
|
|||||||
install:
|
install:
|
||||||
- cmd: git submodule update --init --recursive
|
- cmd: git submodule update --init --recursive
|
||||||
|
|
||||||
image: Visual Studio 2019
|
image: Visual Studio 2022
|
||||||
|
|
||||||
# Build Configurations: dll/static, regular/debug
|
# Build Configurations: shared/static, optimized/debug
|
||||||
configuration:
|
configuration:
|
||||||
- dynamic
|
- default
|
||||||
# - static
|
# - static
|
||||||
- dynamic-debug
|
- debug
|
||||||
# - static-debug
|
# - static-debug
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
@@ -36,9 +34,9 @@ environment:
|
|||||||
SETUP_PATH: .ci-local:.ci
|
SETUP_PATH: .ci-local:.ci
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
- CMP: vs2019
|
- CMP: vs2022
|
||||||
BASE: 7.0
|
BASE: 7.0
|
||||||
- CMP: vs2019
|
- CMP: vs2022
|
||||||
BASE: 3.15
|
BASE: 3.15
|
||||||
|
|
||||||
# Platform: processor architecture
|
# Platform: processor architecture
|
||||||
@@ -54,19 +52,17 @@ matrix:
|
|||||||
CMP: vs2012
|
CMP: vs2012
|
||||||
- platform: x64
|
- platform: x64
|
||||||
CMP: vs2010
|
CMP: vs2010
|
||||||
- platform: x64
|
|
||||||
CMP: vs2008
|
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: python .ci/appveyor/do.py prepare
|
- cmd: python .ci/cue.py prepare
|
||||||
- cmd: python .ci/appveyor/do.py build
|
- cmd: python .ci/cue.py build
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cmd: python .ci/appveyor/do.py test
|
- cmd: python .ci/cue.py test
|
||||||
|
|
||||||
on_finish:
|
on_finish:
|
||||||
- ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
- ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||||
- cmd: python .ci/appveyor/do.py build test-results -s
|
- cmd: python .ci/cue.py test-results
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
- provider: GitHubPullRequest
|
- provider: GitHubPullRequest
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Use different compilers (Visual Studio, MinGW)
|
- One parallel runner (all builds are sequential)
|
||||||
- Use different VS versions (2008, 2010, 2012, 2013, 2015, 2017, 2019)
|
- Windows Server 2012/2016/2019
|
||||||
|
- Compile using gcc/MinGW or different Visual Studio versions: \
|
||||||
|
2010, 2012, 2013, 2015, 2017, 2019, 2022
|
||||||
- Compile for Windows 32bit and 64bit
|
- Compile for Windows 32bit and 64bit
|
||||||
- Create static libraries or DLLs (plus the matching executables)
|
- No useful caching available.
|
||||||
- Create optimized or debug builds
|
|
||||||
|
|
||||||
## How to Use these Scripts
|
## How to Use these Scripts
|
||||||
|
|
||||||
@@ -15,6 +16,10 @@
|
|||||||
repository. For more details, please see below and refer to the
|
repository. For more details, please see below and refer to the
|
||||||
[AppVeyor documentation](https://www.appveyor.com/docs/).
|
[AppVeyor documentation](https://www.appveyor.com/docs/).
|
||||||
|
|
||||||
|
(This applies when using the free tier offered to open source
|
||||||
|
projects. Things will be different using an "Enterprise"
|
||||||
|
installation on customer hardware.)
|
||||||
|
|
||||||
2. Add the ci-scripts respository as a Git Submodule
|
2. Add the ci-scripts respository as a Git Submodule
|
||||||
(see [README](../README.md) one level above).
|
(see [README](../README.md) one level above).
|
||||||
|
|
||||||
@@ -33,24 +38,26 @@
|
|||||||
|
|
||||||
AppVeyor automatically creates a build matrix with the following axes:
|
AppVeyor automatically creates a build matrix with the following axes:
|
||||||
1. `configuration:` \
|
1. `configuration:` \
|
||||||
Select static or dynamic (DLL) as well as regular or debug builds.
|
Select shared (DLL) or static as well as optimized or debug builds. \
|
||||||
|
Default: `shared-optimized`
|
||||||
2. `platform:` \
|
2. `platform:` \
|
||||||
Select 32bit or 64bit processor architecture.
|
Select 32bit or 64bit processor architecture.
|
||||||
3. `environment: / matrix:` \
|
3. `environment: / matrix:` \
|
||||||
List of environment variable settings. Each list element (starting with
|
List of environment variable settings. Each list element (starting with
|
||||||
a dash) is one step on the axis of the build matrix. \
|
a dash) is one step on the axis of the build matrix. \
|
||||||
Set `CMP` to select the compiler: `mingw` for the native
|
Set `CMP` to select the compiler: `gcc` for the native
|
||||||
[MinGW](http://mingw-w64.org/) GNU compiler, `vs2008` ...`vs2019`
|
[MinGW](http://mingw-w64.org/) GNU compiler, `vs2010` ...`vs2022`
|
||||||
(options listed above) for the Microsoft Visual Studio compilers.
|
(options listed above) for the Microsoft Visual Studio compilers.
|
||||||
|
|
||||||
Your builds will take long. \
|
Your builds will take long. \
|
||||||
AppVeyor only grants a single worker VM - all jobs of the matrix are
|
AppVeyor only grants a single parallel runner VM - all jobs of the matrix
|
||||||
executed sequentially. Each job will take between 6 and 15 minutes,
|
are executed sequentially. AppVeyor also does not provide a usable cache
|
||||||
plus testing time.
|
mechanism to retain dependency artifacts across builds.
|
||||||
|
Each job will take between 6 and 15 minutes, plus testing time, every time.
|
||||||
|
|
||||||
The `matrix: / exclude:` setting can be used to reduce the number of
|
The `matrix: / exclude:` setting can be used to reduce the number of
|
||||||
jobs. Check the [AppVeyor docs][appveyor.doc.matrix]
|
jobs. Check the [AppVeyor docs][appveyor.doc.matrix]
|
||||||
for more ways to reduce the build matrix size.
|
for more ways to reduce the build matrix size. \
|
||||||
E.g., you can opt for not creating matrix axes for `configuration:`
|
E.g., you can opt for not creating matrix axes for `configuration:`
|
||||||
and`platform:` by moving these configurations into the job lines
|
and`platform:` by moving these configurations into the job lines
|
||||||
under `environment: / matrix:`.
|
under `environment: / matrix:`.
|
||||||
|
|||||||
671
appveyor/do.py
671
appveyor/do.py
@@ -1,671 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
"""Windows (AppVeyor) ci build script
|
|
||||||
"""
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import sys, os, stat, shutil
|
|
||||||
import fileinput
|
|
||||||
import logging
|
|
||||||
import re
|
|
||||||
import subprocess as sp
|
|
||||||
import distutils.util
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
# Setup ANSI Colors
|
|
||||||
ANSI_RED = "\033[31;1m"
|
|
||||||
ANSI_GREEN = "\033[32;1m"
|
|
||||||
ANSI_YELLOW = "\033[33;1m"
|
|
||||||
ANSI_BLUE = "\033[34;1m"
|
|
||||||
ANSI_MAGENTA = "\033[35;1m"
|
|
||||||
ANSI_CYAN = "\033[36;1m"
|
|
||||||
ANSI_RESET = "\033[0m"
|
|
||||||
ANSI_CLEAR = "\033[0K"
|
|
||||||
|
|
||||||
seen_setups = []
|
|
||||||
modules_to_compile = []
|
|
||||||
setup = {}
|
|
||||||
places = {}
|
|
||||||
|
|
||||||
if 'HomeDrive' in os.environ:
|
|
||||||
cachedir = os.path.join(os.getenv('HomeDrive'), os.getenv('HomePath'), '.cache')
|
|
||||||
toolsdir = os.path.join(os.getenv('HomeDrive'), os.getenv('HomePath'), '.tools')
|
|
||||||
elif 'HOME' in os.environ:
|
|
||||||
cachedir = os.path.join(os.getenv('HOME'), '.cache')
|
|
||||||
toolsdir = os.path.join(os.getenv('HOME'), '.tools')
|
|
||||||
else:
|
|
||||||
cachedir = os.path.join('.', '.cache')
|
|
||||||
toolsdir = os.path.join('.', '.tools')
|
|
||||||
|
|
||||||
if 'CACHEDIR' in os.environ:
|
|
||||||
cachedir = os.environ['CACHEDIR']
|
|
||||||
|
|
||||||
vcvars_table = {
|
|
||||||
# https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History
|
|
||||||
'vs2019':r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat',
|
|
||||||
'vs2017':r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat',
|
|
||||||
'vs2015':r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat',
|
|
||||||
'vs2013':r'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat',
|
|
||||||
'vs2012':r'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat',
|
|
||||||
'vs2010':r'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat',
|
|
||||||
'vs2008':r'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat',
|
|
||||||
}
|
|
||||||
|
|
||||||
ciscriptsdir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
|
||||||
if os.path.basename(ciscriptsdir) == 'appveyor':
|
|
||||||
ciscriptsdir = ciscriptsdir.rstrip(os.pathsep+'appveyor')
|
|
||||||
|
|
||||||
if 'BASE' in os.environ and os.environ['BASE'] == 'SELF':
|
|
||||||
building_base = True
|
|
||||||
places['EPICS_BASE'] = '.'
|
|
||||||
else:
|
|
||||||
building_base = False
|
|
||||||
|
|
||||||
def modlist():
|
|
||||||
if building_base:
|
|
||||||
ret = []
|
|
||||||
else:
|
|
||||||
for var in ['ADD_MODULES', 'MODULES']:
|
|
||||||
setup.setdefault(var, '')
|
|
||||||
if var in os.environ:
|
|
||||||
setup[var] = os.environ[var]
|
|
||||||
logger.debug('ENV assignment: %s = %s', var, setup[var])
|
|
||||||
ret = ['BASE'] + setup['ADD_MODULES'].upper().split() + setup['MODULES'].upper().split()
|
|
||||||
logger.debug('Effective module list: %s', ret)
|
|
||||||
return ret
|
|
||||||
|
|
||||||
zip7 = r'C:\Program Files\7-Zip\7z'
|
|
||||||
make = ''
|
|
||||||
isbase314 = False
|
|
||||||
has_test_results = False
|
|
||||||
silent_dep_builds = True
|
|
||||||
|
|
||||||
def host_info():
|
|
||||||
print('{0}AppVeyor Build Worker Image:{1} {2}'
|
|
||||||
.format(ANSI_CYAN, ANSI_RESET, os.environ['APPVEYOR_BUILD_WORKER_IMAGE']))
|
|
||||||
|
|
||||||
print('{0}Python setup{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
||||||
print(sys.version)
|
|
||||||
print('PYTHONPATH')
|
|
||||||
for dname in sys.path:
|
|
||||||
print(' ', dname)
|
|
||||||
print('platform =', distutils.util.get_platform())
|
|
||||||
|
|
||||||
print('{0}Available Visual Studio versions{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
||||||
for key in vcvars_table:
|
|
||||||
if os.path.exists(vcvars_table[key]):
|
|
||||||
print('Found', key, 'in', vcvars_table[key])
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
# Used from unittests
|
|
||||||
def clear_lists():
|
|
||||||
global isbase314, has_test_results
|
|
||||||
del seen_setups[:]
|
|
||||||
del modules_to_compile[:]
|
|
||||||
setup.clear()
|
|
||||||
places.clear()
|
|
||||||
isbase314 = False
|
|
||||||
has_test_results = False
|
|
||||||
|
|
||||||
# Error-handler to make shutil.rmtree delete read-only files on Windows
|
|
||||||
def remove_readonly(func, path, excinfo):
|
|
||||||
os.chmod(path, stat.S_IWRITE)
|
|
||||||
func(path)
|
|
||||||
|
|
||||||
# source_set(setup)
|
|
||||||
#
|
|
||||||
# Source a settings file (extension .set) found in the setup_dirs path
|
|
||||||
# May be called recursively (from within a setup file)
|
|
||||||
def source_set(name):
|
|
||||||
# allowed separators: colon or whitespace
|
|
||||||
setup_dirs = os.getenv('SETUP_PATH', "").replace(':', ' ').split()
|
|
||||||
if len(setup_dirs) == 0:
|
|
||||||
raise NameError("{0}Search path for setup files (SETUP_PATH) is empty{1}".format(ANSI_RED,ANSI_RESET))
|
|
||||||
|
|
||||||
for set_dir in setup_dirs:
|
|
||||||
set_file = os.path.join(set_dir, name) + ".set"
|
|
||||||
|
|
||||||
if set_file in seen_setups:
|
|
||||||
print("Ignoring already included setup file {0}".format(set_file))
|
|
||||||
return
|
|
||||||
|
|
||||||
if os.path.isfile(set_file):
|
|
||||||
seen_setups.append(set_file)
|
|
||||||
print("Loading setup file {0}".format(set_file))
|
|
||||||
sys.stdout.flush()
|
|
||||||
with open(set_file) as fp:
|
|
||||||
for line in fp:
|
|
||||||
logger.debug('Next line: %s', line.strip())
|
|
||||||
if not line.strip() or line.strip()[0] == '#':
|
|
||||||
continue
|
|
||||||
if line.startswith("include"):
|
|
||||||
logger.debug('Found an include, reading %s', line.split()[1])
|
|
||||||
source_set(line.split()[1])
|
|
||||||
continue
|
|
||||||
assign = line.replace('"', '').strip().split("=", 1)
|
|
||||||
logger.debug('Interpreting as assignment')
|
|
||||||
setup.setdefault(assign[0], os.getenv(assign[0], ""))
|
|
||||||
if not setup[assign[0]].strip():
|
|
||||||
logger.debug('Doing assignment: %s = %s', assign[0], assign[1])
|
|
||||||
setup[assign[0]] = assign[1]
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
raise NameError("{0}Setup file {1} does not exist in SETUP_PATH search path ({2}){3}"
|
|
||||||
.format(ANSI_RED, name, setup_dirs, ANSI_RESET))
|
|
||||||
|
|
||||||
# update_release_local(var, location)
|
|
||||||
# var name of the variable to set in RELEASE.local
|
|
||||||
# location location (absolute path) of where variable should point to
|
|
||||||
#
|
|
||||||
# Manipulate RELEASE.local in the cache location:
|
|
||||||
# - replace "$var=$location" line if it exists and has changed
|
|
||||||
# - otherwise add "$var=$location" line and possibly move EPICS_BASE=... line to the end
|
|
||||||
# Set places[var] = location
|
|
||||||
def update_release_local(var, location):
|
|
||||||
release_local = os.path.join(cachedir, 'RELEASE.local')
|
|
||||||
updated_line = '{0}={1}'.format(var, location.replace('\\', '/'))
|
|
||||||
places[var] = location
|
|
||||||
|
|
||||||
if not os.path.exists(release_local):
|
|
||||||
logger.debug('RELEASE.local does not exist, creating it')
|
|
||||||
try:
|
|
||||||
os.makedirs(cachedir)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
fout = open(release_local, 'w')
|
|
||||||
fout.close()
|
|
||||||
base_line = ''
|
|
||||||
found = False
|
|
||||||
logger.debug("Opening RELEASE.local for adding '%s'", updated_line)
|
|
||||||
for line in fileinput.input(release_local, inplace=1):
|
|
||||||
outputline = line.strip()
|
|
||||||
if 'EPICS_BASE=' in line:
|
|
||||||
base_line = line.strip()
|
|
||||||
logger.debug("Found EPICS_BASE line '%s', not writing it", base_line)
|
|
||||||
continue
|
|
||||||
elif '{0}='.format(var) in line:
|
|
||||||
logger.debug("Found '%s=' line, replacing", var)
|
|
||||||
found = True
|
|
||||||
outputline = updated_line
|
|
||||||
logger.debug("Writing line to RELEASE.local: '%s'", outputline)
|
|
||||||
print(outputline)
|
|
||||||
fileinput.close()
|
|
||||||
fout = open(release_local,"a")
|
|
||||||
if not found:
|
|
||||||
logger.debug("Adding new definition: '%s'", updated_line)
|
|
||||||
print(updated_line, file=fout)
|
|
||||||
if base_line:
|
|
||||||
logger.debug("Writing EPICS_BASE line: '%s'", base_line)
|
|
||||||
print(base_line, file=fout)
|
|
||||||
fout.close()
|
|
||||||
|
|
||||||
def set_setup_from_env(dep):
|
|
||||||
for postf in ['', '_DIRNAME', '_REPONAME', '_REPOOWNER', '_REPOURL',
|
|
||||||
'_VARNAME', '_RECURSIVE', '_DEPTH', '_HOOK']:
|
|
||||||
if dep+postf in os.environ:
|
|
||||||
setup[dep+postf] = os.environ[dep+postf]
|
|
||||||
logger.debug('ENV assignment: %s = %s', dep+postf, setup[dep+postf])
|
|
||||||
|
|
||||||
def call_git(args, **kws):
|
|
||||||
if 'cwd' in kws:
|
|
||||||
place = kws['cwd']
|
|
||||||
else:
|
|
||||||
place = os.getcwd()
|
|
||||||
logger.debug("EXEC '%s' in %s", ' '.join(['git'] + args), place)
|
|
||||||
sys.stdout.flush()
|
|
||||||
exitcode = sp.call(['git'] + args, **kws)
|
|
||||||
logger.debug('EXEC DONE')
|
|
||||||
return exitcode
|
|
||||||
|
|
||||||
def call_make(args=[], **kws):
|
|
||||||
place = kws.get('cwd', os.getcwd())
|
|
||||||
parallel = kws.pop('parallel', 2)
|
|
||||||
silent = kws.pop('silent', False)
|
|
||||||
# no parallel make for Base 3.14
|
|
||||||
if parallel <= 0 or isbase314:
|
|
||||||
makeargs = []
|
|
||||||
else:
|
|
||||||
makeargs = ['-j{0}'.format(parallel), '-Otarget']
|
|
||||||
if silent:
|
|
||||||
makeargs += ['-s']
|
|
||||||
logger.debug("EXEC '%s' in %s", ' '.join([make] + makeargs + args), place)
|
|
||||||
sys.stdout.flush()
|
|
||||||
exitcode = sp.call([make] + makeargs + args, **kws)
|
|
||||||
logger.debug('EXEC DONE')
|
|
||||||
if exitcode != 0:
|
|
||||||
sys.exit(exitcode)
|
|
||||||
|
|
||||||
def get_git_hash(place):
|
|
||||||
logger.debug("EXEC 'git log -n1 --pretty=format:%%H' in %s", place)
|
|
||||||
sys.stdout.flush()
|
|
||||||
head = sp.check_output(['git', 'log', '-n1', '--pretty=format:%H'], cwd=place).decode()
|
|
||||||
logger.debug('EXEC DONE')
|
|
||||||
return head
|
|
||||||
|
|
||||||
def complete_setup(dep):
|
|
||||||
set_setup_from_env(dep)
|
|
||||||
setup.setdefault(dep, 'master')
|
|
||||||
setup.setdefault(dep+"_DIRNAME", dep.lower())
|
|
||||||
setup.setdefault(dep+"_REPONAME", dep.lower())
|
|
||||||
setup.setdefault('REPOOWNER', 'epics-modules')
|
|
||||||
setup.setdefault(dep+"_REPOOWNER", setup['REPOOWNER'])
|
|
||||||
setup.setdefault(dep+"_REPOURL", 'https://github.com/{0}/{1}.git'
|
|
||||||
.format(setup[dep+'_REPOOWNER'], setup[dep+'_REPONAME']))
|
|
||||||
setup.setdefault(dep+"_VARNAME", dep)
|
|
||||||
setup.setdefault(dep+"_RECURSIVE", 'YES')
|
|
||||||
setup.setdefault(dep+"_DEPTH", -1)
|
|
||||||
|
|
||||||
# add_dependency(dep, tag)
|
|
||||||
#
|
|
||||||
# Add a dependency to the cache area:
|
|
||||||
# - check out (recursive if configured) in the CACHE area unless it already exists and the
|
|
||||||
# required commit has been built
|
|
||||||
# - Defaults:
|
|
||||||
# $dep_DIRNAME = lower case ($dep)
|
|
||||||
# $dep_REPONAME = lower case ($dep)
|
|
||||||
# $dep_REPOURL = GitHub / $dep_REPOOWNER (or $REPOOWNER or epics-modules) / $dep_REPONAME .git
|
|
||||||
# $dep_VARNAME = $dep
|
|
||||||
# $dep_DEPTH = 5
|
|
||||||
# $dep_RECURSIVE = 1/YES (0/NO to for a flat clone)
|
|
||||||
# - Add $dep_VARNAME line to the RELEASE.local file in the cache area (unless already there)
|
|
||||||
# - Add full path to $modules_to_compile
|
|
||||||
def add_dependency(dep):
|
|
||||||
recurse = setup[dep+'_RECURSIVE'].lower()
|
|
||||||
if recurse not in ['0', 'no']:
|
|
||||||
recursearg = ["--recursive"]
|
|
||||||
elif recurse not in ['1', 'yes']:
|
|
||||||
recursearg = []
|
|
||||||
else:
|
|
||||||
raise RuntimeError("Invalid value for {}_RECURSIVE='{}' not 0/NO/1/YES".format(dep, recurse))
|
|
||||||
deptharg = {
|
|
||||||
'-1':['--depth', '5'],
|
|
||||||
'0':[],
|
|
||||||
}.get(str(setup[dep+'_DEPTH']), ['--depth', str(setup[dep+'_DEPTH'])])
|
|
||||||
|
|
||||||
tag = setup[dep]
|
|
||||||
|
|
||||||
logger.debug('Adding dependency %s with tag %s', dep, setup[dep])
|
|
||||||
|
|
||||||
# determine if dep points to a valid release or branch
|
|
||||||
if call_git(['ls-remote', '--quiet', '--exit-code', '--refs', setup[dep+'_REPOURL'], tag]):
|
|
||||||
raise RuntimeError("{0}{1} is neither a tag nor a branch name for {2} ({3}){4}"
|
|
||||||
.format(ANSI_RED, tag, dep, setup[dep+'_REPOURL'], ANSI_RESET))
|
|
||||||
|
|
||||||
dirname = setup[dep+'_DIRNAME']+'-{0}'.format(tag)
|
|
||||||
place = os.path.join(cachedir, dirname)
|
|
||||||
checked_file = os.path.join(place, "checked_out")
|
|
||||||
|
|
||||||
if os.path.isdir(place):
|
|
||||||
logger.debug('Dependency %s: directory %s exists, comparing checked-out commit', dep, place)
|
|
||||||
# check HEAD commit against the hash in marker file
|
|
||||||
if os.path.exists(checked_file):
|
|
||||||
with open(checked_file, 'r') as bfile:
|
|
||||||
checked_out = bfile.read().strip()
|
|
||||||
bfile.close()
|
|
||||||
else:
|
|
||||||
checked_out = 'never'
|
|
||||||
head = get_git_hash(place)
|
|
||||||
logger.debug('Found checked_out commit %s, git head is %s', checked_out, head)
|
|
||||||
if head != checked_out:
|
|
||||||
logger.debug('Dependency %s out of date - removing', dep)
|
|
||||||
shutil.rmtree(place, onerror=remove_readonly)
|
|
||||||
else:
|
|
||||||
print('Found {0} of dependency {1} up-to-date in {2}'.format(tag, dep, place))
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
if not os.path.isdir(place):
|
|
||||||
if not os.path.isdir(cachedir):
|
|
||||||
os.makedirs(cachedir)
|
|
||||||
# clone dependency
|
|
||||||
print('Cloning {0} of dependency {1} into {2}'
|
|
||||||
.format(tag, dep, place))
|
|
||||||
sys.stdout.flush()
|
|
||||||
call_git(['clone', '--quiet'] + deptharg + recursearg + ['--branch', tag, setup[dep+'_REPOURL'], dirname], cwd=cachedir)
|
|
||||||
|
|
||||||
sp.check_call(['git', 'log', '-n1'], cwd=place)
|
|
||||||
modules_to_compile.append(place)
|
|
||||||
|
|
||||||
if dep == 'BASE':
|
|
||||||
# add MSI 1.7 to Base 3.14
|
|
||||||
versionfile = os.path.join(place, 'configure', 'CONFIG_BASE_VERSION')
|
|
||||||
if os.path.exists(versionfile):
|
|
||||||
with open(versionfile) as f:
|
|
||||||
if 'BASE_3_14=YES' in f.read():
|
|
||||||
print('Adding MSI 1.7 to {0}'.format(place))
|
|
||||||
sys.stdout.flush()
|
|
||||||
sp.check_call(['patch', '-p1', '-i', os.path.join(ciscriptsdir, 'add-msi-to-314.patch')],
|
|
||||||
cwd=place)
|
|
||||||
else:
|
|
||||||
# force including RELEASE.local for non-base modules by overwriting their configure/RELEASE
|
|
||||||
release = os.path.join(place, "configure", "RELEASE")
|
|
||||||
if os.path.exists(release):
|
|
||||||
with open(release, 'w') as fout:
|
|
||||||
print('-include $(TOP)/../RELEASE.local', file=fout)
|
|
||||||
|
|
||||||
# run hook if defined
|
|
||||||
if dep+'_HOOK' in setup:
|
|
||||||
hook = os.path.join(place, setup[dep+'_HOOK'])
|
|
||||||
if os.path.exists(hook):
|
|
||||||
print('Running hook {0} in {1}'.format(setup[dep+'_HOOK'], place))
|
|
||||||
sys.stdout.flush()
|
|
||||||
sp.check_call(hook, shell=True, cwd=place)
|
|
||||||
|
|
||||||
# write checked out commit hash to marker file
|
|
||||||
head = get_git_hash(place)
|
|
||||||
logger.debug('Writing hash of checked-out dependency (%s) to marker file', head)
|
|
||||||
with open(checked_file, "w") as fout:
|
|
||||||
print(head, file=fout)
|
|
||||||
fout.close()
|
|
||||||
|
|
||||||
update_release_local(setup[dep+"_VARNAME"], place)
|
|
||||||
|
|
||||||
def setup_for_build(args):
|
|
||||||
global make, isbase314, has_test_results
|
|
||||||
dllpaths = []
|
|
||||||
|
|
||||||
# there is no combined static and debug EPICS_HOST_ARCH target,
|
|
||||||
# so a combined debug and static target will appear to be just static
|
|
||||||
# but debug will have been specified in CONFIG_SITE by prepare()
|
|
||||||
hostarchsuffix=''
|
|
||||||
if re.search('debug', os.environ['CONFIGURATION']):
|
|
||||||
hostarchsuffix = '-debug'
|
|
||||||
if re.search('static', os.environ['CONFIGURATION']):
|
|
||||||
hostarchsuffix = '-static'
|
|
||||||
|
|
||||||
if os.environ['PLATFORM'].lower() == 'x86':
|
|
||||||
os.environ['EPICS_HOST_ARCH'] = 'win32-x86' + hostarchsuffix
|
|
||||||
elif os.environ['PLATFORM'].lower() == 'x64':
|
|
||||||
os.environ['EPICS_HOST_ARCH'] = 'windows-x64' + hostarchsuffix
|
|
||||||
|
|
||||||
if os.environ['CMP'] == 'vs2019':
|
|
||||||
# put strawberry perl in the PATH
|
|
||||||
os.environ['PATH'] = os.pathsep.join([os.path.join(r'C:\Strawberry\perl\site\bin'),
|
|
||||||
os.path.join(r'C:\Strawberry\perl\bin'),
|
|
||||||
os.environ['PATH']])
|
|
||||||
if os.environ['CMP'] == 'mingw':
|
|
||||||
if 'INCLUDE' not in os.environ:
|
|
||||||
os.environ['INCLUDE'] = ''
|
|
||||||
if os.environ['PLATFORM'].lower() == 'x86':
|
|
||||||
os.environ['EPICS_HOST_ARCH'] = 'win32-x86-mingw'
|
|
||||||
os.environ['INCLUDE'] = os.pathsep.join([r'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\include',
|
|
||||||
os.environ['INCLUDE']])
|
|
||||||
os.environ['PATH'] = os.pathsep.join([r'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin',
|
|
||||||
os.environ['PATH']])
|
|
||||||
elif os.environ['PLATFORM'].lower() == 'x64':
|
|
||||||
os.environ['EPICS_HOST_ARCH'] = 'windows-x64-mingw'
|
|
||||||
os.environ['INCLUDE'] = os.pathsep.join([r'C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\include',
|
|
||||||
os.environ['INCLUDE']])
|
|
||||||
os.environ['PATH'] = os.pathsep.join([r'C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin',
|
|
||||||
os.environ['PATH']])
|
|
||||||
|
|
||||||
make = os.path.join(toolsdir, 'make.exe')
|
|
||||||
|
|
||||||
base_place = '.'
|
|
||||||
if not building_base:
|
|
||||||
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
for line in lines:
|
|
||||||
(mod, place) = line.strip().split('=')
|
|
||||||
bindir = os.path.join(place, 'bin', os.environ['EPICS_HOST_ARCH'])
|
|
||||||
if os.path.isdir(bindir):
|
|
||||||
dllpaths.append(bindir)
|
|
||||||
if mod == 'EPICS_BASE':
|
|
||||||
base_place = place
|
|
||||||
|
|
||||||
cfg_base_version = os.path.join(base_place, 'configure', 'CONFIG_BASE_VERSION')
|
|
||||||
if os.path.exists(cfg_base_version):
|
|
||||||
with open(cfg_base_version) as myfile:
|
|
||||||
if 'BASE_3_14=YES' in myfile.read():
|
|
||||||
isbase314 = True
|
|
||||||
|
|
||||||
if not isbase314:
|
|
||||||
rules_build = os.path.join(base_place, 'configure', 'RULES_BUILD')
|
|
||||||
if os.path.exists(rules_build):
|
|
||||||
with open(rules_build) as myfile:
|
|
||||||
for line in myfile:
|
|
||||||
if re.match('^test-results:', line):
|
|
||||||
has_test_results = True
|
|
||||||
|
|
||||||
bindir = os.path.join(os.getcwd(), 'bin', os.environ['EPICS_HOST_ARCH'])
|
|
||||||
if os.path.isdir(bindir):
|
|
||||||
dllpaths.append(bindir)
|
|
||||||
|
|
||||||
os.environ['PATH'] = os.pathsep.join(dllpaths + [os.environ['PATH']])
|
|
||||||
|
|
||||||
# apparently %CD% is handled automagically
|
|
||||||
os.environ['TOP'] = os.getcwd()
|
|
||||||
|
|
||||||
addpaths = []
|
|
||||||
for path in args.paths:
|
|
||||||
try:
|
|
||||||
addpaths.append(path.format(**os.environ))
|
|
||||||
except KeyError:
|
|
||||||
print('Environment')
|
|
||||||
[print(' ',K,'=',repr(V)) for K,V in os.environ.items()]
|
|
||||||
raise
|
|
||||||
|
|
||||||
os.environ['PATH'] = os.pathsep.join([os.environ['PATH']] + addpaths)
|
|
||||||
|
|
||||||
def prepare(args):
|
|
||||||
host_info()
|
|
||||||
|
|
||||||
print('{0}Loading setup files{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
|
||||||
source_set('defaults')
|
|
||||||
if 'SET' in os.environ:
|
|
||||||
source_set(os.environ['SET'])
|
|
||||||
|
|
||||||
[complete_setup(mod) for mod in modlist()]
|
|
||||||
|
|
||||||
logger.debug('Loaded setup')
|
|
||||||
kvs = list(setup.items())
|
|
||||||
kvs.sort()
|
|
||||||
[logger.debug(' %s = "%s"', *kv) for kv in kvs]
|
|
||||||
|
|
||||||
# we're working with tags (detached heads) a lot: suppress advice
|
|
||||||
call_git(['config', '--global', 'advice.detachedHead', 'false'])
|
|
||||||
|
|
||||||
print('{0}Checking/cloning dependencies{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
[add_dependency(mod) for mod in modlist()]
|
|
||||||
|
|
||||||
if not building_base:
|
|
||||||
if os.path.isdir('configure'):
|
|
||||||
targetdir = 'configure'
|
|
||||||
else:
|
|
||||||
targetdir = '.'
|
|
||||||
shutil.copy(os.path.join(cachedir, 'RELEASE.local'), targetdir)
|
|
||||||
|
|
||||||
print('{0}Configuring EPICS build system{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
|
||||||
|
|
||||||
with open(os.path.join(places['EPICS_BASE'], 'configure', 'CONFIG_SITE'), 'a') as config_site:
|
|
||||||
if re.search('static', os.environ['CONFIGURATION']):
|
|
||||||
config_site.write('SHARED_LIBRARIES=NO\n')
|
|
||||||
config_site.write('STATIC_BUILD=YES\n')
|
|
||||||
linktype = 'static'
|
|
||||||
else:
|
|
||||||
linktype = 'dynamic (DLL)'
|
|
||||||
if re.search('debug', os.environ['CONFIGURATION']):
|
|
||||||
config_site.write('HOST_OPT=NO\n')
|
|
||||||
optitype = 'debug'
|
|
||||||
else:
|
|
||||||
optitype = 'optimized'
|
|
||||||
|
|
||||||
# Enable/fix parallel build for VisualStudio compiler on older Base versions
|
|
||||||
add_vs_fix = True
|
|
||||||
config_win = os.path.join(places['EPICS_BASE'], 'configure', 'os', 'CONFIG.win32-x86.win32-x86')
|
|
||||||
with open(config_win) as myfile:
|
|
||||||
for line in myfile:
|
|
||||||
if re.match(r'^ifneq \(\$\(VisualStudioVersion\),11\.0\)', line):
|
|
||||||
add_vs_fix = False
|
|
||||||
if add_vs_fix:
|
|
||||||
with open(config_win, 'a') as myfile:
|
|
||||||
myfile.write('''
|
|
||||||
# Fix parallel build for some VisualStudio versions
|
|
||||||
ifneq ($(VisualStudioVersion),)
|
|
||||||
ifneq ($(VisualStudioVersion),11.0)
|
|
||||||
ifeq ($(findstring -FS,$(OPT_CXXFLAGS_NO)),)
|
|
||||||
OPT_CXXFLAGS_NO += -FS
|
|
||||||
OPT_CFLAGS_NO += -FS
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
OPT_CXXFLAGS_NO := $(filter-out -FS,$(OPT_CXXFLAGS_NO))
|
|
||||||
OPT_CFLAGS_NO := $(filter-out -FS,$(OPT_CFLAGS_NO))
|
|
||||||
endif
|
|
||||||
endif''')
|
|
||||||
|
|
||||||
print('EPICS Base build system set up for {0} build with {1} linking'
|
|
||||||
.format(optitype, linktype))
|
|
||||||
|
|
||||||
if not os.path.isdir(toolsdir):
|
|
||||||
os.makedirs(toolsdir)
|
|
||||||
|
|
||||||
makever = '4.2.1'
|
|
||||||
if not os.path.exists(os.path.join(toolsdir, 'make.exe')):
|
|
||||||
print('Installing Make 4.2.1 from ANL web site')
|
|
||||||
sys.stdout.flush()
|
|
||||||
sp.check_call(['curl', '-fsS', '--retry', '3', '-o', 'make-{0}.zip'.format(makever),
|
|
||||||
'https://epics.anl.gov/download/tools/make-{0}-win64.zip'.format(makever)],
|
|
||||||
cwd=toolsdir)
|
|
||||||
sp.check_call([zip7, 'e', 'make-{0}.zip'.format(makever)], cwd=toolsdir)
|
|
||||||
os.remove(os.path.join(toolsdir, 'make-{0}.zip'.format(makever)))
|
|
||||||
|
|
||||||
setup_for_build(args)
|
|
||||||
|
|
||||||
print('{0}EPICS_HOST_ARCH = {1}{2}'.format(ANSI_CYAN, os.environ['EPICS_HOST_ARCH'], ANSI_RESET))
|
|
||||||
print('{0}$ {1} --version{2}'.format(ANSI_CYAN, make, ANSI_RESET))
|
|
||||||
sys.stdout.flush()
|
|
||||||
call_make(['--version'], parallel=0)
|
|
||||||
print('{0}$ perl --version{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
||||||
sys.stdout.flush()
|
|
||||||
sp.check_call(['perl', '--version'])
|
|
||||||
|
|
||||||
if os.environ['CMP'] == 'mingw':
|
|
||||||
print('{0}$ gcc --version{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
||||||
sys.stdout.flush()
|
|
||||||
sp.check_call(['gcc', '--version'])
|
|
||||||
else:
|
|
||||||
print('{0}$ cl{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
||||||
sys.stdout.flush()
|
|
||||||
sp.check_call(['cl'])
|
|
||||||
|
|
||||||
if not building_base:
|
|
||||||
for mod in modlist():
|
|
||||||
place = places[setup[mod+"_VARNAME"]]
|
|
||||||
print('{0}Building dependency {1} in {2}{3}'.format(ANSI_YELLOW, mod, place, ANSI_RESET))
|
|
||||||
call_make(cwd=place, silent=silent_dep_builds)
|
|
||||||
|
|
||||||
print('{0}Dependency module information{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
||||||
print('Module Tag Binaries Commit')
|
|
||||||
print(100 * '-')
|
|
||||||
for mod in modlist():
|
|
||||||
commit = sp.check_output(['git', 'log', '-n1', '--oneline'], cwd=places[setup[mod+"_VARNAME"]]).strip()
|
|
||||||
print("%-10s %-12s %-11s %s" % (mod, setup[mod], 'rebuilt', commit))
|
|
||||||
|
|
||||||
print('{0}Contents of RELEASE.local{1}'.format(ANSI_CYAN, ANSI_RESET))
|
|
||||||
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
|
|
||||||
print(f.read().strip())
|
|
||||||
|
|
||||||
def build(args):
|
|
||||||
setup_for_build(args)
|
|
||||||
print('{0}Building the main module{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
|
||||||
call_make(args.makeargs)
|
|
||||||
|
|
||||||
def test(args):
|
|
||||||
setup_for_build(args)
|
|
||||||
print('{0}Running the main module tests{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
|
||||||
call_make(['tapfiles'])
|
|
||||||
if has_test_results:
|
|
||||||
call_make(['test-results'], parallel=0, silent=True)
|
|
||||||
|
|
||||||
def doExec(args):
|
|
||||||
'exec user command with vcvars'
|
|
||||||
setup_for_build(args)
|
|
||||||
os.environ['MAKE'] = make
|
|
||||||
print('Execute command {}'.format(args.cmd))
|
|
||||||
sys.stdout.flush()
|
|
||||||
sp.check_call(' '.join(args.cmd), shell=True)
|
|
||||||
|
|
||||||
def with_vcvars(cmd):
|
|
||||||
'''re-exec main script with a (hopefully different) command
|
|
||||||
'''
|
|
||||||
CC = os.environ['CMP']
|
|
||||||
|
|
||||||
# cf. https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line
|
|
||||||
|
|
||||||
info = {
|
|
||||||
'python': sys.executable,
|
|
||||||
'self': sys.argv[0],
|
|
||||||
'cmd':cmd,
|
|
||||||
}
|
|
||||||
|
|
||||||
info['arch'] = {
|
|
||||||
'x86': 'x86', # 'amd64_x86' ??
|
|
||||||
'x64': 'amd64',
|
|
||||||
}[os.environ['PLATFORM'].lower()] # 'x86' or 'x64'
|
|
||||||
|
|
||||||
info['vcvars'] = vcvars_table[CC]
|
|
||||||
|
|
||||||
script='''
|
|
||||||
call "{vcvars}" {arch}
|
|
||||||
|
|
||||||
"{python}" "{self}" {cmd}
|
|
||||||
'''.format(**info)
|
|
||||||
|
|
||||||
logger.debug('----- Creating vcvars-trampoline.bat -----')
|
|
||||||
for line in script.split('\n'):
|
|
||||||
logger.debug(line)
|
|
||||||
logger.debug('----- snip -----')
|
|
||||||
|
|
||||||
with open('vcvars-trampoline.bat', 'w') as F:
|
|
||||||
F.write(script)
|
|
||||||
|
|
||||||
print('{0}Calling vcvars-trampoline.bat to set environment for {1} on {2}{3}'
|
|
||||||
.format(ANSI_YELLOW, CC, os.environ['PLATFORM'], ANSI_RESET))
|
|
||||||
sys.stdout.flush()
|
|
||||||
returncode = sp.call('vcvars-trampoline.bat', shell=True)
|
|
||||||
if returncode != 0:
|
|
||||||
sys.exit(returncode)
|
|
||||||
|
|
||||||
def getargs():
|
|
||||||
from argparse import ArgumentParser, REMAINDER
|
|
||||||
P = ArgumentParser()
|
|
||||||
P.add_argument('--no-vcvars', dest='vcvars', default=True, action='store_false',
|
|
||||||
help='Assume vcvarsall.bat has already been run')
|
|
||||||
P.add_argument('--add-path', dest='paths', default=[], action='append',
|
|
||||||
help='Append directory to %PATH%. Expands {ENVVAR}')
|
|
||||||
SP = P.add_subparsers()
|
|
||||||
|
|
||||||
CMD = SP.add_parser('prepare')
|
|
||||||
CMD.set_defaults(func=prepare)
|
|
||||||
|
|
||||||
CMD = SP.add_parser('build')
|
|
||||||
CMD.add_argument('makeargs', nargs=REMAINDER)
|
|
||||||
CMD.set_defaults(func=build)
|
|
||||||
|
|
||||||
CMD = SP.add_parser('test')
|
|
||||||
CMD.set_defaults(func=test)
|
|
||||||
|
|
||||||
CMD = SP.add_parser('exec')
|
|
||||||
CMD.add_argument('cmd', nargs=REMAINDER)
|
|
||||||
CMD.set_defaults(func=doExec)
|
|
||||||
|
|
||||||
return P
|
|
||||||
|
|
||||||
def main(raw):
|
|
||||||
global silent_dep_builds
|
|
||||||
args = getargs().parse_args(raw)
|
|
||||||
if 'VV' in os.environ and os.environ['VV'] == '1':
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
silent_dep_builds = False
|
|
||||||
|
|
||||||
if args.vcvars and os.environ['CMP'].startswith('vs'):
|
|
||||||
# re-exec with MSVC in PATH
|
|
||||||
with_vcvars(' '.join(['--no-vcvars']+raw))
|
|
||||||
|
|
||||||
else:
|
|
||||||
args.func(args)
|
|
||||||
|
|
||||||
if __name__=='__main__':
|
|
||||||
main(sys.argv[1:])
|
|
||||||
47
centos6-eol.repo
Normal file
47
centos6-eol.repo
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
[C6.10-base]
|
||||||
|
name=CentOS-6.10 - Base
|
||||||
|
baseurl=http://vault.centos.org/6.10/os/$basearch/
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
||||||
|
enabled=1
|
||||||
|
metadata_expire=never
|
||||||
|
|
||||||
|
[C6.10-updates]
|
||||||
|
name=CentOS-6.10 - Updates
|
||||||
|
baseurl=http://vault.centos.org/6.10/updates/$basearch/
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
||||||
|
enabled=1
|
||||||
|
metadata_expire=never
|
||||||
|
|
||||||
|
[C6.10-extras]
|
||||||
|
name=CentOS-6.10 - Extras
|
||||||
|
baseurl=http://vault.centos.org/6.10/extras/$basearch/
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
||||||
|
enabled=1
|
||||||
|
metadata_expire=never
|
||||||
|
|
||||||
|
[C6.10-contrib]
|
||||||
|
name=CentOS-6.10 - Contrib
|
||||||
|
baseurl=http://vault.centos.org/6.10/contrib/$basearch/
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
||||||
|
enabled=0
|
||||||
|
metadata_expire=never
|
||||||
|
|
||||||
|
[C6.10-centosplus]
|
||||||
|
name=CentOS-6.10 - CentOSPlus
|
||||||
|
baseurl=http://vault.centos.org/6.10/centosplus/$basearch/
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
||||||
|
enabled=0
|
||||||
|
metadata_expire=never
|
||||||
|
|
||||||
|
[centos-sclo-rh]
|
||||||
|
name=CentOS-6 - SCLo rh
|
||||||
|
baseurl=http://vault.centos.org/6.10/sclo/$basearch/rh/
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
|
||||||
|
enabled=1
|
||||||
|
metadata_expire=never
|
||||||
980
cue-test.py
Normal file
980
cue-test.py
Normal file
@@ -0,0 +1,980 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""Module ci-scripts unit tests
|
||||||
|
"""
|
||||||
|
|
||||||
|
# SET=test00 in the environment and run the tests in this script
|
||||||
|
# all other jobs are started as compile jobs
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import sys, os, shutil, fileinput
|
||||||
|
import re
|
||||||
|
import subprocess as sp
|
||||||
|
import unittest
|
||||||
|
import logging
|
||||||
|
import fnmatch
|
||||||
|
from argparse import Namespace
|
||||||
|
|
||||||
|
builddir = os.getcwd()
|
||||||
|
|
||||||
|
# Detect basic context (service, os)
|
||||||
|
if 'TRAVIS' in os.environ:
|
||||||
|
ci_service = 'travis'
|
||||||
|
ci_os = os.environ['TRAVIS_OS_NAME']
|
||||||
|
|
||||||
|
if 'GITLAB_CI' in os.environ:
|
||||||
|
ci_service = 'gitlab'
|
||||||
|
ci_os = 'linux'
|
||||||
|
|
||||||
|
if 'APPVEYOR' in os.environ:
|
||||||
|
ci_service = 'appveyor'
|
||||||
|
if re.match(r'^Visual', os.environ['APPVEYOR_BUILD_WORKER_IMAGE']):
|
||||||
|
ci_os = 'windows'
|
||||||
|
elif re.match(r'^Ubuntu', os.environ['APPVEYOR_BUILD_WORKER_IMAGE']):
|
||||||
|
ci_os = 'linux'
|
||||||
|
elif re.match(r'^macOS', os.environ['APPVEYOR_BUILD_WORKER_IMAGE']):
|
||||||
|
ci_os = 'osx'
|
||||||
|
|
||||||
|
if 'GITHUB_ACTIONS' in os.environ:
|
||||||
|
ci_service = 'github-actions'
|
||||||
|
if os.environ['RUNNER_OS'] == 'macOS':
|
||||||
|
ci_os = 'osx'
|
||||||
|
else:
|
||||||
|
ci_os = os.environ['RUNNER_OS'].lower()
|
||||||
|
|
||||||
|
|
||||||
|
def find_in_file(regex, filename):
|
||||||
|
file = open(filename, "r")
|
||||||
|
for line in file:
|
||||||
|
if re.search(regex, line):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def getStringIO():
|
||||||
|
if sys.version_info > (3, 0):
|
||||||
|
import io
|
||||||
|
return io.StringIO()
|
||||||
|
else:
|
||||||
|
import StringIO
|
||||||
|
return StringIO.StringIO()
|
||||||
|
|
||||||
|
|
||||||
|
sys.path.append('.')
|
||||||
|
import cue
|
||||||
|
|
||||||
|
# we're working with tags (detached heads) a lot: suppress advice
|
||||||
|
cue.call_git(['config', '--global', 'advice.detachedHead', 'false'])
|
||||||
|
|
||||||
|
# Don't build dependencies when running unit tests
|
||||||
|
cue.skip_dep_builds = True
|
||||||
|
|
||||||
|
class TestSourceSet(unittest.TestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
os.environ['SETUP_PATH'] = '.:appveyor'
|
||||||
|
if 'BASE' in os.environ:
|
||||||
|
del os.environ['BASE']
|
||||||
|
cue.clear_lists()
|
||||||
|
os.chdir(builddir)
|
||||||
|
|
||||||
|
def test_EmptySetupDirsPath(self):
|
||||||
|
del os.environ['SETUP_PATH']
|
||||||
|
self.assertRaisesRegex(NameError, '\(SETUP_PATH\) is empty', cue.source_set, 'test01')
|
||||||
|
|
||||||
|
def test_InvalidSetupName(self):
|
||||||
|
self.assertRaisesRegex(NameError, 'does not exist in SETUP_PATH', cue.source_set, 'xxdoesnotexistxx')
|
||||||
|
|
||||||
|
def test_ValidSetupName(self):
|
||||||
|
capturedOutput = getStringIO()
|
||||||
|
sys.stdout = capturedOutput
|
||||||
|
cue.source_set('test01')
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertEqual(cue.setup['BASE'], '7.0', 'BASE was not set to \'7.0\'')
|
||||||
|
|
||||||
|
def test_SetupDoesNotOverridePreset(self):
|
||||||
|
os.environ['BASE'] = 'foo'
|
||||||
|
capturedOutput = getStringIO()
|
||||||
|
sys.stdout = capturedOutput
|
||||||
|
cue.source_set('test01')
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertEqual(cue.setup['BASE'], 'foo',
|
||||||
|
'Preset BASE was overridden by test01 setup (expected \'foo\' got {0})'
|
||||||
|
.format(cue.setup['BASE']))
|
||||||
|
|
||||||
|
def test_IncludeSetupFirstSetWins(self):
|
||||||
|
captured_output = getStringIO()
|
||||||
|
sys.stdout = captured_output
|
||||||
|
cue.source_set('test02')
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertEqual(cue.setup['BASE'], 'foo',
|
||||||
|
'BASE set in test02 was overridden by test01 setup (expected \'foo\' got {0})'
|
||||||
|
.format(cue.setup['BASE']))
|
||||||
|
self.assertEqual(cue.setup['FOO'], 'bar', 'Setting of single word does not work')
|
||||||
|
self.assertEqual(cue.setup['FOO2'], 'bar bar2', 'Setting of multiple words does not work')
|
||||||
|
self.assertEqual(cue.setup['FOO3'], 'bar bar2', 'Indented setting of multiple words does not work')
|
||||||
|
self.assertEqual(cue.setup['SNCSEQ'], 'R2-2-9', 'Setup test01 was not included')
|
||||||
|
|
||||||
|
def test_DoubleIncludeGetsIgnored(self):
|
||||||
|
capturedOutput = getStringIO()
|
||||||
|
sys.stdout = capturedOutput
|
||||||
|
cue.source_set('test03')
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertRegex(capturedOutput.getvalue(), 'Ignoring already included setup file')
|
||||||
|
|
||||||
|
|
||||||
|
class TestUpdateReleaseLocal(unittest.TestCase):
|
||||||
|
release_local = os.path.join(cue.ci['cachedir'], 'RELEASE.local')
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
if os.path.exists(self.release_local):
|
||||||
|
os.remove(self.release_local)
|
||||||
|
os.chdir(builddir)
|
||||||
|
|
||||||
|
def test_SetModule(self):
|
||||||
|
cue.update_release_local('MOD1', '/foo/bar')
|
||||||
|
found = 0
|
||||||
|
for line in fileinput.input(self.release_local, inplace=1):
|
||||||
|
if 'MOD1=' in line:
|
||||||
|
self.assertEqual(line.strip(), 'MOD1=/foo/bar', 'MOD1 not set correctly')
|
||||||
|
found += 1
|
||||||
|
fileinput.close()
|
||||||
|
self.assertEqual(found, 1, 'MOD1 not written once to RELEASE.local (found {0})'.format(found))
|
||||||
|
|
||||||
|
def test_SetBaseAndMultipleModules(self):
|
||||||
|
cue.update_release_local('EPICS_BASE', '/bar/foo')
|
||||||
|
cue.update_release_local('MOD1', '/foo/bar')
|
||||||
|
cue.update_release_local('MOD2', '/foo/bar2')
|
||||||
|
cue.update_release_local('MOD1', '/foo/bar1')
|
||||||
|
found = {}
|
||||||
|
foundat = {}
|
||||||
|
for line in fileinput.input(self.release_local, inplace=1):
|
||||||
|
if 'MOD1=' in line:
|
||||||
|
self.assertEqual(line.strip(), 'MOD1=/foo/bar1',
|
||||||
|
'MOD1 not set correctly (expected \'MOD1=/foo/bar1\' found \'{0}\')'
|
||||||
|
.format(line))
|
||||||
|
if 'mod1' in found:
|
||||||
|
found['mod1'] += 1
|
||||||
|
else:
|
||||||
|
found['mod1'] = 1
|
||||||
|
foundat['mod1'] = fileinput.filelineno()
|
||||||
|
if 'MOD2=' in line:
|
||||||
|
self.assertEqual(line.strip(), 'MOD2=/foo/bar2',
|
||||||
|
'MOD2 not set correctly (expected \'MOD2=/foo/bar2\' found \'{0}\')'
|
||||||
|
.format(line))
|
||||||
|
if 'mod2' in found:
|
||||||
|
found['mod2'] += 1
|
||||||
|
else:
|
||||||
|
found['mod2'] = 1
|
||||||
|
foundat['mod2'] = fileinput.filelineno()
|
||||||
|
if 'EPICS_BASE=' in line:
|
||||||
|
self.assertEqual(line.strip(), 'EPICS_BASE=/bar/foo',
|
||||||
|
'EPICS_BASE not set correctly (expected \'EPICS_BASE=/bar/foo\' found \'{0}\')'
|
||||||
|
.format(line))
|
||||||
|
if 'base' in found:
|
||||||
|
found['base'] += 1
|
||||||
|
else:
|
||||||
|
found['base'] = 1
|
||||||
|
foundat['base'] = fileinput.filelineno()
|
||||||
|
fileinput.close()
|
||||||
|
self.assertEqual(found['mod1'], 1,
|
||||||
|
'MOD1 does not appear once in RELEASE.local (found {0})'.format(found['mod1']))
|
||||||
|
self.assertEqual(found['mod2'], 1,
|
||||||
|
'MOD2 does not appear once in RELEASE.local (found {0})'.format(found['mod2']))
|
||||||
|
self.assertEqual(found['base'], 1,
|
||||||
|
'EPICS_BASE does not appear once in RELEASE.local (found {0})'.format(found['base']))
|
||||||
|
self.assertGreater(foundat['base'], foundat['mod2'],
|
||||||
|
'EPICS_BASE (line {0}) appears before MOD2 (line {1})'
|
||||||
|
.format(foundat['base'], foundat['mod2']))
|
||||||
|
self.assertGreater(foundat['mod2'], foundat['mod1'],
|
||||||
|
'MOD2 (line {0}) appears before MOD1 (line {1})'.format(foundat['mod2'], foundat['mod1']))
|
||||||
|
|
||||||
|
|
||||||
|
class TestAddDependencyUpToDateCheck(unittest.TestCase):
|
||||||
|
hash_3_15_6 = "ce7943fb44beb22b453ddcc0bda5398fadf72096"
|
||||||
|
location = ''
|
||||||
|
licensefile = ''
|
||||||
|
checked_file = ''
|
||||||
|
release_file = ''
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
os.environ['SETUP_PATH'] = '.:appveyor'
|
||||||
|
cue.clear_lists()
|
||||||
|
cue.detect_context()
|
||||||
|
self.location = os.path.join(cue.ci['cachedir'], 'base-R3.15.6')
|
||||||
|
self.licensefile = os.path.join(self.location, 'LICENSE')
|
||||||
|
self.checked_file = os.path.join(self.location, 'checked_out')
|
||||||
|
self.release_file = os.path.join(self.location, 'configure', 'RELEASE')
|
||||||
|
if os.path.exists(self.location):
|
||||||
|
shutil.rmtree(self.location, onerror=cue.remove_readonly)
|
||||||
|
os.chdir(builddir)
|
||||||
|
cue.source_set('defaults')
|
||||||
|
cue.complete_setup('BASE')
|
||||||
|
|
||||||
|
def test_MissingDependency(self):
|
||||||
|
cue.setup['BASE'] = 'R3.15.6'
|
||||||
|
cue.add_dependency('BASE')
|
||||||
|
self.assertTrue(os.path.exists(self.licensefile), 'Missing dependency was not checked out')
|
||||||
|
self.assertTrue(os.path.exists(self.checked_file), 'Checked-out commit marker was not written')
|
||||||
|
with open(self.checked_file, 'r') as bfile:
|
||||||
|
checked_out = bfile.read().strip()
|
||||||
|
bfile.close()
|
||||||
|
self.assertEqual(checked_out, self.hash_3_15_6,
|
||||||
|
'Wrong commit of dependency checked out (expected=\"{0}\" found=\"{1}\")'
|
||||||
|
.format(self.hash_3_15_6, checked_out))
|
||||||
|
self.assertFalse(find_in_file('include \$\(TOP\)/../RELEASE.local', self.release_file),
|
||||||
|
'RELEASE in Base includes TOP/../RELEASE.local')
|
||||||
|
|
||||||
|
def test_UpToDateDependency(self):
|
||||||
|
cue.setup['BASE'] = 'R3.15.6'
|
||||||
|
cue.add_dependency('BASE')
|
||||||
|
os.remove(self.licensefile)
|
||||||
|
cue.add_dependency('BASE')
|
||||||
|
self.assertFalse(os.path.exists(self.licensefile), 'Check out on top of existing up-to-date dependency')
|
||||||
|
|
||||||
|
def test_OutdatedDependency(self):
|
||||||
|
cue.setup['BASE'] = 'R3.15.6'
|
||||||
|
cue.add_dependency('BASE')
|
||||||
|
os.remove(self.licensefile)
|
||||||
|
with open(self.checked_file, "w") as fout:
|
||||||
|
print('XXX not the right hash XXX', file=fout)
|
||||||
|
fout.close()
|
||||||
|
cue.add_dependency('BASE')
|
||||||
|
self.assertTrue(os.path.exists(self.licensefile), 'No check-out on top of out-of-date dependency')
|
||||||
|
with open(self.checked_file, 'r') as bfile:
|
||||||
|
checked_out = bfile.read().strip()
|
||||||
|
bfile.close()
|
||||||
|
self.assertEqual(checked_out, self.hash_3_15_6,
|
||||||
|
"Wrong commit of dependency checked out (expected='{0}' found='{1}')"
|
||||||
|
.format(self.hash_3_15_6, checked_out))
|
||||||
|
|
||||||
|
|
||||||
|
def is_shallow_repo(place):
|
||||||
|
check = sp.check_output(['git', 'rev-parse', '--is-shallow-repository'], cwd=place).strip().decode('ascii')
|
||||||
|
if check == '--is-shallow-repository':
|
||||||
|
if os.path.exists(os.path.join(place, '.git', 'shallow')):
|
||||||
|
check = 'true'
|
||||||
|
else:
|
||||||
|
check = 'false'
|
||||||
|
return check == 'true'
|
||||||
|
|
||||||
|
|
||||||
|
class TestAddDependencyOptions(unittest.TestCase):
|
||||||
|
location = ''
|
||||||
|
testfile = ''
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
os.environ['SETUP_PATH'] = '.'
|
||||||
|
cue.clear_lists()
|
||||||
|
cue.detect_context()
|
||||||
|
if os.path.exists(cue.ci['cachedir']):
|
||||||
|
shutil.rmtree(cue.ci['cachedir'], onerror=cue.remove_readonly)
|
||||||
|
self.location = os.path.join(cue.ci['cachedir'], 'mcoreutils-master')
|
||||||
|
self.testfile = os.path.join(self.location, '.ci', 'LICENSE')
|
||||||
|
os.path.join(cue.ci['cachedir'], 'mcoreutils-master')
|
||||||
|
cue.source_set('defaults')
|
||||||
|
cue.complete_setup('MCoreUtils')
|
||||||
|
cue.setup['MCoreUtils'] = 'master'
|
||||||
|
|
||||||
|
def test_Default(self):
|
||||||
|
cue.add_dependency('MCoreUtils')
|
||||||
|
self.assertTrue(os.path.exists(self.testfile),
|
||||||
|
'Submodule (.ci) not checked out recursively (requested: default=YES')
|
||||||
|
self.assertTrue(is_shallow_repo(self.location),
|
||||||
|
'Module not checked out shallow (requested: default=5)')
|
||||||
|
|
||||||
|
def test_SetRecursiveNo(self):
|
||||||
|
cue.setup['MCoreUtils_RECURSIVE'] = 'NO'
|
||||||
|
cue.add_dependency('MCoreUtils')
|
||||||
|
self.assertFalse(os.path.exists(self.testfile), 'Submodule (.ci) checked out recursively')
|
||||||
|
|
||||||
|
def test_SetDepthZero(self):
|
||||||
|
cue.setup['MCoreUtils_DEPTH'] = '0'
|
||||||
|
cue.add_dependency('MCoreUtils')
|
||||||
|
self.assertFalse(is_shallow_repo(self.location), 'Module checked out shallow (requested full)')
|
||||||
|
|
||||||
|
def test_SetDepthThree(self):
|
||||||
|
cue.setup['MCoreUtils_DEPTH'] = '3'
|
||||||
|
cue.add_dependency('MCoreUtils')
|
||||||
|
self.assertTrue(is_shallow_repo(self.location),
|
||||||
|
'Module not checked out shallow (requested: depth=3)')
|
||||||
|
|
||||||
|
def test_AddMsiTo314(self):
|
||||||
|
cue.complete_setup('BASE')
|
||||||
|
cue.setup['BASE'] = 'R3.14.12.1'
|
||||||
|
msifile = os.path.join(cue.ci['cachedir'], 'base-R3.14.12.1', 'src', 'dbtools', 'msi.c')
|
||||||
|
cue.add_dependency('BASE')
|
||||||
|
self.assertTrue(os.path.exists(msifile), 'MSI was not added to Base 3.14')
|
||||||
|
|
||||||
|
def test_DefaultBaseBranch(self):
|
||||||
|
cue.complete_setup('BASE')
|
||||||
|
self.assertEqual(cue.setup['BASE'], '7.0',
|
||||||
|
'Default Base branch is not 7.0 (found {0})'.format(cue.setup['BASE']))
|
||||||
|
|
||||||
|
|
||||||
|
def repo_access(dep):
|
||||||
|
cue.set_setup_from_env(dep)
|
||||||
|
cue.setup.setdefault(dep + "_DIRNAME", dep.lower())
|
||||||
|
cue.setup.setdefault(dep + "_REPONAME", dep.lower())
|
||||||
|
cue.setup.setdefault('REPOOWNER', 'epics-modules')
|
||||||
|
cue.setup.setdefault(dep + "_REPOOWNER", cue.setup['REPOOWNER'])
|
||||||
|
cue.setup.setdefault(dep + "_REPOURL", 'https://github.com/{0}/{1}.git'
|
||||||
|
.format(cue.setup[dep + '_REPOOWNER'], cue.setup[dep + '_REPONAME']))
|
||||||
|
with open(os.devnull, 'w') as devnull:
|
||||||
|
return cue.call_git(['ls-remote', '--quiet', '--heads', cue.setup[dep + '_REPOURL']],
|
||||||
|
stdout=devnull, stderr=devnull)
|
||||||
|
|
||||||
|
|
||||||
|
class TestDefaultModuleURLs(unittest.TestCase):
|
||||||
|
modules = ['BASE', 'PVDATA', 'PVACCESS', 'NTYPES',
|
||||||
|
'SNCSEQ', 'STREAM', 'ASYN', 'STD',
|
||||||
|
'CALC', 'AUTOSAVE', 'BUSY', 'SSCAN',
|
||||||
|
'IOCSTATS', 'MOTOR', 'IPAC', ]
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
os.environ['SETUP_PATH'] = '.:appveyor'
|
||||||
|
cue.clear_lists()
|
||||||
|
os.chdir(builddir)
|
||||||
|
cue.source_set('defaults')
|
||||||
|
|
||||||
|
def test_Repos(self):
|
||||||
|
for mod in self.modules:
|
||||||
|
self.assertEqual(repo_access(mod), 0, 'Defaults for {0} do not point to a valid git repository at {1}'
|
||||||
|
.format(mod, cue.setup[mod + '_REPOURL']))
|
||||||
|
|
||||||
|
@unittest.skipIf(ci_os != 'windows', 'VCVars test only applies to windows')
|
||||||
|
class TestVCVars(unittest.TestCase):
|
||||||
|
def test_vcvars(self):
|
||||||
|
if ci_service == 'travis':
|
||||||
|
os.environ['TRAVIS_COMPILER'] = 'vs2017'
|
||||||
|
else:
|
||||||
|
os.environ['CONFIGURATION'] = 'default'
|
||||||
|
if ci_service == 'github-actions' and os.environ['IMAGEOS'] == 'win16':
|
||||||
|
os.environ['CMP'] = 'vs2017'
|
||||||
|
elif ci_service == 'github-actions' and os.environ['IMAGEOS'] == 'win19':
|
||||||
|
os.environ['CMP'] = 'vs2019'
|
||||||
|
else:
|
||||||
|
os.environ['CMP'] = 'vs2022'
|
||||||
|
cue.detect_context()
|
||||||
|
cue.with_vcvars('env')
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(ci_service != 'travis', 'Run travis tests only on travis')
|
||||||
|
class TestTravisDetectContext(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
os.environ['TRAVIS'] = 'true'
|
||||||
|
os.environ['TRAVIS_OS_NAME'] = 'linux'
|
||||||
|
os.environ['TRAVIS_COMPILER'] = 'gcc'
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
cue.clear_lists()
|
||||||
|
os.environ.pop('BCFG', None)
|
||||||
|
os.environ.pop('TEST', None)
|
||||||
|
os.environ.pop('STATIC', None)
|
||||||
|
|
||||||
|
def test_LinuxGccNone(self):
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'travis', "ci['service'] is {0} (expected: travis)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'linux', "ci['os'] is {0} (expected: linux)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'gcc', "ci['compiler'] is {0} (expected: gcc)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_LinuxClangNone(self):
|
||||||
|
os.environ['TRAVIS_COMPILER'] = 'clang'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'travis', "ci['service'] is {0} (expected: travis)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'linux', "ci['os'] is {0} (expected: linux)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'clang', "ci['compiler'] is {0} (expected: clang)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_BcfgShared(self):
|
||||||
|
os.environ['BCFG'] = 'shared'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_BcfgStatic(self):
|
||||||
|
os.environ['BCFG'] = 'static'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertTrue(cue.ci['static'], "ci['static'] is False (expected: True)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'static-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: static-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_BcfgDebug(self):
|
||||||
|
os.environ['BCFG'] = 'debug'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertTrue(cue.ci['debug'], "ci['debug'] is False (expected: True)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-debug',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-debug)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_BcfgStaticDebug(self):
|
||||||
|
os.environ['BCFG'] = 'static-debug'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertTrue(cue.ci['static'], "ci['static'] is False (expected: True)")
|
||||||
|
self.assertTrue(cue.ci['debug'], "ci['debug'] is False (expected: True)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'static-debug',
|
||||||
|
"ci['configuration'] is {0} (expected: static-debug)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_TestNo(self):
|
||||||
|
os.environ['TEST'] = 'NO'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['test'], "ci['test'] is True (expected: False)")
|
||||||
|
|
||||||
|
def test_WindowsGccNone(self):
|
||||||
|
os.environ['TRAVIS_OS_NAME'] = 'windows'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'travis', "ci['service'] is {0} (expected: travis)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'windows', "ci['os'] is {0} (expected: windows)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'gcc', "ci['compiler'] is {0} (expected: gcc)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertIn('strawberryperl', cue.ci['choco'], "'strawberryperl' is not in ci['choco']")
|
||||||
|
self.assertIn('make', cue.ci['choco'], "'make' is not in ci['choco']")
|
||||||
|
|
||||||
|
def test_WindowsVs2017None(self):
|
||||||
|
os.environ['TRAVIS_OS_NAME'] = 'windows'
|
||||||
|
os.environ['TRAVIS_COMPILER'] = 'vs2017'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'travis', "ci['service'] is {0} (expected: travis)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'windows', "ci['os'] is {0} (expected: windows)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'vs2017', "ci['compiler'] is {0} (expected: vs2017)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertIn('strawberryperl', cue.ci['choco'], "'strawberryperl' is not in ci['choco']")
|
||||||
|
self.assertIn('make', cue.ci['choco'], "'make' is not in ci['choco']")
|
||||||
|
|
||||||
|
def test_WindowsVs2019None(self):
|
||||||
|
os.environ['TRAVIS_OS_NAME'] = 'windows'
|
||||||
|
os.environ['TRAVIS_COMPILER'] = 'vs2019'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'travis', "ci['service'] is {0} (expected: travis)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'windows', "ci['os'] is {0} (expected: windows)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'vs2017', "ci['compiler'] is {0} (expected: vs2017)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertIn('strawberryperl', cue.ci['choco'], "'strawberryperl' is not in ci['choco']")
|
||||||
|
self.assertIn('make', cue.ci['choco'], "'make' is not in ci['choco']")
|
||||||
|
|
||||||
|
def test_OsxClangNone(self):
|
||||||
|
os.environ['TRAVIS_OS_NAME'] = 'osx'
|
||||||
|
os.environ['TRAVIS_COMPILER'] = 'clang'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'travis', "ci['service'] is {0} (expected: travis)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'osx', "ci['os'] is {0} (expected: osx)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'clang', "ci['compiler'] is {0} (expected: clang)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_StaticGetsWarning(self):
|
||||||
|
os.environ['STATIC'] = 'YES'
|
||||||
|
capturedOutput = getStringIO()
|
||||||
|
sys.stdout = capturedOutput
|
||||||
|
cue.detect_context()
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertRegex(capturedOutput.getvalue(), "Variable 'STATIC' not supported anymore")
|
||||||
|
|
||||||
|
def test_MisspelledBcfgGetsWarning(self):
|
||||||
|
os.environ['BCFG'] = 'static-dubug'
|
||||||
|
capturedOutput = getStringIO()
|
||||||
|
sys.stdout = capturedOutput
|
||||||
|
cue.detect_context()
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertRegex(capturedOutput.getvalue(), "Unrecognized build configuration setting")
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(ci_service != 'appveyor', 'Run appveyor tests only on appveyor')
|
||||||
|
class TestAppveyorDetectContext(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
os.environ['APPVEYOR'] = 'True'
|
||||||
|
os.environ['APPVEYOR_BUILD_WORKER_IMAGE'] = 'Visual Studio 2019'
|
||||||
|
os.environ['CMP'] = 'vs2019'
|
||||||
|
os.environ['CONFIGURATION'] = 'default'
|
||||||
|
os.environ['PLATFORM'] = 'x64'
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
cue.clear_lists()
|
||||||
|
os.environ.pop('STATIC', None)
|
||||||
|
os.environ.pop('TEST', None)
|
||||||
|
|
||||||
|
def test_Platform32(self):
|
||||||
|
os.environ['PLATFORM'] = 'x86'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x86',
|
||||||
|
"ci['platform'] is {0} (expected: x86)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
|
||||||
|
def test_Platform64(self):
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64',
|
||||||
|
"ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
|
||||||
|
def test_PlatformX64(self):
|
||||||
|
os.environ['PLATFORM'] = 'X64'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64',
|
||||||
|
"ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
|
||||||
|
def test_ConfigDefault(self):
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_ConfigStatic(self):
|
||||||
|
os.environ['CONFIGURATION'] = 'static'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertTrue(cue.ci['static'], "ci['static'] is False (expected: True)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'static-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: static-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_ConfigDebug(self):
|
||||||
|
os.environ['CONFIGURATION'] = 'debug'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertTrue(cue.ci['debug'], "ci['debug'] is False (expected: True)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-debug',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-debug)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_ConfigStaticDebug(self):
|
||||||
|
os.environ['CONFIGURATION'] = 'static-debug'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertTrue(cue.ci['static'], "ci['static'] is False (expected: True)")
|
||||||
|
self.assertTrue(cue.ci['debug'], "ci['debug'] is False (expected: True)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'static-debug',
|
||||||
|
"ci['configuration'] is {0} (expected: static-debug)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
|
||||||
|
def test_TestNo(self):
|
||||||
|
os.environ['TEST'] = 'NO'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertFalse(cue.ci['test'], "ci['test'] is True (expected: False)")
|
||||||
|
|
||||||
|
def test_WindowsGccNone(self):
|
||||||
|
os.environ['CMP'] = 'gcc'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'appveyor', "ci['service'] is {0} (expected: appveyor)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'windows', "ci['os'] is {0} (expected: windows)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'gcc', "ci['compiler'] is {0} (expected: gcc)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertIn('make', cue.ci['choco'], "'make' is not in ci['choco']")
|
||||||
|
|
||||||
|
def test_WindowsVs2017None(self):
|
||||||
|
os.environ['APPVEYOR_BUILD_WORKER_IMAGE'] = 'Visual Studio 2017'
|
||||||
|
os.environ['CMP'] = 'vs2017'
|
||||||
|
os.environ['PLATFORM'] = 'x86'
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'appveyor', "ci['service'] is {0} (expected: appveyor)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'windows', "ci['os'] is {0} (expected: windows)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'vs2017', "ci['compiler'] is {0} (expected: vs2017)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x86', "ci['platform'] is {0} (expected: x86)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertIn('make', cue.ci['choco'], "'make' is not in ci['choco']")
|
||||||
|
|
||||||
|
def test_WindowsVs2019None(self):
|
||||||
|
cue.detect_context()
|
||||||
|
self.assertEqual(cue.ci['service'], 'appveyor', "ci['service'] is {0} (expected: appveyor)"
|
||||||
|
.format(cue.ci['service']))
|
||||||
|
self.assertEqual(cue.ci['os'], 'windows', "ci['os'] is {0} (expected: windows)"
|
||||||
|
.format(cue.ci['os']))
|
||||||
|
self.assertEqual(cue.ci['compiler'], 'vs2019', "ci['compiler'] is {0} (expected: vs2019)"
|
||||||
|
.format(cue.ci['compiler']))
|
||||||
|
self.assertEqual(cue.ci['platform'], 'x64', "ci['platform'] is {0} (expected: x64)"
|
||||||
|
.format(cue.ci['platform']))
|
||||||
|
self.assertFalse(cue.ci['static'], "ci['static'] is True (expected: False)")
|
||||||
|
self.assertFalse(cue.ci['debug'], "ci['debug'] is True (expected: False)")
|
||||||
|
self.assertEqual(cue.ci['configuration'], 'shared-optimized',
|
||||||
|
"ci['configuration'] is {0} (expected: shared-optimized)"
|
||||||
|
.format(cue.ci['configuration']))
|
||||||
|
self.assertIn('make', cue.ci['choco'], "'make' is not in ci['choco']")
|
||||||
|
|
||||||
|
def test_StaticGetsWarning(self):
|
||||||
|
os.environ['STATIC'] = 'YES'
|
||||||
|
capturedOutput = getStringIO()
|
||||||
|
sys.stdout = capturedOutput
|
||||||
|
cue.detect_context()
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertRegex(capturedOutput.getvalue(), "Variable 'STATIC' not supported anymore")
|
||||||
|
|
||||||
|
def test_MisspelledConfigurationGetsWarning(self):
|
||||||
|
os.environ['CONFIGURATION'] = 'static-dubug'
|
||||||
|
capturedOutput = getStringIO()
|
||||||
|
sys.stdout = capturedOutput
|
||||||
|
cue.detect_context()
|
||||||
|
sys.stdout = sys.__stdout__
|
||||||
|
self.assertRegex(capturedOutput.getvalue(), "Unrecognized build configuration setting")
|
||||||
|
|
||||||
|
|
||||||
|
class TestSetupForBuild(unittest.TestCase):
|
||||||
|
args = Namespace(paths=[])
|
||||||
|
if ci_os == 'windows':
|
||||||
|
choco_installs = ['make']
|
||||||
|
if ci_service != 'appveyor':
|
||||||
|
choco_installs.append('strawberryperl')
|
||||||
|
sp.check_call(['choco', 'install', '-ry'] + choco_installs)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
cue.building_base = True
|
||||||
|
if ci_service == 'appveyor':
|
||||||
|
os.environ['CONFIGURATION'] = 'default'
|
||||||
|
cue.detect_context()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
os.environ.pop('EPICS_HOST_ARCH', None)
|
||||||
|
cue.clear_lists()
|
||||||
|
|
||||||
|
def test_AddPathsOption(self):
|
||||||
|
os.environ['FOOBAR'] = 'BAR'
|
||||||
|
args = Namespace(paths=['/my/{FOOBAR}/dir', '/my/foobar'])
|
||||||
|
cue.setup_for_build(args)
|
||||||
|
self.assertTrue(re.search('/my/BAR/dir', os.environ['PATH']), 'Expanded path not in PATH')
|
||||||
|
self.assertTrue(re.search('/foobar', os.environ['PATH']), 'Plain path not in PATH')
|
||||||
|
os.environ.pop('FOOBAR', None)
|
||||||
|
|
||||||
|
@unittest.skipIf(ci_os != 'windows', 'HostArchConfiguration test only applies to windows')
|
||||||
|
def test_HostArchConfiguration(self):
|
||||||
|
cue.ci['compiler'] = 'vs2017'
|
||||||
|
for cue.ci['debug'] in [True, False]:
|
||||||
|
for cue.ci['static'] in [True, False]:
|
||||||
|
config_st = {True: 'static', False: 'shared'}
|
||||||
|
config_db = {True: '-debug', False: '-optimized'}
|
||||||
|
config = config_st[cue.ci['static']] + config_db[cue.ci['debug']]
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertTrue('EPICS_HOST_ARCH' in os.environ,
|
||||||
|
'EPICS_HOST_ARCH is not set for Configuration={0}'.format(config))
|
||||||
|
if cue.ci['static']:
|
||||||
|
self.assertTrue(re.search('-static$', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH is not -static for Configuration={0}'.format(config))
|
||||||
|
self.assertFalse(re.search('debug', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH is -debug for Configuration={0}'.format(config))
|
||||||
|
elif cue.ci['debug']:
|
||||||
|
self.assertFalse(re.search('static', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH (found {0}) is -static for Configuration={1}'
|
||||||
|
.format(os.environ['EPICS_HOST_ARCH'], config))
|
||||||
|
self.assertTrue(re.search('-debug$', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH (found {0}) is not -debug for Configuration={1}'
|
||||||
|
.format(os.environ['EPICS_HOST_ARCH'], config))
|
||||||
|
else:
|
||||||
|
self.assertFalse(re.search('static', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH is -static for Configuration={0}'.format(config))
|
||||||
|
self.assertFalse(re.search('debug', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH is -debug for Configuration={0}'.format(config))
|
||||||
|
|
||||||
|
@unittest.skipIf(ci_os != 'windows', 'HostArchPlatform test only applies to windows')
|
||||||
|
def test_HostArchPlatform(self):
|
||||||
|
if ci_service == 'appveyor':
|
||||||
|
platforms = ['x86', 'x64']
|
||||||
|
else:
|
||||||
|
platforms = ['x64']
|
||||||
|
for platform in platforms:
|
||||||
|
for cc in ['vs2019', 'gcc']:
|
||||||
|
cue.ci['platform'] = platform
|
||||||
|
cue.ci['compiler'] = cc
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertTrue('EPICS_HOST_ARCH' in os.environ,
|
||||||
|
'EPICS_HOST_ARCH is not set for {0} / {1}'
|
||||||
|
.format(cc, cue.ci['platform']))
|
||||||
|
if platform == 'x86':
|
||||||
|
self.assertTrue(re.search('^win32-x86', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH (found {0}) is not win32-x86 for {1} / {2}'
|
||||||
|
.format(os.environ['EPICS_HOST_ARCH'], cc, platform))
|
||||||
|
else:
|
||||||
|
self.assertTrue(re.search('^windows-x64', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH (found {0}) is not windows-x64 for {1} / {2}'
|
||||||
|
.format(os.environ['EPICS_HOST_ARCH'], cc, platform))
|
||||||
|
if cc == 'gcc':
|
||||||
|
self.assertTrue(re.search('-mingw$', os.environ['EPICS_HOST_ARCH']),
|
||||||
|
'EPICS_HOST_ARCH (found {0}) is not -mingw for {1} / {2}'
|
||||||
|
.format(os.environ['EPICS_HOST_ARCH'], cc, platform))
|
||||||
|
if ci_service == 'appveyor':
|
||||||
|
pattern = {'x86': 'mingw32', 'x64': 'mingw64'}
|
||||||
|
self.assertTrue(re.search(pattern[platform], os.environ['PATH']),
|
||||||
|
'Binary location for {0} not in PATH (found PATH = {1})'
|
||||||
|
.format(pattern[platform], os.environ['PATH']))
|
||||||
|
|
||||||
|
@unittest.skipIf(ci_os != 'windows', 'Strawberry perl test only applies to windows')
|
||||||
|
def test_StrawberryInPath(self):
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertTrue(re.search('strawberry', os.environ['PATH'], flags=re.IGNORECASE),
|
||||||
|
'Strawberry Perl location not in PATH (found PATH = {0})'
|
||||||
|
.format(os.environ['PATH']))
|
||||||
|
|
||||||
|
def setBase314(self, yesno):
|
||||||
|
cfg_base_version = os.path.join('configure', 'CONFIG_BASE_VERSION')
|
||||||
|
fout = open(cfg_base_version, 'w')
|
||||||
|
print('# test file for base version detection', file=fout)
|
||||||
|
print('BASE_3_14={0}'.format(yesno), file=fout)
|
||||||
|
fout.close()
|
||||||
|
|
||||||
|
def setTestResultsTarget(self, target):
|
||||||
|
rules_build = os.path.join('configure', 'RULES_BUILD')
|
||||||
|
fout = open(rules_build, 'w')
|
||||||
|
print('# test file for target detection', file=fout)
|
||||||
|
print('{0}: something'.format(target), file=fout)
|
||||||
|
fout.close()
|
||||||
|
|
||||||
|
def test_DetectionBase314No(self):
|
||||||
|
self.setBase314('NO')
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertFalse(cue.is_base314, 'Falsely detected Base 3.14')
|
||||||
|
|
||||||
|
def test_DetectionBase314Yes(self):
|
||||||
|
self.setBase314('YES')
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertTrue(cue.is_base314, 'Base 3.14 = YES not detected')
|
||||||
|
|
||||||
|
def test_DetectionTestResultsTarget314No(self):
|
||||||
|
self.setBase314('YES')
|
||||||
|
self.setTestResultsTarget('nottherighttarget')
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertFalse(cue.has_test_results, 'Falsely detected test-results target')
|
||||||
|
|
||||||
|
def test_DetectionTestResultsTarget314Yes(self):
|
||||||
|
self.setBase314('YES')
|
||||||
|
self.setTestResultsTarget('test-results')
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertFalse(cue.has_test_results, 'Falsely found test-results on Base 3.14')
|
||||||
|
|
||||||
|
def test_DetectionTestResultsTargetNot314Yes(self):
|
||||||
|
self.setBase314('NO')
|
||||||
|
self.setTestResultsTarget('test-results')
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertTrue(cue.has_test_results, 'Target test-results not detected')
|
||||||
|
|
||||||
|
def test_ExtraMakeArgs(self):
|
||||||
|
os.environ['EXTRA'] = 'bla'
|
||||||
|
for ind in range(1,5):
|
||||||
|
os.environ['EXTRA{0}'.format(ind)] = '"bla {0}"'.format(ind)
|
||||||
|
cue.setup_for_build(self.args)
|
||||||
|
self.assertTrue(cue.extra_makeargs[0] == 'bla', 'Extra make arg [0] not set')
|
||||||
|
for ind in range(1,5):
|
||||||
|
self.assertTrue(cue.extra_makeargs[ind] == 'bla {0}'.format(ind),
|
||||||
|
'Extra make arg [{0}] not set (expected "bla {0}", found "{1}")'
|
||||||
|
.format(ind, cue.extra_makeargs[ind]))
|
||||||
|
|
||||||
|
|
||||||
|
class TestHooks(unittest.TestCase):
|
||||||
|
location = os.path.join(cue.ci['cachedir'], 'hook_test')
|
||||||
|
bla_file = os.path.join(location, 'bla.txt')
|
||||||
|
new_file = os.path.join(location, 'dd', 'new.txt')
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
if os.path.exists(self.location):
|
||||||
|
shutil.rmtree(self.location, onerror=cue.remove_readonly)
|
||||||
|
try:
|
||||||
|
os.makedirs(self.location)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
with open(self.bla_file, 'w') as f:
|
||||||
|
f.write('''LINE1=YES
|
||||||
|
LINE2=NO''')
|
||||||
|
|
||||||
|
def test_patchfile(self):
|
||||||
|
hook = os.path.join(builddir, 'test.patch')
|
||||||
|
cue.apply_patch(hook, cwd=self.location)
|
||||||
|
line1_yes = False
|
||||||
|
with open(self.bla_file) as f:
|
||||||
|
if 'LINE1=YES' in f.read():
|
||||||
|
line1_yes = True
|
||||||
|
self.assertFalse(line1_yes, "Patch didn't change line in test file 'bla.txt'")
|
||||||
|
self.assertTrue(os.path.exists(self.new_file), "patch didn't add new file")
|
||||||
|
|
||||||
|
def test_archiveZip(self):
|
||||||
|
hook = os.path.join(builddir, 'test.zip')
|
||||||
|
cue.extract_archive(hook, cwd=self.location)
|
||||||
|
self.assertTrue(os.path.exists(self.new_file), "archive extract didn't add new file")
|
||||||
|
|
||||||
|
def test_archive7z(self):
|
||||||
|
hook = os.path.join(builddir, 'test.7z')
|
||||||
|
cue.extract_archive(hook, cwd=self.location)
|
||||||
|
self.assertTrue(os.path.exists(self.new_file), "archive extract didn't add new file")
|
||||||
|
|
||||||
|
@unittest.skipIf(ci_os != 'linux', 'CrossCompatibilityHandling tests only apply to linux')
|
||||||
|
class TestCrossCompatibilityHandling(unittest.TestCase):
|
||||||
|
args = Namespace(paths=[])
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
cue.clear_lists()
|
||||||
|
os.environ.pop('CI_CROSS_TARGETS', None)
|
||||||
|
os.environ.pop('RTEMS_TARGET', None)
|
||||||
|
os.environ.pop('RTEMS', None)
|
||||||
|
os.environ.pop('WINE', None)
|
||||||
|
os.environ['MODULES'] = ''
|
||||||
|
cue.detect_context()
|
||||||
|
# Make cue.prepare() reconfigure base
|
||||||
|
for root, dirs, files in os.walk(cue.ci['cachedir']):
|
||||||
|
if 'checked_out' in files:
|
||||||
|
if fnmatch.fnmatch(root, '*/base-*'):
|
||||||
|
os.remove(os.path.join(root, 'checked_out'))
|
||||||
|
|
||||||
|
def runtest_rtems(self, arch, ver):
|
||||||
|
cue.prepare(self.args)
|
||||||
|
self.assertTrue('CI_CROSS_TARGETS' in os.environ, "CI_CROSS_TARGETS has not been set")
|
||||||
|
self.assertTrue(os.environ['CI_CROSS_TARGETS'].startswith(':' + arch),
|
||||||
|
"CI_CROSS_TARGETS is {0} (expected: :{1}...)"
|
||||||
|
.format(os.environ['CI_CROSS_TARGETS'], arch))
|
||||||
|
self.assertTrue(os.environ['CI_CROSS_TARGETS'].endswith('@' + ver),
|
||||||
|
"CI_CROSS_TARGETS is {0} (expected: ...@{1})"
|
||||||
|
.format(os.environ['CI_CROSS_TARGETS'], ver))
|
||||||
|
|
||||||
|
def test_RTEMS49_no_target(self):
|
||||||
|
os.environ['RTEMS'] = '4.9'
|
||||||
|
self.runtest_rtems('RTEMS-pc386', '4.9')
|
||||||
|
|
||||||
|
def test_RTEMS49_with_target(self):
|
||||||
|
os.environ['RTEMS'] = '4.9'
|
||||||
|
os.environ['RTEMS_TARGET'] = 'RTEMS-pc386'
|
||||||
|
self.runtest_rtems('RTEMS-pc386', '4.9')
|
||||||
|
|
||||||
|
def test_RTEMS410_no_target(self):
|
||||||
|
os.environ['RTEMS'] = '4.10'
|
||||||
|
self.runtest_rtems('RTEMS-pc386', '4.10')
|
||||||
|
|
||||||
|
def test_RTEMS410_with_target(self):
|
||||||
|
os.environ['RTEMS'] = '4.10'
|
||||||
|
os.environ['RTEMS_TARGET'] = 'RTEMS-pc386'
|
||||||
|
self.runtest_rtems('RTEMS-pc386', '4.10')
|
||||||
|
|
||||||
|
def test_RTEMS5_no_target(self):
|
||||||
|
os.environ['RTEMS'] = '5'
|
||||||
|
self.runtest_rtems('RTEMS-pc686', '5')
|
||||||
|
|
||||||
|
def test_RTEMS5_with_target(self):
|
||||||
|
os.environ['RTEMS'] = '5'
|
||||||
|
os.environ['RTEMS_TARGET'] = 'RTEMS-pc686'
|
||||||
|
self.runtest_rtems('RTEMS-pc686', '5')
|
||||||
|
|
||||||
|
def test_WINE32(self):
|
||||||
|
os.environ['WINE'] = '32'
|
||||||
|
cue.prepare(self.args)
|
||||||
|
self.assertTrue('CI_CROSS_TARGETS' in os.environ, "CI_CROSS_TARGETS has not been set")
|
||||||
|
self.assertEqual(os.environ['CI_CROSS_TARGETS'], ':win32-x86-mingw',
|
||||||
|
"CI_CROSS_TARGETS is {0} (expected: :win32-x86-mingw)"
|
||||||
|
.format(os.environ['CI_CROSS_TARGETS']))
|
||||||
|
|
||||||
|
def test_WINE64(self):
|
||||||
|
os.environ['WINE'] = '64'
|
||||||
|
cue.prepare(self.args)
|
||||||
|
self.assertTrue('CI_CROSS_TARGETS' in os.environ, "CI_CROSS_TARGETS has not been set")
|
||||||
|
self.assertEqual(os.environ['CI_CROSS_TARGETS'], ':windows-x64-mingw',
|
||||||
|
"CI_CROSS_TARGETS is {0} (expected: :windows-x64-mingw)"
|
||||||
|
.format(os.environ['CI_CROSS_TARGETS']))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if 'VV' in os.environ and os.environ['VV'] == '1':
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
cue.silent_dep_builds = False
|
||||||
|
|
||||||
|
cue.detect_context()
|
||||||
|
cue.host_info()
|
||||||
|
if sys.argv[1:] == ['env']:
|
||||||
|
# testing with_vcvars
|
||||||
|
[print(K, '=', V) for K, V in os.environ.items()]
|
||||||
|
elif ci_os == 'windows' and sys.argv[1:] == ['findvs']:
|
||||||
|
from fnmatch import fnmatch
|
||||||
|
print('Available Visual Studio versions')
|
||||||
|
for base in (r'C:\Program Files (x86)', r'C:\Program Files'):
|
||||||
|
for root, dirs, files in os.walk(base):
|
||||||
|
for fname in files:
|
||||||
|
if fnmatch(fname, 'vcvarsall.bat'):
|
||||||
|
print('Found', os.path.join(root, fname))
|
||||||
|
sys.stdout.flush()
|
||||||
|
else:
|
||||||
|
unittest.main()
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
# EPICS Base
|
# EPICS Base
|
||||||
|
BASE=7.0
|
||||||
BASE_DIRNAME=base
|
BASE_DIRNAME=base
|
||||||
BASE_REPONAME=epics-base
|
BASE_REPONAME=epics-base
|
||||||
BASE_REPOOWNER=epics-base
|
BASE_REPOOWNER=epics-base
|
||||||
@@ -17,7 +18,7 @@ NTYPES_REPONAME=normativeTypesCPP
|
|||||||
NTYPES_REPOOWNER=epics-base
|
NTYPES_REPOOWNER=epics-base
|
||||||
|
|
||||||
# Sequencer
|
# Sequencer
|
||||||
SNCSEQ_REPOURL=https://www-csr.bessy.de/control/SoftDist/sequencer/repo/branch-2-2.git
|
SNCSEQ_REPOURL=https://github.com/mdavidsaver/sequencer-mirror.git
|
||||||
SNCSEQ_DEPTH=0
|
SNCSEQ_DEPTH=0
|
||||||
SNCSEQ_DIRNAME=seq
|
SNCSEQ_DIRNAME=seq
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ testHarness_SRCS += epicsRunExampleTests.c
|
|||||||
exampleTestHarness_SRCS += $(testHarness_SRCS)
|
exampleTestHarness_SRCS += $(testHarness_SRCS)
|
||||||
exampleTestHarness_SRCS_RTEMS += rtemsTestHarness.c
|
exampleTestHarness_SRCS_RTEMS += rtemsTestHarness.c
|
||||||
|
|
||||||
|
ifdef BASE_7_0
|
||||||
PROD_SRCS_RTEMS += rtemsTestData.c
|
PROD_SRCS_RTEMS += rtemsTestData.c
|
||||||
|
endif
|
||||||
|
|
||||||
PROD_vxWorks = exampleTestHarness
|
PROD_vxWorks = exampleTestHarness
|
||||||
PROD_RTEMS = exampleTestHarness
|
PROD_RTEMS = exampleTestHarness
|
||||||
@@ -54,5 +56,7 @@ endif
|
|||||||
|
|
||||||
include $(TOP)/configure/RULES
|
include $(TOP)/configure/RULES
|
||||||
|
|
||||||
|
ifdef BASE_7_0
|
||||||
rtemsTestData.c : $(TESTFILES) $(TOOLS)/epicsMakeMemFs.pl
|
rtemsTestData.c : $(TESTFILES) $(TOOLS)/epicsMakeMemFs.pl
|
||||||
$(PERL) $(TOOLS)/epicsMakeMemFs.pl $@ epicsRtemsFSImage $(TESTFILES)
|
$(PERL) $(TOOLS)/epicsMakeMemFs.pl $@ epicsRtemsFSImage $(TESTFILES)
|
||||||
|
endif
|
||||||
|
|||||||
70
github-actions/README.md
Normal file
70
github-actions/README.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# GitHub Actions Scripts for EPICS Modules
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- 20 parallel runners on Linux/Windows (5 runners on MacOS)
|
||||||
|
- Ubuntu 18/20/22, MacOS 11/12, Windows Server 2019/2022
|
||||||
|
- Compile natively on Linux (gcc, clang)
|
||||||
|
- Compile natively on MacOS (clang)
|
||||||
|
- Compile natively on Windows (gcc/MinGW, Visual Studio 2019/2022)
|
||||||
|
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
||||||
|
- Cross-compile for RTEMS 4.9 and 4.10 (pc386, Base >= 3.15)
|
||||||
|
- Cross-compile for RTEMS 5 (10 BSPs, Base >= 7.0.5.1)
|
||||||
|
- Caching not supported yet.
|
||||||
|
|
||||||
|
## How to Use these Scripts
|
||||||
|
|
||||||
|
1. Add the ci-scripts respository as a Git Submodule
|
||||||
|
(see [README](../README.md) one level above).
|
||||||
|
|
||||||
|
2. Add settings files defining which dependencies in which versions
|
||||||
|
you want to build against
|
||||||
|
(see [README](../README.md) one level above).
|
||||||
|
|
||||||
|
3. Create a GitHub Actions configuration by copying one of the workflow
|
||||||
|
examples into the directory `.github/workflows` of your module.
|
||||||
|
```bash
|
||||||
|
$ mkdir -p .github/workflows
|
||||||
|
$ cp .ci/github-actions/ci-scripts-build.yml.example-full .github/workflows/ci-scripts-build.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Edit the workflow configuration to include the build jobs you want
|
||||||
|
GitHub Actions to run.
|
||||||
|
|
||||||
|
Build jobs are specified in the `jobs: <job-name>: strategy:`
|
||||||
|
declaration. The `matrix:` element specifies the axes as configuration
|
||||||
|
parameters with their lists of values,
|
||||||
|
`env:` (on the build level) controls the setting of environment variables
|
||||||
|
(which can be matrix parameters).
|
||||||
|
The `runs-on:` setting specifies the image (operating system) of the
|
||||||
|
runner.
|
||||||
|
The `name:` is what shows up in the web interface for the workflow,
|
||||||
|
builds and jobs, and the elements under `steps:` describe the actions
|
||||||
|
executed for each job of the matrix.
|
||||||
|
|
||||||
|
Please check the comments in the examples for more hints, and the
|
||||||
|
[GitHub Actions documentation](https://help.github.com/en/actions)
|
||||||
|
for a lot more options and details.
|
||||||
|
|
||||||
|
5. Push your changes and click on the `Actions` tab of your GitHub repository
|
||||||
|
page to see your build results.
|
||||||
|
|
||||||
|
## Specifics
|
||||||
|
|
||||||
|
#### Quote Environment Variable Values
|
||||||
|
|
||||||
|
Variable settings distinguish between numerical and string values.
|
||||||
|
Better quote all branch and tag names. E.g.,
|
||||||
|
```yaml
|
||||||
|
env:
|
||||||
|
BASE: "7.0"
|
||||||
|
```
|
||||||
|
to avoid ci-scripts trying to `git clone` with `--branch 7`.
|
||||||
|
|
||||||
|
## Caches
|
||||||
|
|
||||||
|
GitHub Actions provides caching of dependencies.
|
||||||
|
|
||||||
|
However, since their cache restore and create algorithm is fundamentally
|
||||||
|
different from those used by Travis and AppVeyor, this will require some
|
||||||
|
more changes in ci-scripts to work. Be patient.
|
||||||
227
github-actions/ci-scripts-build.yml.example-full
Normal file
227
github-actions/ci-scripts-build.yml.example-full
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
# .github/workflows/ci-scripts-build.yml for use with EPICS Base ci-scripts
|
||||||
|
# (see: https://github.com/epics-base/ci-scripts)
|
||||||
|
|
||||||
|
# This is YAML - indentation levels are crucial
|
||||||
|
|
||||||
|
# Set the 'name:' properties to values that work for you (MYMODULE)
|
||||||
|
|
||||||
|
name: MYMODULE
|
||||||
|
|
||||||
|
# Trigger on pushes and PRs to any branch
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- 'documentation/*'
|
||||||
|
- '**/*.html'
|
||||||
|
- '**/*.md'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
SETUP_PATH: .ci-local:.ci
|
||||||
|
# For the sequencer on Linux/Windows/MacOS
|
||||||
|
APT: re2c
|
||||||
|
CHOCO: re2c
|
||||||
|
BREW: re2c
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-base:
|
||||||
|
name: ${{ matrix.name }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
# Set environment variables from matrix parameters
|
||||||
|
env:
|
||||||
|
CMP: ${{ matrix.cmp }}
|
||||||
|
BCFG: ${{ matrix.configuration }}
|
||||||
|
WINE: ${{ matrix.wine }}
|
||||||
|
RTEMS: ${{ matrix.rtems }}
|
||||||
|
RTEMS_TARGET: ${{ matrix.rtems_target }}
|
||||||
|
EXTRA: ${{ matrix.extra }}
|
||||||
|
TEST: ${{ matrix.test }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
# Job names also name artifacts, character limitations apply
|
||||||
|
include:
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
wine: "64"
|
||||||
|
name: "Ub-20 gcc-9 + MinGW"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: static
|
||||||
|
wine: "64"
|
||||||
|
name: "Ub-20 gcc-9 + MinGW, static"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: static
|
||||||
|
extra: "CMD_CXXFLAGS=-std=c++11"
|
||||||
|
name: "Ub-20 gcc-9 C++11, static"
|
||||||
|
|
||||||
|
- os: ubuntu-18.04
|
||||||
|
cmp: clang
|
||||||
|
configuration: default
|
||||||
|
name: "Ub-18 clang-9"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: clang
|
||||||
|
configuration: default
|
||||||
|
extra: "CMD_CXXFLAGS=-std=c++11"
|
||||||
|
name: "Ub-20 clang-10 C++11"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
rtems: "4.10"
|
||||||
|
name: "Ub-20 gcc-9 + RT-4.10"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
rtems: "4.9"
|
||||||
|
name: "Ub-20 gcc-9 + RT-4.9"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
rtems: "5"
|
||||||
|
rtems_target: RTEMS-pc686-qemu
|
||||||
|
name: "Ub-20 gcc-9 + RT-5.1 pc686"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
rtems: "5"
|
||||||
|
rtems_target: RTEMS-beatnik
|
||||||
|
test: NO
|
||||||
|
name: "Ub-20 gcc-9 + RT-5.1 beatnik"
|
||||||
|
|
||||||
|
- os: ubuntu-18.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
name: "Ub-18 gcc-7"
|
||||||
|
|
||||||
|
- os: ubuntu-18.04
|
||||||
|
cmp: gcc-8
|
||||||
|
utoolchain: true
|
||||||
|
configuration: default
|
||||||
|
name: "Ub-18 gcc-8"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc-8
|
||||||
|
utoolchain: true
|
||||||
|
configuration: default
|
||||||
|
name: "Ub-20 gcc-8"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: clang
|
||||||
|
configuration: default
|
||||||
|
name: "Ub-20 clang-10"
|
||||||
|
|
||||||
|
- os: macos-11
|
||||||
|
cmp: clang
|
||||||
|
configuration: default
|
||||||
|
name: "MacOS clang-13"
|
||||||
|
|
||||||
|
- os: macos-12
|
||||||
|
cmp: clang
|
||||||
|
configuration: default
|
||||||
|
name: "MacOS clang-13"
|
||||||
|
|
||||||
|
- os: windows-2019
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
name: "Win2019 MinGW"
|
||||||
|
|
||||||
|
- os: windows-2019
|
||||||
|
cmp: gcc
|
||||||
|
configuration: static
|
||||||
|
name: "Win2019 MinGW, static"
|
||||||
|
|
||||||
|
- os: windows-2019
|
||||||
|
cmp: vs2019
|
||||||
|
configuration: default
|
||||||
|
name: "Win2019 MSC-19"
|
||||||
|
|
||||||
|
- os: windows-2019
|
||||||
|
cmp: vs2019
|
||||||
|
configuration: static
|
||||||
|
name: "Win2019 MSC-19, static"
|
||||||
|
|
||||||
|
- os: windows-2022
|
||||||
|
cmp: vs2022
|
||||||
|
configuration: default
|
||||||
|
name: "Win2022 MSC-22"
|
||||||
|
|
||||||
|
- os: windows-2022
|
||||||
|
cmp: vs2022
|
||||||
|
configuration: static
|
||||||
|
name: "Win2022 MSC-22, static"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Automatic core dumper analysis
|
||||||
|
uses: mdavidsaver/ci-core-dumper@master
|
||||||
|
- name: "apt-get install"
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install qemu-system-x86 g++-mingw-w64-x86-64 gdb
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
- name: "apt-get install ${{ matrix.cmp }}"
|
||||||
|
run: |
|
||||||
|
sudo apt-get -y install software-properties-common
|
||||||
|
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install ${{ matrix.cmp }}
|
||||||
|
if: matrix.utoolchain
|
||||||
|
- name: Prepare and compile dependencies
|
||||||
|
run: python .ci/cue.py prepare
|
||||||
|
- name: Build main module
|
||||||
|
run: python .ci/cue.py build
|
||||||
|
- name: Run main module tests
|
||||||
|
run: python .ci/cue.py -T 15M test
|
||||||
|
- name: Upload tapfiles Artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: tapfiles ${{ matrix.name }}
|
||||||
|
path: '**/O.*/*.tap'
|
||||||
|
- name: Collect and show test results
|
||||||
|
run: python .ci/cue.py test-results
|
||||||
|
|
||||||
|
build-cross:
|
||||||
|
name: cross ${{ matrix.cross }} / ${{ matrix.cmp }} / ${{ matrix.configuration }}
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
env:
|
||||||
|
CMP: gcc
|
||||||
|
BCFG: default
|
||||||
|
CI_CROSS_TARGETS: ${{ matrix.cross }}
|
||||||
|
APT: re2c
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
# configuration: [default, static, debug, static-debug]
|
||||||
|
configuration: [default]
|
||||||
|
cross:
|
||||||
|
- linux-aarch64
|
||||||
|
- linux-arm@arm-linux-gnueabi
|
||||||
|
- linux-arm@arm-linux-gnueabihf
|
||||||
|
- linux-ppc
|
||||||
|
- linux-ppc64
|
||||||
|
- win32-x86-mingw
|
||||||
|
- windows-x64-mingw
|
||||||
|
- RTEMS-pc386-qemu@4.9
|
||||||
|
- RTEMS-pc386-qemu@4.10
|
||||||
|
- RTEMS-pc686-qemu@5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Prepare and compile dependencies
|
||||||
|
run: python cue.py prepare
|
||||||
|
- name: Build main module
|
||||||
|
run: python cue.py build
|
||||||
|
- name: Run main module tests
|
||||||
|
run: python cue.py -T 15M test
|
||||||
|
- name: Collect and show test results
|
||||||
|
run: python cue.py test-results
|
||||||
81
github-actions/ci-scripts-build.yml.example-mini
Normal file
81
github-actions/ci-scripts-build.yml.example-mini
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
# .github/workflows/ci-scripts-build.yml for use with EPICS Base ci-scripts
|
||||||
|
# (see: https://github.com/epics-base/ci-scripts)
|
||||||
|
|
||||||
|
# This is YAML - indentation levels are crucial
|
||||||
|
|
||||||
|
# Set the 'name:' properties to values that work for you
|
||||||
|
|
||||||
|
name: MYMODULE
|
||||||
|
|
||||||
|
# Trigger on pushes and PRs to any branch
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- 'documentation/*'
|
||||||
|
- '**/*.html'
|
||||||
|
- '**/*.md'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
SETUP_PATH: .ci-local:.ci
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-linux:
|
||||||
|
name: ${{ matrix.name }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
# Set environment variables from matrix parameters
|
||||||
|
env:
|
||||||
|
CMP: ${{ matrix.cmp }}
|
||||||
|
BCFG: ${{ matrix.configuration }}
|
||||||
|
BASE: ${{ matrix.base }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
- os: ubuntu-18.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
base: "7.0"
|
||||||
|
name: "7.0 Ub-18 gcc-7"
|
||||||
|
|
||||||
|
- os: ubuntu-18.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: static
|
||||||
|
base: "7.0"
|
||||||
|
name: "7.0 Ub-18 gcc-7 static"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: default
|
||||||
|
base: "3.15"
|
||||||
|
name: "3.15 Ub-20 gcc-9"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: static
|
||||||
|
base: "3.15"
|
||||||
|
name: "3.15 Ub-20 gcc-9 static"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: gcc
|
||||||
|
configuration: debug
|
||||||
|
base: "3.15"
|
||||||
|
name: "3.15 Ub-20 gcc-9 debug"
|
||||||
|
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
cmp: clang
|
||||||
|
configuration: default
|
||||||
|
base: "3.15"
|
||||||
|
name: "3.15 Ub-20 clang-10"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Prepare and compile dependencies
|
||||||
|
run: python .ci/cue.py prepare
|
||||||
|
- name: Build main module
|
||||||
|
run: python .ci/cue.py build
|
||||||
|
- name: Run main module tests
|
||||||
|
run: python .ci/cue.py test
|
||||||
|
- name: Collect and show test results
|
||||||
|
run: python .ci/cue.py test-results
|
||||||
121
gitlab/.gitlab-ci.yml.example-full
Normal file
121
gitlab/.gitlab-ci.yml.example-full
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
# .gitlab-ci.yml for testing EPICS Base ci-scripts
|
||||||
|
# (see: https://github.com/epics-base/ci-scripts)
|
||||||
|
|
||||||
|
# This is YAML - indentation levels are crucial
|
||||||
|
|
||||||
|
# GitLab runner can use any Docker container, we're using this one
|
||||||
|
# to be comparable with the other CI services
|
||||||
|
image: ubuntu:bionic
|
||||||
|
|
||||||
|
cache:
|
||||||
|
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
||||||
|
paths:
|
||||||
|
- .cache/
|
||||||
|
|
||||||
|
variables:
|
||||||
|
GIT_SUBMODULE_STRATEGY: "recursive"
|
||||||
|
SETUP_PATH: ".ci-local:.ci"
|
||||||
|
BASE_RECURSIVE: "NO"
|
||||||
|
# Additional packages needed for
|
||||||
|
# | EPICS |clang| Windows cross builds |RTEMS testing |sequencer
|
||||||
|
APT: "libreadline6-dev libncurses5-dev perl clang g++-mingw-w64-i686 g++-mingw-w64-x86-64 qemu-system-x86 re2c"
|
||||||
|
CMP: "gcc"
|
||||||
|
BGFC: "default"
|
||||||
|
|
||||||
|
# Template for build jobs (hidden)
|
||||||
|
.build:
|
||||||
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full
|
||||||
|
- python .ci/cue.py prepare
|
||||||
|
script:
|
||||||
|
- python .ci/cue.py build
|
||||||
|
- python .ci/cue.py test
|
||||||
|
- python .ci/cue.py test-results
|
||||||
|
|
||||||
|
# If you need to do more during install and build,
|
||||||
|
# add a local directory to your module and do e.g.
|
||||||
|
# - ./.ci-local/travis/install-extras.sh
|
||||||
|
|
||||||
|
# Define build jobs
|
||||||
|
|
||||||
|
# Well-known variables to use
|
||||||
|
# SET source setup file
|
||||||
|
# ADD_MODULES extra modules (for a specific job)
|
||||||
|
# BCFG build configuration (static/debug/static-debug;
|
||||||
|
# default: shared-optimized)
|
||||||
|
# TEST set to NO to skip running the tests (default: YES)
|
||||||
|
# VV set to make build scripts verbose (default: unset)
|
||||||
|
# EXTRA content will be added to make command line
|
||||||
|
# EXTRA1..5 more additional arguments for the make command
|
||||||
|
# (one argument per variable)
|
||||||
|
|
||||||
|
# Usually from setup files, but may be specified or overridden
|
||||||
|
# on a job line
|
||||||
|
# MODULES list of dependency modules
|
||||||
|
# BASE branch or release tag name of the EPICS Base to use
|
||||||
|
# <MODULE> branch or release tag for a specific module
|
||||||
|
# ... see README for setup file syntax description
|
||||||
|
|
||||||
|
# Different configurations of gcc and clang
|
||||||
|
gcc_default:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "7.0"
|
||||||
|
|
||||||
|
gcc_static:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "7.0"
|
||||||
|
BCFG: "static"
|
||||||
|
|
||||||
|
clang_default:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "7.0"
|
||||||
|
CMP: "clang"
|
||||||
|
|
||||||
|
clang_static_c++11:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "7.0"
|
||||||
|
CMP: "clang"
|
||||||
|
BCFG: "static"
|
||||||
|
EXTRA: "CMD_CXXFLAGS=-std=c++11"
|
||||||
|
|
||||||
|
# Cross-compilations to Windows using gcc/MinGW and WINE
|
||||||
|
wine32_default:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "3.15"
|
||||||
|
BCFG: "static"
|
||||||
|
WINE: "32"
|
||||||
|
TEST: "NO"
|
||||||
|
|
||||||
|
wine64_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "7.0"
|
||||||
|
BCFG: "debug"
|
||||||
|
WINE: "64"
|
||||||
|
|
||||||
|
# Cross-builds to RTEMS 4.9, 4.10 and 5
|
||||||
|
rtems4.9_default:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
RTEMS: "4.9"
|
||||||
|
BASE: "3.15"
|
||||||
|
|
||||||
|
rtems4.10_debug:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
RTEMS: "4.10"
|
||||||
|
BASE: "7.0"
|
||||||
|
BCFG: "debug"
|
||||||
|
|
||||||
|
rtems5_default:
|
||||||
|
extends: .build
|
||||||
|
image: ubuntu:focal
|
||||||
|
variables:
|
||||||
|
RTEMS: "5"
|
||||||
|
RTEMS_TARGET: "RTEMS-pc686-qemu"
|
||||||
36
gitlab/.gitlab-ci.yml.example-mini
Normal file
36
gitlab/.gitlab-ci.yml.example-mini
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# .gitlab-ci.yml for testing EPICS Base ci-scripts
|
||||||
|
# (see: https://github.com/epics-base/ci-scripts)
|
||||||
|
|
||||||
|
image: ubuntu:bionic
|
||||||
|
|
||||||
|
variables:
|
||||||
|
GIT_SUBMODULE_STRATEGY: "recursive"
|
||||||
|
SETUP_PATH: ".ci-local:.ci"
|
||||||
|
BASE_RECURSIVE: "NO"
|
||||||
|
# Minimal set of packages needed to compile EPICS Base
|
||||||
|
APT: "libreadline6-dev libncurses5-dev perl"
|
||||||
|
CMP: "gcc"
|
||||||
|
BGFC: "default"
|
||||||
|
|
||||||
|
# Template for build jobs (hidden)
|
||||||
|
.build:
|
||||||
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- apt-get update -qq && apt-get install -y -qq build-essential git python curl p7zip-full
|
||||||
|
- python .ci/cue.py prepare
|
||||||
|
script:
|
||||||
|
- python .ci/cue.py build
|
||||||
|
- python .ci/cue.py test
|
||||||
|
- python .ci/cue.py test-results
|
||||||
|
|
||||||
|
# Build on Linux using default gcc for Base branches 7.0 and 3.15
|
||||||
|
|
||||||
|
gcc_base_7_0:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "7.0"
|
||||||
|
|
||||||
|
gcc_base_3_15:
|
||||||
|
extends: .build
|
||||||
|
variables:
|
||||||
|
BASE: "3.15"
|
||||||
69
gitlab/README.md
Normal file
69
gitlab/README.md
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# GitLab CI/CD Scripts for EPICS Modules
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Docker-based runners on Linux (one VM instance per job)
|
||||||
|
- Can use any Docker image from Dockerhub (the examples use
|
||||||
|
`ubuntu:bionic`)
|
||||||
|
- Compile natively using different compilers (gcc, clang)
|
||||||
|
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
||||||
|
- Cross-compile for RTEMS 4.9 and 4.10 (pc386, Base >= 3.15)
|
||||||
|
- Cross-compile for RTEMS 5 (10 BSPs, Base >= 7.0.5.1)
|
||||||
|
- Built dependencies are cached (for faster builds).
|
||||||
|
|
||||||
|
## How to Use these Scripts
|
||||||
|
|
||||||
|
1. Get an account on [GitLab](https://gitlab.com/), create a project
|
||||||
|
for your support module and have it mirror your upstream GitHub
|
||||||
|
repository. For more details, please refer to the
|
||||||
|
[GitLab CI/CD documentation](https://docs.gitlab.com/ee/README.html).
|
||||||
|
|
||||||
|
(This applies when using the free tier offered to open source
|
||||||
|
projects. Things will be different using an "Enterprise"
|
||||||
|
installation on customer hardware.)
|
||||||
|
|
||||||
|
2. Add the ci-scripts respository as a Git Submodule
|
||||||
|
(see [README](../README.md) one level above).
|
||||||
|
|
||||||
|
3. Add settings files defining which dependencies in which versions
|
||||||
|
you want to build against
|
||||||
|
(see [README](../README.md) one level above).
|
||||||
|
|
||||||
|
4. Create a GitLab configuration by copying one of the examples into
|
||||||
|
the root directory of your module.
|
||||||
|
```
|
||||||
|
$ cp .ci/gitlab/.gitlab-ci.yml.example-full .gitlab-ci.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Edit the `.gitlab-ci.yml` configuration to include the jobs you want
|
||||||
|
GitLab CI/CD to run.
|
||||||
|
|
||||||
|
Build jobs are declared in the list at the end of the file.
|
||||||
|
Each element (starting with the un-indented line) defines the
|
||||||
|
settings for one build job. `extends:` specifies a template to use as
|
||||||
|
a default structure, `variables:` controls the setting of environment
|
||||||
|
variables (overwriting settings from the template).
|
||||||
|
Also see the comments in the examples for more hints, and the
|
||||||
|
[GitLab CI/CD documentation](https://docs.gitlab.com/ee/README.html)
|
||||||
|
for more options and details.
|
||||||
|
|
||||||
|
6. Push your changes to GitHub, wait for the synchronization (every 5min)
|
||||||
|
and check [GitLab](https://gitlab.com/) for your build results.
|
||||||
|
|
||||||
|
## Caches
|
||||||
|
|
||||||
|
GitLab is configured to keep the caches separate for different jobs.
|
||||||
|
|
||||||
|
However, changing the job description (in the `.gitlab-ci.yml`
|
||||||
|
configuration file) or its environment settings or changing a value
|
||||||
|
inside a setup file will _not_ invalidate the cache - you will
|
||||||
|
have to manually delete the caches through the GitLab web interface.
|
||||||
|
|
||||||
|
Caches are automatically removed after approx. four weeks.
|
||||||
|
Your jobs will have to rebuild them once in a while.
|
||||||
|
|
||||||
|
## Miscellanea
|
||||||
|
|
||||||
|
To use the feature to extract `.zip`/`.7z` archives by setting
|
||||||
|
`*_HOOK` variables, the Linux and MacOS runners need the APT package
|
||||||
|
`p7zip-full` resp. the Homebrew package `p7zip` installed.
|
||||||
14
test.patch
Normal file
14
test.patch
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
diff -ruN a/bla.txt b/bla.txt
|
||||||
|
--- a/bla.txt 2020-06-19 18:54:43.129076711 +0200
|
||||||
|
+++ b/bla.txt 2020-06-19 18:55:05.093948316 +0200
|
||||||
|
@@ -1,3 +1,3 @@
|
||||||
|
-LINE1=YES
|
||||||
|
+LINE1=NO
|
||||||
|
LINE2=NO
|
||||||
|
|
||||||
|
diff -ruN a/dd/new.txt b/dd/new.txt
|
||||||
|
--- a/dd/new.txt 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ b/dd/new.txt 2020-06-19 18:55:35.255032413 +0200
|
||||||
|
@@ -0,0 +1,2 @@
|
||||||
|
+NEW LINE 1
|
||||||
|
+NEW LINE 2
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
MODULES="sncseq"
|
MODULES="sncseq"
|
||||||
|
|
||||||
BASE=7.0
|
BASE=7.0
|
||||||
SNCSEQ=R2-2-7
|
SNCSEQ=R2-2-9
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
dist: xenial
|
dist: bionic
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
@@ -14,6 +14,8 @@ cache:
|
|||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- SETUP_PATH=.ci-local:.ci
|
- SETUP_PATH=.ci-local:.ci
|
||||||
|
# for the sequencer on Windows
|
||||||
|
- CHOCO=re2c
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@@ -29,19 +31,22 @@ addons:
|
|||||||
- g++-mingw-w64-x86-64
|
- g++-mingw-w64-x86-64
|
||||||
# for RTEMS cross builds
|
# for RTEMS cross builds
|
||||||
- qemu-system-x86
|
- qemu-system-x86
|
||||||
|
# for .zip/.7z archive hooks
|
||||||
|
- p7zip-full
|
||||||
homebrew:
|
homebrew:
|
||||||
packages:
|
packages:
|
||||||
# for all EPICS builds
|
|
||||||
- bash
|
|
||||||
# for the sequencer
|
# for the sequencer
|
||||||
- re2c
|
- re2c
|
||||||
update: true
|
# for .zip/.7z archive hooks
|
||||||
|
- p7zip
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ./.ci/travis/prepare.sh
|
- python .ci/cue.py prepare
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./.ci/travis/build.sh
|
- python .ci/cue.py build
|
||||||
|
- python .ci/cue.py test
|
||||||
|
- python .ci/cue.py test-results
|
||||||
|
|
||||||
# If you need to do more during install and build,
|
# If you need to do more during install and build,
|
||||||
# add a local directory to your module and do e.g.
|
# add a local directory to your module and do e.g.
|
||||||
@@ -52,12 +57,13 @@ script:
|
|||||||
# Well-known variables to use
|
# Well-known variables to use
|
||||||
# SET source setup file
|
# SET source setup file
|
||||||
# ADD_MODULES extra modules (for a specific job)
|
# ADD_MODULES extra modules (for a specific job)
|
||||||
# EXTRA content will be added to make command line
|
# BCFG build configuration (static/debug/static-debug;
|
||||||
# EXTRA1..5 additional arguments for the make command
|
# default: shared-optimized)
|
||||||
# (one argument per variable)
|
|
||||||
# STATIC set to YES for static build (default: NO)
|
|
||||||
# TEST set to NO to skip running the tests (default: YES)
|
# TEST set to NO to skip running the tests (default: YES)
|
||||||
# VV set to make build scripts verbose (default: unset)
|
# VV set to make build scripts verbose (default: unset)
|
||||||
|
# EXTRA content will be added to make command line
|
||||||
|
# EXTRA1..5 more additional arguments for the make command
|
||||||
|
# (one argument per variable)
|
||||||
|
|
||||||
# Usually from setup files, but may be specified or overridden
|
# Usually from setup files, but may be specified or overridden
|
||||||
# on a job line
|
# on a job line
|
||||||
@@ -76,7 +82,7 @@ jobs:
|
|||||||
- env: BASE=7.0
|
- env: BASE=7.0
|
||||||
compiler: clang
|
compiler: clang
|
||||||
|
|
||||||
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
- env: BASE=7.0
|
||||||
|
|
||||||
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
||||||
compiler: clang
|
compiler: clang
|
||||||
@@ -89,19 +95,20 @@ jobs:
|
|||||||
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
||||||
dist: trusty
|
dist: trusty
|
||||||
|
|
||||||
# Cross-compilations to Windows using MinGW and WINE
|
# Cross-compilations to Windows using gcc/MinGW and WINE
|
||||||
|
|
||||||
- env: BASE=7.0 WINE=32 TEST=NO STATIC=YES
|
- env: BASE=7.0 WINE=32 TEST=NO BCFG=static
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
- env: BASE=7.0 WINE=64 TEST=NO STATIC=NO
|
- env: BASE=7.0 WINE=64 TEST=NO
|
||||||
compiler: mingw
|
|
||||||
|
|
||||||
# Cross-compilation to RTEMS
|
# Cross-compilation to RTEMS
|
||||||
|
|
||||||
- env: BASE=7.0 RTEMS=4.10 TEST=NO
|
- env: BASE=7.0 RTEMS=4.10 APT=usrmerge
|
||||||
|
|
||||||
- env: BASE=7.0 RTEMS=4.9 TEST=NO
|
- env: BASE=7.0 RTEMS=4.9 APT=usrmerge
|
||||||
|
|
||||||
|
- env: BASE=7.0 RTEMS=5 RTEMS_TARGET=RTEMS-pc686-qemu
|
||||||
|
dist: focal
|
||||||
|
|
||||||
# Other gcc versions (added as an extra package)
|
# Other gcc versions (added as an extra package)
|
||||||
|
|
||||||
@@ -117,4 +124,14 @@ jobs:
|
|||||||
|
|
||||||
- env: BASE=7.0
|
- env: BASE=7.0
|
||||||
os: osx
|
os: osx
|
||||||
|
osx_image: xcode11.3
|
||||||
compiler: clang
|
compiler: clang
|
||||||
|
|
||||||
|
# Windows builds
|
||||||
|
|
||||||
|
- env: BASE=7.0
|
||||||
|
os: windows
|
||||||
|
compiler: vs2017
|
||||||
|
|
||||||
|
- env: BASE=7.0
|
||||||
|
os: windows
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
dist: xenial
|
dist: bionic
|
||||||
|
|
||||||
# Minimal set of packages needed to compile EPICS Base
|
# Minimal set of packages needed to compile EPICS Base
|
||||||
|
|
||||||
@@ -15,12 +15,14 @@ addons:
|
|||||||
- perl
|
- perl
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ./.ci/travis/prepare.sh
|
- python .ci/cue.py prepare
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./.ci/travis/build.sh
|
- python .ci/cue.py build
|
||||||
|
- python .ci/cue.py test
|
||||||
|
- python .ci/cue.py test-results
|
||||||
|
|
||||||
# Build using default gcc for Base branches 7.0 and 3.15
|
# Build on Linux using default gcc for Base branches 7.0 and 3.15
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
From 00ee7bf7d3618c748491c88742c011a8353abeba Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Johnson <anj@anl.gov>
|
|
||||||
Date: Wed, 24 Oct 2018 14:27:15 -0500
|
|
||||||
Subject: [PATCH] Add RTEMS-pc368-qemu target, use in Travis-CI builds
|
|
||||||
|
|
||||||
---
|
|
||||||
configure/os/CONFIG.Common.RTEMS-pc386-qemu | 11 +++++++++++
|
|
||||||
configure/os/CONFIG_SITE.Common.RTEMS-pc386 | 5 -----
|
|
||||||
configure/os/CONFIG_SITE.Common.RTEMS-pc386-qemu | 9 +++++++++
|
|
||||||
src/libCom/RTEMS/Makefile | 2 +-
|
|
||||||
src/tools/makeTestfile.pl | 2 +-
|
|
||||||
6 files changed, 24 insertions(+), 10 deletions(-)
|
|
||||||
create mode 100644 configure/os/CONFIG.Common.RTEMS-pc386-qemu
|
|
||||||
delete mode 100644 configure/os/CONFIG_SITE.Common.RTEMS-pc386
|
|
||||||
create mode 100644 configure/os/CONFIG_SITE.Common.RTEMS-pc386-qemu
|
|
||||||
|
|
||||||
diff --git a/configure/os/CONFIG.Common.RTEMS-pc386-qemu b/configure/os/CONFIG.Common.RTEMS-pc386-qemu
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..684f01a19
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/configure/os/CONFIG.Common.RTEMS-pc386-qemu
|
|
||||||
@@ -0,0 +1,11 @@
|
|
||||||
+# CONFIG.Common.RTEMS-pc386-qemu
|
|
||||||
+#
|
|
||||||
+# Definitions for the RTEMS-pc386-qemu target
|
|
||||||
+# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc386-qemu
|
|
||||||
+#
|
|
||||||
+#-------------------------------------------------------
|
|
||||||
+
|
|
||||||
+# Include definitions from RTEMS-pc386
|
|
||||||
+include $(CONFIG)/os/CONFIG.Common.RTEMS-pc386
|
|
||||||
+
|
|
||||||
+RTEMS_QEMU_FIXUPS = YES
|
|
||||||
diff --git a/configure/os/CONFIG_SITE.Common.RTEMS-pc386-qemu b/configure/os/CONFIG_SITE.Common.RTEMS-pc386-qemu
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..027dcf4ab
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/configure/os/CONFIG_SITE.Common.RTEMS-pc386-qemu
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+# CONFIG_SITE.Common.RTEMS-pc386-qemu
|
|
||||||
+#
|
|
||||||
+# Site-specific overrides for the RTEMS-pc386-qemu target
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+# If you're building this architecture you _probably_ want to
|
|
||||||
+# run the tests for it under QEMU, but if not you can turn
|
|
||||||
+# them off here by commenting out this line:
|
|
||||||
+CROSS_COMPILER_RUNTEST_ARCHS += RTEMS-pc386-qemu
|
|
||||||
diff --git a/src/libCom/RTEMS/Makefile b/src/libCom/RTEMS/Makefile
|
|
||||||
index 2f12b7bf0..22a92733c 100644
|
|
||||||
--- a/src/libCom/RTEMS/Makefile
|
|
||||||
+++ b/src/libCom/RTEMS/Makefile
|
|
||||||
@@ -24,7 +24,7 @@ rtemsCom_SRCS += epicsRtemsInitHookPre.c
|
|
||||||
rtemsCom_SRCS += epicsRtemsInitHookPost.c
|
|
||||||
rtemsCom_SRCS += epicsMemFs.c
|
|
||||||
|
|
||||||
-ifeq ($(T_A),RTEMS-pc386)
|
|
||||||
+ifeq ($(RTEMS_BSP),pc386)
|
|
||||||
rtemsCom_SRCS += ne2kpci.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
diff --git a/src/tools/makeTestfile.pl b/src/tools/makeTestfile.pl
|
|
||||||
index 73f522034..fb431fe7a 100644
|
|
||||||
--- a/src/tools/makeTestfile.pl
|
|
||||||
+++ b/src/tools/makeTestfile.pl
|
|
||||||
@@ -37,7 +37,7 @@ if( $TA =~ /^win32-x86/ && $HA !~ /^win/ ) {
|
|
||||||
$exec = "wine64 $exe";
|
|
||||||
|
|
||||||
# Run pc386 test harness w/ QEMU
|
|
||||||
-} elsif( $TA =~ /^RTEMS-pc386$/ ) {
|
|
||||||
+} elsif( $TA =~ /^RTEMS-pc386-qemu$/ ) {
|
|
||||||
$exec = "qemu-system-i386 -m 64 -no-reboot -serial stdio -display none -net nic,model=ne2k_pci -net user,restrict=yes -kernel $exe";
|
|
||||||
|
|
||||||
# Explicitly fail for other RTEMS targets
|
|
||||||
--
|
|
||||||
2.21.0.windows.1
|
|
||||||
|
|
||||||
@@ -2,12 +2,16 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
- Two parallel runners on Linux/Windows (two runners on MacOS)
|
||||||
|
- Ubuntu 14/16/18/20, MacOS 10.13/14/15, Windows Server v1809
|
||||||
- Use different compilers (gcc, clang)
|
- Use different compilers (gcc, clang)
|
||||||
- Use different gcc versions
|
- Use different gcc versions
|
||||||
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
- Cross-compile for Windows 32bit and 64bit using MinGW and WINE
|
||||||
- Cross-compile for RTEMS 4.9 and 4.10
|
- Cross-compile for RTEMS 4.9 and 4.10 (pc386, Base >= 3.15)
|
||||||
- Compile on MacOS
|
- Cross-compile for RTEMS 5 (10 BSPs, Base >= 7.0.5.1)
|
||||||
- Released versions of dependencies are cached (for faster builds)
|
- Compile natively on MacOS (clang)
|
||||||
|
- Compile natively on Windows (gcc/MinGW, Visual Studio 2017)
|
||||||
|
- Built dependencies are cached (for faster builds).
|
||||||
|
|
||||||
## How to Use these Scripts
|
## How to Use these Scripts
|
||||||
|
|
||||||
@@ -17,6 +21,10 @@
|
|||||||
[Travis-CI Tutorial](https://docs.travis-ci.com/user/tutorial/).
|
[Travis-CI Tutorial](https://docs.travis-ci.com/user/tutorial/).
|
||||||
Make sure to use `travis-ci.org` and not their `.com` site.
|
Make sure to use `travis-ci.org` and not their `.com` site.
|
||||||
|
|
||||||
|
(This applies when using the free tier offered to open source
|
||||||
|
projects. Things will be different using an "Enterprise"
|
||||||
|
installation on customer hardware.)
|
||||||
|
|
||||||
2. Add the ci-scripts respository as a Git Submodule
|
2. Add the ci-scripts respository as a Git Submodule
|
||||||
(see [README](../README.md) one level above).
|
(see [README](../README.md) one level above).
|
||||||
|
|
||||||
@@ -34,7 +42,7 @@
|
|||||||
Travis to run.
|
Travis to run.
|
||||||
|
|
||||||
Build jobs are declared in the list following the `jobs: include:`
|
Build jobs are declared in the list following the `jobs: include:`
|
||||||
declaration. Each element (starting with `-` in column 3) defines the
|
declaration. Each element (starting with a dash) defines the
|
||||||
settings for one build job. `env:` controls the setting of environment
|
settings for one build job. `env:` controls the setting of environment
|
||||||
variables,`dist:` specifies the Linux distribution,
|
variables,`dist:` specifies the Linux distribution,
|
||||||
`os:` the operating system.
|
`os:` the operating system.
|
||||||
@@ -58,3 +66,9 @@ configuration.)
|
|||||||
|
|
||||||
Caches are automatically removed after approx. four weeks.
|
Caches are automatically removed after approx. four weeks.
|
||||||
Your jobs will have to rebuild them once in a while.
|
Your jobs will have to rebuild them once in a while.
|
||||||
|
|
||||||
|
## Miscellanea
|
||||||
|
|
||||||
|
To use the feature to extract `.zip`/`.7z` archives by setting
|
||||||
|
`*_HOOK` variables, the Linux and MacOS runners need the APT package
|
||||||
|
`p7zip-full` resp. the Homebrew package `p7zip` installed.
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Set VV in .travis.yml to make scripts verbose
|
|
||||||
[ "$VV" ] && set -x
|
|
||||||
|
|
||||||
CACHEDIR=${CACHEDIR:-${HOME}/.cache}
|
|
||||||
|
|
||||||
if [ "$BASE" = "SELF" ]
|
|
||||||
then
|
|
||||||
EPICS_BASE=$CURDIR
|
|
||||||
else
|
|
||||||
eval $(grep "EPICS_BASE=" ${CACHEDIR}/RELEASE.local)
|
|
||||||
fi
|
|
||||||
export EPICS_BASE
|
|
||||||
|
|
||||||
[ -z "$EPICS_HOST_ARCH" -a -f $EPICS_BASE/src/tools/EpicsHostArch.pl ] && EPICS_HOST_ARCH=$(perl $EPICS_BASE/src/tools/EpicsHostArch.pl)
|
|
||||||
[ -z "$EPICS_HOST_ARCH" -a -f $EPICS_BASE/startup/EpicsHostArch.pl ] && EPICS_HOST_ARCH=$(perl $EPICS_BASE/startup/EpicsHostArch.pl)
|
|
||||||
export EPICS_HOST_ARCH
|
|
||||||
|
|
||||||
# Base 3.15 doesn't have -qemu target architecture and needs an extra define
|
|
||||||
[ -e $EPICS_BASE/configure/os/CONFIG.Common.RTEMS-pc386-qemu ] || EXTRA_QEMU=RTEMS_QEMU_FIXUPS=YES
|
|
||||||
|
|
||||||
# use array variable to get the quoting right while using separate words for arguments
|
|
||||||
[ -n "$EXTRA0" ] && EXTRA[0]="$EXTRA0"
|
|
||||||
[ -n "$EXTRA1" ] && EXTRA[1]="$EXTRA1"
|
|
||||||
[ -n "$EXTRA2" ] && EXTRA[2]="$EXTRA2"
|
|
||||||
[ -n "$EXTRA3" ] && EXTRA[3]="$EXTRA3"
|
|
||||||
[ -n "$EXTRA4" ] && EXTRA[4]="$EXTRA4"
|
|
||||||
[ -n "$EXTRA5" ] && EXTRA[5]="$EXTRA5"
|
|
||||||
|
|
||||||
make -j2 $EXTRA_QEMU "${EXTRA[@]}"
|
|
||||||
|
|
||||||
ret=0
|
|
||||||
|
|
||||||
if [ "$TEST" != "NO" ]
|
|
||||||
then
|
|
||||||
make -j2 tapfiles || ret=$?
|
|
||||||
|
|
||||||
if grep -q "BASE_3_14=NO" $EPICS_BASE/configure/CONFIG_BASE_VERSION
|
|
||||||
then
|
|
||||||
grep -q "^test-results:" $EPICS_BASE/configure/RULES_BUILD && make -sk test-results
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit $ret
|
|
||||||
@@ -1,247 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# The following if clause can be removed for ci-scripts major version 3
|
|
||||||
if [ "$TRAVIS_OS_NAME" == osx -a "$BASH_VERSINFO" -lt 4 ]
|
|
||||||
then
|
|
||||||
brew install bash
|
|
||||||
if [ $(/usr/local/bin/bash -c 'echo $BASH_VERSINFO') -lt 4 ]
|
|
||||||
then
|
|
||||||
echo "Failed to install a recent bash" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
exec /usr/local/bin/bash $0 "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set VV in .travis.yml to make scripts verbose
|
|
||||||
[ "$VV" ] && set -x
|
|
||||||
|
|
||||||
# Perl version of "readlink -f" (which MacOS does not provide)
|
|
||||||
readlinkf() { perl -MCwd -e 'print Cwd::abs_path shift' "$1"; }
|
|
||||||
|
|
||||||
SCRIPTDIR=$(dirname $(readlinkf $0))
|
|
||||||
CURDIR="$PWD"
|
|
||||||
CACHEDIR=${CACHEDIR:-${HOME}/.cache}
|
|
||||||
[ -e ${CACHEDIR} ] || mkdir -p ${CACHEDIR}
|
|
||||||
|
|
||||||
# source functions
|
|
||||||
. $SCRIPTDIR/utils.sh
|
|
||||||
|
|
||||||
echo -e "${ANSI_YELLOW}Using bash version $BASH_VERSION${ANSI_RESET}"
|
|
||||||
|
|
||||||
if [ -f /etc/hosts ]
|
|
||||||
then
|
|
||||||
# The travis-ci "bionic" image throws us a curveball in /etc/hosts
|
|
||||||
# by including two entries for localhost. The first for 127.0.1.1
|
|
||||||
# which causes epicsSockResolveTest to fail.
|
|
||||||
# cat /etc/hosts
|
|
||||||
# ...
|
|
||||||
# 127.0.1.1 localhost localhost ip4-loopback
|
|
||||||
# 127.0.0.1 localhost nettuno travis vagrant travis-job-....
|
|
||||||
|
|
||||||
sudo sed -i -e '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts
|
|
||||||
|
|
||||||
echo "==== /etc/hosts"
|
|
||||||
cat /etc/hosts
|
|
||||||
echo "===="
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Load settings
|
|
||||||
# -------------
|
|
||||||
|
|
||||||
fold_start load.settings "Loading settings"
|
|
||||||
|
|
||||||
# load default settings for well-known modules
|
|
||||||
source_set defaults
|
|
||||||
|
|
||||||
# source configured settings
|
|
||||||
[ -z "${SET+x}" ] || source_set $SET
|
|
||||||
|
|
||||||
fold_end load.settings
|
|
||||||
|
|
||||||
# Check out dependencies
|
|
||||||
# ----------------------
|
|
||||||
|
|
||||||
if [ "$BASE" != "SELF" ]
|
|
||||||
then
|
|
||||||
fold_start check.out.dependencies "Checking/cloning dependencies"
|
|
||||||
|
|
||||||
for mod in BASE $ADD_MODULES $MODULES
|
|
||||||
do
|
|
||||||
mod_uc=${mod^^}
|
|
||||||
eval add_dependency $mod_uc \${${mod_uc}:=master}
|
|
||||||
done
|
|
||||||
[ -d ./configure ] && target=./configure/RELEASE.local || target=./RELEASE.local
|
|
||||||
cp ${CACHEDIR}/RELEASE.local $target
|
|
||||||
|
|
||||||
fold_end check.out.dependencies
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set up compiler
|
|
||||||
# ---------------
|
|
||||||
|
|
||||||
fold_start set.up.epics_build "Setting up EPICS build system"
|
|
||||||
|
|
||||||
if [ "$BASE" = "SELF" ]
|
|
||||||
then
|
|
||||||
EPICS_BASE=$CURDIR
|
|
||||||
else
|
|
||||||
eval $(grep "EPICS_BASE=" ${CACHEDIR}/RELEASE.local)
|
|
||||||
fi
|
|
||||||
export EPICS_BASE
|
|
||||||
echo "EPICS_BASE=$EPICS_BASE"
|
|
||||||
|
|
||||||
[ -z "$EPICS_HOST_ARCH" -a -f $EPICS_BASE/src/tools/EpicsHostArch.pl ] && EPICS_HOST_ARCH=$(perl $EPICS_BASE/src/tools/EpicsHostArch.pl)
|
|
||||||
[ -z "$EPICS_HOST_ARCH" -a -f $EPICS_BASE/startup/EpicsHostArch.pl ] && EPICS_HOST_ARCH=$(perl $EPICS_BASE/startup/EpicsHostArch.pl)
|
|
||||||
export EPICS_HOST_ARCH
|
|
||||||
echo "EPICS_HOST_ARCH=$EPICS_HOST_ARCH"
|
|
||||||
|
|
||||||
if echo ${modules_to_compile} | grep -q "$EPICS_BASE" || [ "$BASE" = "SELF" ]
|
|
||||||
then
|
|
||||||
|
|
||||||
# requires wine and g++-mingw-w64-i686
|
|
||||||
if [ "$WINE" = "32" ]
|
|
||||||
then
|
|
||||||
echo "Cross mingw32"
|
|
||||||
sed -i -e '/CMPLR_PREFIX/d' $EPICS_BASE/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
|
|
||||||
CMPLR_PREFIX=i686-w64-mingw32-
|
|
||||||
EOF
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/CONFIG_SITE
|
|
||||||
CROSS_COMPILER_TARGET_ARCHS+=win32-x86-mingw
|
|
||||||
EOF
|
|
||||||
|
|
||||||
elif [ "$WINE" = "64" ]
|
|
||||||
then
|
|
||||||
echo "Cross mingw64"
|
|
||||||
sed -i -e '/CMPLR_PREFIX/d' $EPICS_BASE/configure/os/CONFIG_SITE.linux-x86.windows-x64-mingw
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/os/CONFIG_SITE.linux-x86.windows-x64-mingw
|
|
||||||
CMPLR_PREFIX=x86_64-w64-mingw32-
|
|
||||||
EOF
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/CONFIG_SITE
|
|
||||||
CROSS_COMPILER_TARGET_ARCHS+=windows-x64-mingw
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$STATIC" = "YES" ]
|
|
||||||
then
|
|
||||||
echo "Build static libraries/executables"
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/CONFIG_SITE
|
|
||||||
SHARED_LIBRARIES=NO
|
|
||||||
STATIC_BUILD=YES
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
HOST_CCMPLR_NAME=`echo "$TRAVIS_COMPILER" | sed -E 's/^([[:alpha:]][^-]*(-[[:alpha:]][^-]*)*)+(-[0-9\.]+)?$/\1/g'`
|
|
||||||
HOST_CMPLR_VER_SUFFIX=`echo "$TRAVIS_COMPILER" | sed -E 's/^([[:alpha:]][^-]*(-[[:alpha:]][^-]*)*)+(-[0-9\.]+)?$/\3/g'`
|
|
||||||
HOST_CMPLR_VER=`echo "$HOST_CMPLR_VER_SUFFIX" | cut -c 2-`
|
|
||||||
|
|
||||||
case "$HOST_CCMPLR_NAME" in
|
|
||||||
clang)
|
|
||||||
echo "Host compiler is clang"
|
|
||||||
HOST_CPPCMPLR_NAME=$(echo "$HOST_CCMPLR_NAME" | sed 's/clang/clang++/g')
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH
|
|
||||||
GNU = NO
|
|
||||||
CMPLR_CLASS = clang
|
|
||||||
CC = ${HOST_CCMPLR_NAME}$HOST_CMPLR_VER_SUFFIX
|
|
||||||
CCC = ${HOST_CPPCMPLR_NAME}$HOST_CMPLR_VER_SUFFIX
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# hack
|
|
||||||
sed -i -e 's/CMPLR_CLASS = gcc/CMPLR_CLASS = clang/' $EPICS_BASE/configure/CONFIG.gnuCommon
|
|
||||||
|
|
||||||
${HOST_CCMPLR_NAME}$HOST_CMPLR_VER_SUFFIX --version
|
|
||||||
;;
|
|
||||||
gcc)
|
|
||||||
echo "Host compiler is GCC"
|
|
||||||
HOST_CPPCMPLR_NAME=$(echo "$HOST_CCMPLR_NAME" | sed 's/gcc/g++/g')
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH
|
|
||||||
CC = ${HOST_CCMPLR_NAME}$HOST_CMPLR_VER_SUFFIX
|
|
||||||
CCC = ${HOST_CPPCMPLR_NAME}$HOST_CMPLR_VER_SUFFIX
|
|
||||||
EOF
|
|
||||||
|
|
||||||
${HOST_CCMPLR_NAME}$HOST_CMPLR_VER_SUFFIX --version
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Host compiler is default"
|
|
||||||
gcc --version
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cat <<EOF >> $EPICS_BASE/configure/CONFIG_SITE
|
|
||||||
USR_CPPFLAGS += $USR_CPPFLAGS
|
|
||||||
USR_CFLAGS += $USR_CFLAGS
|
|
||||||
USR_CXXFLAGS += $USR_CXXFLAGS
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# set RTEMS to eg. "4.9" or "4.10"
|
|
||||||
# requires qemu, bison, flex, texinfo, install-info
|
|
||||||
if [ -n "$RTEMS" ]
|
|
||||||
then
|
|
||||||
echo "Cross RTEMS${RTEMS} for pc386"
|
|
||||||
sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' $EPICS_BASE/configure/os/CONFIG_SITE.Common.RTEMS
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/os/CONFIG_SITE.Common.RTEMS
|
|
||||||
RTEMS_VERSION=$RTEMS
|
|
||||||
RTEMS_BASE=$HOME/.rtems
|
|
||||||
EOF
|
|
||||||
# Base 3.15 doesn't have -qemu target architecture
|
|
||||||
[ -e $EPICS_BASE/configure/os/CONFIG.Common.RTEMS-pc386-qemu ] && QEMU=-qemu
|
|
||||||
cat << EOF >> $EPICS_BASE/configure/CONFIG_SITE
|
|
||||||
CROSS_COMPILER_TARGET_ARCHS += RTEMS-pc386$QEMU
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
|
||||||
echo -e "${ANSI_GREEN}EPICS build system already set up (Base was loaded from cache)${ANSI_RESET}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Download RTEMS cross compiler
|
|
||||||
if [ -n "$RTEMS" ]
|
|
||||||
then
|
|
||||||
echo "Downloading RTEMS${RTEMS} cross compiler for pc386"
|
|
||||||
curl -L "https://github.com/mdavidsaver/rsb/releases/download/20171203-${RTEMS}/i386-rtems${RTEMS}-trusty-20171203-${RTEMS}.tar.bz2" \
|
|
||||||
| tar -C / -xmj
|
|
||||||
fi
|
|
||||||
|
|
||||||
fold_end set.up.compiler
|
|
||||||
|
|
||||||
echo "\$ make --version"
|
|
||||||
make --version
|
|
||||||
|
|
||||||
[ "$BASE" = "SELF" ] && exit 0
|
|
||||||
|
|
||||||
# Build required dependencies
|
|
||||||
# ---------------------------
|
|
||||||
|
|
||||||
fold_start build.dependencies "Build missing/outdated dependencies"
|
|
||||||
|
|
||||||
[ "$VV" ] && silent="-s" || silent=
|
|
||||||
|
|
||||||
[ -z "$modules_to_compile" ] && echo -e "${ANSI_GREEN}All dependency modules are up-to-date (nothing to do)${ANSI_RESET}"
|
|
||||||
|
|
||||||
for module in ${modules_to_compile}
|
|
||||||
do
|
|
||||||
eval name=\${module#${CACHEDIR}/}
|
|
||||||
fold_start build.$name "Build $name"
|
|
||||||
make -j2 $silent -C $module $EXTRA
|
|
||||||
fold_end build.$name
|
|
||||||
done
|
|
||||||
|
|
||||||
fold_end build.dependencies
|
|
||||||
|
|
||||||
echo -e "${ANSI_BLUE}Dependency module information${ANSI_RESET}"
|
|
||||||
|
|
||||||
echo "Module Tag Binaries Commit"
|
|
||||||
echo "-----------------------------------------------------------------------------------"
|
|
||||||
for mod in base $MODULES $ADD_MODULES
|
|
||||||
do
|
|
||||||
mod_uc=${mod^^}
|
|
||||||
eval tag=\${${mod_uc}}
|
|
||||||
eval dir=${CACHEDIR}/\${${mod_uc}_DIRNAME}-$tag
|
|
||||||
echo "$modules_to_compile" | grep -q "$dir" && stat="rebuilt" || stat="from cache"
|
|
||||||
commit=$(git -C $dir log -n1 --oneline)
|
|
||||||
printf "%-10s %-12s %-11s %s\n" "$mod" "$tag" "$stat" "$commit"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo -e "${ANSI_BLUE}Contents of RELEASE.local${ANSI_RESET}"
|
|
||||||
cat ${CACHEDIR}/RELEASE.local
|
|
||||||
218
travis/utils.sh
218
travis/utils.sh
@@ -1,218 +0,0 @@
|
|||||||
# Utility functions for Travis scripts in ci-scripts
|
|
||||||
#
|
|
||||||
# This file is sourced by the executable scripts
|
|
||||||
# CACHEDIR must be defined and existing before calling these functions
|
|
||||||
|
|
||||||
# Portable version of 'sed -i' (that MacOS doesn't provide)
|
|
||||||
|
|
||||||
# sedi (cmd, file)
|
|
||||||
# Do the equivalent of "sed -i cmd file"
|
|
||||||
sedi () {
|
|
||||||
cat $2 | sed "$1" > $2.tmp$$; mv -f $2.tmp$$ $2
|
|
||||||
}
|
|
||||||
|
|
||||||
# Setup ANSI Colors
|
|
||||||
export ANSI_RED="\033[31;1m"
|
|
||||||
export ANSI_GREEN="\033[32;1m"
|
|
||||||
export ANSI_YELLOW="\033[33;1m"
|
|
||||||
export ANSI_BLUE="\033[34;1m"
|
|
||||||
export ANSI_RESET="\033[0m"
|
|
||||||
export ANSI_CLEAR="\033[0K"
|
|
||||||
|
|
||||||
# Travis log fold control
|
|
||||||
# from https://github.com/travis-ci/travis-rubies/blob/build/build.sh
|
|
||||||
|
|
||||||
fold_start() {
|
|
||||||
echo -e "travis_fold:start:$1\\r${ANSI_YELLOW}$2${ANSI_RESET}"
|
|
||||||
}
|
|
||||||
|
|
||||||
fold_end() {
|
|
||||||
echo -en "travis_fold:end:$1\\r"
|
|
||||||
}
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo -e "${ANSI_RED}$1${ANSI_RESET}"
|
|
||||||
[ "$UTILS_UNITTEST" ] || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# source_set(settings)
|
|
||||||
#
|
|
||||||
# Source a settings file (extension .set) found in SETUP_PATH
|
|
||||||
# May be called recursively (from within a settings file)
|
|
||||||
declare -a SEEN_SETUPS
|
|
||||||
source_set() {
|
|
||||||
local set_file=${1//[$'\r']}
|
|
||||||
local set_dir
|
|
||||||
local found=0
|
|
||||||
[ "${SETUP_PATH}" ] || die "Search path for setup files (SETUP_PATH) is empty"
|
|
||||||
for set_dir in ${SETUP_PATH//:/ }
|
|
||||||
do
|
|
||||||
if [ -e $set_dir/$set_file.set ]
|
|
||||||
then
|
|
||||||
if [[ " ${SEEN_SETUPS[@]} " =~ " $set_dir/$set_file.set " ]]
|
|
||||||
then
|
|
||||||
echo "Ignoring already included setup file $set_dir/$set_file.set"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
SEEN_SETUPS+=($set_dir/$set_file.set)
|
|
||||||
echo "Loading setup file $set_dir/$set_file.set"
|
|
||||||
local line
|
|
||||||
while read -r line
|
|
||||||
do
|
|
||||||
[ -z "$line" ] && continue
|
|
||||||
echo $line | grep -q "^#" && continue
|
|
||||||
if echo $line | grep -q "^include\W"
|
|
||||||
then
|
|
||||||
source_set $(echo $line | awk '{ print $2 }')
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if echo "$line" | grep -q "^\w\+="
|
|
||||||
then
|
|
||||||
IFS== read var value <<< "${line//[$'\r']}"
|
|
||||||
value=$(sed "s/^\(\"\)\(.*\)\1\$/\2/g" <<< "$value") # remove surrounding quotes
|
|
||||||
eval [ "\${$var}" ] || eval "$var=\$value"
|
|
||||||
fi
|
|
||||||
done < $set_dir/$set_file.set
|
|
||||||
found=1
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
[ $found -ne 0 ] || die "Setup file $set_file.set does not exist in SETUP_PATH search path ($SETUP_PATH)"
|
|
||||||
}
|
|
||||||
|
|
||||||
# update_release_local(varname, place)
|
|
||||||
# varname name of the variable to set in RELEASE.local
|
|
||||||
# place place (absolute path) of where variable should point to
|
|
||||||
#
|
|
||||||
# Manipulate RELEASE.local in the cache location:
|
|
||||||
# - replace "$varname=$place" line if it exists and has changed
|
|
||||||
# - otherwise add "$varname=$place" line and possibly move EPICS_BASE=... line to the end
|
|
||||||
update_release_local() {
|
|
||||||
local var=$1
|
|
||||||
local place=$2
|
|
||||||
local release_local=${CACHEDIR}/RELEASE.local
|
|
||||||
local updated_line="${var}=${place}"
|
|
||||||
|
|
||||||
local ret=0
|
|
||||||
[ -e ${release_local} ] && grep -q "${var}=" ${release_local} || ret=$?
|
|
||||||
if [ $ret -eq 0 ]
|
|
||||||
then
|
|
||||||
existing_line=$(grep "${var}=" ${release_local})
|
|
||||||
if [ "${existing_line}" != "${updated_line}" ]
|
|
||||||
then
|
|
||||||
sedi "s|${var}=.*|${var}=${place}|g" ${release_local}
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "$var=$place" >> ${release_local}
|
|
||||||
ret=0
|
|
||||||
grep -q "EPICS_BASE=" ${release_local} || ret=$?
|
|
||||||
if [ $ret -eq 0 ]
|
|
||||||
then
|
|
||||||
base_line=$(grep "EPICS_BASE=" ${release_local})
|
|
||||||
sedi '\|EPICS_BASE=|d' ${release_local}
|
|
||||||
echo ${base_line} >> ${release_local}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# add_dependency(dep, tag)
|
|
||||||
#
|
|
||||||
# Add a dependency to the cache area:
|
|
||||||
# - check out (recursive if configured) in the CACHE area unless it already exists and the
|
|
||||||
# required commit has been built
|
|
||||||
# - Defaults:
|
|
||||||
# $dep_DIRNAME = lower case ($dep)
|
|
||||||
# $dep_REPONAME = lower case ($dep)
|
|
||||||
# $dep_REPOURL = GitHub / $dep_REPOOWNER (or $REPOOWNER or epics-modules) / $dep_REPONAME .git
|
|
||||||
# $dep_VARNAME = $dep
|
|
||||||
# $dep_DEPTH = 5
|
|
||||||
# $dep_RECURSIVE = 1/YES (0/NO to for a flat clone)
|
|
||||||
# - Add $dep_VARNAME line to the RELEASE.local file in the cache area (unless already there)
|
|
||||||
# - Add full path to $modules_to_compile
|
|
||||||
add_dependency() {
|
|
||||||
curdir="$PWD"
|
|
||||||
DEP=$1
|
|
||||||
TAG=$2
|
|
||||||
dep_lc=${DEP,,}
|
|
||||||
eval dirname=\${${DEP}_DIRNAME:=${dep_lc}}
|
|
||||||
eval reponame=\${${DEP}_REPONAME:=${dep_lc}}
|
|
||||||
eval repourl=\${${DEP}_REPOURL:="https://github.com/\${${DEP}_REPOOWNER:=${REPOOWNER:-epics-modules}}/${reponame}.git"}
|
|
||||||
eval varname=\${${DEP}_VARNAME:=${DEP}}
|
|
||||||
eval recursive=\${${DEP}_RECURSIVE:=1}
|
|
||||||
recursive=${recursive,,}
|
|
||||||
local recurse=""
|
|
||||||
[ "$recursive" != "0" -a "$recursive" != "no" ] && recurse="--recursive"
|
|
||||||
|
|
||||||
# determine if $DEP points to a valid release or branch
|
|
||||||
git ls-remote --quiet --exit-code --refs $repourl "$TAG" > /dev/null 2>&1 ||
|
|
||||||
die "$TAG is neither a tag nor a branch name for $DEP ($repourl)"
|
|
||||||
|
|
||||||
if [ -e $CACHEDIR/$dirname-$TAG ]
|
|
||||||
then
|
|
||||||
[ -e $CACHEDIR/$dirname-$TAG/built ] && BUILT=$(cat $CACHEDIR/$dirname-$TAG/built) || BUILT="never"
|
|
||||||
HEAD=$(cd "$CACHEDIR/$dirname-$TAG" && git log -n1 --pretty=format:%H)
|
|
||||||
if [ "$HEAD" != "$BUILT" ]
|
|
||||||
then
|
|
||||||
rm -fr $CACHEDIR/$dirname-$TAG
|
|
||||||
else
|
|
||||||
echo "Found $TAG of dependency $DEP in $CACHEDIR/$dirname-$TAG"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e $CACHEDIR/$dirname-$TAG ]
|
|
||||||
then
|
|
||||||
cd $CACHEDIR
|
|
||||||
eval depth=\${${DEP}_DEPTH:-"-1"}
|
|
||||||
case ${depth} in
|
|
||||||
-1 )
|
|
||||||
deptharg="--depth 5"
|
|
||||||
;;
|
|
||||||
0 )
|
|
||||||
deptharg=""
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
deptharg="--depth $depth"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "Cloning $TAG of dependency $DEP into $CACHEDIR/$dirname-$TAG"
|
|
||||||
git clone --quiet $deptharg $recurse --branch "$TAG" $repourl $dirname-$TAG
|
|
||||||
( cd $dirname-$TAG && git log -n1 )
|
|
||||||
do_recompile=yes
|
|
||||||
# add MSI to Base 3.14
|
|
||||||
if [ $DEP == "BASE" ]
|
|
||||||
then
|
|
||||||
versionfile=$CACHEDIR/$dirname-$TAG/configure/CONFIG_BASE_VERSION
|
|
||||||
if [ -e ${versionfile} ] && grep -q "BASE_3_14=YES" ${versionfile}
|
|
||||||
then
|
|
||||||
echo "Adding MSI 1.7 to $CACHEDIR/$dirname-$TAG"
|
|
||||||
( cd $dirname-$TAG; patch -p1 < $SCRIPTDIR/../add-msi-to-314.patch )
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# fix non-base modules that do not include the .local files in configure/RELEASE
|
|
||||||
release=$CACHEDIR/$dirname-$TAG/configure/RELEASE
|
|
||||||
if [ -e $release ]
|
|
||||||
then
|
|
||||||
echo "-include \$(TOP)/../RELEASE.local" > $release
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
# run hook
|
|
||||||
eval hook="\${${DEP}_HOOK}"
|
|
||||||
if [ "$hook" ]
|
|
||||||
then
|
|
||||||
if [ -x "$curdir/$hook" ]
|
|
||||||
then
|
|
||||||
echo "Running hook $hook in $CACHEDIR/$dirname-$TAG"
|
|
||||||
( cd $CACHEDIR/$dirname-$TAG; "$curdir/$hook" )
|
|
||||||
else
|
|
||||||
die "Hook script $hook is not executable or does not exist."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
HEAD=$(cd "$CACHEDIR/$dirname-$TAG" && git log -n1 --pretty=format:%H)
|
|
||||||
echo "$HEAD" > "$CACHEDIR/$dirname-$TAG/built"
|
|
||||||
cd "$curdir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "${do_recompile}" ] && modules_to_compile="${modules_to_compile} $CACHEDIR/$dirname-$TAG"
|
|
||||||
|
|
||||||
update_release_local ${varname} $CACHEDIR/$dirname-$TAG
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user