diff --git a/.ci b/.ci new file mode 160000 index 00000000..20f8e053 --- /dev/null +++ b/.ci @@ -0,0 +1 @@ +Subproject commit 20f8e053931fdef8a9413cc6229286c5d9ed152f diff --git a/.ci-local/defaults.set b/.ci-local/defaults.set new file mode 100644 index 00000000..1e35c182 --- /dev/null +++ b/.ci-local/defaults.set @@ -0,0 +1,6 @@ +# EPICS Base +BASE_DIRNAME=base +BASE_REPONAME=epics-base +BASE_REPOOWNER=epics-base +BASE_VARNAME=EPICS_BASE +BASE_RECURSIVE=no diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml new file mode 100644 index 00000000..5b42e90b --- /dev/null +++ b/.github/workflows/ci-scripts.yml @@ -0,0 +1,105 @@ +name: Sequencer-Build + +on: + push: + paths-ignore: + - 'documentation/*' + - '**/*.html' + - '**/*.md' + pull_request: + +env: + SETUP_PATH: .ci-local + APT: re2c + CHOCO: re2c + BREW: re2c + +jobs: + build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + # Set environment variables from matrix parameters + env: + CMP: ${{ matrix.cmp }} + BCFG: ${{ matrix.configuration }} + BASE: ${{ matrix.base }} + CI_CROSS_TARGETS: ${{ matrix.cross }} + EXTRA: ${{ matrix.extra }} + TEST: ${{ matrix.test }} + VV: "1" + + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + name: "Ub-22 gcc base-7.0" + + - os: ubuntu-latest + cmp: clang + configuration: default + base: "7.0" + name: "Ub-22 clang base-7.0" + + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "3.15" + name: "Ub-22 gcc base-3.15" + + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "3.14" + name: "Ub-22 gcc base-3.14" + + - os: ubuntu-latest + cmp: gcc + configuration: default + cross: "RTEMS-pc686-qemu@5" + base: "7.0" + name: "Ub-22 gcc + RT-5.1 pc686 base-7.0" + + - os: macos-latest + cmp: clang + configuration: default + base: "7.0" + name: "Mac clang base-7.0" + + - os: windows-2019 + cmp: vs2019 + configuration: default + base: "7.0" + name: "Win2019 MSC19 base-7.0" + + - os: windows-2019 + cmp: vs2019 + configuration: static + base: "7.0" + name: "Win2019 MSC19 static base-7.0" + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: "apt-get install" + run: | + sudo apt-get update + sudo apt-get -y install re2c gdb + if: runner.os == 'Linux' + - name: Automatic core dumper analysis + uses: mdavidsaver/ci-core-dumper@master + - name: Prepare and compile dependencies + run: python .ci/cue.py prepare + - name: Apply patches + run: patch -p1 -i ./seq-2.2.9-base707-fix.patch + - name: Build main module + run: python .ci/cue.py -T 60M build + - name: Run main module tests + run: python -m ci_core_dumper exec python .ci/cue.py -T 15M test + - name: Collect and show test results + if: ${{ always() }} + run: python .ci/cue.py -T 5M test-results diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..b40210d3 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,69 @@ +name: Sequencer-Docs + +on: + push: + paths: + - 'documentation/**' + - '.github/workflows/*' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +env: + SETUP_PATH: .ci-local + +jobs: + build: + name: Build html documentation + runs-on: ubuntu-latest + env: + CMP: gcc + BCFG: default + BASE: "7.0" + EXTRA: "docs" + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: "apt-get install" + run: | + sudo apt-get update + sudo apt-get -y install re2c sphinx latexmk texlive-fonts-recommended \ + texlive-latex-recommended texlive-latex-extra + sudo pip3 install sphinxcontrib-blockdiag + - name: Prepare and compile dependencies + run: python .ci/cue.py prepare + - name: Build documentation + run: python .ci/cue.py build + - name: Finalize doc site + run: | + cp documentation/O.Common/latex/Manual.pdf documentation/O.Common/html + touch documentation/O.Common/html/.nojekyll + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'documentation/O.Common/html' + + deploy: + needs: build + name: Deploy on Pages + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1a6f7fd6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +/cfg/ +/bin/ +/lib/ +/db/ +/dbd/ +/include/ +/templates/ +/html/ +/configure/*.local +/configure/CONFIG_SITE.Common.* +O.*/ +*.orig +*.log +.*.swp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..cfa3a703 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".ci"] + path = .ci + url = https://github.com/epics-base/ci-scripts diff --git a/README.md b/README.md index dfc49bd9..570e4811 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,6 @@ # The EPICS SNL Compiler and Sequencer -This is a **mirror** of the *stable* (2.2) branch -of the EPICS State Notation Language Compiler and Runtime Sequencer, -converted to Git from an upstream-provided Darcs mirror -at https://hub.darcs.net/bf/seq-branch-2-2 +This is the EPICS State Notation Language Compiler and Runtime Sequencer. ## [Documentation](https://epics-modules.github.io/sequencer/) ## [Releases](https://github.com/epics-modules/sequencer/tags) - -## Branches of this Mirror - -* *main* - plain mirror of the upstream Darcs sources, plus this README file -* *ci* - branch that adds configuration for builds, tests and documentation - using GitHub Actions and Pages - -Upstream author/maintainer: [Benjamin Franksen](mailto:benjamin.franksen@helmholtz-berlin.de) diff --git a/documentation/Installation.txt b/documentation/Installation.txt index bff3ad28..56fe0204 100644 --- a/documentation/Installation.txt +++ b/documentation/Installation.txt @@ -13,10 +13,9 @@ EPICS base You need to have `EPICS base`_ and its dependencies (`GNU make`_, `Perl`_) installed. Any version of EPICS base starting with 3.14.12.2 and up to 3.15 -should do. Starting with seq-`2.2.6`_, EPICS base versions up to 7.0.1 can be -used. +should do. Starting with seq-`2.2.6`_, EPICS 7 can be used. -.. _EPICS base: http://www.aps.anl.gov/epics/base/ +.. _EPICS base: https://epics-controls.org/resources-and-support/base/ .. _GNU make: http://www.gnu.org/software/make/ .. _Perl: http://www.perl.org/ @@ -49,7 +48,7 @@ Download Releases are available here: - http://www-csr.bessy.de/control/SoftDist/sequencer/releases/ + https://github.com/epics-modules/sequencer/tags The current stable release is `2.2.9`_. Please take a look at the `VersioningPolicy` if you are unsure whether to upgrade to @@ -58,17 +57,8 @@ a new release. .. note:: The documentation and download links you will find on this page are for - version 2.2. The `documentation for version 2.1`_ is still there and will - be maintained at least until version 2.3 is released. + version 2.2. -Development snapshots are available under the name - - seq--snapshot-.tar.gz - -where is the branch name without the 'branch-' prefix. - -In the releases directory there is always a symbolic link to the -`latest snapshot`_. Here are all releases for version 2.2: @@ -86,17 +76,17 @@ Here are all releases for version 2.2: `2.2.1`_ `Release_Notes_2.2.1` `Known_Problems_2.2.1` ========== ======================= ============================ -If you want to help testing, please use the `latest snapshot`_, or check out +If you want to help testing, please check out the `darcs`_ repository for `branch-2-2`_:: - darcs get http://www-csr.bessy.de/control/SoftDist/sequencer/repo/branch-2-2 + darcs get https://hub.darcs.net/bf/seq-branch-2-2 -Since release 2.2.2 there is also a git mirror, so you can as well :: +Using this git mirror, you can as well :: - git clone http://www-csr.bessy.de/control/SoftDist/sequencer/repo/branch-2-2.git + git clone https://github.com/epics-modules/sequencer.git -but please note that this is just a mirror, no more: I cannot accept git -patches (or whatever they are called in git); it may also happen that I have +but please note that this is just a mirror: I cannot accept git +patches or work with GitHub Pull Requests; it may also happen that I have to re-create the whole git repo from scratch (because incremental conversion sometimes fails). @@ -104,27 +94,18 @@ Development of new features now happens on `branch-2-3`_. See `Contribute`_ for a short description how to record and send patches. -You can also follow development by using the `repository browser`_. - -.. _latest snapshot: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2-2-snapshot-latest.tar.gz -.. _2.2.9: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.9.tar.gz -.. _2.2.8: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.8.tar.gz -.. _2.2.7: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.7.tar.gz -.. _2.2.6: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.6.tar.gz -.. _2.2.5: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.5.tar.gz -.. _2.2.4: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.4.tar.gz -.. _2.2.3: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.3.tar.gz -.. _2.2.2: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.2.tar.gz -.. _2.2.1: http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.1.tar.gz -.. _repository browser: http://www-csr.bessy.de/cgi-bin/darcsweb.cgi -.. _branch-2-0: http://www-csr.bessy.de/cgi-bin/darcsweb.cgi?r=seq%20branch-2-0;a=summary -.. _branch-2-1: http://www-csr.bessy.de/cgi-bin/darcsweb.cgi?r=seq%20branch-2-1;a=summary -.. _branch-2-2: http://www-csr.bessy.de/cgi-bin/darcsweb.cgi?r=seq%20branch-2-2;a=summary -.. _branch-2-3: http://www-csr.bessy.de/cgi-bin/darcsweb.cgi?r=seq%20branch-2-3;a=summary -.. _old: http://www-csr.bessy.de/control/SoftDist/sequencer/repo/old/ -.. _stable: http://www-csr.bessy.de/control/SoftDist/sequencer/repo/stable/ -.. _experimental: http://www-csr.bessy.de/control/SoftDist/sequencer/repo/experimental/ -.. _documentation for version 2.1: http://www-csr.bessy.de/control/SoftDist/sequencer-2-1/index.html +.. _2.2.9: https://github.com/epics-modules/sequencer/releases/tag/R2-2-9 +.. _2.2.8: https://github.com/epics-modules/sequencer/releases/tag/R2-2-8 +.. _2.2.7: https://github.com/epics-modules/sequencer/releases/tag/R2-2-7 +.. _2.2.6: https://github.com/epics-modules/sequencer/releases/tag/R2-2-6 +.. _2.2.5: https://github.com/epics-modules/sequencer/releases/tag/R2-2-5 +.. _2.2.4: https://github.com/epics-modules/sequencer/releases/tag/R2-2-4 +.. _2.2.3: https://github.com/epics-modules/sequencer/releases/tag/R2-2-3 +.. _2.2.2: https://github.com/epics-modules/sequencer/releases/tag/R2-2-2 +.. _2.2.1: https://github.com/epics-modules/sequencer/releases/tag/R2-2-1 +.. _branch-2-1: https://hub.darcs.net/bf/seq-branch-2-1 +.. _branch-2-2: https://hub.darcs.net/bf/seq-branch-2-2 +.. _branch-2-3: https://hub.darcs.net/bf/seq-branch-2-3 Unpack ------ @@ -132,16 +113,16 @@ Unpack Change to the directory that you wish to be the parent of the sequencer source tree. Then unpack and untar the file. For example:: - gunzip seq-x.y.z.tar.gz - tar xf seq-x.y.z.tar + gunzip sequencer-Rx-y-z.tar.gz + tar xf sequencer-Rx-y-z.tar or, if you have `GNU tar`_, simply:: - tar zxf seq-x.y.z.tar.gz + tar zxf sequencer-Rx-y-z.tar.gz You can now:: - cd seq-x.y.z + cd sequencer-Rx-y-z and look at the source tree. The actual source code for the sequencer is under ``src``. The documentation sources are under ``documentation`` and @@ -150,7 +131,7 @@ consist of plain readable text files (actually, the format is make changes to the docs). In what follows, ``$SEQ`` refers to the directory where you are now, -i.e. ``.../seq-x.y.z/``. +i.e. ``.../sequencer-Rx-y-z/``. .. _GNU tar: http://www.gnu.org/software/tar/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html @@ -316,9 +297,9 @@ into your Makefile. Here, ``xyz.st`` is the name of your SNL program, and ``abc`` is the name of the library or binary to produce. Note that ``.st`` files are run through the C preprocessor (`cpp`) before giving them to the SNL compiler. Use the extension ``.stt`` to avoid this. For details, -see Chapter 4 of the `EPICS Application Developer's Guide`_. +see the relevant part in the `EPICS Application Developer's Guide`_. -.. _EPICS Application Developer's Guide: http://www.aps.anl.gov/epics/base/R3-14/11-docs/AppDevGuide.pdf +.. _EPICS Application Developer's Guide: https://docs.epics-controls.org/en/latest/build-system/specifications.html#state-notation-programs A complete example application that also uses the sequencer can be produced using makeBaseApp, e.g. :: @@ -350,7 +331,7 @@ For more involved changes you might want to send a `darcs`_ patch. You can create a local copy of the `darcs`_ repository (the stable branch in this example) by saying:: - darcs get http://www-csr.bessy.de/control/SoftDist/sequencer/repo/stable + darcs get https://hub.darcs.net/bf/seq-branch-2-2 Assuming you have made some changes, first update your repository to include the latest changes from upstream (with darcs this is not diff --git a/documentation/Makefile b/documentation/Makefile index 3cba6d56..c6088fc0 100644 --- a/documentation/Makefile +++ b/documentation/Makefile @@ -113,3 +113,9 @@ SILENT=$(if $(findstring s,$(MFLAGS)),>/dev/null,) pdf: html $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex $(MAKE) -C $(BUILDDIR)/latex all-pdf $(SILENT) + +commit: html + touch O.Common/html/.nojekyll + ./commit-gh.sh documentation/O.Common/html/ O.Common/html/.nojekyll O.Common/html/*.* O.Common/html/_*/*.* + +.PHONY: commit diff --git a/documentation/commit-gh.sh b/documentation/commit-gh.sh new file mode 100755 index 00000000..d630165d --- /dev/null +++ b/documentation/commit-gh.sh @@ -0,0 +1,45 @@ +#!/bin/sh +set -e -x +# Usage: commit-gh +# +# Creates a commit containing only the files in the sub-directory provided as an argument +# +# Does not disturb the working copy or index + +prefix="$1" +shift + +# Commit to this branch +BRANCH=refs/heads/gh-pages + +# Use the main branch description as the gh-pages commit message +MSG=`git describe --tags --always` + +# Scratch space +TDIR=`mktemp -d -p $PWD` + +# Automatic cleanup of scratch space +trap 'rm -rf $TDIR' INT TERM QUIT EXIT + +export GIT_INDEX_FILE="$TDIR/index" + +# Add listed files to a new (empty) index +git update-index --add "$@" + +# Write the index into the repo, get tree hash +TREE=`git write-tree --prefix="$prefix"` + +echo "TREE $TREE" +git cat-file -p $TREE + +# Create a commit with our new tree +# Reference current branch head as parent (if any) +CMT=`git commit-tree -m "$MSG" $TREE` + +echo "COMMIT $CMT" +git cat-file -p $CMT + +# Update the branch with the new commit tree hash +git update-ref $BRANCH $CMT + +echo "Done" diff --git a/documentation/index.txt b/documentation/index.txt index 78ce6821..fcfbbe08 100644 --- a/documentation/index.txt +++ b/documentation/index.txt @@ -15,6 +15,7 @@ State Notation Language and Sequencer :Bug Reports: tech-talk@aps.anl.gov :Version: |version| + Welcome to the home page of the **EPICS Sequencer** project. diff --git a/documentation/templates/home.html b/documentation/templates/home.html index b099d2a5..68e99e74 100644 --- a/documentation/templates/home.html +++ b/documentation/templates/home.html @@ -10,8 +10,13 @@

{{ 'Other Versions' }}

+

{{ 'Sources' }}

+

{{ 'Related' }}

diff --git a/seq-2.2.9-base707-fix.patch b/seq-2.2.9-base707-fix.patch new file mode 100644 index 00000000..8fc7ca14 --- /dev/null +++ b/seq-2.2.9-base707-fix.patch @@ -0,0 +1,21 @@ +diff -uri seq-2.2.9/test/compiler/snc_test.plt seq-2.2.9-fix/test/compiler/snc_test.plt +--- seq-2.2.9/test/compiler/snc_test.plt 2021-05-19 13:35:39.000000000 +0200 ++++ seq-2.2.9-fix/test/compiler/snc_test.plt 2023-01-27 12:15:47.642857803 +0100 +@@ -51,7 +51,7 @@ + `make -s -B $prog.i`; + my $failed = 0; + # execute the snc and capture the output +- my $output = `..${dirsep}..${dirsep}..${dirsep}bin${dirsep}${host_arch}${dirsep}snc $prog.i -o $prog.c 2>&1`; ++ my $output = `..${dirsep}..${dirsep}..${dirsep}bin${dirsep}${host_arch}${dirsep}snc $prog.i -o $prog.xc 2>&1`; + # test whether it terminated normally + my $exitsig = $? & 127; + is ($exitsig, 0, "$prog: snc terminates normally") or $failed = 1; +@@ -61,7 +61,7 @@ + my $exitcode = $? >> 8; + my $errors_are_expected = $tests->{$prog}->{errors} > 0; + ok(($exitcode != 0) == $errors_are_expected, "$prog: correct exitcode"); +- ok(-e "$prog.c" == ($exitcode == 0), "$prog: success <=> creates output file"); ++ ok(-e "$prog.xc" == ($exitcode == 0), "$prog: success <=> creates output file"); + my $nw = 0; + $nw++ while ($output =~ /warning/g); + is($nw, $tests->{$prog}->{warnings}, "$prog: number of warnings") or $failed = 1;