Package: gcc-defaults
Version: 1.224
Severity: important
Tags: patch
Justification: breaks architecture cross bootstrap
User: debian-cr...@lists.debian.org
Usertags: cross-satisfiability
User: helm...@debian.org
Usertags: rebootstrap
X-Debbugs-Cc: z...@debian.org

Hi Matthias,

you recently fixed use of the apt cache in gcc-defaults #1104504.
Unfortunately, the new version poses several problems.

A relatively straight forward one is this message during build:

| dpkg-query: error in show format: may not be empty string

It originates from:

| MOD_VER := $(shell dpkg-query -W --showformat='${Provides}' 
gfortran-$(PV_GFORT) \
|                 | sed 's/.*\(gfortran-mod-[0-9]*\).*/\1/')

In this invocation, ${Provides} is evaluated as a makefile variable. As
it happens to be unset, the empty string is substituted. dpkg doesn't
like that and as a result, gfortran does not provide any gfortran-mod-*.

This is easily fixed by escaping the $ as '$${Provides}'. Fair enough.

The next problem is the additional gfortran-VER dependency. It's implied
as a host architecture dependency and it transitively depends on
binutils:HOST. This is in stark conflict with binutils:BUILD as depended
upon by build-essential. As a result, this dependency is always
cross-unsatisfiable.

If we assume that the modversion does not vary across architectures
(which seems like a valid assumption given that it is scraped from
$(srcdir)/gcc/fortran/module.cc), we may change that to
gfortran-VER:native. Do you agree?

Helmut
diff --minimal -Nru gcc-defaults-1.225/debian/changelog 
gcc-defaults-1.225+nmu1/debian/changelog
--- gcc-defaults-1.225/debian/changelog 2025-05-03 22:55:23.000000000 +0200
+++ gcc-defaults-1.225+nmu1/debian/changelog    2025-06-07 13:15:53.000000000 
+0200
@@ -1,3 +1,11 @@
+gcc-defaults (1.225+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mod-version computation.
+  * Depend on the native gfortran-N.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 07 Jun 2025 13:15:53 +0200
+
 gcc-defaults (1.225) experimental; urgency=medium
 
   * Fix ga68 cross dependencies.
diff --minimal -Nru gcc-defaults-1.225/debian/control 
gcc-defaults-1.225+nmu1/debian/control
--- gcc-defaults-1.225/debian/control   2025-05-03 16:36:44.000000000 +0200
+++ gcc-defaults-1.225+nmu1/debian/control      2025-06-07 13:15:53.000000000 
+0200
@@ -5,7 +5,7 @@
 Uploaders: Matthias Klose <d...@debian.org>
 Standards-Version: 4.7.2
 Build-Depends: m4, debhelper-compat (= 13),
-  gcc-15-base (>= 15.1.0-2~), gfortran-15,
+  gcc-15-base (>= 15.1.0-2~), gfortran-15:native,
   lsb-release
 Vcs-Browser: https://salsa.debian.org/toolchain-team/gcc-defaults
 Vcs-Git: https://salsa.debian.org/toolchain-team/gcc-defaults.git
diff --minimal -Nru gcc-defaults-1.225/debian/rules 
gcc-defaults-1.225+nmu1/debian/rules
--- gcc-defaults-1.225/debian/rules     2025-05-03 16:30:14.000000000 +0200
+++ gcc-defaults-1.225+nmu1/debian/rules        2025-06-07 13:15:53.000000000 
+0200
@@ -592,7 +592,7 @@
   ))
 endif
 
-MOD_VER := $(shell dpkg-query -W --showformat='${Provides}' 
gfortran-$(PV_GFORT) \
+MOD_VER := $(shell dpkg-query -W --showformat='$${Provides}' 
gfortran-$(PV_GFORT) \
                | sed 's/.*\(gfortran-mod-[0-9]*\).*/\1/')
 
 README:
@@ -745,7 +745,7 @@
 ifeq ($(with_native),yes)
        sed \
          -e "s/@SOURCE@/$(SOURCE)/g" \
-         -e "s/@GFORTRAN@/gfortran-$(PV_GFORT)/g" \
+         -e "s/@GFORTRAN@/gfortran-$(PV_GFORT):native/g" \
          debian/control.source  > debian/control
        sed \
          -e "s/@multilib_archs@/$(multilib_archs)/g" \
@@ -755,7 +755,7 @@
 else
          sed \
            -e "s/@SOURCE@/$(SOURCE)/g" \
-           -e "s/@GFORTRAN@/gfortran-$(PV_GFORT)/g" \
+           -e "s/@GFORTRAN@/gfortran-$(PV_GFORT):native/g" \
            debian/control.source \
            | grep -v '^Build-Depends-Indep:' \
            > debian/control

Reply via email to