forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] <CopyIfChanged/> uses last write time (d…
…otnet#1968) Fixes: dotnet#1962 Since 0adf1ae, I believe that resource changes on macOS have been flaky: sometimes working, sometimes not. They have been consistently working on Windows, however... After writing the simplest test I could, I found that my machine on High Sierra could *sometimes* reproduce what our QA team was seeing. I had to add the `[Repeat]` NUnit attribute before I could get the failure to occur regularly. After debugging for quite some time, I noticed a mistake in the `<CopyIfChanged/>` task: when comparing timestamps, it looks like it is using the last *access* time of the destination file instead of the last *write* time! I think this is likely a typo (unintended), since switching the call to `File.GetLastWriteTimeUtc()` fixes the problem. Keeping the test is a good idea, because it seems a bit scary we didn't catch this yet. With that discovery, we audited the rest of the codebase and found that we were using `File.GetLastAccessTimeUtc()` in several places. We have deemed these *all* to be accidental, and have replaced all occurrences of `File.GetLastAccessTimeUtc()` with `File.GetLastWriteTimeUtc()`.
- Loading branch information
1 parent
577c600
commit b4abdd9
Showing
4 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters