FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 06-06-2010, 07:10 PM
Joey Hess
 
Default dpkg-buildflags

Some questions I have..

* Do you anticipate adding more flags later? [1]

* Do you think it would be a good idea for packages to set all flags
dpkg-buildflags supports?

* If packages should set all the flags, have you considered having a
mode where it lists them all (like dpkg-architecture -l), perhaps
with export statements?


[1] automake documentation mentions "CCASFLAGS, CFLAGS, CPPFLAGS,
CXXFLAGS, FCFLAGS, FFLAGS, GCJFLAGS, LDFLAGS, LFLAGS, LIBTOOLFLAGS,
OBJCFLAGS, RFLAGS, UPCFLAGS, and YFLAGS"

--
see shy jo
 
Old 06-07-2010, 06:53 AM
Raphael Hertzog
 
Default dpkg-buildflags

Hi Joey,

On Sun, 06 Jun 2010, Joey Hess wrote:
> Some questions I have..
>
> * Do you anticipate adding more flags later? [1]

Possibly yes, although they might not necessarily be among the flags you
listed.

Ubuntu uses dpkg-buildflags to export supplementary variables related to
their hardened gcc wrapper (see Dpkg::Vendor::Ubuntu) so in essence
we already have the case where dpkg-buildflags knows about more flags.

I also wondered if we could not (ab)use dpkg-buildflags to offer a simple
standardized way to forward supplementary options to ./configure:

./configure [...] $(dpkg-buildflags --get configure_opts)

Maybe it could even provide the --build and --host options as required
by default (or maybe not if we want to a have a single flag name that can be
used whatever the build system currently is).

We could define a rule that all caps flags are to be exported while others
are not.

> * Do you think it would be a good idea for packages to set all flags
> dpkg-buildflags supports?

At first I hardcoded a list of flags in dpkg-buildpackage but then
we dropped that so that Ubuntu can export more flags than the initial
list.

So I think that it's probably best (in terms of consistency) to have
all flags exported.

> * If packages should set all the flags, have you considered having a
> mode where it lists them all (like dpkg-architecture -l), perhaps
> with export statements?

Would you like this? I have no problem adding this feature to
dpkg-buildflags.

Cheers,
--
Raphal Hertzog

Like what I do? Sponsor me: http://ouaza.com/wp/2010/01/05/5-years-of-freexian/
My Debian goals: http://ouaza.com/wp/2010/01/09/debian-related-goals-for-2010/


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100607065303.GB1576@rivendell">http://lists.debian.org/20100607065303.GB1576@rivendell
 
Old 06-23-2010, 03:21 PM
Goswin von Brederlow
 
Default dpkg-buildflags

Raphael Hertzog <hertzog@debian.org> writes:

> Hi Joey,
>
> On Sun, 06 Jun 2010, Joey Hess wrote:
>> Some questions I have..
>>
>> * Do you anticipate adding more flags later? [1]
>
> Possibly yes, although they might not necessarily be among the flags you
> listed.
>
> Ubuntu uses dpkg-buildflags to export supplementary variables related to
> their hardened gcc wrapper (see Dpkg::Vendor::Ubuntu) so in essence
> we already have the case where dpkg-buildflags knows about more flags.
>
> I also wondered if we could not (ab)use dpkg-buildflags to offer a simple
> standardized way to forward supplementary options to ./configure:
>
> ./configure [...] $(dpkg-buildflags --get configure_opts)

Will there ever be any flags that are not configure_opts?

> Maybe it could even provide the --build and --host options as required
> by default (or maybe not if we want to a have a single flag name that can be
> used whatever the build system currently is).
>
> We could define a rule that all caps flags are to be exported while others
> are not.
>
>> * Do you think it would be a good idea for packages to set all flags
>> dpkg-buildflags supports?
>
> At first I hardcoded a list of flags in dpkg-buildpackage but then
> we dropped that so that Ubuntu can export more flags than the initial
> list.
>
> So I think that it's probably best (in terms of consistency) to have
> all flags exported.
>
>> * If packages should set all the flags, have you considered having a
>> mode where it lists them all (like dpkg-architecture -l), perhaps
>> with export statements?
>
> Would you like this? I have no problem adding this feature to
> dpkg-buildflags.
>
> Cheers,

An equivalent to

.buildflags:
for i in $(shell dpkg-buildflags --list); do
echo "$$i := $$(dpkg-buildflags --get $$i)"; echo "export $$i";
done >.buildflags

#include .buildflags
PHONY: .buildflags

would be nice. I.e. set and export all variables dpkg-buildflags knows
about.

