Skip to content

Commit 2a21b48

Browse files
authored
CI/release: dry-run fixes (empty __version__, artifact-url, MPICH arm64) (#3842)
* Fix empty neuron.__version__ when git describe fails in shallow clones Release dry-runs build wheels from a depth-1 checkout without creating the release tag. git describe then fails while .git still exists, so GIT_DESCRIBE stayed empty and neuron.__version__ (nrnversion(5)) was "", breaking ModelDB CI workdir creation. Fall back to PROJECT_VERSION and assert non-empty __version__ in wheel tests. * CI: pin Ubuntu 24.04 MPICH for arm64 wheel tests Host arm64 mpich/libmpich12 4.2.0-5.1 debs on nrn-ci-deps ci-deps-v1 and select amd64 vs arm64 in install_mpich_noble.sh so ubuntu-24.04-arm wheel jobs no longer try to dpkg amd64 packages (LP#2072338 pin). * CI: fix merge-wheels artifact URL output for ModelDB/build-ci actions/upload-artifact/merge@v4 exposes artifact-url, not artifacts-url. The empty job output made Release ModelDB V2 fall back to neuron-nightly instead of this run's wheels artifact.
1 parent 2b29967 commit 2a21b48

7 files changed

Lines changed: 69 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ jobs:
8585
needs:
8686
- build-wheels
8787
outputs:
88-
artifacts-url: ${{ steps.merge-artifacts.outputs.artifacts-url }}
88+
# upload-artifact/merge@v4 exports artifact-url (singular), not artifacts-url.
89+
# Job output key stays artifacts-url for existing consumers (modeldb-ci, build-ci).
90+
artifacts-url: ${{ steps.merge-artifacts.outputs.artifact-url }}
8991
steps:
9092
- name: Merge Artifacts
9193
id: merge-artifacts

ci/deps/MANIFEST.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,28 @@ assets:
4949
- ci/deps/install_mpich_noble.sh
5050
notes: Runtime library package for mpich-noble-4.2.0-5.1.
5151

52+
- id: mpich-noble-4.2.0-5.1-arm64
53+
file: mpich_4.2.0-5.1_arm64.deb
54+
sha256: c790342026ca5786bdad889af5b2c6f4c249bb07968aaf5435feb6b2771df452
55+
upstream_url: https://launchpad.net/ubuntu/+source/mpich/4.2.0-5.1/+build/28285883/+files/mpich_4.2.0-5.1_arm64.deb
56+
managed: true
57+
consumers:
58+
- .github/workflows/wheels-template.yml
59+
- ci/deps/install_mpich_noble.sh
60+
notes: >
61+
arm64 counterpart of mpich-noble-4.2.0-5.1 (Launchpad build 28285883).
62+
Pair with libmpich12-noble-4.2.0-5.1-arm64. Used by ubuntu-24.04-arm wheel tests.
63+
64+
- id: libmpich12-noble-4.2.0-5.1-arm64
65+
file: libmpich12_4.2.0-5.1_arm64.deb
66+
sha256: 4fdbdcdcf23a36f3f7fcd2f2fe2fdaff24629a107fa9f0c6904dd1c3aa662ae1
67+
upstream_url: https://launchpad.net/ubuntu/+source/mpich/4.2.0-5.1/+build/28285883/+files/libmpich12_4.2.0-5.1_arm64.deb
68+
managed: true
69+
consumers:
70+
- .github/workflows/wheels-template.yml
71+
- ci/deps/install_mpich_noble.sh
72+
notes: Runtime library package for mpich-noble-4.2.0-5.1-arm64.
73+
5274
# --- P0/P1: static readline/ncurses sources (GNU mirrors flake) ---
5375
- id: ncurses-6.4-src
5476
file: ncurses-6.4.tar.gz

ci/deps/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ There is no automatic upgrade. `check-upstream.sh` is awareness only.
7676

7777
Hosted on **nrn-ci-deps** release **`ci-deps-v1`**:
7878

79-
- `mpich_4.2.0-5.1_amd64.deb` + `libmpich12_4.2.0-5.1_amd64.deb` — Ubuntu 24.04 wheel tests (LP#2072338)
79+
- `mpich_4.2.0-5.1_{amd64,arm64}.deb` + `libmpich12_4.2.0-5.1_{amd64,arm64}.deb` — Ubuntu 24.04 wheel tests (LP#2072338); `install_mpich_noble.sh` selects by `dpkg --print-architecture`
8080
- `ncurses-6.4.tar.gz`, `readline-8.3.tar.gz` — Mac static readline (`build_static_readline_osx.bash`)
8181
- `readline-7.0.tar.gz`, `ncurses-6.4.tar.gz` — manylinux wheel image (`packaging/python/Dockerfile`)
8282
- `automake-1.16.5.tar.xz` — Ubuntu MUSIC path in `neuron-ci.yml`

ci/deps/install_mpich_noble.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ if [[ "$(id -u)" -ne 0 ]]; then
3030
exit 1
3131
fi
3232

33+
arch="$(dpkg --print-architecture)"
34+
case "${arch}" in
35+
amd64)
36+
mpich_id="mpich-noble-4.2.0-5.1"
37+
lib_id="libmpich12-noble-4.2.0-5.1"
38+
mpich_deb="mpich_4.2.0-5.1_amd64.deb"
39+
lib_deb="libmpich12_4.2.0-5.1_amd64.deb"
40+
;;
41+
arm64)
42+
mpich_id="mpich-noble-4.2.0-5.1-arm64"
43+
lib_id="libmpich12-noble-4.2.0-5.1-arm64"
44+
mpich_deb="mpich_4.2.0-5.1_arm64.deb"
45+
lib_deb="libmpich12_4.2.0-5.1_arm64.deb"
46+
;;
47+
*)
48+
echo "error: unsupported architecture '${arch}' for pinned mpich (need amd64 or arm64)" >&2
49+
exit 1
50+
;;
51+
esac
52+
3353
WORKDIR="$(mktemp -d -t nrn-mpich-noble.XXXXXX)"
3454
cleanup() { rm -rf "${WORKDIR}"; }
3555
trap cleanup EXIT
@@ -39,15 +59,15 @@ trap cleanup EXIT
3959
# Override with NRN_CI_DEPS_SOURCE=local if debugging with a gitignored assets/ copy.
4060
export NRN_CI_DEPS_SOURCE="${NRN_CI_DEPS_SOURCE:-release}"
4161

42-
"${SCRIPT_DIR}/fetch.sh" mpich-noble-4.2.0-5.1 "${WORKDIR}"
43-
"${SCRIPT_DIR}/fetch.sh" libmpich12-noble-4.2.0-5.1 "${WORKDIR}"
62+
"${SCRIPT_DIR}/fetch.sh" "${mpich_id}" "${WORKDIR}"
63+
"${SCRIPT_DIR}/fetch.sh" "${lib_id}" "${WORKDIR}"
4464

4565
# Ensure base packages exist (headers etc.) then overwrite with pinned debs.
4666
apt-get install -y -qq mpich libmpich-dev || true
4767
dpkg --install \
48-
"${WORKDIR}/libmpich12_4.2.0-5.1_amd64.deb" \
49-
"${WORKDIR}/mpich_4.2.0-5.1_amd64.deb"
68+
"${WORKDIR}/${lib_deb}" \
69+
"${WORKDIR}/${mpich_deb}"
5070

51-
echo "installed pinned mpich 4.2.0-5.1 for Ubuntu 24.04"
71+
echo "installed pinned mpich 4.2.0-5.1 for Ubuntu 24.04 (${arch})"
5272
mpichversion 2>/dev/null || true
5373
mpirun.mpich --version 2>/dev/null || mpirun --version 2>/dev/null || true

cmake/MacroHelper.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,21 @@ endfunction()
256256
function(add_cpp_git_information target scope)
257257
find_program(GIT git)
258258
if(EXISTS "${PROJECT_SOURCE_DIR}/.git" AND GIT)
259+
# Shallow clones: tags may not be ancestors of HEAD, so describe fails and GIT_DESCRIBE would
260+
# stay empty (neuron.__version__ / nrnversion(5)). Fall back to PROJECT_VERSION so release
261+
# dry-run and ship wheels match.
259262
execute_process(
260263
COMMAND "${GIT}" -C "${PROJECT_SOURCE_DIR}" describe
261264
OUTPUT_VARIABLE GIT_DESCRIBE
265+
RESULT_VARIABLE GIT_DESCRIBE_RESULT
262266
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
263267
268+
if(GIT_DESCRIBE_RESULT OR "${GIT_DESCRIBE}" STREQUAL "")
269+
set(GIT_DESCRIBE "${PROJECT_VERSION}")
270+
message(
271+
STATUS "git describe failed or empty; falling back to PROJECT_VERSION=${PROJECT_VERSION}")
272+
endif()
273+
264274
execute_process(
265275
COMMAND "${GIT}" -C "${PROJECT_SOURCE_DIR}" rev-parse --abbrev-ref HEAD
266276
OUTPUT_VARIABLE GIT_BRANCH

docs/install/ci_deps.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ ci/deps/fetch.sh --list
3939

4040
# Download a managed asset from nrn-ci-deps (default for install helpers)
4141
NRN_CI_DEPS_SOURCE=release ci/deps/fetch.sh mpich-noble-4.2.0-5.1 /tmp/out
42+
# arm64 pin (ubuntu-24.04-arm wheel tests):
43+
# NRN_CI_DEPS_SOURCE=release ci/deps/fetch.sh mpich-noble-4.2.0-5.1-arm64 /tmp/out
4244

4345
# Ubuntu 24.04 wheel tests: install pinned MPICH from the Release
46+
# (selects amd64 or arm64 debs via dpkg --print-architecture)
4447
ci/deps/install_mpich_noble.sh
4548

4649
# Compare pins to upstream (awareness only; does not auto-upgrade)
4750
ci/deps/check-upstream.sh mpich-noble-4.2.0-5.1
51+
# ci/deps/check-upstream.sh mpich-noble-4.2.0-5.1-arm64
4852
```
4953

5054
Promote a new pin (files stay local/transient; then upload to **nrn-ci-deps**):
@@ -60,7 +64,8 @@ rm -f ci/deps/assets/* # optional; assets/ is gitignored
6064

6165
On **nrn-ci-deps** release **`ci-deps-v1`**:
6266

63-
- Ubuntu 24.04 MPICH packages for wheel tests (LP#2072338)
67+
- Ubuntu 24.04 MPICH packages for wheel tests (LP#2072338), **amd64 and arm64**
68+
6469
- GNU **ncurses** / **readline** sources for Mac static readline and the manylinux Dockerfile
6570
- **automake** 1.16.5 for the Ubuntu MUSIC job in `neuron-ci`
6671

packaging/python/test_wheels.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ $python_exe -m uv pip install -r packaging/python/test_requirements.txt
268268
$python_exe -m uv pip install --force-reinstall $python_wheel
269269
$python_exe -m uv pip show neuron || $python_exe -m uv pip show neuron-nightly
270270

271+
# neuron.__version__ is nrnversion(5)/GIT_DESCRIBE; empty breaks ModelDB workdir naming
272+
$python_exe -c "import neuron; v = neuron.__version__; assert v and str(v).strip(), repr(v)"
271273

272274
# check the existence of coreneuron support
273275
compile_options="$(nrniv -nobanner -nogui -c 'nrnversion(6)')"

0 commit comments

Comments
 (0)