Bug#115655: marked as done ([ARCH][DPKG-ARCHITECTURE] outputs non-canonical GNU system type)
Your message dated Sat, 22 Jan 2005 18:07:05 +0000
with message-id <1106417225.522.31.camel@descent.netsplit.com>
and subject line Bug#115655: [ARCH][DPKG-ARCHITECTURE] outputs non-canonical GNU system type
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 15 Oct 2001 10:21:42 +0000
>From robbe@orcus.priv.at Mon Oct 15 05:21:42 2001
Return-path: <robbe@orcus.priv.at>
Received: from 212186010174.11.tuwien.teleweb.at (hoss.orcus.priv.at) [212.186.10.174]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 15t4sQ-0003Hi-00; Mon, 15 Oct 2001 05:21:42 -0500
Received: by hoss.orcus.priv.at (Postfix, from userid 1000)
id 775AAF04F; Mon, 15 Oct 2001 12:24:56 +0200 (CEST)
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg-architecture outputs non-canonical GNU system type
X-Debbugs-CC: Robert Bihlmeyer <robbe@orcus.priv.at>
X-Attribution: Robbe
From: Robert Bihlmeyer <robbe@orcus.priv.at>
Date: 15 Oct 2001 12:23:41 +0200
Message-ID: <87pu7p6w2a.fsf@orcus.priv.at>
Lines: 175
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Delivered-To: submit@bugs.debian.org
Package: dpkg-dev
Version: 1.9.17
Severity: normal
Tags: patch
(Fixing this would go some way to resolving the config.{guess,sub}
misery -- see [1] and related posts --, so this is of moderate
importance.)
dpkg-architecture provides the "GNU System Type" in
DEB_{BUILD,HOST}_GNU_TYPE variables. This output is suitable for
passing to configure's --build and --host switches. But this is not
the canonical form, it misses the -vendor- part. Proper
canonicalization (if a package needs it) depends on an up-to-date
config.sub coming with the package. We have seen that releasing
updated config.sub versions supporting new architectures creates a lot
of work for Debian maintainers, becuase many many packages have to be
updated with it.
If configure is fed an already canonical system type, config.sub needs
to do nothing, and it will work even if it is too old to know of this
kind of system.
E.g. with autotools-dev 20010907.1 installed:
~$ /usr/share/misc/config.sub i386-linux
i386-pc-linux-gnu
canonicalization works fine.
~$ /usr/share/misc/config.sub sheb-linux
Invalid configuration `sheb-linux': machine `sheb' not recognized
it does not work because config.sub is not new enough.
~$ /usr/share/misc/config.sub sheb-unknown-linux-gnu
sheb-unknown-linux-gnu
here it works fine because the input is already canonical.
Appended is a patch. I've choosen to add new variables
DEB_*_GNU_CANONICAL instead of replacing DEB_*_GNU_TYPE to stay
backward compatible with rules files doing things along the lines of
"ifeq $($(DEB_HOST_GNU_TYPE),i386-linux)".
[1] http://lists.debian.org/debian-mentors/2001/debian-mentors-200110/msg00178.html
diff -u dpkg-architecture~ dpkg-architecture
--- dpkg-architecture~ Mon Oct 15 12:14:09 2001
+++ dpkg-architecture Mon Oct 15 12:14:09 2001
@@ -47,6 +47,7 @@
push(@INC,$dpkglibdir);
require 'controllib.pl';
+# maps Debian architecture to short GNU type
%archtable=('i386', 'i386-linux',
'sparc', 'sparc-linux',
'sparc64', 'sparc64-linux',
@@ -111,6 +112,13 @@
return @list;
}
+sub canonicalize_gnu {
+ local ($_) = @_;
+ s/-linux$/-linux-gnu/;
+ s/^i386-/i386-pc-/ or s/^mips-/mips-mips-/ or s/-/-unknown-/;
+ return $_;
+}
+
# Set default values:
$deb_build_arch = `dpkg --print-installation-architecture`;
@@ -119,6 +127,7 @@
}
chomp $deb_build_arch;
$deb_build_gnu_type = $archtable{$deb_build_arch};
+$deb_build_gnu_canonical = canonicalize_gnu($deb_build_gnu_type);
$deb_build_gnu_cpu = $deb_build_gnu_type;
$deb_build_gnu_system = $deb_build_gnu_type;
$deb_build_gnu_cpu =~ s/-.*$//;
@@ -151,6 +160,7 @@
$deb_host_gnu_type = $gcc;
($deb_host_gnu_system = $gcc) =~ s/^.*-//;
($deb_host_gnu_cpu = $gcc ) =~ s/-.*$//;
+ $deb_host_gnu_canonical = canonicalize_gnu($deb_host_gnu_type);
}
}
if (!defined($deb_host_arch)) {
@@ -159,6 +169,7 @@
$deb_host_gnu_cpu = $deb_build_gnu_cpu;
$deb_host_gnu_system = $deb_build_gnu_system;
$deb_host_gnu_type = $deb_build_gnu_type;
+ $deb_host_gnu_canonical = $deb_build_gnu_canonical;
}
@@ -212,6 +223,7 @@
$deb_host_gnu_cpu = $deb_host_gnu_system = $deb_host_gnu_type = $req_host_gnu_type;
$deb_host_gnu_cpu =~ s/-.*$//;
$deb_host_gnu_system =~ s/^.*-//;
+ $deb_host_gnu_canonical = canonicalize_gnu($deb_host_gnu_type);
}
#$gcc = `\${CC:-gcc} --print-libgcc-file-name`;
@@ -224,25 +236,29 @@
$deb_build_gnu_cpu = $ENV{DEB_BUILD_GNU_CPU} if (exists $ENV{DEB_BUILD_GNU_CPU});
$deb_build_gnu_system = $ENV{DEB_BUILD_GNU_SYSTEM} if (exists $ENV{DEB_BUILD_GNU_SYSTEM});
$deb_build_gnu_type = $ENV{DEB_BUILD_GNU_TYPE} if (exists $ENV{DEB_BUILD_GNU_TYPE});
+ $deb_build_gnu_canonical = $ENV{DEB_BUILD_GNU_CANONICAL} if (exists $ENV{DEB_BUILD_GNU_CANONICAL});
$deb_host_arch = $ENV{DEB_HOST_ARCH} if (exists $ENV{DEB_HOST_ARCH});
$deb_host_gnu_cpu = $ENV{DEB_HOST_GNU_CPU} if (exists $ENV{DEB_HOST_GNU_CPU});
$deb_host_gnu_system = $ENV{DEB_HOST_GNU_SYSTEM} if (exists $ENV{DEB_HOST_GNU_SYSTEM});
$deb_host_gnu_type = $ENV{DEB_HOST_GNU_TYPE} if (exists $ENV{DEB_HOST_GNU_TYPE});
+ $deb_host_gnu_canonical = $ENV{DEB_HOST_GNU_CANONICAL} if (exists $ENV{DEB_HOST_GNU_CANONICAL});
}
@ordered = qw(DEB_BUILD_ARCH DEB_BUILD_GNU_CPU
- DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
+ DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE DEB_BUILD_GNU_CANONICAL
DEB_HOST_ARCH DEB_HOST_GNU_CPU
- DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
+ DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE DEB_HOST_GNU_CANONICAL);
$env{'DEB_BUILD_ARCH'}=$deb_build_arch;
$env{'DEB_BUILD_GNU_CPU'}=$deb_build_gnu_cpu;
$env{'DEB_BUILD_GNU_SYSTEM'}=$deb_build_gnu_system;
$env{'DEB_BUILD_GNU_TYPE'}=$deb_build_gnu_type;
+$env{'DEB_BUILD_GNU_CANONICAL'}=$deb_build_gnu_canonical;
$env{'DEB_HOST_ARCH'}=$deb_host_arch;
$env{'DEB_HOST_GNU_CPU'}=$deb_host_gnu_cpu;
$env{'DEB_HOST_GNU_SYSTEM'}=$deb_host_gnu_system;
$env{'DEB_HOST_GNU_TYPE'}=$deb_host_gnu_type;
+$env{'DEB_HOST_GNU_CANONICAL'}=$deb_host_gnu_canonical;
if ($action eq 'l') {
foreach $k (@ordered) {
@@ -359,7 +375,11 @@
=item DEB_BUILD_GNU_TYPE
-The GNU system type of the build machine.
+The short GNU system type of the build machine.
+
+=item DEB_BUILD_GNU_CANONICAL
+
+The canonical (cpu-vendor-os) form of DEB_BUILD_GNU_TYPE
=item DEB_BUILD_GNU_CPU
@@ -375,7 +395,11 @@
=item DEB_HOST_GNU_TYPE
-The GNU system type of the host machine.
+The short GNU system type of the host machine.
+
+=item DEB_HOST_GNU_CANONICAL
+
+The canonical (cpu-vendor-os) form of DEB_HOST_GNU_TYPE
=item DEB_HOST_GNU_CPU
@@ -401,8 +425,8 @@
please use the following:
-B_ARCH=$(DEB_BUILD_GNU_TYPE)
-H_ARCH=$(DEB_HOST_GNU_TYPE)
+B_ARCH=$(DEB_BUILD_GNU_CANONICAL)
+H_ARCH=$(DEB_HOST_GNU_CANONICAL)
configure --build=$(B_ARCH) --host=$(H_ARCH)
Instead:
---------------------------------------
Received: (at 115655-done) by bugs.debian.org; 22 Jan 2005 18:06:49 +0000
>From scott@netsplit.com Sat Jan 22 10:06:49 2005
Return-path: <scott@netsplit.com>
Received: from populous.netsplit.com (mailgate.netsplit.com) [62.49.129.34] (qmailr)
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1CsPeq-0004DQ-00; Sat, 22 Jan 2005 10:06:49 -0800
Received: (qmail 22576 invoked from network); 22 Jan 2005 18:06:46 -0000
Received: from unknown (HELO descent.netsplit.com) (scott@62.49.129.40)
by populous.netsplit.com with RC4-MD5 encrypted SMTP; 22 Jan 2005 18:06:46 -0000
Subject: Bug#115655: [ARCH][DPKG-ARCHITECTURE] outputs non-canonical GNU
system type
From: Scott James Remnant <scott@netsplit.com>
To: Robert Bihlmeyer <robbe@orcus.priv.at>, 115655-done@bugs.debian.org
Cc: Henrique de Moraes Holschuh <hmh@debian.org>
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ZxA/bww8EUQXmyu0TLx2"
Date: Sat, 22 Jan 2005 18:07:05 +0000
Message-Id: <1106417225.522.31.camel@descent.netsplit.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.2
Delivered-To: 115655-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
VALID_BTS_CONTROL autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level:
X-CrossAssassin-Score: 2
--=-ZxA/bww8EUQXmyu0TLx2
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
tags 115655 - patch
thanks
The correct way to deal with this would be to pass the $cpu-$os system
type we generate to /usr/share/misc/config.sub from the autotools-dev
package, and use that return value.
Trying to munge it ourselves just seems wrong. Thus the patch on this
bug isn't appropriate, removing the patch tag.
Every source's configure script already does this anyway, the issue is
that some sources ship with older versions of this script.
The solutions I can see are:
1) File bugs on sources with old scripts (we already do this).
2) Make it easier for source packages to pick up new versions of these
files (we already do this).
3) Include config.sub in dpkg, and pass result through that. This would
mean dpkg's could be out of date when compared to the source
package's, or autotools-dev.
4) Add a dependency on autotools-dev; promoting it all the way from
optional to Essential.
I don't think (3) fixes the problem and I don't think (4) is tenable. I
think the correct solutions to this bug are (1) and (2), which we
already do.
I therefore declare this bug closed unless a (5) can be found.
Scott
--=20
Have you ever, ever felt like this?
Had strange things happen? Are you going round the twist?
--=-ZxA/bww8EUQXmyu0TLx2
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQBB8pZJIexP3IStZ2wRAmcrAJ0RR+Y5RlN1UMecDVUQNbnW18aiQgCbBeSy
P4SLyzQYYpHiJ9oDkJjj7qk=
=60UD
-----END PGP SIGNATURE-----
--=-ZxA/bww8EUQXmyu0TLx2--
Reply to: