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

Windows: Android tools should use the prebuilt windows_jni.dll from embedded tools #3832

Open
laszlocsomor opened this Issue Sep 28, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@laszlocsomor
Copy link
Contributor

laszlocsomor commented Sep 28, 2017

"//src:windows_msvc": ["//src/main/native/windows:windows_jni.dll"],

Since the Android tools themselves are embedded binaries, and users will most likely not have Bazel's repo checked out when building Android rules, the tools should not depend on targets in Bazel's own repo.

@aj-michael

This comment has been minimized.

Copy link
Contributor

aj-michael commented Sep 28, 2017

Can we bundle the windows_jni.dll inside the busybox deploy jar that we embed in bazel? e.g. put it in here:

java_library(
name = "android_builder_lib",
srcs = glob([
"*.java",
"xml/*.java",
"aapt2/*.java",
]),
deps = [
"//src/main/java/com/google/devtools/common/options",
"//src/tools/android/java/com/google/devtools/build/android/junctions",
"//src/tools/android/java/com/google/devtools/build/android/proto:serialize_format_java_pb",
"//src/tools/android/java/com/google/devtools/build/android/resources",
"//third_party:android_common_25_0_0",
"//third_party:asm",
"//third_party:guava",
"//third_party:jsr305",
"//third_party/java/android_databinding:exec",
"//third_party/java/aosp_gradle_core",
"//third_party/protobuf:protobuf_java",
],
)

@laszlocsomor

This comment has been minimized.

Copy link
Contributor

laszlocsomor commented Sep 28, 2017

I don't see how we could.

If we added it as a resource, then the BusyBox would need to unpack it at runtime, and delete it after it's done running to avoid polluting the disk.

If we added it as a data-dependency, then it wouldn't be added to the runfiles of @src/tools/android/java/com/google/devtools/build/android:ResourceProcessorBusyBox.

@aj-michael

This comment has been minimized.

Copy link
Contributor

aj-michael commented Sep 28, 2017

Hmm, I was thinking that deploy jars worked with runfiles somehow, although now that I think about it, I don't know how it would work. For posterity, I was assuming something like this:

# BUILD
java_binary(
    name = "foo",
    data = ["foo_data"],
)
java_import(
    name = "foo_import",
    jars = [":foo_deploy.jar"],
)
java_binary(
    name = "bar",
    runtime_deps = [":foo_import"],
)

but I tried it, and bar does not have access to foo_data

@laszlocsomor

This comment has been minimized.

Copy link
Contributor

laszlocsomor commented Sep 28, 2017

Yes, I remember having tried the same and reaching the same conclusion.

@laszlocsomor

This comment has been minimized.

Copy link
Contributor

laszlocsomor commented May 16, 2018

Update: I haven't done anything for this bug and likely won't do anything before end of Q2'18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment