Open fangism opened 3 years ago
This is on linux. Not sure if it looks the same on other platforms.
What would be the expected behaviour from a build system perspective? I would assume queries/reads should follow symlinks but deletes shouldn't, what do you think?
@fangism ping
[Sorry, I've been out for a few weeks.]
From the original comment, this might seem more reasonable:
$ touch foo
$ ln -s foo bar
$ fsatrace erwdtmq /dev/stdout -- rm -f bar
r|/usr/bin/rm
q|/home/fangism/bar
d|/home/fangism/bar
But I haven't dug into the details of how operations on symlinks are traced.
If queries/reads don't follow symlinks that would put a burden on the build system. The one I'm using would certainly need to be modified to take into account this fact.
I propose to report the symlink only when deleting, reporting the linked file elsewhere. Do you have any example of a situation where this would be a problem in a build system?
Using the above rm
example, what would your proposed trace look like?
r|/usr/bin/rm
q|/home/fangism/foo
d|/home/fangism/bar
r|/usr/bin/rm q|/home/fangism/foo d|/home/fangism/bar
This is an improvement, and should let us proceed further.
Removing a symbolic link looks like removing the link's destination (but perhaps should not?).
Demonstration:
Destination
foo
is unaffected.I expected something more like: