Repository navigation
Update base image to debian trixie - #7
Conversation
The I/O API Makeinclude files shared a single MFLAGS variable between
COPTFLAGS and FOPTFLAGS, so the gfortran-only -fbacktrace and
-fallow-argument-mismatch were handed to mpicc as well. Every C source
file compiled with a pair of
cc1: warning: command-line option '-fallow-argument-mismatch' is
valid for Fortran but not for C
warnings. Split the Fortran-only flags into FMFLAGS and use them only in
FOPTFLAGS; MFLAGS now holds just the flags both compilers understand.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Trixie ships GCC 14, which promotes -Wimplicit-function-declaration, -Wimplicit-int, -Wint-conversion, -Wincompatible-pointer-types, -Wreturn-mismatch and -Wdeclaration-missing-parameter-type from warnings to errors by default. The vendored I/O API 3.1 sources are pre-C99 and do not survive that; the build failed compiling ioapi/sortic.c on an implicit declaration of exit(). The I/O API tarball is fetched from upstream at build time, so patching the sources is not an option. Instead add a CLEGACY variable to COPTFLAGS that pins -std=gnu17 and downgrades those six diagnostics back to warnings. Fortran is unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The env var was hardcoded to 1.0.0 when it was introduced and nothing bumped it, so the published images have been reporting a stale version since 1.0.1. Follow the approach already used in openmethane/setup-wrf: declare an ARG defaulting to "development", surface it as an ENV, and have CI pass the version read from pyproject.toml. The release workflow tags v$(uv version --short), so prefixing the pyproject version with "v" reproduces the tag exactly. Tag builds now assert that the two agree, which would have caught the original drift. Also expose the version as org.opencontainers.image.version. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
There look to be lines in the makeinclude files where -g and -O[2,3] are |
|
I dug into this with Claude (I lack the expertise with gfortran to diagnose) and it ran some tests which determined
|
Updates the base image from
debian:bookworm-slimtodebian:trixie-slim, fixes the build failure that caused, and cleans up two related issues found along the way.Three commits, one per independent issue.
1. Keep gfortran-only flags out of the C compiler flags (
1f7b57b0)Independent of the trixie change — this was producing warnings on bookworm too.
Both
scripts/ioapi/Makeinclude.*files shared a singleMFLAGSbetweenCOPTFLAGSandFOPTFLAGS, so the gfortran-only-fbacktraceand-fallow-argument-mismatchwere handed tompiccas well. Every C source file compiled with a pair of:Split the Fortran-only flags into a new
FMFLAGSused only byFOPTFLAGS.MFLAGSnow holds just the flags both compilers understand.2. Build on debian trixie (
2d6c262b)The actual failure. Trixie ships GCC 14 (bookworm had GCC 12), which promotes six legacy C diagnostics from warnings to errors by default. The vendored I/O API 3.1 sources are pre-C99 and don't survive that — the build died on:
The I/O API tarball is fetched from upstream at build time, so patching the sources isn't an option. Instead,
COPTFLAGSgains aCLEGACYvariable that pins-std=gnu17and downgrades those six diagnostics back to warnings. Fortran is unaffected.3. Populate
OPENMETHANE_CMAQ_VERSIONfrom a build ARG (5fbf5b17)The env var was hardcoded to
1.0.0when introduced (2b2a987e) and nothing bumped it, so published images have been reporting a stale version since 1.0.1.Follows the approach already used in openmethane/setup-wrf: an
ARGdefaulting todevelopment, surfaced as anENV, with CI passing the version read frompyproject.toml. The release workflow tagsv$(uv version --short), so prefixing withvreproduces the tag exactly — and tag builds now assert the two agree, which would have caught the original drift.The
ARGsits below theCOPY --from=builderlines so a version bump only invalidates the trailing layers rather than the large copies out of the builder stage.Note: the value's format changes from
1.0.0tov1.0.2.dev1(gaining avprefix), matching setup-wrf. Nothing in this repo consumes the var, but worth checking downstream.Verification
docker build --no-cachepasses; zero build errors, zero Fortran-flag warnings.mcip,icon,bcon) passes on the trixie image.libnetcdff7,libnetcdf22,libmpich12,cshall present, no missing shared libraries across the built binaries.development,--build-arggivesv1.0.2.dev1, OCI label matches, tag check passes on match and fails on mismatch.COPY --from=builderlayers stayCACHEDacross a version change.The warnings that remain in the build log are all upstream's own — Fortran type mismatches (which
-fallow-argument-mismatchexists to tolerate) and suffix-rule warnings from the I/O API Makefile.Out of scope, but noted
Makeinclude.Linux_aarch64gfortuses-march=native -mtune=native, which inside a Docker build compiles for the builder's CPU and canSIGILLon a different host. The arm64 matrix entry is commented out inbuild_docker.yaml, so it's latent and unverified here. The x86_64 file's-march=core-avx2has a milder version of the same issue (requires Haswell or newer).🤖 Generated with Claude Code