]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
release: fix Windows CRLF crash and RPM ps2pdf failure
authorTobias Oetiker <tobi@oetiker.ch>
Sun, 17 May 2026 17:47:53 +0000 (19:47 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Sun, 17 May 2026 17:47:53 +0000 (19:47 +0200)
The first run of the automated Release workflow failed in two jobs:

* Windows MSVC (x86/x64) — the version-bump step died with
  "CHANGES: no leading 'RRDtool - master ...' block found".
  actions/checkout writes CHANGES with CRLF endings on Windows
  runners, defeating the LF-anchored regexes in finalize-changes.pl.
  Normalize CRLF -> LF after slurping the file, and add a
  .gitattributes entry forcing LF on CHANGES as defense-in-depth.

* RPM (almalinux:9) — "make dist" died with "ps2pdf: command not
  found" while generating EXTRA_DIST PDFs. The minimal RPM container
  has no ghostscript. The build-rpm job already depends on
  build-source, which ships the canonical tarball, so download that
  artifact instead of rebuilding it in-container. This matches the
  job's own documented intent and drops a class of missing-dist-dep
  failures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
.gitattributes [new file with mode: 0644]
.github/workflows/release.yml
conftools/finalize-changes.pl

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..00e915b
--- /dev/null
@@ -0,0 +1,4 @@
+# CHANGES is rewritten at release time by conftools/finalize-changes.pl,
+# whose regexes are LF-anchored. Force LF on checkout everywhere (notably
+# on Windows CI runners) so that rewrite cannot break.
+CHANGES text eol=lf
index a93afecd059403c79943c19ccdcb9ab1b0474418..a9c5ca691601cd5788633867c59a47bda5223c1a 100644 (file)
@@ -287,12 +287,13 @@ jobs:
           version: ${{ needs.compute-version.outputs.version }}
           date: ${{ needs.compute-version.outputs.date }}
 
-      - name: Build source tarball locally for rpmbuild input
-        run: |
-          set -e
-          ./bootstrap
-          ./configure
-          make dist
+      # Reuse the canonical tarball produced by build-source instead of
+      # rebuilding it here: `make dist` needs doc-toolchain deps (ps2pdf via
+      # ghostscript) that this minimal RPM container does not carry.
+      - name: Download source tarball from build-source
+        uses: actions/download-artifact@v6
+        with:
+          name: source-tarball
 
       - name: Stage rpmbuild tree
         env:
index 94e02b1da63bf03ead711681394f8dd3dc0b884e..194ea0b53b8a6610cec6ed75b7dd077aa0fc64bf 100755 (executable)
@@ -34,6 +34,11 @@ local $/;
 my $content = <$fh>;
 close $fh;
 
+# Normalize CRLF -> LF. On Windows CI runners actions/checkout writes
+# CHANGES with CRLF line endings, which would defeat the LF-anchored
+# regexes below. The file is always rewritten with LF (matching the repo).
+$content =~ s/\r\n/\n/g;
+
 # Idempotency: a "RRDtool $version - YYYY-MM-DD" header already present
 # means the rewrite ran on a previous job in the same release; just exit.
 if ($content =~ /^RRDtool \Q$version\E - \d{4}-\d{2}-\d{2}\b/m) {