Files
Jungfraujoch/update_version.sh
leonarski_fandClaude Opus 5.5 07ae3c3a40
Build Packages / Create release (push) Successful in 16s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 3m21s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 7m32s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 11m23s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 13m14s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 18m37s
Build Packages / build:viewer:windows-x86_64:nocuda (push) Successful in 19m22s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 21m19s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 21m29s
Build Packages / build:viewer:windows-x86_64:cuda (push) Successful in 24m17s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 18m28s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 27m29s
Build Packages / Generate python client (push) Successful in 28s
Build Packages / Build documentation (push) Successful in 1m5s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 17m25s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 19m11s
Build Packages / build:rugnux:windows-x86_64:cuda (push) Successful in 13m42s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 17m57s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 22m23s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 22m12s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 21m9s
Build Packages / Unit tests (push) Successful in 2h20m14s
XDS plugin: GPL linking permission, own tgz with its notices, macOS build; one portable CI build
LICENSE: the section-7 addendum is rewritten as numbered additional permissions. CUDA libraries
are treated as System Libraries (Intel MKL dropped - never linked). New: the XDS plugin may be
linked with the closed-source XDS, valid only while it contains no third-party GPL code.

The plugin links HDF5, zlib-ng, Zstandard and Compression (LZ4, Bitshuffle, Bitshuffle h-perf)
and nothing else - no FFTW. In a portable (viewer-only) build it is its own CPack component,
shipped as jfjoch_xds_plugin-<version>-<os>-<arch>.tar.gz with LICENSE, a short
xds-plugin/THIRD_PARTY_NOTICES.md and only those six licence texts. On macOS it now exports only
plugin_* (--exclude-libs does the same on Linux). The RPM/DEB packaging is unchanged.

The viewer-only build already compiled everything rugnux needs, so it now packs one archive per
program: Linux three .tar.gz (viewer, rugnux, plugin); macOS the viewer .dmg plus rugnux and
plugin .tar.gz, each generator getting its components through CPACK_PROJECT_CONFIG_FILE. CI
merges build-viewer-tgz + build-rugnux-tgz into build-portable-tgz (cuda and nocuda, so Linux
rugnux gains a -cpu archive) and the two macOS jobs into build-macos. Both check that FFTW is
neither on the plugin's link line nor in its symbol table and that it exports only plugin_*.
The bare .so upload from the RPM job is dropped. RUGNUX_ONLY stays for aarch64 and Windows.

Verified locally (Linux, CPU, CI flags): three tarballs, the plugin link line is exactly the list
above, 0 FFTW symbols, four exports, system-only dynamic deps; XDS loads the packaged plugin.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 20:29:19 +02:00

