[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#815172: crossbuild-essential-armhf: cross-building issues due to missing libc6-dev:armhf



Control: tags -1 = patch
Control: block -1 by 989723
Control: retitle -1 mark build-essentila Multi-Arch: same to have cross builds install libc6-dev

On Wed, May 11, 2016 at 09:15:09PM +0200, Matthias Klose wrote:
> having a dependency on a foreign arch prevents migration to testing, so for
> now I prefer having packages in testing. of course a recommends could be
> added.

It is true that we cannot have foreign architecture dependencies at this
time. The good news is that we don't have to. We can just turn the
package foreign and then the dependency no longer crosses an
architecture boundary!

At this time, the semantics for building go like this:

    If you build natively, satisfy the depenency "build-essential". If
    you cross build. satisfy the dependency "crossbuild-essential-$arch"
    (and additionally libc-dev:$arch and libstdc++-dev:$arch).

How about we simplify these semantics to:

    If you build, satisfy the dependency "build-essential".

Of course, if it was that easy we wouldn't have gone for the longer
version above, right? Right. The problem formerly was that
build-essential couldn't easily express a dependency on "the host
architecture and build architecture gcc and g++ toolchains". Now, it
can. It's gcc-for-host and gcc-for-build (g++ likewise). And with that
part resolved, we may simply change the dependencies of build-essential.
Please bear in mind that gcc-for-build depends on "gcc", so in the
native case, we really do get the same packages as before plus a few
almost empty dependency packages. And in the cross case, the
build-essential dependency that is implicitly host architecture
qualified will pull all the right packages - including libc6-dev:$host.

So we may now change build-essential to become Multi-Arch: same and
coinstall it and use it as the single package that will ensure presence
of build-essential functionality in native and cross builds. This is a
result of a lot of work that Matthias and me spent on adding the
-for-build and -for-host packages to binutils first, and then to gcc-VER
and gcc-defaults.

Now I hope I'm not missing something critical and we may just settle
this really old bug that has required us to put workarounds into both
sbuild and pbuilder for so long. It may now just work.

Helmut
diff --minimal -Nru build-essential-12.12/Makefile.am build-essential-12.12+nmu1/Makefile.am
--- build-essential-12.12/Makefile.am	2005-07-07 20:27:17.000000000 +0200
+++ build-essential-12.12+nmu1/Makefile.am	2024-12-07 13:09:59.000000000 +0100
@@ -4,7 +4,7 @@
 
 pkgdata_DATA = \
 	list \
-	essential-packages-list
+	essential-packages-list-@DEB_HOST_ARCH@
 
 EXTRA_DIST = \
 	list
@@ -12,11 +12,5 @@
 	make-esslist.sh \
 	essential-packages-list-*
 
-essential-packages-list: essential-packages-list-@DEB_HOST_ARCH@
-	ln -s $< $@
-
 essential-packages-list-@DEB_HOST_ARCH@:
 	echo "No essential packages list is available" > $@
-
-clean-local:
-	rm -f essential-packages-list
diff --minimal -Nru build-essential-12.12/Makefile.in build-essential-12.12+nmu1/Makefile.in
--- build-essential-12.12/Makefile.in	2014-08-12 01:29:23.000000000 +0200
+++ build-essential-12.12+nmu1/Makefile.in	2024-12-07 13:09:59.000000000 +0100
@@ -236,7 +236,7 @@
 top_srcdir = @top_srcdir@
 pkgdata_DATA = \
 	list \
-	essential-packages-list
+	essential-packages-list-@DEB_HOST_ARCH@
 
 EXTRA_DIST = \
 	list
@@ -595,15 +595,9 @@
 	make-esslist.sh \
 	essential-packages-list-*
 
-essential-packages-list: essential-packages-list-@DEB_HOST_ARCH@
-	ln -s $< $@
-
 essential-packages-list-@DEB_HOST_ARCH@:
 	echo "No essential packages list is available" > $@
 
-clean-local:
-	rm -f essential-packages-list
-
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --minimal -Nru build-essential-12.12/debian/changelog build-essential-12.12+nmu1/debian/changelog
--- build-essential-12.12/debian/changelog	2024-10-11 08:15:58.000000000 +0200
+++ build-essential-12.12+nmu1/debian/changelog	2024-12-07 13:09:59.000000000 +0100
@@ -1,3 +1,15 @@
+build-essential (12.12+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Mark build-essential Multi-Arch: same. (Closes: #815172)
+    + Add an architecture suffix to
+      /usr/share/build-essential/essential-packages-list. (Closes: #989723)
+    + Declare Breaks with dh-buildinfo for the aforementioned move.
+    + Annotate make dependency with :any.
+    + Add *-for-{build,host} to gcc dependencies.
+
+ -- Helmut Grohne <helmut@subdivi.de>  Sat, 07 Dec 2024 13:09:59 +0100
+
 build-essential (12.12) unstable; urgency=medium
 
   * Source-only upload.
diff --minimal -Nru build-essential-12.12/debian/control build-essential-12.12+nmu1/debian/control
--- build-essential-12.12/debian/control	2024-10-10 11:38:53.000000000 +0200
+++ build-essential-12.12+nmu1/debian/control	2024-12-07 13:09:59.000000000 +0100
@@ -7,7 +7,9 @@
 
 Package: build-essential
 Architecture: any
+Multi-Arch: same
 Depends: ${build-essential}, ${misc:Depends}
+Breaks: dh-buildinfo (<<  0.11+nmu4~)
 Description: Informational list of build-essential packages
  If you do not plan to build Debian packages, you don't need this
  package.  Starting with dpkg (>= 1.14.18) this package is required
diff --minimal -Nru build-essential-12.12/debian/control.native.in build-essential-12.12+nmu1/debian/control.native.in
--- build-essential-12.12/debian/control.native.in	2021-01-03 11:26:09.000000000 +0100
+++ build-essential-12.12+nmu1/debian/control.native.in	2024-12-07 13:09:59.000000000 +0100
@@ -1,7 +1,9 @@
 
 Package: build-essential
 Architecture: any
+Multi-Arch: same
 Depends: ${build-essential}, ${misc:Depends}
+Breaks: dh-buildinfo (<<  0.11+nmu4~)
 Description: Informational list of build-essential packages
  If you do not plan to build Debian packages, you don't need this
  package.  Starting with dpkg (>= 1.14.18) this package is required
diff --minimal -Nru build-essential-12.12/debian/rules build-essential-12.12+nmu1/debian/rules
--- build-essential-12.12/debian/rules	2023-06-22 15:10:42.000000000 +0200
+++ build-essential-12.12+nmu1/debian/rules	2024-12-07 13:09:59.000000000 +0100
@@ -59,7 +59,6 @@
 	  case $$f in list|list.cross) continue; esac; \
 	  rm -f $$f; \
 	done
-	rm -f essential-packages-list
 	dh_clean
 
 # Make it as clean as svn can make it.
@@ -80,7 +79,7 @@
 
 	mkdir -p debian/build-essential/usr/share/doc/build-essential
 	ln -sf	../../build-essential/list \
-		../../build-essential/essential-packages-list \
+		../../build-essential/essential-packages-list-$(DEB_HOST_ARCH) \
 		debian/build-essential/usr/share/doc/build-essential
 endif
 
@@ -89,7 +88,7 @@
 	for a in $(cross_archs); do \
 	  p=crossbuild-essential-$$a; \
 	  $(MAKE) prefix=$(CURDIR)/debian/$$p/usr install; \
-	  rm -f debian/$$p/usr/share/build-essential/essential-packages-list; \
+	  rm -f debian/$$p/usr/share/build-essential/essential-packages-list-$(DEB_HOST_ARCH); \
 	  rm -rf debian/$$p/usr/share/$$p; \
 	  mv debian/$$p/usr/share/build-essential \
 		debian/$$p/usr/share/$$p; \
diff --minimal -Nru build-essential-12.12/list build-essential-12.12+nmu1/list
--- build-essential-12.12/list	2024-10-10 11:45:53.000000000 +0200
+++ build-essential-12.12+nmu1/list	2024-12-07 13:08:57.000000000 +0100
@@ -33,13 +33,15 @@
 libc6-dev-sparc64 [sparc]
   Used only on the sparc architecture.
 
-gcc (>= 4:14.2)
-g++ (>= 4:14.2)
+gcc-for-build (>= 4:14.2)
+gcc-for-host (>= 4:14.2)
+g++-for-build (>= 4:14.2)
+g++-for-host (>= 4:14.2)
 
   NOTE:
   The libstdc++ -dev library is not needed, as g++ depends on it
 
-make
+make:any
   Also depended on by dpkg-dev, but make does warrant its own
   dependency since debian/rules will need it even if dpkg-dev
   stopped depending on it

Reply to: