You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Travis Vitek <vi...@roguewave.com> on 2008/01/24 20:13:01 UTC
Discussion for STDCXX-573
[http://issues.apache.org/jira/browse/STDCXX-573]
This issue requests that we add purify support to the build system. I'm
trying to decide what the best way to go about this is going to be.
Andrew provided a patch that uses $PURE_OPTS to enable purify and to provide
additional flags. I don't really like adding another environment variable or
flag that does the same thing unless it is really necessary. By default,
purify will look at $PURIFYOPTIONS and $PUREOPTIONS for additional purify
flags.
So I'm considering just using a PURIFY flag to indicate that the user wants
to link with purify, and then providing a default set of flags. If the user
provides PURIFYOPTIONS or PUREOPTIONS, then the defaults will be overridden.
That would mean that calling `gmake PURIFY=1' would enable purify with the
default options "-windows=no -log-file=\$@.log -view-file=\$@.view". If you
want to override that behavior, you would use `gmake PURIFY=1
PURIFYFLAGS=<FLAGS>'.
Does anyone have any arguments against using this method?
--
View this message in context: http://www.nabble.com/Discussion-for-STDCXX-573-tp15072366p15072366.html
Sent from the stdcxx-dev mailing list archive at Nabble.com.
Re: Discussion for STDCXX-573
Posted by Andrew Black <ab...@roguewave.com>.
Greetings Travis
An advantage to the design proposed in the initial patch is that the
same set of purify flags will be used across invocations. This could be
useful to prevent regeneration of the instrumented libraries and other
such items, along with possibly providing the ability to add a rule for
cleaning up said items. A disadvantage is that it's harder to modify
the flags if changes are needed.
One enhancement to the proposed alternate design is to auto-detect the
existence of the PURIFYOPTIONS and/or PUREOPTIONS environmental
variables, and from the existence deduct that the user wish to perform a
purify enabled build (unless specified otherwise, such as with the
WITHOUT_PURIFY switch).
--Andrew Black
Re: Discussion for STDCXX-573
Posted by Martin Sebor <se...@roguewave.com>.
Travis Vitek wrote:
>
>
> Travis Vitek wrote:
>> [http://issues.apache.org/jira/browse/STDCXX-573]
>>
>> This issue requests that we add purify support to the build system. I'm
>> trying to decide what the best way to go about this is going to be.
>>
>> Andrew provided a patch that uses $PURE_OPTS to enable purify and to
>> provide additional flags. I don't really like adding another environment
>> variable or flag that does the same thing unless it is really necessary.
>> By default, purify will look at $PURIFYOPTIONS and $PUREOPTIONS for
>> additional purify flags.
>>
>> So I'm considering just using a PURIFY flag to indicate that the user
>> wants to link with purify, and then providing a default set of flags. If
>> the user provides PURIFYOPTIONS or PUREOPTIONS, then the defaults will be
>> overridden.
>>
>> That would mean that calling `gmake PURIFY=1' would enable purify with the
>> default options "-windows=no -log-file=\$@.log -view-file=\$@.view". If
>> you want to override that behavior, you would use `gmake PURIFY=1
>> PURIFYFLAGS=<FLAGS>'.
>>
>> Does anyone have any arguments against using this method?
>>
>
> Should I be caching the PURIFYOPTIONS and PUREOPTIONS variables in
> makefile.in?
They're environment variables, aren't they? I don't think we need
or want to cache their values. I assume purify itself will read
them from the environment when it's invoked.
> If yes, then I'm stuck. I think I would want to allow the user
> to invoke make as
>
> gmake WITH_PURIFY=true PURIFYOPTIONS="-log-file=\$@.log -windows=no"
I don't see how this would work in general unless PURIFYOPTIONS
(the make variable) got passed by our GNUmakefile to Purify on
the command line or defined as an environment variable as you
show below.
Is PURIFYOPTIONS the only way to communicate -log-file to Purify?
If it is, it seems that GNUMakefile should append the option to
the variable before executing each target.
>
> or
>
> PURIFYOPTIONS="-log-file=\$@.log -windows=no" gmake WITH_PURIFY=true
This should work in general because this PURIFYOPTIONS is an
environment variable. But I still don't think we should be
expecting the user to specify a pattern like this in their
PURIFYOPTIONS.
>
> The problem is that when writing PURIFYOPTIONS out to the makefile.in [from
> GNUmakefile], the $@ gets expanded or stripped. The closest thing I have to
> something that works is
>
> && echo "WITH_PURIFY = $(WITH_PURIFY)" >> $(MAKEFILE_IN) \
> && echo "PURIFYOPTIONS = `echo $$PURIFYOPTIONS`" >> $(MAKEFILE_IN) \
>
> This works well if PURIFYOPTIONS is from the environment, but not so well if
> it is an argument to make.
Right. That's the same problem as shell quoting. Sooner or later
you'll end up stripping too many layers of quotes or not stripping
enough.
Martin
RE: Discussion for STDCXX-573
Posted by Eric Lemings <Er...@roguewave.com>.
> -----Original Message-----
> From: Travis Vitek [mailto:vitek@roguewave.com]
> Sent: Thursday, January 24, 2008 4:38 PM
> To: dev@stdcxx.apache.org
> Subject: Re: Discussion for STDCXX-573
>
>
>
...
> something that works is
>
> && echo "WITH_PURIFY = $(WITH_PURIFY)" >> $(MAKEFILE_IN) \
> && echo "PURIFYOPTIONS = `echo $$PURIFYOPTIONS`" >> $(MAKEFILE_IN) \
>
> This works well if PURIFYOPTIONS is from the environment, but
> not so well if
> it is an argument to make.
Wouldn't make -e take care of that?
Re: Discussion for STDCXX-573
Posted by Travis Vitek <vi...@roguewave.com>.
Travis Vitek wrote:
>
> [http://issues.apache.org/jira/browse/STDCXX-573]
>
> This issue requests that we add purify support to the build system. I'm
> trying to decide what the best way to go about this is going to be.
>
> Andrew provided a patch that uses $PURE_OPTS to enable purify and to
> provide additional flags. I don't really like adding another environment
> variable or flag that does the same thing unless it is really necessary.
> By default, purify will look at $PURIFYOPTIONS and $PUREOPTIONS for
> additional purify flags.
>
> So I'm considering just using a PURIFY flag to indicate that the user
> wants to link with purify, and then providing a default set of flags. If
> the user provides PURIFYOPTIONS or PUREOPTIONS, then the defaults will be
> overridden.
>
> That would mean that calling `gmake PURIFY=1' would enable purify with the
> default options "-windows=no -log-file=\$@.log -view-file=\$@.view". If
> you want to override that behavior, you would use `gmake PURIFY=1
> PURIFYFLAGS=<FLAGS>'.
>
> Does anyone have any arguments against using this method?
>
Should I be caching the PURIFYOPTIONS and PUREOPTIONS variables in
makefile.in? If yes, then I'm stuck. I think I would want to allow the user
to invoke make as
gmake WITH_PURIFY=true PURIFYOPTIONS="-log-file=\$@.log -windows=no"
or
PURIFYOPTIONS="-log-file=\$@.log -windows=no" gmake WITH_PURIFY=true
The problem is that when writing PURIFYOPTIONS out to the makefile.in [from
GNUmakefile], the $@ gets expanded or stripped. The closest thing I have to
something that works is
&& echo "WITH_PURIFY = $(WITH_PURIFY)" >> $(MAKEFILE_IN) \
&& echo "PURIFYOPTIONS = `echo $$PURIFYOPTIONS`" >> $(MAKEFILE_IN) \
This works well if PURIFYOPTIONS is from the environment, but not so well if
it is an argument to make.
Travis
--
View this message in context: http://www.nabble.com/Discussion-for-STDCXX-573-tp15072366p15077852.html
Sent from the stdcxx-dev mailing list archive at Nabble.com.
Re: Discussion for STDCXX-573
Posted by Martin Sebor <se...@roguewave.com>.
Eric Lemings wrote:
>
>
>> -----Original Message-----
>> From: Travis Vitek [mailto:vitek@roguewave.com]
>> Sent: Thursday, January 24, 2008 12:13 PM
>> To: dev@stdcxx.apache.org
>> Subject: Discussion for STDCXX-573
>>
>>
> ...
>> want to override that behavior, you would use `gmake PURIFY=1
>> PURIFYFLAGS=<FLAGS>'.
I agree with keeping the number of new variables to a minimum.
>>
>> Does anyone have any arguments against using this method?
>
> Suggest using a more descriptive name than PURIFY such as USE_PURIFY,
> ENABLE_PURIFY, WITH_PURIFY, or something like that.
I was thinking the same thing. In light of STDCXX-260, using
the WITH_ prefix for these type of things in general (we also
have Valgrind on Linux and cadvise on HP-UX) might be a good
naming convention to go with. I.e., using the traditional
--with-xxx switch to configure would nicely translate to
defining WITH_PURIFY=1 in the generated $BUILDDIR/makefile.in.
It would be nice if users who configured using --with-purify
could add WITHOUT_PURIFY=1 on the make command like to disable
the tool, just like those who configured without it can simply
add WITH_PURIFY=1 for the opposite effect.
Martin
http://issues.apache.org/jira/browse/STDCXX-260
>
> Brad.
RE: Discussion for STDCXX-573
Posted by Eric Lemings <Er...@roguewave.com>.
> -----Original Message-----
> From: Travis Vitek [mailto:vitek@roguewave.com]
> Sent: Thursday, January 24, 2008 12:13 PM
> To: dev@stdcxx.apache.org
> Subject: Discussion for STDCXX-573
>
>
...
> want to override that behavior, you would use `gmake PURIFY=1
> PURIFYFLAGS=<FLAGS>'.
>
> Does anyone have any arguments against using this method?
Suggest using a more descriptive name than PURIFY such as USE_PURIFY,
ENABLE_PURIFY, WITH_PURIFY, or something like that.
Brad.