7 Commits

Author SHA1 Message Date
Ralph Lange
ba5508b39e travis: update README
(fixes #19)
2020-05-20 18:59:45 +02:00
Ralph Lange
d5eab412b4 Readme: small updates and fixes 2020-05-20 18:42:04 +02:00
Ralph Lange
fff4249771 appveyor: fix VisualStudio parallel build for older Base versions 2020-05-14 18:18:50 +02:00
Ralph Lange
11e2f1852b Do not run 'make test-results' on Base 3.14
- also add tests for this
2020-05-13 12:35:38 +02:00
Ralph Lange
53e23e3684 appveyor: update README
- fixes #37
2020-05-11 09:10:42 +02:00
Ralph Lange
f0ce39129c appveyor: clean-up install; move 'prepare' to 'build_script'
fixes #38
2020-05-07 18:47:35 +02:00
Ralph Lange
1583d41197 Skip running test-results target if not defined 2020-05-05 11:59:25 +02:00
9 changed files with 179 additions and 36 deletions

View File

@@ -15,14 +15,6 @@
cache: cache:
- C:\Users\appveyor\.tools -> appveyor\do.py - C:\Users\appveyor\.tools -> appveyor\do.py
#---------------------------------#
# additional packages #
#---------------------------------#
install:
# for the sequencer
- cinst re2c
#---------------------------------# #---------------------------------#
# repository cloning # # repository cloning #
#---------------------------------# #---------------------------------#
@@ -31,6 +23,8 @@ install:
init: init:
# Set autocrlf to make batch files work # Set autocrlf to make batch files work
- git config --global core.autocrlf true - git config --global core.autocrlf true
# print the connection info for RDP connections (see 'debugging' below)
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# Set clone depth (do not fetch complete history) # Set clone depth (do not fetch complete history)
clone_depth: 50 clone_depth: 50
@@ -44,6 +38,16 @@ skip_commits:
- '**/*.md' - '**/*.md'
- '.travis.yml' - '.travis.yml'
#---------------------------------#
# additional packages #
#---------------------------------#
install:
# fetch submodules (like ci-scripts)
- cmd: git submodule update --init --recursive
# for the sequencer
- cinst re2c
#---------------------------------# #---------------------------------#
# build matrix configuration # # build matrix configuration #
#---------------------------------# #---------------------------------#
@@ -144,7 +148,6 @@ test_script:
## so you may want to adjust the build matrix above to just build the one of interest ## so you may want to adjust the build matrix above to just build the one of interest
#on_failure: #on_failure:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

View File

@@ -198,8 +198,8 @@ specific job will run the job with high verbosity,
printing every command as it is being executed and switching the dependency printing every command as it is being executed and switching the dependency
builds to higher verbosity. builds to higher verbosity.
For local debugging, you may set `CACHEDIR` to change the location for the For debugging on your local machine, you may set `CACHEDIR` to change the
dependency builds. [default is `$HOME/.cache`] location for the dependency builds. [default is `$HOME/.cache`]
## References: EPICS Modules Using ci-scripts ## References: EPICS Modules Using ci-scripts
@@ -236,16 +236,16 @@ This will make all builds (not just for your module) verbose.
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.4 of ci-scripts: setup to release 2.3.5 of ci-scripts:
```bash ```bash
cd .ci cd .ci
git pull origin v2.3.4 git pull origin v2.3.5
cd - cd -
git add .ci git add .ci
# if needed: # if needed:
edit .travis.yml edit .travis.yml
git add .travis.yml git add .travis.yml
git commit -m "Update ci-scripts submodule to v2.3.4" git commit -m "Update ci-scripts submodule to v2.3.5"
``` ```
Check the example configuration files inside ci-scripts (and their Check the example configuration files inside ci-scripts (and their

View File

@@ -308,9 +308,11 @@ class TestSetupForBuild(unittest.TestCase):
platform = os.environ['PLATFORM'] platform = os.environ['PLATFORM']
cc = os.environ['CMP'] cc = os.environ['CMP']
args = Namespace(paths=[]) args = Namespace(paths=[])
do.building_base = True
def setUp(self): def setUp(self):
os.environ.pop('EPICS_HOST_ARCH', None) os.environ.pop('EPICS_HOST_ARCH', None)
do.clear_lists()
def tearDown(self): def tearDown(self):
os.environ['CONFIGURATION'] = self.configuration os.environ['CONFIGURATION'] = self.configuration
@@ -380,6 +382,47 @@ class TestSetupForBuild(unittest.TestCase):
self.assertTrue(re.search('strawberry', os.environ['PATH'], flags=re.IGNORECASE), self.assertTrue(re.search('strawberry', os.environ['PATH'], flags=re.IGNORECASE),
'Strawberry Perl location not in PATH for vs2019') '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 __name__ == "__main__":
if 'VV' in os.environ and os.environ['VV'] == '1': if 'VV' in os.environ and os.environ['VV'] == '1':

View File

@@ -12,14 +12,6 @@
cache: cache:
- C:\Users\appveyor\.tools - C:\Users\appveyor\.tools
#---------------------------------#
# additional packages #
#---------------------------------#
install:
# for the sequencer
- cinst re2c
#---------------------------------# #---------------------------------#
# repository cloning # # repository cloning #
#---------------------------------# #---------------------------------#
@@ -43,6 +35,16 @@ skip_commits:
- '**/*.md' - '**/*.md'
- '.travis.yml' - '.travis.yml'
#---------------------------------#
# additional packages #
#---------------------------------#
install:
# fetch submodules (like ci-scripts)
- cmd: git submodule update --init --recursive
# for the sequencer
- cinst re2c
#---------------------------------# #---------------------------------#
# build matrix configuration # # build matrix configuration #
#---------------------------------# #---------------------------------#
@@ -113,11 +115,8 @@ matrix:
# building & testing # # building & testing #
#---------------------------------# #---------------------------------#
install:
- cmd: git submodule update --init --recursive
- cmd: python .ci/appveyor/do.py prepare
build_script: build_script:
- cmd: python .ci/appveyor/do.py prepare
- cmd: python .ci/appveyor/do.py build - cmd: python .ci/appveyor/do.py build
test_script: test_script:

View File

@@ -19,6 +19,9 @@ skip_commits:
- '**/*.md' - '**/*.md'
- '.travis.yml' - '.travis.yml'
install:
- cmd: git submodule update --init --recursive
image: Visual Studio 2019 image: Visual Studio 2019
# Build Configurations: dll/static, regular/debug # Build Configurations: dll/static, regular/debug
@@ -54,11 +57,8 @@ matrix:
- platform: x64 - platform: x64
CMP: vs2008 CMP: vs2008
install:
- cmd: git submodule update --init --recursive
- cmd: python .ci/appveyor/do.py prepare
build_script: build_script:
- cmd: python .ci/appveyor/do.py prepare
- cmd: python .ci/appveyor/do.py build - cmd: python .ci/appveyor/do.py build
test_script: test_script:

View File

@@ -12,7 +12,7 @@
1. Get an account on [AppVeyor](https://www.appveyor.com/), connect 1. Get an account on [AppVeyor](https://www.appveyor.com/), connect
it to your GitHub account and activate your support module's it to your GitHub account and activate your support module's
repository. For more details, please 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/).
2. Add the ci-scripts respository as a Git Submodule 2. Add the ci-scripts respository as a Git Submodule
@@ -45,15 +45,56 @@
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 worker VM - all jobs of the matrix are
executed sequentially. Each job will take around 10 minutes. executed sequentially. Each job will take between 6 and 15 minutes,
plus testing 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](https://www.appveyor.com/docs/build-configuration/#build-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:`
and`platform:` by moving these configurations into the job lines
under `environment: / matrix:`.
6. Push your changes and check 6. Push your changes and check
[ci.appveyor.com](https://ci.appveyor.com/) for your build results. [ci.appveyor.com](https://ci.appveyor.com/) for your build results.
## GitHub / AppVeyor Integration and Authentication
### Security
Enabling Two-Factor-Authentication (2FA) is always a good idea, for all
your web based services, including GitHub and AppVeyor. \
Get an app for your phone (Authy works fine for me, but there are plenty),
and your phone will generate one-time passwords to verify your identity
to the service if required (e.g., when logging in from a new device).
### Authentication
You can use different ways and services to authenticate when you log into
your AppVeyor account. The easiest way - at least when you're using the
service with repositories on GitHub - is to use GitHub authentication.
### GitHub Integration
AppVeyor offers two ways to integrate with GitHub: through a GitHub
application or through an OAuth application. GitHub applications are using
the newer API, allow easier fine-grained access rights tuning and are
preferred.
The differences are mostly visible when you work with repositories under
organizational GitHub accounts: Using OAuth, AppVeyor always has the full
rights of your personal GitHub account.
GitHub applications on the other hand have separate instances and
configuration for every organizational account you are using on GitHub.
### Enabling Builds for your Repository
On the 'Projects' tab of your AppVeyor web interface, create a new project.
If the repository is not listed on the project creation page,
verify the Integration settings. Most of the relevant configuration
is taken from GitHub and has to be set up there.
### AppVeyor Account Sharing
You can always invite other AppVeyor users to have access to an AppVeyor
account, forming a team. Such additional shared accounts are a way to make
the AppVeyor limits (e.g., one parallel builder per account) more manageable.
## Known Issues ## Known Issues
#### Build Worker Images #### Build Worker Images
@@ -66,3 +107,6 @@ is shown in the example configuration files:
- Set the default image using the `image:` tag. - Set the default image using the `image:` tag.
- Override the image for specific jobs by setting the - Override the image for specific jobs by setting the
`APPVEYOR_BUILD_WORKER_IMAGE` environment variable. `APPVEYOR_BUILD_WORKER_IMAGE` environment variable.
<!-- Links -->
[appveyor.doc.matrix]: https://www.appveyor.com/docs/build-configuration/#build-matrix

View File

@@ -78,6 +78,7 @@ def modlist():
zip7 = r'C:\Program Files\7-Zip\7z' zip7 = r'C:\Program Files\7-Zip\7z'
make = '' make = ''
isbase314 = False isbase314 = False
has_test_results = False
silent_dep_builds = True silent_dep_builds = True
def host_info(): def host_info():
@@ -99,10 +100,13 @@ def host_info():
# Used from unittests # Used from unittests
def clear_lists(): def clear_lists():
global isbase314, has_test_results
del seen_setups[:] del seen_setups[:]
del modules_to_compile[:] del modules_to_compile[:]
setup.clear() setup.clear()
places.clear() places.clear()
isbase314 = False
has_test_results = False
# Error-handler to make shutil.rmtree delete read-only files on Windows # Error-handler to make shutil.rmtree delete read-only files on Windows
def remove_readonly(func, path, excinfo): def remove_readonly(func, path, excinfo):
@@ -357,7 +361,7 @@ def add_dependency(dep):
update_release_local(setup[dep+"_VARNAME"], place) update_release_local(setup[dep+"_VARNAME"], place)
def setup_for_build(args): def setup_for_build(args):
global make, isbase314 global make, isbase314, has_test_results
dllpaths = [] dllpaths = []
# there is no combined static and debug EPICS_HOST_ARCH target, # there is no combined static and debug EPICS_HOST_ARCH target,
@@ -415,6 +419,14 @@ def setup_for_build(args):
if 'BASE_3_14=YES' in myfile.read(): if 'BASE_3_14=YES' in myfile.read():
isbase314 = True 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']) bindir = os.path.join(os.getcwd(), 'bin', os.environ['EPICS_HOST_ARCH'])
if os.path.isdir(bindir): if os.path.isdir(bindir):
dllpaths.append(bindir) dllpaths.append(bindir)
@@ -480,6 +492,29 @@ def prepare(args):
else: else:
optitype = 'optimized' 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' print('EPICS Base build system set up for {0} build with {1} linking'
.format(optitype, linktype)) .format(optitype, linktype))
@@ -541,7 +576,8 @@ def test(args):
setup_for_build(args) setup_for_build(args)
print('{0}Running the main module tests{1}'.format(ANSI_YELLOW, ANSI_RESET)) print('{0}Running the main module tests{1}'.format(ANSI_YELLOW, ANSI_RESET))
call_make(['tapfiles']) call_make(['tapfiles'])
call_make(['test-results'], parallel=0, silent=True) if has_test_results:
call_make(['test-results'], parallel=0, silent=True)
def doExec(args): def doExec(args):
'exec user command with vcvars' 'exec user command with vcvars'

View File

@@ -43,3 +43,18 @@
6. Push your changes and check 6. Push your changes and check
[travis-ci.org](https://travis-ci.org/) for your build results. [travis-ci.org](https://travis-ci.org/) for your build results.
## Caches
Travis keeps the caches separate for different jobs. As soon as the job
description (in the `.travis.yml` configuration file) or its environment
settings change (adding a space character is enough), the cache is different
and will be rebuilt when the job runs.
This also means that changing a value inside a setup file will _not_
invalidate the cache - in that case you will have to manually delete the cache
through the Travis web interface. (Or add a space character in the job
configuration.)
Caches are automatically removed after approx. four weeks.
Your jobs will have to rebuild them once in a while.

View File

@@ -37,7 +37,10 @@ if [ "$TEST" != "NO" ]
then then
make -j2 tapfiles || ret=$? make -j2 tapfiles || ret=$?
make -sk test-results 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 fi
exit $ret exit $ret