127 lines
4.7 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (2019-2024) Paul Scherrer Institute
#
# Stop at the first failing command (this script rewrites generated code and version
# strings in place, so a silently skipped step leaves the tree half-updated).
set -e
set -o pipefail
VERSION=$(<VERSION)
# Regular expression for semantic versioning with optional pre-release and build metadata
regex="^([0-9]+)\.([0-9]+)\.([0-9]+)(-[A-Za-z0-9.\-]+)?(\+[A-Za-z0-9.\-]+)?$"
if [[ $VERSION =~ $regex ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
patch="${BASH_REMATCH[3]}"
prerelease="${BASH_REMATCH[4]}"
build="${BASH_REMATCH[5]}"
echo "Major version: $major"
echo "Minor version: $minor"
echo "Patch version: $patch"
[ -n "$prerelease" ] && echo "Pre-release version: ${prerelease:1}" # Remove the leading '-'
[ -n "$build" ] && echo "Build metadata: ${build:1}" # Remove the leading '+'
else
echo "Invalid semantic version: $VERSION"
exit 1
fi
OPENAPI_VERSION=7.20.0
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${OPENAPI_VERSION}/openapi-generator-cli-${OPENAPI_VERSION}.jar -O openapi-generator-cli.jar
SRC=' version:.*'
DST=" version: $VERSION"
sed -i -e "s/$SRC/$DST/" broker/jfjoch_api.yaml
git rm -r broker/gen/model docs/python_client frontend/src/client
# The python generator only overwrites what the current schema produces, and the docs below are
# copied out of this directory wholesale - so without clearing it, a schema that has been removed
# from the API keeps its generated model and its published .md page for good.
rm -rf python-client
# The --git-* properties only end up as the source URL in the generated README/pyproject; they must
# name the current repository (gitea.psi.ch/mx/jungfraujoch), not the retired git.psi.ch instance.
java -jar openapi-generator-cli.jar generate -i broker/jfjoch_api.yaml -o python-client/ -g python --git-host=gitea.psi.ch --git-repo-id jungfraujoch --git-user-id mx --additional-properties=packageName=jfjoch_client,packageVersion=$VERSION
java -jar openapi-generator-cli.jar generate -i broker/jfjoch_api.yaml -o broker/gen -g cpp-pistache-server
# Bump package.json BEFORE npm install, so the regenerated package-lock.json records the
# new version instead of the previous one.
sed -i "s,\"version\":.*,\"version\": \"$VERSION\"\,," frontend/package.json
cd frontend
sed -i s/\".*\"/\"$VERSION\"/g src/version.ts
npm install
npm run openapi
npm run redocly4broker
cd ..
mkdir -p docs/python_client/docs
cp python-client/README.md docs/python_client
cp python-client/docs/*.md docs/python_client/docs
# Mirror the root third-party notices into the docs tree so they are published with
# the documentation. The verbatim license texts (licenses/*.txt) are not part of the
# docs source tree, so point those links at the repository; the project-license links
# point at the in-docs LICENSE / FPGA_LICENSE pages.
REPOBASE=https://gitea.psi.ch/mx/jungfraujoch/src/branch/main
{
echo "<!--"
echo " Auto-generated from THIRD_PARTY_NOTICES.md by update_version.sh — do not hand-edit."
echo " Edit the canonical THIRD_PARTY_NOTICES.md at the repository root instead."
echo "-->"
echo
sed -e "s,](licenses/,]($REPOBASE/licenses/,g" \
-e "s,](xds-plugin/,]($REPOBASE/xds-plugin/,g" \
-e "s,](LICENSE)),](LICENSE.md)),g" \
-e "s,](fpga/LICENSE),](FPGA_LICENSE.md),g" \
-e "s,](docs/ACKNOWLEDGEMENT.md),](ACKNOWLEDGEMENT.md),g" \
THIRD_PARTY_NOTICES.md
} > docs/THIRD_PARTY_NOTICES.md
git add broker/gen/model/*.cpp broker/gen/model/*.h frontend/src/client docs/python_client/*.md docs/python_client/docs/*.md docs/THIRD_PARTY_NOTICES.md
sed -i "s,release =.*,release = \'$VERSION\'," docs/conf.py
cd fpga
SRC="define JFJOCH_FPGA_MAJOR_VERSION 8'd.*"
DST="define JFJOCH_FPGA_MAJOR_VERSION 8'd${major}"
sed -i "s/$SRC/$DST/" hdl/action_config.v
SRC="define JFJOCH_FPGA_MINOR_VERSION 8'd.*"
DST="define JFJOCH_FPGA_MINOR_VERSION 8'd${minor}"
sed -i "s/$SRC/$DST/" hdl/action_config.v
SRC="define JFJOCH_FPGA_PATCH_VERSION 8'd.*"
DST="define JFJOCH_FPGA_PATCH_VERSION 8'd${patch}"
sed -i "s/$SRC/$DST/" hdl/action_config.v
SRC="define JFJOCH_FPGA_PRERELEASE 64'h.*"
if [ -n "$prerelease" ]; then
result=$(printf '%.7s' "${prerelease:1}" | rev | xxd -p -u)
DST="define JFJOCH_FPGA_PRERELEASE 64'h$result"
else
DST="define JFJOCH_FPGA_PRERELEASE 64'h0"
fi
sed -i "s/$SRC/$DST/" hdl/action_config.v
cd pcie_driver
sed -i s,MODULE_VERSION\(\".*,MODULE_VERSION\(\"$VERSION\"\)\;, jfjoch_drv.c
sed -i s,VERSION=.*,VERSION=$VERSION, postinstall.sh
sed -i s,VERSION=.*,VERSION=$VERSION, preuninstall.sh
sed -i s,PACKAGE_VERSION=.*,PACKAGE_VERSION=$VERSION, dkms.conf
sed -i s,VERSION=.*,VERSION=$VERSION, install_dkms.sh