Xamarin-macios: Resources are always considered as 'newer than output'

Created on 12 Apr 2018  路  11Comments  路  Source: xamarin/xamarin-macios

The step for me is to build any ios project with resources. If you then build it a second time it complains that the input file is newer than the output file for all resources, so we copy them all instead of doing a no-op.

I uploaded a 200mb log file here: https://xamarinhq.slack.com/files/U03CFBR1A/FA4T824L8/output

My repro project was the ios designer's MTDesigner.sln. In this project the issue shows up everywhewre, but you can look for FillTexture.png as one example when searching the logs

bug iOS need-info

Most helpful comment

that looks like it would be the cause of the issue:

csharp> new System.IO.FileInfo ("hello").LastWriteTimeUtc.Ticks
636592027029502131
csharp> System.IO.File.Copy ("hello", "hello_copy")
csharp> new System.IO.FileInfo ("hello_copy").LastWriteTimeUtc.Ticks
636592027020000000

gonna look into it

All 11 comments

Running stat from a terminal:

stat -f "%m %N" bin/NoDist/Tests/MonoTouchDesignerServerTests.app/FillTexture.png  tests/MonoTouch.Designer.Server.Tests/obj-monotouch/FillTexture.png
1523528229 tests/MonoTouch.Designer.Server.Tests/obj-monotouch/FillTexture.png
1523528229 bin/NoDist/Tests/MonoTouchDesignerServerTests.app/FillTexture.png

Checking it via C#

csharp> new System.IO.FileInfo ("tests/MonoTouch.Designer.Server.Tests/obj-monotouch/FillTexture.png").LastWriteTimeUtc.Ticks
636591250290764649

csharp> new System.IO.FileInfo ("bin/NoDist/Tests/MonoTouchDesignerServerTests.app/FillTexture.png").LastWriteTimeUtc.Ticks
636591250290000000

As you can see the output is older than the input.

mono --version
Mono JIT compiler version 5.14.0.12 (2018-04/7af9ad8cdb6 Fri Apr  6 10:50:49 EDT 2018)

on MacOS 10.13.4

I think this is related to https://github.com/xamarin/xamarin-macios/issues/3584. In fact, it also triggers rebuilds of dependent projects, which could end up being quite costly.

Also, there was another issue for Mono cutting the resolution of file times. I thought it was already resolved in 2018-04 though. https://github.com/mono/mono/issues/7646

I'm pretty sure @filipnavara nailed it with the mono issue since the numbers above shows the value is truncated.

@lewurm do you know if the version that @alanmcgovern mentioned above (5.14.0.12) has the fix (or not) ?

5.14.0.12 contains the fix, and I agree, the symptoms look the same.

@alanmcgovern do you know _how_ bin/NoDist/Tests/MonoTouchDesignerServerTests.app/FillTexture.png is copied? potentially MONO_LOG_LEVEL=debug MONO_LOG_MASK="io-layer-file" could help to track it down.

It鈥檚 copied with File.Copy if that鈥檚 any use. I can dig in more if you need more than that

that looks like it would be the cause of the issue:

csharp> new System.IO.FileInfo ("hello").LastWriteTimeUtc.Ticks
636592027029502131
csharp> System.IO.File.Copy ("hello", "hello_copy")
csharp> new System.IO.FileInfo ("hello_copy").LastWriteTimeUtc.Ticks
636592027020000000

gonna look into it

Using Mono JIT compiler version 5.14.0.40 (2018-04/d835b7d55f0 Sun Apr 15 14:05:04 EDT 2018) the issue is still there:

csharp> new System.IO.FileInfo ("obj/Debug/build.props").LastWriteTimeUtc.Ticks
636596459657450000
csharp> new System.IO.FileInfo ("obj/Debug/resourcepaths.cache").LastWriteTimeUtc.Ticks
636596454888160000
stat -f "%m %N" obj/Debug/build.props obj/Debug/resourcepaths.cache                                                           
1524048315 obj/Debug/build.props
1524048316 obj/Debug/resourcepaths.cache

follow-up fix potentially fixes the issue Alan is seeing https://github.com/mono/mono/pull/8293

we are waiting for the package so he can test it

This latest patch seems to have fixed the issues we were seeing!

LGTM!

Thanks!

Was this page helpful?
0 / 5 - 0 ratings