Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-29 Thread Anders Kaseorg
reassign 576967 cdbs
tags 576967 +patch
thanks

How can you suggest that a multiword CC is “abuse” and okay to break, when 
by your own logic (bug 523642), CDBS “has a well defined current behaviour 
that users rely on”?

This change also broke one of my packages that does some cross compiling 
by setting CC = gcc -m32.  This is a perfectly legitimate use of CC; for 
example, the libc6 packaging does this to cross-compile libc6-i386 on 
amd64.

But in fact, the CDBS change that introduced this regression (commit 
ee9bbf5 in version 0.4.77) doesn’t even correctly do what it was 
_intended_ to do.  The $(origin) function is supposed to be called with a 
variable name, not with the contents of a variable. 
http://www.gnu.org/software/make/manual/html_node/Origin-Function.html#Origin-Function

So, can you please apply this patch, which fixes both of these bugs and 
should make everyone happy?

Thanks,
Anders

diff --git a/1/rules/buildvars.mk.in b/1/rules/buildvars.mk.in
index cbca47b..535ca74 100644
--- a/1/rules/buildvars.mk.in
+++ b/1/rules/buildvars.mk.in
@@ -121,10 +121,10 @@ cdbs_expand_branches = $(subst WORDDELIMITER,$3,$(subst 
BRANCHDELIMITER,$4,$(cal
 cdbs_findargs-path-or-name = $(if $(findstring /,$(firstword $(1))),-path 
'./$(patsubst ./%,%,$(firstword $(1)))',-name '$(firstword $(1))') $(foreach 
obj,$(wordlist 2,$(words $(1)),$(1)),-or $(if $(findstring /,$(obj)),-path 
'./$(obj:./%=%)',-name '$(obj)'))
 
 # Resolve VAR only if declared explicitly in makefile or environment
-cdbs_expand_nondefaultvar = $(if $(filter-out $(origin $1),default),$1)
+cdbs_expand_nondefaultvar = $(if $(filter-out $(origin $1),default),$1=$($1))
 
 # Declare (shell-style) variables to itself if explicitly declared
-cdbs_set_nondefaultvars = $(foreach var,$1,$(patsubst %,$(var)=%,$(call 
cdbs_expand_nondefaultvar,$($(var)
+cdbs_set_nondefaultvars = $(foreach var,$1,$(call 
cdbs_expand_nondefaultvar,$(var)))
 
 # Return non-empty if build system is different from host system
 cdbs_crossbuild = $(if $(call 
cdbs_streq,$(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)),,yes)



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#576967: [Build-common-hackers] Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-29 Thread Jonas Smedegaard

Hi Anders,

On Thu, Apr 29, 2010 at 03:20:41AM -0400, Anders Kaseorg wrote:
How can you suggest that a multiword CC is “abuse” and okay to break, 
when by your own logic (bug 523642), CDBS “has a well defined current 
behaviour that users rely on”?


Because I am stupid and unworthy?

Please do not hide complaints as questions.


the CDBS change that introduced this regression (commit ee9bbf5 in 
version 0.4.77) doesn’t even correctly do what it was _intended_ to do.  
The $(origin) function is supposed to be called with a variable name, 
not with the contents of a variable.


Thanks a bunch for spotting this.

I am aware of the special way $(origin) use variables, and I _did_ test 
that it actually worked when implementing it, but obviously I did a

mistake anyway when applying :-P


So, can you please apply this patch, which fixes both of these bugs and 
should make everyone happy?


Most certainly.  Thanks a lot for the investigation and patch!


 - Jonas

--
* Jonas Smedegaard - idealist  Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private


signature.asc
Description: Digital signature


Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-29 Thread Jonas Smedegaard

tags 576967 pending
thanks

Hi again,

On Thu, Apr 29, 2010 at 09:58:32AM +0200, Jonas Smedegaard wrote:

On Thu, Apr 29, 2010 at 03:20:41AM -0400, Anders Kaseorg wrote:
How can you suggest that a multiword CC is “abuse” and okay to 
break, when by your own logic (bug 523642), CDBS “has a well 
defined current behaviour that users rely on”?


Because I am stupid and unworthy?

Please do not hide complaints as questions.


Whoops - sorry for biting: I thought you posted to the follow-up 
bugreport #578303, where I already admitted that it was wrong to not 
support multiword CC / CXX.


(plus it is wrong of me to bite in any case)

The reason I - historically! - considered this not a bug in CDBS was 
that I could not think of a sane use for multiword CC / CXX.



Anyway, your patch has been applied now (slightly adjusted: I kept 
cdbs_expand_nondefaultvar as is and made a new convenience variable 
cdbs_set_nondefaultvar, as expansion and shell-style declaration are 
separate things.



Kind regards,

  - Jonas

--
* Jonas Smedegaard - idealist  Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

  [x] quote me freely  [ ] ask before reusing  [ ] keep private


signature.asc
Description: Digital signature


Processed: Re: Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-29 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 tags 576967 pending
Bug #576967 [cdbs] cdbs: Splits CC into multiple env-var words
Added tag(s) pending.
 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#576967: [Build-common-hackers] Bug#576967: Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-10 Thread Peter Eisentraut
On tor, 2010-04-08 at 21:25 +0200, Jonas Smedegaard wrote:
 reassign 576967 abiword
 thanks
 
 Hi Daniel,
 
 On Thu, Apr 08, 2010 at 09:14:26AM -0700, Daniel Schepler wrote:
 
 From my pbuilder build log for abiword:
 
 cd .  CC=gcc CC=-Wl,--as-needed [...]
 
 This appears to be the result from debian/rules setting
 CC := gcc -Wl,--as-needed
 and similarly for CXX.  This used to work fine.
 
 Indeed that is the cause.  And it is wrong use of CDBS, so no surprise 
 that it fails now that CDBS recently have tightened its CC handling.
 
 Abiword should instead use something like this instead:
 
 CFLAGS += -Wl,--as-needed

While using CFLAGS here is probably better, there are other valid uses
for having a multiword CC, and that case is apparently still broken.

 
 
 Reassigning this bugreport to abiword where it belongs.
 
 
 Kind regards,
 
  - Jonas
 
 ___
 Build-common-hackers mailing list
 build-common-hack...@lists.alioth.debian.org
 http://lists.alioth.debian.org/mailman/listinfo/build-common-hackers






-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-10 Thread Jonas Smedegaard

Hi Peter (and others),

On Sat, Apr 10, 2010 at 12:05:03PM +0300, Peter Eisentraut wrote:

On tor, 2010-04-08 at 21:25 +0200, Jonas Smedegaard wrote:



On Thu, Apr 08, 2010 at 09:14:26AM -0700, Daniel Schepler wrote:

From my pbuilder build log for abiword:

cd .  CC=gcc CC=-Wl,--as-needed [...]

This appears to be the result from debian/rules setting
CC := gcc -Wl,--as-needed
and similarly for CXX.  This used to work fine.

Indeed that is the cause.  And it is wrong use of CDBS, so no 
surprise that it fails now that CDBS recently have tightened its CC 
handling.


Abiword should instead use something like this instead:

CFLAGS += -Wl,--as-needed


While using CFLAGS here is probably better, there are other valid uses 
for having a multiword CC, and that case is apparently still broken.


Let's separate abuse and valid use:

Please file a separate bugreport against cdbs with a concrete example of 
such valid use of multi-word CC.



Kind regards,

 - Jonas

--
* Jonas Smedegaard - idealist  Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private


signature.asc
Description: Digital signature


Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-08 Thread Daniel Schepler
Package: cdbs
Version: 0.4.77
Severity: serious

From my pbuilder build log for abiword:

...
touch debian/stamp-autotools-files
chmod a+x /tmp/buildd/abiword-2.8.2/./configure
mkdir -p .
cd .  CC=gcc CC=-Wl,--as-needed CXX=g++ CXX=-Wl,--as-needed 
CFLAGS=-g -O2 -g -Wall -O2 CXXFLAGS=-g -O2 -g -Wall -O2 CPPFLAGS= 
LDFLAGS= /tmp/buildd/abiword-2.8.2/./configure --build=x86_64-linux-gnu  
--prefix=/usr --
includedir=\${prefix}/include --mandir=\${prefix}/share/man 
--infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--libexecdir=\${prefix}/lib/abiword --disable-maintainer-mode 
--disable-dependency-tracking --disable-silent-rules --srcdir=.  --
enable-static --enable-dynamic --enable-clipart --enable-templates 
--enable-collab-backend-xmpp --enable-collab-backend-tcp 
--enable-collab-backend-service --enable-shave --enable-plugins=aiksaurus 
applix babelfish bmp clarisworks collab command docbook eml 
freetranslation gdict gimp goffice google grammar hancom hrtext iscii kword 
latex loadbindings mathview mht mif mswrite opendocument openwriter openxml 
opml ots paint passepartout pdb pdf presentation psion s5 sdw t602 urldict 
wikipedia wmf wml 
wordperfect wpg xslfo garble --without-gnomevfs --with-gio --with-goffice 
configure: WARNING: unrecognized options: --disable-silent-rules, 
--enable-dynamic
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to disable maintainer-specific portions of Makefiles... no
checking for gcc... -Wl,--as-needed
checking for C compiler default output file name... 
configure: error: in `/tmp/buildd/abiword-2.8.2':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** [debian/stamp-autotools] Error 77
dpkg-buildpackage: error: debian/rules build gave error exit status 2

This appears to be the result from debian/rules setting
CC := gcc -Wl,--as-needed
and similarly for CXX.  This used to work fine.

(Setting to RC severity since it causes abiword to FTBFS.)
-- 
Daniel Schepler



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#576967: [Build-common-hackers] Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-08 Thread Jonas Smedegaard

reassign 576967 abiword
thanks

Hi Daniel,

On Thu, Apr 08, 2010 at 09:14:26AM -0700, Daniel Schepler wrote:


From my pbuilder build log for abiword:



cd .  CC=gcc CC=-Wl,--as-needed [...]



This appears to be the result from debian/rules setting
CC := gcc -Wl,--as-needed
and similarly for CXX.  This used to work fine.


Indeed that is the cause.  And it is wrong use of CDBS, so no surprise 
that it fails now that CDBS recently have tightened its CC handling.


Abiword should instead use something like this instead:

CFLAGS += -Wl,--as-needed


Reassigning this bugreport to abiword where it belongs.


Kind regards,

- Jonas

--
* Jonas Smedegaard - idealist  Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private


signature.asc
Description: Digital signature


Processed: Re: [Build-common-hackers] Bug#576967: cdbs: Splits CC into multiple env-var words

2010-04-08 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 reassign 576967 abiword
Bug #576967 [cdbs] cdbs: Splits CC into multiple env-var words
Bug reassigned from package 'cdbs' to 'abiword'.
Bug No longer marked as found in versions cdbs/0.4.77.
 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org