-
Notifications
You must be signed in to change notification settings - Fork 524
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.Tasks] Fix CollectNonEmptyDirectories to handle file collisions. #5038
Conversation
Draft release notes During the finalization of this PR for merging, when you get a chance, you can add a short release note for it to
|
f3ecc7a
to
75dc4da
Compare
…e file collisions. Context Redth/ResizetizerNT#23 The `CollectNonEmptyDirectories` task is responsible for creating a cache file `files.cache`. This file contains a list of all the resource files for that particular directory. We hit a problem when using `ResizetizerNT` and a `google-services.json` file where the `files.cache` for one would be overwritten by the other. This is because of a simple assuption within the Task itself. That if the "directory" was not in the Intermediate `lp` directory (for libraries) then we could just create the `files.cache` file in the parent directory. This woud be the root of the `IntermediateOutputPath`. The problem with `ResizetizerNT` and `google-services.json` is that they are BOTH outside of the `lp` directory. They also only create a directory structure which is one level deep. So `..` will ALWAYS end up in the `IntermediateOutputPath`. The other issue is that they were both using the same file name. #facepalm. The `files.cache` should instead be handled in the same manner as the `stamp` file. In that if the file is NOT in the `lp` directory we should use a unique filename. In this case we can use the same technique and use the directory hash. This way the two directories do not collide with each other.
75dc4da
to
072e415
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BCL test failures are expected: https://discordapp.com/channels/732297728826277939/732297837953679412/746334964462780476
Something broke with the he-IL
calendar's new year.
The one performance test looks OK, I didn't see any regression in the .binlog
: Exceeded expected time of 7250ms, actual 7274.528ms
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release note approved. Thanks for the correction on the error message. In the final collated release notes, I'll plan to adjust the formatting to put the example error message up front and limit the resolution details for compactness. Feel free to comment back if anything looks bad about this adjustment though.
- [GitHub PR 5038](https://github.com/xamarin/xamarin-android/pull/5038):
Errors similar to _error APT2260: resource drawable/icon (aka
com.contoso.androidapp:drawable/icon) not found_ could prevent
building projects that were using ResizetizerNT and
`google-services.json` together.
The build system has now been updated to ensure each resource
directory has its own unique cache file.
…e file collisions. (#5038) Context Redth/ResizetizerNT#23 The `CollectNonEmptyDirectories` task is responsible for creating a cache file `files.cache`. This file contains a list of all the resource files for that particular directory. We hit a problem when using `ResizetizerNT` and a `google-services.json` file where the `files.cache` for one would be overwritten by the other. This is because of a simple assuption within the Task itself. That if the "directory" was not in the Intermediate `lp` directory (for libraries) then we could just create the `files.cache` file in the parent directory. This woud be the root of the `IntermediateOutputPath`. The problem with `ResizetizerNT` and `google-services.json` is that they are BOTH outside of the `lp` directory. They also only create a directory structure which is one level deep. So `..` will ALWAYS end up in the `IntermediateOutputPath`. The other issue is that they were both using the same file name. #facepalm. The `files.cache` should instead be handled in the same manner as the `stamp` file. In that if the file is NOT in the `lp` directory we should use a unique filename. In this case we can use the same technique and use the directory hash. This way the two directories do not collide with each other.
Context Redth/ResizetizerNT#23
The
CollectNonEmptyDirectories
task is responsible forcreating a cache file
files.cache
. This file containsa list of all the resource files for that particular
directory.
We hit a problem when using
ResizetizerNT
and agoogle-services.json
file where thefiles.cache
forone would be overwritten by the other. This is because of
a simple assuption within the Task itself. That if the
"directory" was not in the Intermediate
lp
directory(for libraries) then we could just create the
files.cache
file in the parent directory. This woud be the root of
the
IntermediateOutputPath
.The problem with
ResizetizerNT
andgoogle-services.json
is thatthey are BOTH outside of the
lp
directory. They also only createa directory structure which is one level deep. So
..
will ALWAYSend up in the
IntermediateOutputPath
. The other issue is that theywere both using the same file name. #facepalm.
The
files.cache
should instead be handled in the same manner asthe
stamp
file. In that if the file is NOT in thelp
directorywe should use a unique filename. In this case we can use the same
technique and use the directory hash. This way the two directories
do not collide with each other.