Bug#856396: dpkg-dev: dpkg-source displays warnings when gcc is not installed

2017-08-20 Thread Daniel Shahaf
Guillem Jover wrote on Mon, 21 Aug 2017 01:34 +0200:
> Hi!
> 

Good morning!

> On Sun, 2017-08-20 at 03:21:59 +, Daniel Shahaf wrote:
> > Guillem Jover wrote on Sun, Apr 09, 2017 at 03:24:55 +0200:
> > > On Tue, 2017-02-28 at 15:23:49 +, CONSUEGRA Lenny - externe wrote:
> > > > When building a package with dpkg-source, warnings are printed if gcc is
> > > > not installed on the system :
> > > > 
> > > > root@build:/srv/build/tmp/test# dpkg-source -b ublock-origin-1.9.4+dfsg
> > > >  sh: 1: gcc: not found
> > > >  dpkg-source: warning: Couldn't determine gcc system type, falling back 
> > > > to default (native compilation)
> > > 
> > > I've analyzed the code, and it does indeed not really require the host
> > > architecture when building a source package, so I've got a couple of
> > > commits that get rid of those messages.
> > > 
> > > The first disables the perl warnings for when the program is not found
> > > (the equivalent of first line for 1.18.x, but w/o going via the shell),
> > > and the second removes the need completely of calling gcc (so the
> > > second line will not even be emitted).
> > > 
> > > I've queued these for 1.19.x.
> > 
> > I see a similar error in another codepath:
> > 
> > % apt-get source hello
> > % cd hello*/
> > % dpkg-buildpackage
> > ⋮
> > dpkg-buildpackage: info: source changed by Salvatore Bonaccorso 
> > 
> > Can't exec "gcc": No such file or directory at 
> > /usr/share/perl5/Dpkg/Arch.pm line 165.
> > dpkg-architecture: warning: cannot determine CC system type, falling back 
> > to default (native compilation)
> > ⋮
> 
> I don't think this is the same problem, given that you did a full build
> instead of a source only one?
> 

I don't think it's the same problem either.  (Perhaps it should be
tracked as a separate bug report.)

> > I think the following patch will suffice to address it:
> > 
> > [[[
> […]
> > ]]]
> > 
> > I tested it in current sid.
> 
> What compiler do you have installed that provides cc and it's not gcc?

apt install clang

It provides an implementation of /etc/alternatives/cc.

> That'd be pretty non-standard Debian?
> 

Well, yes, but it works...

(and the patch should be a no-op for standard Debian where cc is gcc)

> > I tried to build the package with this
> > patch, on the assumption that that would run unit tests, but the build
> > failed both with and without the patch with "error: cannot get project
> > version" (probably from ./get-version).  I built by running 'pdebuild'
> > without arguments in a fresh debcheckout.
> 
> When building from a git tree, you need git installed. :)

As I said, I was building from a fresh debcheckout; I obtained it by running
'debcheckout' which ran 'git'.  I am not sure what the problem was; perhaps
I should have had pdebuild have pbuilder pre-install git in the chroot?

Cheers,

Daniel



Bug#856396: dpkg-dev: dpkg-source displays warnings when gcc is not installed

2017-08-20 Thread Guillem Jover
Hi!

On Sun, 2017-08-20 at 03:21:59 +, Daniel Shahaf wrote:
> Guillem Jover wrote on Sun, Apr 09, 2017 at 03:24:55 +0200:
> > On Tue, 2017-02-28 at 15:23:49 +, CONSUEGRA Lenny - externe wrote:
> > > When building a package with dpkg-source, warnings are printed if gcc is
> > > not installed on the system :
> > > 
> > > root@build:/srv/build/tmp/test# dpkg-source -b ublock-origin-1.9.4+dfsg
> > >  sh: 1: gcc: not found
> > >  dpkg-source: warning: Couldn't determine gcc system type, falling back 
> > > to default (native compilation)
> > 
> > I've analyzed the code, and it does indeed not really require the host
> > architecture when building a source package, so I've got a couple of
> > commits that get rid of those messages.
> > 
> > The first disables the perl warnings for when the program is not found
> > (the equivalent of first line for 1.18.x, but w/o going via the shell),
> > and the second removes the need completely of calling gcc (so the
> > second line will not even be emitted).
> > 
> > I've queued these for 1.19.x.
> 
> I see a similar error in another codepath:
> 
> % apt-get source hello
> % cd hello*/
> % dpkg-buildpackage
> ⋮
> dpkg-buildpackage: info: source changed by Salvatore Bonaccorso 
> 
> Can't exec "gcc": No such file or directory at /usr/share/perl5/Dpkg/Arch.pm 
> line 165.
> dpkg-architecture: warning: cannot determine CC system type, falling back to 
> default (native compilation)
> ⋮

I don't think this is the same problem, given that you did a full build
instead of a source only one?

> I think the following patch will suffice to address it:
> 
> [[[
[…]
> ]]]
> 
> I tested it in current sid.

What compiler do you have installed that provides cc and it's not gcc?
That'd be pretty non-standard Debian?

> I tried to build the package with this
> patch, on the assumption that that would run unit tests, but the build
> failed both with and without the patch with "error: cannot get project
> version" (probably from ./get-version).  I built by running 'pdebuild'
> without arguments in a fresh debcheckout.

When building from a git tree, you need git installed. :)

Thanks,
Guillem



Bug#856396: dpkg-dev: dpkg-source displays warnings when gcc is not installed

2017-08-19 Thread Daniel Shahaf
Guillem Jover wrote on Sun, Apr 09, 2017 at 03:24:55 +0200:
> On Tue, 2017-02-28 at 15:23:49 +, CONSUEGRA Lenny - externe wrote:
> > Package: dpkg-dev
> > Version: 1.17.27
> > Severity: minor
> > Tags: upstream
> 
> > When building a package with dpkg-source, warnings are printed if gcc is
> > not installed on the system :
> > 
> > root@build:/srv/build/tmp/test# dpkg-source -b ublock-origin-1.9.4+dfsg
> >  sh: 1: gcc: not found
> >  dpkg-source: warning: Couldn't determine gcc system type, falling back to 
> > default (native compilation)
> 
> I've analyzed the code, and it does indeed not really require the host
> architecture when building a source package, so I've got a couple of
> commits that get rid of those messages.
> 
> The first disables the perl warnings for when the program is not found
> (the equivalent of first line for 1.18.x, but w/o going via the shell),
> and the second removes the need completely of calling gcc (so the
> second line will not even be emitted).
> 
> I've queued these for 1.19.x.

I see a similar error in another codepath:

% apt-get source hello
% cd hello*/
% dpkg-buildpackage
⋮
dpkg-buildpackage: info: source changed by Salvatore Bonaccorso 

Can't exec "gcc": No such file or directory at /usr/share/perl5/Dpkg/Arch.pm 
line 165.
dpkg-architecture: warning: cannot determine CC system type, falling back to 
default (native compilation)
⋮

I think the following patch will suffice to address it:

[[[
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index c6321a580..341169c1b 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -158,7 +158,7 @@ sub get_build_arch()
 
 sub get_host_gnu_type()
 {
-my $CC = $ENV{CC} || 'gcc';
+my $CC = $ENV{CC} || 'cc';
 
 return $cc_host_gnu_type{$CC} if defined $cc_host_gnu_type{$CC};
 
@@ -175,7 +175,7 @@ sub get_build_arch()
 sub set_host_gnu_type
 {
 my ($host_gnu_type) = @_;
-my $CC = $ENV{CC} || 'gcc';
+my $CC = $ENV{CC} || 'cc';
 
 $cc_host_gnu_type{$CC} = $host_gnu_type;
 }
]]]

I tested it in current sid.  I tried to build the package with this
patch, on the assumption that that would run unit tests, but the build
failed both with and without the patch with "error: cannot get project
version" (probably from ./get-version).  I built by running 'pdebuild'
without arguments in a fresh debcheckout.

Cheers,

Daniel



Bug#856396: dpkg-dev: dpkg-source displays warnings when gcc is not installed

2017-04-08 Thread Guillem Jover
Hi!

On Tue, 2017-02-28 at 15:23:49 +, CONSUEGRA Lenny - externe wrote:
> Package: dpkg-dev
> Version: 1.17.27
> Severity: minor
> Tags: upstream

> When building a package with dpkg-source, warnings are printed if gcc is
> not installed on the system :
> 
> root@build:/srv/build/tmp/test# dpkg-source -b ublock-origin-1.9.4+dfsg
>  sh: 1: gcc: not found
>  dpkg-source: warning: Couldn't determine gcc system type, falling back to 
> default (native compilation)

I've analyzed the code, and it does indeed not really require the host
architecture when building a source package, so I've got a couple of
commits that get rid of those messages.

The first disables the perl warnings for when the program is not found
(the equivalent of first line for 1.18.x, but w/o going via the shell),
and the second removes the need completely of calling gcc (so the
second line will not even be emitted).

I've queued these for 1.19.x.

> A bug report has already been filled for dpkg-dev 1.14.26 :
> 
>https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526132

Although this was for extraction which is a quite different code path,
so not a regression or anything.

Thanks,
Guillem



Bug#856396: dpkg-dev: dpkg-source displays warnings when gcc is not installed

2017-02-28 Thread CONSUEGRA Lenny - externe
Package: dpkg-dev
Version: 1.17.27
Severity: minor
Tags: upstream

Dear Maintainer,

When building a package with dpkg-source, warnings are printed if gcc is not 
installed on the system :

root@build:/srv/build/tmp/test# dpkg-source -b ublock-origin-1.9.4+dfsg
 sh: 1: gcc: not found
 dpkg-source: warning: Couldn't determine gcc system type, falling back to 
default (native compilation)


A bug report has already been filled for dpkg-dev 1.14.26 :

   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526132


Thanks,

--
Lenny


-- System Information:
Debian Release: 8.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dpkg-dev depends on:
ii  base-files8+deb8u7
ii  binutils  2.25-5
ii  bzip2 1.0.6-7+b3
ii  libdpkg-perl  1.17.27
ii  make  4.0-8.1
ii  patch 2.7.5-1
ii  xz-utils  5.1.1alpha+20120614-2+b3

Versions of packages dpkg-dev recommends:
pn  build-essential  
pn  fakeroot 
ii  gcc-4.9 [c-compiler] 4.9.2-10
ii  gnupg1.4.18-7+deb8u3
ii  gnupg2   2.0.26-6+deb8u1
ii  gpgv 1.4.18-7+deb8u3
pn  libalgorithm-merge-perl  

Versions of packages dpkg-dev suggests:
pn  debian-keyring  

-- no debconf information



Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à 
l'intention exclusive des destinataires et les informations qui y figurent sont 
strictement confidentielles. Toute utilisation de ce Message non conforme à sa 
destination, toute diffusion ou toute publication totale ou partielle, est 
interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le 
copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si 
vous avez reçu ce Message par erreur, merci de le supprimer de votre système, 
ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support 
que ce soit. Nous vous remercions également d'en avertir immédiatement 
l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie 
électronique arrivent en temps utile, sont sécurisées ou dénuées de toute 
erreur ou virus.


This message and any attachments (the 'Message') are intended solely for the 
addressees. The information contained in this Message is confidential. Any use 
of information contained in this Message not in accord with its purpose, any 
dissemination or disclosure, either whole or partial, is prohibited except 
formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any 
part of it. If you have received this message in error, please delete it and 
all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or 
virus-free.