MfG
Goswin



--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87sk4dbwrm.fsf@frosties.localdomain">http://lists.debian.org/87sk4dbwrm.fsf@frosties.localdomain
 
Old 06-24-2010, 09:14 PM
Pierre Habouzit
 
Default dpkg-buildflags

On Mon, Jun 07, 2010 at 08:53:03AM +0200, Raphael Hertzog wrote:
> > * If packages should set all the flags, have you considered having a
> > mode where it lists them all (like dpkg-architecture -l), perhaps
> > with export statements?
>
> Would you like this? I have no problem adding this feature to
> dpkg-buildflags.

That would be very useful, and you want it to be suitable for $(eval).

It's likely that you will have to support various escapings for it to be
suitable for sh eval, make eval, and maybe other languages.

something like:

dpkg-buildflags --export=[sh|make]


One would use it this way with the shell:

eval $(dpkg-buildflags --export=sh || echo exit $?)

and in make:

$(eval $(shell dpkg-buildflags --export=make || echo '$$(error dpkg-buildflags failed with code '$$?')')))

It's likely to be wise that the output "exports" the variables (as in
shell or make "export" feature to make this bit of the environment
available to sub-shells).
--
O Pierre Habouzit
O madcoder@debian.org
OOO http://www.madism.org


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100624211432.GD5357@madism.org">http://lists.debian.org/20100624211432.GD5357@madism.org
 
Old 06-30-2010, 01:05 PM
Goswin von Brederlow
 
Default dpkg-buildflags

Pierre Habouzit <madcoder@madism.org> writes:

> On Mon, Jun 07, 2010 at 08:53:03AM +0200, Raphael Hertzog wrote:
>> > * If packages should set all the flags, have you considered having a
>> > mode where it lists them all (like dpkg-architecture -l), perhaps
>> > with export statements?
>>
>> Would you like this? I have no problem adding this feature to
>> dpkg-buildflags.
>
> That would be very useful, and you want it to be suitable for $(eval).
>
> It's likely that you will have to support various escapings for it to be
> suitable for sh eval, make eval, and maybe other languages.
>
> something like:
>
> dpkg-buildflags --export=[sh|make]
>
>
> One would use it this way with the shell:
>
> eval $(dpkg-buildflags --export=sh || echo exit $?)
>
> and in make:
>
> $(eval $(shell dpkg-buildflags --export=make || echo '$$(error dpkg-buildflags failed with code '$$?')')))
>
> It's likely to be wise that the output "exports" the variables (as in
> shell or make "export" feature to make this bit of the environment
> available to sub-shells).

mrvn@book:~% cat Makefile
$(eval $(shell echo FOO=1; echo BAR=2))
$(info FOO=$(FOO))
$(info BAR=$(BAR))
all:

mrvn@book:~% make
FOO=1 BAR=2
BAR=
make: Nothing to be done for `all'.


How do you get make to honor line breaks in $(eval ...)?

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87mxuck6wp.fsf@frosties.localdomain">http://lists.debian.org/87mxuck6wp.fsf@frosties.localdomain
 
Old 06-30-2010, 03:04 PM
Pierre Habouzit
 
Default dpkg-buildflags

On Wed, Jun 30, 2010 at 03:05:10PM +0200, Goswin von Brederlow wrote:
> Pierre Habouzit <madcoder@madism.org> writes:
>
> > On Mon, Jun 07, 2010 at 08:53:03AM +0200, Raphael Hertzog wrote:
> >> > * If packages should set all the flags, have you considered having a
> >> > mode where it lists them all (like dpkg-architecture -l), perhaps
> >> > with export statements?
> >>
> >> Would you like this? I have no problem adding this feature to
> >> dpkg-buildflags.
> >
> > That would be very useful, and you want it to be suitable for $(eval).
> >
> > It's likely that you will have to support various escapings for it to be
> > suitable for sh eval, make eval, and maybe other languages.
> >
> > something like:
> >
> > dpkg-buildflags --export=[sh|make]
> >
> >
> > One would use it this way with the shell:
> >
> > eval $(dpkg-buildflags --export=sh || echo exit $?)
> >
> > and in make:
> >
> > $(eval $(shell dpkg-buildflags --export=make || echo '$$(error dpkg-buildflags failed with code '$$?')')))
> >
> > It's likely to be wise that the output "exports" the variables (as in
> > shell or make "export" feature to make this bit of the environment
> > available to sub-shells).
>
> mrvn@book:~% cat Makefile
> $(eval $(shell echo FOO=1; echo BAR=2))
> $(info FOO=$(FOO))
> $(info BAR=$(BAR))
> all:
>
> mrvn@book:~% make
> FOO=1 BAR=2
> BAR=
> make: Nothing to be done for `all'.
>
>
> How do you get make to honor line breaks in $(eval ...)?

