Bug 635607

Summary: unexpected ordering change in wildcard expansion in make-3.82
Product: [Fedora] Fedora Reporter: Michal Schmidt <mschmidt>
Component: makeAssignee: Petr Machata <pmachata>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: mnewsome, pmachata
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-20 17:52:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.