-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
incompatible_prohibit_aapt1: Prohibit Bazel usage of aapt1 #10000
Comments
If this flag is active, AAPT2 is the only Android resource packaging tool in use and we prohibit methods of configuring the AAPT tool version. #10000 PiperOrigin-RevId: 274703802
Since the flag was not in 1.0, "migration-1.0" is an inappropriate label. Please follow https://www.bazel.build/breaking-changes-guide.html for introducing breaking changes. |
It's also not in 1.1, is it? |
cc @meisterT |
No - the commit isn't tagged with 1.1. |
@jin asked me to comment here instead of filing a new issue. There's still one action that is using bazel/src/tools/android/java/com/google/devtools/build/android/AndroidResourceValidatorAction.java Line 148 in c018f60
I included a repro project below. Description of the problem / feature request:The source of the problem stemmed building our app which has Jetpack Navigation. Running
Feature requests: what underlying problem are you trying to solve with this feature?Building our internal Android sample app that uses Jetpack Navigation. Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.Repro project: https://github.com/changusmc/android-navigation Full error logs from building my project: worker-1-AndroidResourceValidator.log What operating system are you running Bazel on?MacOSX 10.15.1 What's the output of
|
I was able to work around this by moving |
This is a known issue, we have someone working on extricating aapt1 from AndroidResourceValidatorAction. If I understand correctly, this isn't strictly blocking you from preparing your project for the incompatible change. |
I was able to side step this as mentioned above, but I don't know if it means that this project is ready for the incompatible change. I hope that once the validator action is moved to |
The validator action was running both aapt1 and aapt2. With this commit, if you're using --incompatible_prohibit_aapt1, Bazel should not invoke aapt1. |
Bazel 1.0 [1] enables aapt2 by default, so this attribute doesn't do anything. Bazel 2.0 [2] will prohibit [3] any uses of this attribute. This also means that building with Bazel versions <1.0 would potentially use aapt1, but this might actually be a good thing. TF has a minimum version requirement of 0.19, and many aapt2-related fixes have been made in the 0.2x series. [1] https://blog.bazel.build/2019/10/10/bazel-1.0.html [2] bazelbuild/bazel#10000 [3] https://github.com/bazelbuild/bazel/blob/b3f54f673259604ea526c560d4abd144bd267295/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java#L262 [4] https://github.com/tensorflow/tensorflow/blob/dc73a9889fc1ebedaf150da2a0c1dfed11da3858/WORKSPACE#L92 PiperOrigin-RevId: 281679131 Change-Id: I47818b8b59eeb78a8c439523ce72e388428f2da9
It seems the flag isn't flipped yet, so extending the migration window |
Per #10000, aapt2 is the only Android asset packaging tool in use, and allowing the provider to be null just pushes errors downstream. PiperOrigin-RevId: 284091553
Baseline: 807ed23 Cherry picks: + db0e32c: build.sh: Fix bug in build script for RC release + 85e84f7: Set --incompatible_prohibit_aapt1 default to true. + 84eae2f: Let shellzelisk fallback to bazel-real if it's the requested version. + d5ae460: Fix a typo in bazel.sh Incompatible changes: - --incompatible_remap_main_repo is enabled by default. Therefore, both ways of addressing the main repository, by its name and by '@' are now considered referring to the same repository. see #7130 - --incompatible_disallow_dict_lookup_unhashable_keys is enabled by default #9184 - --incompatible_remove_native_maven_jar is now enabled by default and the flag removed. See #6799 - --incompatible_prohibit_aapt1 is enabled by default. See #10000 Important changes: - --incompatible_proto_output_v2: proto v2 for aquery proto output formats, which reduces the output size compared to v1. Note that the messages' ids in v2 are in uint64 instead of string like in v1. - Adds --incompatible_remove_enabled_toolchain_types. - Package loading now consistently fails if package loading had a glob evaluation that encountered a symlink cycle or symlink infinite expansion. Previously, such package loading with such glob evaluations would fail only in some cases. - The --disk_cache flag can now also be used together with the gRPC remote cache. - An action's discover inputs runtime metrics is now categorized as parse time on the CriticalPathComponent. - Make the formatting example more like to the written text by adding an initial description. - An action's discover inputs runtime metrics is now categorized as parse time on the CriticalPathComponent. - Bazel's Debian package and the binary installer now include an improved wrapper that understands `<WORKSPACE>/.bazelversion` files and the `$USE_BAZEL_VERSION` environment variable. This is similar to what Bazelisk offers (https://github.com/bazelbuild/bazelisk#how-does-bazelisk-know-whi ch-bazel-version-to-run-and-where-to-get-it-from), except that it works offline and integrates with apt-get. - We are planning to deprecate the runfiles manifest files, which aren't safe in the presence of whitespace, and also unnecessarily require local CPU when remote execution is used. This release adds --experimental_skip_runfiles_manifests to disable the generation of the input manifests (rule.manifest files) in most cases. Note that this flag has no effect on Windows by default or if --experimental_enable_runfiles is explicitly set to false. This release contains contributions from many people at Google, as well as aldersondrive, Benjamin Peterson, Bor Kae Hwang, David Ostrovsky, Jakob Buchgraber, Jin, John Millikin, Keith Smiley, Lauri Peltonen, nikola-sh, Peter Mounce, Tony Hsu.
Baseline: 807ed23 Cherry picks: + db0e32c: build.sh: Fix bug in build script for RC release + 85e84f7: Set --incompatible_prohibit_aapt1 default to true. + 84eae2f: Let shellzelisk fallback to bazel-real if it's the requested version. + d5ae460: Fix a typo in bazel.sh Incompatible changes: - --incompatible_remap_main_repo is enabled by default. Therefore, both ways of addressing the main repository, by its name and by '@' are now considered referring to the same repository. see bazelbuild#7130 - --incompatible_disallow_dict_lookup_unhashable_keys is enabled by default bazelbuild#9184 - --incompatible_remove_native_maven_jar is now enabled by default and the flag removed. See bazelbuild#6799 - --incompatible_prohibit_aapt1 is enabled by default. See bazelbuild#10000 Important changes: - --incompatible_proto_output_v2: proto v2 for aquery proto output formats, which reduces the output size compared to v1. Note that the messages' ids in v2 are in uint64 instead of string like in v1. - Adds --incompatible_remove_enabled_toolchain_types. - Package loading now consistently fails if package loading had a glob evaluation that encountered a symlink cycle or symlink infinite expansion. Previously, such package loading with such glob evaluations would fail only in some cases. - The --disk_cache flag can now also be used together with the gRPC remote cache. - An action's discover inputs runtime metrics is now categorized as parse time on the CriticalPathComponent. - Make the formatting example more like to the written text by adding an initial description. - An action's discover inputs runtime metrics is now categorized as parse time on the CriticalPathComponent. - Bazel's Debian package and the binary installer now include an improved wrapper that understands `<WORKSPACE>/.bazelversion` files and the `$USE_BAZEL_VERSION` environment variable. This is similar to what Bazelisk offers (https://github.com/bazelbuild/bazelisk#how-does-bazelisk-know-whi ch-bazel-version-to-run-and-where-to-get-it-from), except that it works offline and integrates with apt-get. - We are planning to deprecate the runfiles manifest files, which aren't safe in the presence of whitespace, and also unnecessarily require local CPU when remote execution is used. This release adds --experimental_skip_runfiles_manifests to disable the generation of the input manifests (rule.manifest files) in most cases. Note that this flag has no effect on Windows by default or if --experimental_enable_runfiles is explicitly set to false. This release contains contributions from many people at Google, as well as aldersondrive, Benjamin Peterson, Bor Kae Hwang, David Ostrovsky, Jakob Buchgraber, Jin, John Millikin, Keith Smiley, Lauri Peltonen, nikola-sh, Peter Mounce, Tony Hsu.
Can you confirm this was released in 2.0? |
Per bazelbuild/bazel#10000, aapt2 is the only Android asset packaging tool in use, and allowing the provider to be null just pushes errors downstream. PiperOrigin-RevId: 284091553
If this flag is active, AAPT2 is the only Android resource packaging tool in use and we prohibit methods of configuring the AAPT tool version. bazelbuild/bazel#10000 PiperOrigin-RevId: 274703802
Tracking issue for the incompatible change to prohibit aapt1.
Bazel now uses aapt2 by default (#6907) meaning aapt support is deprecated.
When this change goes in effect, aapt will no longer be available.
To resolve issues when migrating your app to build with aapt2, see https://developer.android.com/studio/command-line/aapt2#aapt2_changes
The text was updated successfully, but these errors were encountered: