Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tests] Fix Repeat Build Tests #2582

Merged
merged 1 commit into from
Jan 3, 2019

Conversation

dellis1972
Copy link
Contributor

PR #2515 highlighted an issue with a few of our
repeat build tests. Tests were failing because
the _Sign target was being skipped. Looking
at the build logs, BuildApk was being called.
As was _CreateBaseApk, so what is going on?

So it turns out that in BuildApk we use the
CopyZipIfChanged method to move the temp
zip file over to the actual one. In this case
... the zip was identical! So the "new" zip
was not copied.. and so the _Sign task did
not need to run.

How can the zip be the same? It had an updated
file? Well wrong.. we just touched the timestamp.
In which case the zip ends up with the exact same
CRC values for each file. We use the CRC to detect
changes.. so no changes. So it turns out our build
system was behaving as expected.. it was just our
test was invalid.

So the fix here is to update the tests to make sure we
do change a file. This means the CRC's will change and
the targets will run.

PR dotnet#2515 highlighted an issue with a few of our
repeat build tests. Tests were failing because
the `_Sign` target was being skipped. Looking
at the build logs, `BuildApk` was being called.
As was `_CreateBaseApk`, so what is going on?

So it turns out that in `BuildApk` we use the
`CopyZipIfChanged` method to move the temp
zip file over to the actual one. In this case
... the zip was identical! So the "new" zip
was not copied.. and so the `_Sign` task did
not need to run.

How can the zip be the same? It had an updated
file? Well wrong.. we just touched the timestamp.
In which case the zip ends up with the exact same
CRC values for each file. We use the CRC to detect
changes.. so no changes. So it turns out our build
system was behaving as expected.. it was just our
test was invalid.

So the fix here is to update the tests to make sure we
do change a file. This means the CRC's will change and
the targets will run.
@jonpryor jonpryor merged commit 324e615 into dotnet:master Jan 3, 2019
dellis1972 added a commit that referenced this pull request Jan 22, 2019
PR #2515 highlighted an issue with a few of our repeat build tests.
Tests were failing because the `_Sign` target was being skipped.
Looking at the build logs, the `BuildApk` target was being called,
as was the `_CreateBaseApk` target, so what is going on?

It turns out that in the `<BuildApk/>` task we use the
`MonoAndroidHelper.CopyIfZipChanged()` method to move the temp zip
file over to the actual one.  In this case, the zip was identical!
Thus the "new" zip was not copied, and the `_Sign` target did not
need to run.

How can the zip be the same?  Didn't it have an updated file?
Not quite; we just touched the timestamp.  In this case the zip ends
up with the exact same CRC values for each file.  We use the CRC to
detect changes, so no changes were detected.  It turns out our build
system was behaving as expected, it was just our test was invalid.

The fix here is to update the tests to make sure we do change a file.
This means the CRC's will change and the targets will run.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants