Re: GNU make 3.82 is now available

2010-07-28 Thread Paul Smith
On Wed, 2010-07-28 at 07:31 -0600, Eric Blake wrote:
> It's not obvious from this announcement (and I haven't been following
> the make lists) whether you are aware: The POSIX 2008 wording has a bug.
>  The intent of the Austin Group is that -e must NOT be provided if some
> other mechanism ignores errors for a particular shell invocation (such
> as starting a command with - or invoking 'make -i'):
>  http://austingroupbugs.net/view.php?id=257

Gak.  No, I wasn't aware of that.  I'll sign up for an account there.

However, is this really how other versions of make do things?  That
seems just... insane and ridiculous to me.

If your makefile is written to expect that it's invoked with -e, then
allowing the user to turn that off simply by passing -i on the make
command line seems incredibly dangerous!

Suppose you have a makefile like this:

PREFIX = /foo

clean: ; [ "$(PREFIX)" != "" ]; rm -rf $(PREFIX)/*

You are relying on the behavior of -e to cause the rule to exit when the
condition is not met, so that you don't wipe out your entire root
partition.

Now someone comes along and runs "make -i", and voila!  Instant
devastation.

Yes, of course this is a contrived example but it's not hard to imagine
perfectly legitimate situations where this would be bad.  In the new
POSIX model where -e is expected, you have to anticipate that makefile
recipes will be written to make use of that fact (otherwise why bother?)
and simply turning off that flag on the command line seems really
horrible.

I can see it could be useful when starting a command with "-"; in that
case the person actually writing the command made a conscious decision
that they wanted to disable -e when they wrote the recipe.


It's bad enough that the standard reversed it's previous, very clear
language in such a way that every implementation which has previously
been conforming to the standard was no longer conforming, but to require
such (IMO) non-sensical features is a disservice.  Is the only function
of the standard to codify existing behavior (of some subset of
implementations--no one seems to have been concerned about the existing
behavior of GNU make, arguably the most widely used make implementation)
without any judgement as to whether it is a good idea?

-- 
---
 Paul D. Smith   Find some GNU make tips at:
 http://www.gnu.org  http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: GNU make 3.82 is now available

2010-07-28 Thread Eric Blake
On 07/28/2010 12:50 AM, Paul Smith wrote:
> * WARNING: Backward-incompatibility!
>   The POSIX standard for make was changed in the 2008 version in a
>   fundamentally incompatible way: make is required to invoke the shell as if
>   the '-e' flag were provided.  Because this would break many makefiles that
>   have been written to conform to the original text of the standard, the
>   default behavior of GNU make remains to invoke the shell with simply '-c'.
>   However, any makefile specifying the .POSIX special target will follow the
>   new POSIX standard and pass '-e' to the shell.  See also .SHELLFLAGS
>   below.

It's not obvious from this announcement (and I haven't been following
the make lists) whether you are aware: The POSIX 2008 wording has a bug.
 The intent of the Austin Group is that -e must NOT be provided if some
other mechanism ignores errors for a particular shell invocation (such
as starting a command with - or invoking 'make -i'):
 http://austingroupbugs.net/view.php?id=257

> 
> * New special variable: .SHELLFLAGS allows you to change the options passed
>   to the shell when it invokes recipes.  By default the value will be "-c"
>   (or "-ec" if .POSIX is set).

Given that recent POSIX ruling, I'm not sure what impact it should have
on .SHELLFLAGS.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


GNU make 3.82 is now available

2010-07-27 Thread Paul Smith

GNU make is a tool which controls the generation of executables and
other non-source files of a program from the program's source files.

You can learn more at: http://www.gnu.org/software/make/


The next stable release of GNU make, 3.82, is available now for download:

1a11100f3c63fcf5753818e59d63088f  make-3.82.tar.bz2
7f7c000e3b30c6840f2e9cf86b254fac  make-3.82.tar.gz

You can obtain a copy from:   http://ftp.gnu.org/gnu/make/
You can choose a nearby mirror:   http://ftpmirror.gnu.org/make/
A list of mirror sites is available:  http://www.gnu.org/order/ftp.html




A complete list of bugs fixed in this version is available here:

http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom

* Compiling GNU make now requires a conforming ISO C 1989 compiler and
  standard runtime library.

* WARNING: Future backward-incompatibility!
  Wildcards are not documented as returning sorted values, but up to and
  including this release the results have been sorted and some makefiles are
  apparently depending on that.  In the next release of GNU make, for
  performance reasons, we may remove that sorting.  If your makefiles
  require sorted results from wildcard expansions, use the $(sort ...)
  function to request it explicitly.

* WARNING: Backward-incompatibility!
  The POSIX standard for make was changed in the 2008 version in a
  fundamentally incompatible way: make is required to invoke the shell as if
  the '-e' flag were provided.  Because this would break many makefiles that
  have been written to conform to the original text of the standard, the
  default behavior of GNU make remains to invoke the shell with simply '-c'.
  However, any makefile specifying the .POSIX special target will follow the
  new POSIX standard and pass '-e' to the shell.  See also .SHELLFLAGS
  below.

* WARNING: Backward-incompatibility!
  The '$?' variable now contains all prerequisites that caused the target to
  be considered out of date, even if they do not exist (previously only
  existing targets were provided in $?).

* WARNING: Backward-incompatibility!
  As a result of parser enhancements, three backward-compatibility issues
  exist: first, a prerequisite containing an "=" cannot be escaped with a
  backslash any longer.  You must create a variable containing an "=" and
  use that variable in the prerequisite.  Second, variable names can no
  longer contain whitespace, unless you put the whitespace in a variable and
  use the variable.  Third, in previous versions of make it was sometimes
  not flagged as an error for explicit and pattern targets to appear in the
  same rule.  Now this is always reported as an error.

* WARNING: Backward-incompatibility!
  The pattern-specific variables and pattern rules are now applied in the
  shortest stem first order instead of the definition order (variables
  and rules with the same stem length are still applied in the definition
  order). This produces the usually-desired behavior where more specific
  patterns are preferred. To detect this feature search for 'shortest-stem'
  in the .FEATURES special variable.

* WARNING: Backward-incompatibility!
  The library search behavior has changed to be compatible with the standard
  linker behavior. Prior to this version for prerequisites specified using
  the -lfoo syntax make first searched for libfoo.so in the current
  directory, vpath directories, and system directories. If that didn't yield
  a match, make then searched for libfoo.a in these directories. Starting
  with this version make searches first for libfoo.so and then for libfoo.a
  in each of these directories in order.

* New command line option: --eval=STRING causes STRING to be evaluated as
  makefile syntax (akin to using the $(eval ...) function).  The evaluation
  is performed after all default rules and variables are defined, but before
  any makefiles are read.

* New special variable: .RECIPEPREFIX allows you to reset the recipe
  introduction character from the default (TAB) to something else.  The
  first character of this variable value is the new recipe introduction
  character.  If the variable is set to the empty string, TAB is used again.
  It can be set and reset at will; recipes will use the value active when
  they were first parsed.  To detect this feature check the value of
  $(.RECIPEPREFIX).

* New special variable: .SHELLFLAGS allows you to change the options passed
  to the shell when it invokes recipes.  By default the value will be "-c"
  (or "-ec" if .POSIX is set).

* New special target: .ONESHELL instructs make to invoke a single instance
  of the shell and provide it with the entire recipe, regardless of how many
  lines it contains.  As a special feature to allow more