bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Simpler example of pathological behavior of directory caching


From: Martin Dorey
Subject: RE: Simpler example of pathological behavior of directory caching
Date: Thu, 6 Oct 2016 19:01:43 +0000

I can reproduce it too:

 

address@hidden:~/playpen/kyle-rose$ rm -f target*; ~/download/make-git/make

touch target1

touch target2

touch target3

touch target4

touch target5

touch target6

touch target7

touch target8

touch target9

touch target10

glob:

address@hidden:~/playpen/kyle-rose$ make --version

GNU Make 4.2.1

Built for x86_64-pc-linux-gnu

Copyright (C) 1988-2016 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

address@hidden:~/playpen/kyle-rose$

 

That was built from git a few seconds ago.

 

address@hidden:~/playpen/kyle-rose$ uname -a

Linux swiftboat 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux

address@hidden:~/playpen/kyle-rose$

 

Local ext4 storage.

 

I was surprised.  I thought I'd deduced from its behavior that make updated the cache for the targets it thinks it's created as it creates them, thus circumventing the OP's oddly peremptory insistence that you check the directory mtime.  (Perhaps there was some history that explains the tone but, although the Subject looks like it was a follow-up, the mail doesn't seem to be a reply to anything I remember or that I've been able to find.)  I had wondered if I'd misunderstood when the $(wildcard) is evaluated, but $(error) there goes off when the recipe is executed, not when it's parsed.

 

From: Bug-make [mailto:bug-make-bounces+address@hidden On Behalf Of Kyle Rose
Sent: Thursday, October 06, 2016 11:47
To: address@hidden
Cc: address@hidden
Subject: Re: Simpler example of pathological behavior of directory caching

 

On Thu, Oct 6, 2016 at 11:38 AM, Paul Smith <address@hidden> wrote:

You should include the version of GNU make that you're using; my
version works as expected:

$ make --version
GNU Make 4.2.1

 

Funny you should mention that:

$ make --version
GNU Make 4.2.1
Built for i686-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ make
touch target1
touch target2
touch target3
touch target4
touch target5
touch target6
touch target7
touch target8
touch target9
touch target10
glob:
$ make
glob: target10 target3 target8 target7 target6 target5 target1 target2 target9 target4

4.2.1 definitely broken, at least on my system.


>> Why not refresh the cache when the directory's mtime has changed?


Because not all systems have the same rules for directory mtime as
POSIX does, so that's not a reliable/portable indicator.

 

What does POSIX have to say about returning the wrong value for $(wildcard ...)?

 

There's no question the caching needs to be improved.

 

Consistency may be desirable in general, but correctness in my environments (mainly Linux and OS X) is more desirable for me. Given the various ifdefs around Windows, for instance, there's already no guarantee of consistency of behavior across OSes, so I'm not really convinced by that argument.

In any event, the existing behavior is a flat-out defect and should be corrected.

 

Kyle


reply via email to

[Prev in Thread] Current Thread [Next in Thread]