Bug 635607 - unexpected ordering change in wildcard expansion in make-3.82
Summary: unexpected ordering change in wildcard expansion in make-3.82
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: make
Version: 14
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Machata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-20 10:22 UTC by Michal Schmidt
Modified: 2015-05-05 01:35 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-09-20 17:52:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michal Schmidt 2010-09-20 10:22:15 UTC
A change in make-3.82 caused a subtle breakage in procps (see bug 632236).

With make-3.82 the link order in procps changed.
See build logs from Koji:

Built with make-3.81:
http://kojipkgs.fedoraproject.org/packages/procps/3.2.8/10.fc14/data/logs/i686/build.log

Built with make-3.82:
http://kojipkgs.fedoraproject.org/packages/procps/3.2.8/11.fc14/data/logs/i686/build.log

Notice for example that the order of proc/version.c and proc/sysinfo.c reversed.
Previously they were in alphabetical order, now they're not.

The NEWS file for make-3.82 says:
* 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.

If I'm reading "up to and including this release" right, the order was NOT supposed to change in this version. But it did.


To reproduce, try a simple Makefile:
SOURCES := $(wildcard *.c)
lib.so: $(SOURCES)
        gcc -shared -o lib.so $(SOURCES)

Then "touch" a few empty *.c files and run make.

Comment 1 Michal Schmidt 2010-09-20 10:30:06 UTC
Oh, I see the documentation has now changed in 3.82-2:

+ * WARNING: Backward-incompatibility!
++  Wildcards were not documented as returning sorted values, but the results
++  have been sorted up until this release..  If your makefiles require sorted
++  results from wildcard expansions, use the $(sort ...)  function to request
++  it explicitly.

So is this NOTABUG now?

Comment 2 Petr Machata 2010-09-20 17:52:44 UTC
Yes, I've brought a couple patches from upstream, and one of them is making the change "official".  This is a feature now.


Note You need to log in before you can comment on or make changes to this bug.