gah, make is annoying. Well there is always the possibility:

-include dpkg-buildflags.mk
dpkg-buildflags.mk:
$(shell dpkg-buildflags --export=make) > $@

Which is probably a hell of a lot simpler.
Stupid make....

(for those not very comfortable with make, the -include
dpkg-buildflags.mk will check if the file exist, if not won't complain
but will find if there is a target named 'dpkg-buildflags.mk', if yes
will do its rules and retry to include the file.

Which in the end does what is meant.


--- with your example: ---

┌─(17:03)────
└[apollon] cat Makefile
-include a.mk
a.mk:
(echo FOO=1; echo BAR=2) > $@

$(info FOO=$(FOO))
$(info BAR=$(BAR))
┌─(17:03)────
└[apollon] make
FOO=
BAR=
(echo FOO=1; echo BAR=2) > a.mk
FOO=1
BAR=2
make: `a.mk' is up to date.
┌─(17:03)────
└[apollon] cat a.mk
FOO=1
BAR=2
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100630150454.GA17803@madism.org">http://lists.debian.org/20100630150454.GA17803@madism.org
 
Old 07-01-2010, 08:04 AM
Goswin von Brederlow
 
Default dpkg-buildflags

Pierre Habouzit <madcoder@madism.org> writes:

> On Wed, Jun 30, 2010 at 03:05:10PM +0200, Goswin von Brederlow wrote:
>> mrvn@book:~% cat Makefile
>> $(eval $(shell echo FOO=1; echo BAR=2))
>> $(info FOO=$(FOO))
>> $(info BAR=$(BAR))
>> all:
>>
>> mrvn@book:~% make
>> FOO=1 BAR=2
>> BAR=
>> make: Nothing to be done for `all'.
>>
>>
>> How do you get make to honor line breaks in $(eval ...)?
>
> gah, make is annoying. Well there is always the possibility:
>
> -include dpkg-buildflags.mk
> dpkg-buildflags.mk:
> $(shell dpkg-buildflags --export=make) > $@
>
> Which is probably a hell of a lot simpler.
> Stupid make....

Indeed.

> (for those not very comfortable with make, the -include
> dpkg-buildflags.mk will check if the file exist, if not won't complain
> but will find if there is a target named 'dpkg-buildflags.mk', if yes
> will do its rules and retry to include the file.
>
> Which in the end does what is meant.

Except it won't make the file ever again even if the dpkg-buildflags
output changes. So if you want to preserve timestamps unless the output
changes you need something like this. If the timestamp doesn't matter
you just need the .PHONY.

-include dpkg-buildflags.mk
dpkg-buildflags.mk:
$(shell dpkg-buildflags --export=make) > $@.new
@if ! cmp 2>/dev/null --quiet $@.new $@; then
echo Updating $@;
mv $@.new $@;
else
rm $@.new;
fi

.PHONY: dpkg-buildflags.mk

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87hbkjiq6l.fsf@frosties.localdomain">http://lists.debian.org/87hbkjiq6l.fsf@frosties.localdomain
 
Old 07-01-2010, 08:08 AM
Pierre Habouzit
 
Default dpkg-buildflags

On Thu, Jul 01, 2010 at 10:04:02AM +0200, Goswin von Brederlow wrote:
> Pierre Habouzit <madcoder@madism.org> writes:
>
> > On Wed, Jun 30, 2010 at 03:05:10PM +0200, Goswin von Brederlow wrote:
> >> mrvn@book:~% cat Makefile
> >> $(eval $(shell echo FOO=1; echo BAR=2))
> >> $(info FOO=$(FOO))
> >> $(info BAR=$(BAR))
> >> all:
> >>
> >> mrvn@book:~% make
> >> FOO=1 BAR=2
> >> BAR=
> >> make: Nothing to be done for `all'.
> >>
> >>
> >> How do you get make to honor line breaks in $(eval ...)?
> >
> > gah, make is annoying. Well there is always the possibility:
> >
> > -include dpkg-buildflags.mk
> > dpkg-buildflags.mk:
> > $(shell dpkg-buildflags --export=make) > $@
> >
> > Which is probably a hell of a lot simpler.
> > Stupid make....
>
> Indeed.
>
> > (for those not very comfortable with make, the -include
> > dpkg-buildflags.mk will check if the file exist, if not won't complain
> > but will find if there is a target named 'dpkg-buildflags.mk', if yes
> > will do its rules and retry to include the file.
> >
> > Which in the end does what is meant.
>
> Except it won't make the file ever again even if the dpkg-buildflags
> output changes. So if you want to preserve timestamps unless the output
> changes you need something like this. If the timestamp doesn't matter
> you just need the .PHONY.
>
> -include dpkg-buildflags.mk
> dpkg-buildflags.mk:
> $(shell dpkg-buildflags --export=make) > $@.new
> @if ! cmp 2>/dev/null --quiet $@.new $@; then
> echo Updating $@;
> mv $@.new $@;
> else
> rm $@.new;
> fi

You don't need to protect the regeneration with your
update-only-if-changed trick because no rule will ever depend upon the
dpkg-buildflags.mk freshness, so the sole need you have is to mark the
rule PHONY if you need such a thing.

--
O Pierre Habouzit
O madcoder@debian.org
OOO http://www.madism.org


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100701080845.GB27936@madism.org">http://lists.debian.org/20100701080845.GB27936@madism.org
 
Old 07-01-2010, 09:08 AM
Goswin von Brederlow
 
Default dpkg-buildflags

Pierre Habouzit <madcoder@madism.org> writes:

> On Thu, Jul 01, 2010 at 10:04:02AM +0200, Goswin von Brederlow wrote:
>> Pierre Habouzit <madcoder@madism.org> writes:
>>
>> > On Wed, Jun 30, 2010 at 03:05:10PM +0200, Goswin von Brederlow wrote:
>> >> mrvn@book:~% cat Makefile
>> >> $(eval $(shell echo FOO=1; echo BAR=2))
>> >> $(info FOO=$(FOO))
>> >> $(info BAR=$(BAR))
>> >> all:
>> >>
>> >> mrvn@book:~% make
>> >> FOO=1 BAR=2
>> >> BAR=
>> >> make: Nothing to be done for `all'.
>> >>
>> >>
>> >> How do you get make to honor line breaks in $(eval ...)?
>> >
>> > gah, make is annoying. Well there is always the possibility:
>> >
>> > -include dpkg-buildflags.mk
>> > dpkg-buildflags.mk:
>> > $(shell dpkg-buildflags --export=make) > $@
>> >
>> > Which is probably a hell of a lot simpler.
>> > Stupid make....
>>
>> Indeed.
>>
>> > (for those not very comfortable with make, the -include
>> > dpkg-buildflags.mk will check if the file exist, if not won't complain
>> > but will find if there is a target named 'dpkg-buildflags.mk', if yes
>> > will do its rules and retry to include the file.
>> >
>> > Which in the end does what is meant.
>>
>> Except it won't make the file ever again even if the dpkg-buildflags
>> output changes. So if you want to preserve timestamps unless the output
>> changes you need something like this. If the timestamp doesn't matter
>> you just need the .PHONY.
>>
>> -include dpkg-buildflags.mk
>> dpkg-buildflags.mk:
>> $(shell dpkg-buildflags --export=make) > $@.new
>> @if ! cmp 2>/dev/null --quiet $@.new $@; then
>> echo Updating $@;
>> mv $@.new $@;
>> else
>> rm $@.new;
>> fi
>
> You don't need to protect the regeneration with your
> update-only-if-changed trick because no rule will ever depend upon the
> dpkg-buildflags.mk freshness, so the sole need you have is to mark the
> rule PHONY if you need such a thing.

Since the file should be removed in clean it probably doesn't need to be
PHONY. If any of the flags are changed you need to remove all object
files anyway so debian/rules clean would be in order then.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87zkybh8ms.fsf@frosties.localdomain">http://lists.debian.org/87zkybh8ms.fsf@frosties.localdomain
 
Old 07-25-2010, 03:00 PM
Raphael Hertzog
 
Default dpkg-buildflags

Hi,

On Mon, 07 Jun 2010, Raphael Hertzog wrote:
> > * If packages should set all the flags, have you considered having a
> > mode where it lists them all (like dpkg-architecture -l), perhaps
> > with export statements?
>
> Would you like this? I have no problem adding this feature to
> dpkg-buildflags.

I have added such a feature here, I will push it later today, it will be
in dpkg 1.15.8.

Cheers,
--
Raphaël Hertzog ◈ Debian Developer ◈ [Flattr=20693]

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
▶ http://RaphaelHertzog.fr (Français)


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100725150024.GB5776@rivendell">http://lists.debian.org/20100725150024.GB5776@rivendell
 

Thread Tools




All times are GMT. The time now is 05:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org