-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Make AndroidTests pass with incompatible_disallow_empty_glob #15374
Conversation
So were each of these globs actually failing with |
How I came up with these globs and not others? Once these 3 are merged, the flag still cannot be flipped because of protocolbuffers/upb#584 |
So adding Is there someone on the bazel team who you're working with to drive this effort? At minimum it would be good to create a separate issue to attach as a TODO to each glob that has |
No, who would be the right person?
The problem is not with the example but when running the test //src/test/java/com/google/devtools/build/lib/bazel/rules/android:AndroidTests
If you prefer I can do that |
One of the reasons why is not possible to flip incompatible_disallow_empty_glob is because AndroidTests are failing //src/test/java/com/google/devtools/build/lib/bazel/rules/android:AndroidTests This commit add allow_empty = True to reflect the default behavior and make the tests pass.
@ahumesky I've updated the changes to include only the changes strictly needed for AndroidTests. If you think that this is not ok then probably the tests should be adapted instead. |
@@ -186,7 +186,7 @@ public void setupMockClient(MockToolsConfig config, List<String> workspaceConten | |||
"java_host_runtime_alias(name = 'current_host_java_runtime')", | |||
"filegroup(name='langtools', srcs=['jdk/lib/tools.jar'])", | |||
"filegroup(name='bootclasspath', srcs=['jdk/jre/lib/rt.jar'])", | |||
"filegroup(name='extdir', srcs=glob(['jdk/jre/lib/ext/*']))", |
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.
Just one comment about this. It does not look like android specific but it is needed also to make the android tests work. Maybe someone else apart from the android team should look at it.
Gentle reminder |
@@ -1,6 +1,6 @@ | |||
cc_library( | |||
name = "cpufeatures", | |||
srcs = glob(["ndk/sources/android/cpufeatures/*.c"]), | |||
hdrs = glob(["ndk/sources/android/cpufeatures/*.h"]), | |||
srcs = glob(["ndk/sources/android/cpufeatures/*.c"], allow_empty = True), |
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.
It doesn't make sense to me that these could ever result in failed globs in real life, but maybe they do in our tests.
OTOH, I don't think it is a problem that we hide the glob failure. We will simply push the error from glob time until link time, but the build will still fail, so all is good.
The same question applies everywhere.
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.
LGTM, but I'm no nothing about these rules.
It also seems strange to me that any of these globs would return empty. I would expect downstream failures if various NDK features are missing source files. I'm OK with pushing this in upstream, but we should all be aware that something else entirely may be broken that's causing the source files not to show up. |
There are several globs that are empty and this prevents building with the incompatible flag bazelbuild#8195. This commit just makes it explicit that empty is allowed. Closes bazelbuild#15374. PiperOrigin-RevId: 477730831 Change-Id: I7063906f8eca5db4653fb126f4b781dec2c035cd
There are several globs that are empty and this prevents building
with the incompatible flag #8195.
This commit just makes it explicit that empty is allowed.