Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   Don't use / when applying sed with CFLAGS (http://www.linux-archive.org/gentoo-development/545015-dont-use-when-applying-sed-cflags.html)

Fabian Groffen 06-27-2011 03:01 PM

Don't use / when applying sed with CFLAGS
 
On 27-06-2011 14:08:52 +0000, Justin Lecher wrote:
> Please do not use / as seperater when using sed with CFLAGS. I came across a bug today where it failed for crossdev. Here the toolchain header paths in the cflags and consowuently the seds fail.

Please also don't use ':' as separator, as some platforms have options
for their toolchain that includes colons.


--
Fabian Groffen
Gentoo on a different level

Lars Wendler 06-27-2011 03:23 PM

Don't use / when applying sed with CFLAGS
 
Am Montag 27 Juni 2011, 17:01:01 schrieb Fabian Groffen:
> On 27-06-2011 14:08:52 +0000, Justin Lecher wrote:
> > Please do not use / as seperater when using sed with CFLAGS. I came
> > across a bug today where it failed for crossdev. Here the toolchain
> > header paths in the cflags and consowuently the seds fail.
>
> Please also don't use ':' as separator, as some platforms have options
> for their toolchain that includes colons.

Rather than telling us what to _not_ use as separator how about suggesting a
list of konwn to be good separators for such cases. How about the @ character?

--
Lars Wendler (Polynomial-C)
Gentoo package maintainer and bug-wrangler

Donnie Berkholz 06-27-2011 03:37 PM

Don't use / when applying sed with CFLAGS
 
On 17:23 Mon 27 Jun , Lars Wendler wrote:
> Am Montag 27 Juni 2011, 17:01:01 schrieb Fabian Groffen:
> > On 27-06-2011 14:08:52 +0000, Justin Lecher wrote:
> > > Please do not use / as seperater when using sed with CFLAGS. I came
> > > across a bug today where it failed for crossdev. Here the toolchain
> > > header paths in the cflags and consowuently the seds fail.
> >
> > Please also don't use ':' as separator, as some platforms have options
> > for their toolchain that includes colons.
>
> Rather than telling us what to _not_ use as separator how about suggesting a
> list of konwn to be good separators for such cases. How about the @ character?

One of my favorites for weird cases is ~.

--
Thanks,
Donnie

Donnie Berkholz
Sr. Developer, Gentoo Linux
Blog: http://dberkholz.com

Jeroen Roovers 06-27-2011 03:44 PM

Don't use / when applying sed with CFLAGS
 
On Mon, 27 Jun 2011 17:01:01 +0200
Fabian Groffen <grobian@gentoo.org> wrote:

> On 27-06-2011 14:08:52 +0000, Justin Lecher wrote:
> > Please do not use / as seperater when using sed with CFLAGS. I came
> > across a bug today where it failed for crossdev. Here the toolchain
> > header paths in the cflags and consowuently the seds fail.
>
> Please also don't use ':' as separator, as some platforms have options
> for their toolchain that includes colons.

Then don't do it at all or we could be here til Christmas. That is, do
not inject CFLAGS/LDFLAGS/CC/... into any file, but use the file's
native variable format so that it picks up the information from the
environment. :)


jer

Mike Frysinger 06-27-2011 07:26 PM

Don't use / when applying sed with CFLAGS
 
On Monday, June 27, 2011 11:23:58 Lars Wendler wrote:
> Am Montag 27 Juni 2011, 17:01:01 schrieb Fabian Groffen:
> > On 27-06-2011 14:08:52 +0000, Justin Lecher wrote:
> > > Please do not use / as seperater when using sed with CFLAGS. I came
> > > across a bug today where it failed for crossdev. Here the toolchain
> > > header paths in the cflags and consowuently the seds fail.
> >
> > Please also don't use ':' as separator, as some platforms have options
> > for their toolchain that includes colons.
>
> Rather than telling us what to _not_ use as separator how about suggesting
> a list of konwn to be good separators for such cases. How about the @
> character?

"|" tends to be safe for *FLAGS

this topic has come up before, so it's probably useful to read the history in
the archives rather than rehash the whole thing from scratch every year or so.
i thought we also had a section in the devmanual covering this ...
-mike

justin 06-27-2011 07:56 PM

Don't use / when applying sed with CFLAGS
 
On 6/27/11 9:26 PM, Mike Frysinger wrote:
> On Monday, June 27, 2011 11:23:58 Lars Wendler wrote:
>> Am Montag 27 Juni 2011, 17:01:01 schrieb Fabian Groffen:
>>> On 27-06-2011 14:08:52 +0000, Justin Lecher wrote:
>>>> Please do not use / as seperater when using sed with CFLAGS. I came
>>>> across a bug today where it failed for crossdev. Here the toolchain
>>>> header paths in the cflags and consowuently the seds fail.
>>>
>>> Please also don't use ':' as separator, as some platforms have options
>>> for their toolchain that includes colons.
>>
>> Rather than telling us what to _not_ use as separator how about suggesting
>> a list of konwn to be good separators for such cases. How about the @
>> character?
>
> "|" tends to be safe for *FLAGS
>
> this topic has come up before, so it's probably useful to read the history in
> the archives rather than rehash the whole thing from scratch every year or so.
> i thought we also had a section in the devmanual covering this ...
> -mike

I am not cross compiling so I never hit this issue nor was interested
in. And not even thought about it, so the addressed audience are people
like me.
Due to this bug I did a grep on the tree and there are really many
package doing it wrong. So any section in the manuals or past
discussions here didn't change a thing as it seems.

justin

Mike Frysinger 06-27-2011 08:25 PM

Don't use / when applying sed with CFLAGS
 
On Monday, June 27, 2011 15:56:24 justin wrote:
> On 6/27/11 9:26 PM, Mike Frysinger wrote:
> > On Monday, June 27, 2011 11:23:58 Lars Wendler wrote:
> >> Am Montag 27 Juni 2011, 17:01:01 schrieb Fabian Groffen:
> >>> On 27-06-2011 14:08:52 +0000, Justin Lecher wrote:
> >>>> Please do not use / as seperater when using sed with CFLAGS. I came
> >>>> across a bug today where it failed for crossdev. Here the toolchain
> >>>> header paths in the cflags and consowuently the seds fail.
> >>>
> >>> Please also don't use ':' as separator, as some platforms have options
> >>> for their toolchain that includes colons.
> >>
> >> Rather than telling us what to _not_ use as separator how about
> >> suggesting a list of konwn to be good separators for such cases. How
> >> about the @ character?
> >
> > "|" tends to be safe for *FLAGS
> >
> > this topic has come up before, so it's probably useful to read the
> > history in the archives rather than rehash the whole thing from scratch
> > every year or so. i thought we also had a section in the devmanual
> > covering this ...
>
> I am not cross compiling so I never hit this issue nor was interested
> in. And not even thought about it, so the addressed audience are people
> like me.

it's not a cross-compiling issue. anyone can use these chars in their flags.
like the prefix weirdos doing native builds.

> Due to this bug I did a grep on the tree and there are really many
> package doing it wrong. So any section in the manuals or past
> discussions here didn't change a thing as it seems.

probably because it's such a minor issue and only crops up with people using
uncommon values. also, i'd suspect you have quite a bit of false positives as
it isnt just a matter of "using / or : as the separator is always wrong". and
it only matters if the variables from users get expanded in the middle of the
sed expression. using 's:...:${CFLAGS}:' is not a problem.
-mike


All times are GMT. The time now is 04:34 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.