Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cirrus CI and macOS on M1 CI #145

Draft
wants to merge 44 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f5f0835
Adding a Cirrus CI configuration to get things started.
rptb1 Feb 6, 2023
f60017c
Testing Cirrus CI configurations for FRI6LL and LIA6*.
rptb1 Feb 6, 2023
279ce81
Persuade Cirrus CI to reveal details about the platforms.
rptb1 Feb 6, 2023
1fb620c
Match arm64 for XCA6LL since that's what's produced by Cirrus CI VMs …
rptb1 Feb 7, 2023
6379e6e
Match "arm" for XCA6LL since that's what's produced by autoconf scrip…
rptb1 Feb 7, 2023
2f359b4
Refining Cirrus CI configuration based on better understanding of wha…
rptb1 Feb 7, 2023
7f54c34
Attempt to specify architecture for FreeBSD. Attempt to find out why…
rptb1 Feb 8, 2023
0a21917
Suppress uninitialized warning on platforms where VMParamFromArgs doe…
rptb1 Feb 8, 2023
17e500c
Lifting compiler dimension out of scripts.
rptb1 Feb 8, 2023
2c482a7
Package names on Linux and FreeBSD aren't as orthogonal as I hoped.
rptb1 Feb 8, 2023
42a97e8
Moving LIA6* and FRI6* to Cirrus CI from Travis CI where they won't c…
rptb1 Feb 8, 2023
86e3275
Splitting design.mps.ci from design.mps.tests and noting items for in…
rptb1 Feb 9, 2023
6dadde6
Lifting environment variables as a step to reducing repetition.
rptb1 Feb 9, 2023
ddcb384
Environment variables didn't seem to work. Testing with documentation…
rptb1 Feb 9, 2023
fd32ff3
Documentation example doesn't work as shown. Adding container.
rptb1 Feb 9, 2023
81f9e9c
Lifting common script parts into templates to reduce repetition.
rptb1 Feb 9, 2023
8c6c2e3
Overriding clone script to try to apply CI to trial merge.
rptb1 Feb 9, 2023
7e1ecd3
Removing "which" test command because it stops cloning on failure.
rptb1 Feb 9, 2023
752859a
Second attempt at fetching the trial merge for pull requests.
rptb1 Feb 9, 2023
0442b60
Adding git to install to enable clone script override.
rptb1 Feb 9, 2023
0da6884
Adding list of platforms built by which CI system, and cross-referenc…
rptb1 Feb 9, 2023
1e08497
Updating design.mps.ci.service to be an overview of relevant facts ab…
rptb1 Feb 9, 2023
a7d85d1
Reorganising existing text into new outline for design.mps.ci.
rptb1 Feb 9, 2023
aa07e8d
Adding CI as an index term, and Confidentiality as a valid field for …
rptb1 Feb 9, 2023
a76ce9c
Fixing up tag references from CI configuration files. Misc minor con…
rptb1 Feb 9, 2023
e92b175
Better references to configuration files. Draft administration section.
rptb1 Feb 9, 2023
a536e1a
Fixing markup of definition list.
rptb1 Feb 9, 2023
bef3b95
Adding reference to design.mps.ci.
rptb1 Feb 10, 2023
7877339
Adding a FIXME to include Cirrus etc. in proc.merge.pull-request.
rptb1 Feb 10, 2023
8f278eb
Drafting goals (design.mps.ci.goal) and requirements (design.mps.ci.r…
rptb1 Feb 10, 2023
d203aff
Adding a few notes on design.
rptb1 Feb 10, 2023
bdfccc0
Drafting more of the requirements and design sections.
rptb1 Feb 26, 2023
549d329
Completing CI requirements, although in some cases with notes.
rptb1 Mar 8, 2023
717d55d
Using RFC 2119 key words.
rptb1 Mar 8, 2023
fc54e1a
Defining CI platform requirements.
rptb1 Mar 8, 2023
b7c229e
Cleaning up the Services section and linking to requirements.
rptb1 Mar 8, 2023
e595d8c
Removing TODO notes that are done.
rptb1 Mar 8, 2023
316b2e0
Catch-up merge master into branch/2023-02-06/cirrus-ci
rptb1 Mar 8, 2023
79a814d
Removing references to Travis CI from proc.merge.pull-request and inc…
rptb1 Mar 8, 2023
8b6ae56
Promoting some comments to TODOs and attempting to resolve others.
rptb1 Mar 8, 2023
6cba37c
Correcting tag "design.mps.ci" to "design.ci" because CI is not *part…
rptb1 Mar 15, 2023
e6c97d2
Clarifying some TODOs. Drafting administration section. Drafting desi…
rptb1 Mar 16, 2023
f5f3d23
Linking tags.
rptb1 Mar 16, 2023
32185ed
Another pass of improvements including quantified requirememnts, clar…
rptb1 Mar 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# .cirrus.yml -- Cirrus CI configuration for the MPS
#
# Copyright (c) 2023 Ravenbrook Limited. See end of file for license.
#
# See design.ci.cirrus.config.

# FIXME: Specify versions of OS and toolchains. Source?

# Templates for inclusion in tasks.
#
# See <https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks>.

init_script_template: &INIT_SCRIPT_TEMPLATE
init_script:
# Cirrus CI doesn't include machine configuration in its output,
# so gather it here.
- uname -a

build_script_template: &BUILD_SCRIPT_TEMPLATE
build_script:
# Cirrus CI doesn't include toolchain configuration in its output,
# so gather it here.
- $CC --version
- $CC -dumpmachine
# see design.ci.run.posix
- CC=$CC ./configure --prefix=$PWD/prefix && make install && make test

# Override clone script to get the *trial merge* of a pull request
# with its base (usually master) rather than the branch. See
# <https://cirrus-ci.org/guide/tips-and-tricks/#custom-clone-command>.
# See also
# <https://github.com/cirruslabs/cirrus-ci-docs/discussions/1110#discussion-4613478>.

clone_script_template: &CLONE_SCRIPT_TEMPLATE
clone_script: |
set -x
git clone --depth=1 --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
if test -n "$CIRRUS_PR"; then
cd $CIRRUS_WORKING_DIR &&
git fetch --depth=1 origin pull/$CIRRUS_PR/merge &&
git checkout FETCH_HEAD
fi


# The builds for Cirrus CI
#
# See design.ci.platforms.

XCA6LL_task:
macos_instance:
# What does this syntax mean?
# See <https://github.com/cirruslabs/cirrus-ci-docs/discussions/1147#discussioncomment-4902556>.
image: ghcr.io/cirruslabs/macos-ventura-xcode
env:
CC: cc
<< : *CLONE_SCRIPT_TEMPLATE
<< : *INIT_SCRIPT_TEMPLATE
<< : *BUILD_SCRIPT_TEMPLATE

FRI6LL_task:
freebsd_instance:
# Why is this a "family"?
# See <https://github.com/cirruslabs/cirrus-ci-docs/discussions/1147#discussioncomment-4902556>.
image_family: freebsd-13-1
env:
CC: clang
install_script: pkg install -y git gmake
<< : *CLONE_SCRIPT_TEMPLATE
<< : *INIT_SCRIPT_TEMPLATE
<< : *BUILD_SCRIPT_TEMPLATE

FRI6GC_task:
freebsd_instance:
image_family: freebsd-13-1
env:
CC: gcc
install_script: pkg install -y git gmake gcc
<< : *CLONE_SCRIPT_TEMPLATE
<< : *INIT_SCRIPT_TEMPLATE
<< : *BUILD_SCRIPT_TEMPLATE

# Is this really "LI" if it's a docker container? Does it matter?
# Is gcc:latest what we want to test against?
# Perhaps we should start with an ubuntu image.
LIA6GC_task:
arm_container:
image: gcc # https://hub.docker.com/_/gcc
env:
CC: gcc
<< : *CLONE_SCRIPT_TEMPLATE
<< : *INIT_SCRIPT_TEMPLATE
<< : *BUILD_SCRIPT_TEMPLATE

LIA6LL_task:
arm_container:
image: ubuntu # https://hub.docker.com/_/ubuntu
env:
CC: clang
install_script:
- apt-get update
- apt-get install -y git make clang
<< : *CLONE_SCRIPT_TEMPLATE
<< : *INIT_SCRIPT_TEMPLATE
<< : *BUILD_SCRIPT_TEMPLATE


# A. REFERENCES
#
#
# B. DOCUMENT HISTORY
#
# 2013-02-08 RB Created.
#
#
# C. COPYRIGHT AND LICENSE
#
# Copyright (C) 2023 Ravenbrook Limited <https://www.ravenbrook.com/>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# $Id$

8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2019-2022 `GitHub contributors`_ (MIT License).
# Copyright (c) 2023 Ravenbrook Limited. See end of file for license.
#
# See design.mps.test.ci.
# See design.ci.github.config.
#
# TODO: Exclude certain branches.
#
Expand All @@ -25,7 +25,7 @@ jobs:

# The build matrix for GitHub CI on Posix platforms
#
# See design.mps.tests.ci.github.platforms.
# See design.ci.platforms.
#
# FreeBSD and ARM64 targets are in Travis CI, configured by
# .travis.yml.
Expand All @@ -42,7 +42,7 @@ jobs:

runs-on: ${{ matrix.os }}

# See design.mps.tests.ci.run.posix.
# See design.ci.run.posix.
steps:
- uses: actions/checkout@v3
- run: CC=${{ matrix.compiler }} ./configure
Expand All @@ -53,7 +53,7 @@ jobs:

runs-on: windows-latest

# See design.mps.tests.ci.run.windows.
# See design.ci.run.windows.
#
# The path to Visual Studio is documented at
# <https://github.com/actions/runner-images/blob/e6fcf60b8e6c0f80a065327eaefe836881c28b68/images/win/Windows2022-Readme.md?plain=1#L215>.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/fixme-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# .github/workflows/fixme-check.yml -- check for FIXME task labels
#
# See design.ci.run.checks.
#
# This is a GitHub CI workflow
# <https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration>
# to check for FIXME and similar task labels left unresolved in the
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/rst-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# .github/workflows/rst-check.yml -- check syntax of reStructuredText files
#
# See design.ci.run.checks.
#
# This is a GitHub CI workflow
# <https://docs.github.com/en/actions/using-workflows/about-workflows>
# to check the syntax of reStructuredText files.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/shell-script-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# .github/workflows/shell-script-check.yml -- check shell scripts
#
# See design.ci.run.checks.
#
# This is a GitHub CI workflow
# <https://docs.github.com/en/actions/using-workflows/about-workflows>
# to check shell scripts.
Expand Down
32 changes: 3 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Copyright (c) 2013-2023 Ravenbrook Limited. See end of file for license.
#
# See design.mps.test.ci.
# See design.ci.travis.config.

# Some branches don't need builds. Add them here to avoid using build
# resources and unnecessary build messages.
Expand All @@ -15,45 +15,19 @@ language: c # see <https://docs.travis-ci.com/user/languages/c/>.

# The build matrix for Travis CI
#
# See design.mps.tests.ci.travis.platforms.
#
# Most x86_64/amd64 builds are in GitHub CI, configured by
# .github/workflows/build-and-test.yml.
# See design.ci.platforms.

os:
- freebsd
- linux
arch:
- arm64
compiler:
- clang
- gcc

script: # see design.mps.test.ci.run.posix
script: # see design.ci.run.posix
- ./configure --prefix=$PWD/prefix && make install && make test

matrix:

# Extra build jobs to add to the matrix
include:

# GitHub CI does not provide FreeBSD
# <https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources>
# on any architecture, so we add it here for amd64. See also
# design.mps.tests.ci.travis.platforms.

- os: freebsd
arch: amd64
compiler: clang
- os: freebsd
arch: amd64
compiler: gcc

# Specific combinations to exclude from the matrix
exclude:
- os: osx
compiler: gcc

notifications:
email:
- [email protected]
Expand Down
4 changes: 4 additions & 0 deletions code/arenavm.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,10 @@ static Res VMArenaCreate(Arena *arenaReturn, ArgList args)
zones. Make it easier to write portable programs by rounding up. */
size = grainSize * MPS_WORD_WIDTH;

/* Suppress uninitialized warning on platforms where VMParamFromArgs
does nothing. Discovered by GCC 12.2.0. */
mps_lib_memset(vmParams, 0, sizeof(vmParams));

/* Parse remaining arguments, if any, into VM parameters. We must do
this into some stack-allocated memory for the moment, since we
don't have anywhere else to put it. It gets copied later. */
Expand Down
Loading