tl;dr: I want to know what cargo uses to determine whether or not a file has changed to debug a problem I've observed in my build system setup.
Description
I currently have lsyncd setup to mirror project files onto a remote linux machine where I compile code via ENVVARS_HERE=$my_values cargo build. lsyncd's use of rsync w/ the archive flag unfortunately seems to not copy over whatever attribute it is that cargo uses to determine whether or not a file has been edited:
I have a workspace set up:
workspace
+ crateA
+ ...
+ crateB
+ ...
where crateB depends on crateA. Henceforth, 'remote machine' refers to the machine on which cargo is invoked, and 'local machine' refers to a machine editing the code that lsyncd then passes onto the 'remote machine'. I will use 'recently' to refer to any time during which the dependencies of the action being described have not been changed relative to the state being described in a manner I am aware of.
Situation A
Initial state:
- workspace has been copied from the local machine to the remote machine
lsyncdis not running on the local machinecrateBhas been compiled recently bycargo buildon the remote machine
Perform:
- edit source file in
crateBon the remote machine - invoke
cargo buildon the remote machine
Result:
crateBis recompiled bycargoon the remote machine
Situation B
Initial state:
- workspace has been copied from the local machine to the remote machine
lsyncdis running on the local machine (see notes below regarding configuration)crateBhas been compiled recently bycargo buildon the remote machine (see notes regarding timing relative tolsyncd's operation modes)
Perform:
- edit
crateBfile on local machine - wait for synchronization to trigger and complete
- invoke
cargo buildon remote machine
Result:
crateAcompiles on the remote machine, followed bycrateB
Notes
lsyncdwas run both with and withoutarchive = true(which to the best of my knowledge sets rsync'sarchiveflag to copy 'most' metadata, where 'most' appears to miss whatever it is thatcargocares about), with no observed change in the results.- compilation for initial state where
lsyncdwas present was tested for the following cases with no observed changes in the results: compilation beforelsyncd's initial pass, and compilation afterlsyncd's initial pass - the target directory for
lsyncdon the remote machine is on atmpfsfilesystem (if that makes some arcane difference)
Question
I want a way to suss out what's going on here, both in this situation with lsyncd and in the future if/when I give up on lsyncd for some other approach that stumbles on a similar problem. Sources regarding cargo on e.g. SO reference the use of timestamps, but there are many kinds of timestamps and which timestamp they refer to is unclear.
What exactly does cargo check for when determining whether or not a file has changed?