Artifact timestamps are not preserved and cause inefficient incremental build

We use multiple dependent builds that are connected by Artifacts and Snapshot dependencies. Teamcity is smart in that it doesn't build a dependency if no files are changed for that dependency. But then it copies the artifacts to the build that needs them and changes the artifact timestamps to the copy time.

This causes the second project that needs those artifacts to treat them as newer than the current build and this causes a rebuild for all projects that depend on these artifacts, even though they haven't changed. While this isn't a problem for full clean builds, it is a problem for incremental builds.

To me this feels like a bug, unchanged artifacts do not need to get a new timestamp when re-used again in another build. We are currently working around this issue by using the ability to pack the artifacts in a zip file. The zip file itself gets a new timestamp but the timestamps of the files inside it are preserved.

Is this a bug that I should report or is there a good reason for this behavior?

3 comments

Tim,

Not sure I fully understand the case, please clarify:

Do you refer to:
A. When artifact file is downloaded via artifact dependency and there already exist one on disk which is the same by content, do not update the file timestamp.
or
B. Builds with no changes which use artifact dependency are rebuilt by the make tool because the artifact timesteamp changes.

Case A can probably be filed into the tracker.

For the case B it seems that it should rather be configured to eliminate build tiggering at all then ensuring the files have specific timestamps and no recompilation is occurring.

TeamCity snapshot dependencies should help in eliminating excessive build triggering.

0

Yegor,

I meant case A. The downloaded dependencies are not different from what was downloaded the previous time but due to the fact that they get a new timestamp they cause all dependend objects to rebuild even if there is no reason for it.

Let me know if you want me to file it. There is a workaround (using zip) but it would be more intuative if the workaround wasn't needed.

0

Tim,

I filed it as TW-14453. Please watch the issue to be notified on changes or participate in further discussion.

0

Please sign in to leave a comment.