bugmake - Bugs: bug #14617, wildcard function produces...

 
 

bug #14617: wildcard function produces incorrect results because of cache

Submitter:  Matthew Carter <mcarter>
Submitted:  Thu 22 Sep 2005 03:57:23 PM UTC
Votes: 1
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.80 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 13 Jun 2009 08:04:56 PM UTC, comment #4: 

Closed as a duplicate of bug #443

Paul D. Smith <psmith>
Group administrator
Wed 23 Apr 2008 06:57:20 PM UTC, comment #3: 

It looks like the problem is still present. Tested on Ubuntu Gutsy.

AZ <alfonsname>
Fri 07 Jul 2006 02:40:46 AM UTC, comment #2: 

An additional option beyond what I mentioned is to address the "problem" at the point it occurs, in $(wildcard):

Either an optional param to $(wildcard --ignorecache ...), or
an alternate named function for the same: $(wildcard-nocache ...).

Larry West <larrywest42>
Fri 07 Jul 2006 02:34:31 AM UTC, comment #1: 

I'm seeing the same problem, I believe, on RHEL 4 with Make 3.80.  In my case, I'm testing for a (target-like) directory with $(wildcard $(DIR)), then creating the directory.  In my real Makefile, a later sanity test with $(if $(wildcard $(DIR)) then aborts, even though the directory does indeed exist.

I see the need for cacheing to minimize the time spent calling stat(2), as mentioned in bug #443, but I think there should be some mechanism to invalidate the cache.

The easiest would be to invalidate the cache when a shell command is invoked.  Possibly make this an attribute for some target trees via a phony target like .PRECIOUS:

.INVALIDATE_CACHE_WHEN_SHELLING:  targ1 targ2

.INVALIDATE_CACHE_WHEN_SHELLING:  # no dependencies = "always"

Of course a less stupid name would be preferable.

Or an explicit function: $(invalidate_cache), possibly accepting a list of filenames: $(invalidate_cache file1 file2) if it's not too much work.

Anyway, I'm uploading an example Makefile that demonstrates the problem, and the output from "make -d -p".

Larry West <larrywest42>
Thu 22 Sep 2005 03:57:23 PM UTC, original submission:  

This issue is similar to bug #443, but is different in that it does not use multiple invocations of the $(wildcard) function.

Reproduced on Linux Fedora Core 3 and on cygwin.

Symptoms:
Running "make" with the attached Makefile shows a contradiction:  The "$(shell ls ${file})" command demonstrates that $file exists, yet the subsequent "$(wildcard ${file})" command indicates that it does not.

A subsequent run of "make", after $file has been created, does not reproduce the problem.  This indicates to me that the problem results from $(wildcard) using a directory cache.

The implicit rule at the bottom of Makefile seems to be necessary to reproduce the problem, even though the implicit rule is overridden by the explicit rule and is, therefore, never invoked.

Matthew Carter <mcarter>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #10317:  wildcard-cache.tgz added by larrywest42 (5KiB - application/octet-stream - tgz w/ Makefile & output illustrating $(wildcard) cacheing problem)
file #3093:  Makefile added by mcarter (278B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by alfonsname (Posted a comment)
  •  

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-06-13 psmith StatusNone Duplicate
        Open/ClosedOpen Closed
    2006-07-07 larrywest42 Attached File- Added wildcard-cache.tgz, #10317
        Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added larrywest42
    2005-09-22 mcarter Attached File- Added Makefile, #2986

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code