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

Defining android_ndk_repository() will prevent non-Android targets from building if ANDROID_NDK_HOME is unset #14893

Closed
oakad opened this issue Feb 23, 2022 · 1 comment

Comments

@oakad
Copy link

oakad commented Feb 23, 2022

Seems like #2722 is somehow back in bazel v5.0.0.
Was not happening for me on bazel v4.x.x.

In a macro file included from my WORKSPACE I have the following defines (without loss of generality):

native.android_sdk_repository(
    name = "androidsdk",
    api_level = 28,
    build_tools_version = "30.0.3",
)

native.android_ndk_repository(
    name = "androidndk",
    api_level = 29,
)

No special flags on the command line (no extra_toolchains, crosstool_top, cpu or such).

And yet, the outcome is build failing:

bazel build -s my-target
ERROR:WORKSPACE:37:8: fetching android_ndk_repository rule //external:androidndk: Either the path attribute of android_ndk_repository or the ANDROID_NDK_HOME environment variable must be set.
ERROR: Analysis of target '//my-target' failed; build aborted: Either the path attribute of android_ndk_repository or the ANDROID_NDK_HOME environment variable must be set.
INFO: Elapsed time: 0.081s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf
igured)
Fetching @go_sdk; fetching
Fetching @local_jdk; Restarting.

@Wyverald
Copy link
Member

dupe of bazelbuild/rules_android_ndk#92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants