bazelbuild / bazelbuild/rules_android_ndk

5.0rc1: `android_ndk_repository` is fetched eagerly

Open
#92 28 comments 0 reactions 1 assignee Claimed by @Wyverald View on GitHub
P2
Dominant language
Starlark
Stars
43
Forks
32
PR merge metrics
No merged PRs in 30d

Description

### Description of the problem / feature request:

In bazel 5.0rc1 `android_ndk_repository` is fetched even if nothing depends on it. In 4.2.1, this wasn't the case.

### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Add `android_ndk_repository(name = "androidndk", api_level = 29)` to `WORKSPACE`, don't have the `ANDROID_NDK_HOME` environment variable set. Build anything, and get this error:

```
ERROR: /Users/brentleyjones/Developer/Lyft/eager_repo_fetching_bug/WORKSPACE:19:23: 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.
INFO: Repository remote_coverage_tools instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:3:13: in
Repository rule http_archive defined at:
/private/var/tmp/_bazel_brentleyjones/256d770c92848b1788719fcd229cde09/external/bazel_tools/tools/build_defs/repo/http.bzl:364:31: in
ERROR: Analysis of target '//:test' failed; build aborted: Either the path attribute of android_ndk_repository or the ANDROID_NDK_HOME environment variable must be set.
```

In 4.2.1 this error wouldn't happen.

### What operating system are you running Bazel on?

macOS 11.6.1

### What's the output of `bazel info release`?

release 5.0.0rc1

### Have you found anything relevant by searching the web?

No.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.