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

Update android_sdk_repository to create a valid, but useless, repository #12070

Closed
wants to merge 1 commit into from

Conversation

katre
Copy link
Member

@katre katre commented Sep 9, 2020

if the SDK doesn't actually exist.

This allows non-Android builds to proceed but will fail building android
code.

Fixes #12069.

if the SDK doesn't actually exist.

This allows non-Android builds to proceed but will fail building android
code.

Fixes bazelbuild#12069.
@katre katre requested a review from jin September 9, 2020 19:02
@katre katre requested a review from ahumesky as a code owner September 9, 2020 19:02
Copy link
Member

@jin jin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

@bazel-io bazel-io closed this in 144d514 Sep 10, 2020
@katre katre deleted the i12069-missing-android-sdk branch September 10, 2020 00:24
laurentlb pushed a commit that referenced this pull request Oct 1, 2020
if the SDK doesn't actually exist.

This allows non-Android builds to proceed but will fail building android
code.

Fixes #12069.

Closes #12070.
RELNOTES: Non-android targets can again be built when android_sdk_repository is present but invalid.
PiperOrigin-RevId: 330832321
laurentlb pushed a commit that referenced this pull request Oct 2, 2020
if the SDK doesn't actually exist.

This allows non-Android builds to proceed but will fail building android
code.

Fixes #12069.

Closes #12070.
RELNOTES: Non-android targets can again be built when android_sdk_repository is present but invalid.
PiperOrigin-RevId: 330832321
nkoroste pushed a commit to nkoroste/bazel that referenced this pull request Feb 23, 2021
**Background**
In order to use Bazel to build for Hermosa, we need to be able to compile for arm64 architecture. This requires the repository rule `android_ndk_repository` to be included in the WORKSPACE. However, including this rule for all Android developers will require the Android NDK to be installed, even if it is not being used to compile for different architectures. This PR is very similar to the one already in Bazel that adds support for non-Android builds that have `android_sdk_repository` in their WORKSPACE. bazelbuild#12070 The changes here will allow for `android_ndk_repository` to be included in a WORKSPACE without the need to have the Android NDK installed (except, of course, if one is attempting to compile non-default CPU architecture, in which case it will appropriately fail).
https://jira.sc-corp.net/browse/HSW-8831

**Changes**
- Modify `AndroidNdkRepositoryFunction` to create an empty repository file based on a template if it detects that the Android NDK is not installed.
- Update integration tests and add a new one to confirm new functionality.

**Test Plan**
Using CI build from this PR, pull in to Android repo and confirm the following.
Without NDK installed:
- [x] Able to build mushroom and confirm NDK doesn't download.
- [x] Able to build client linked mushroom build and confirm NDK doesn't download.
- [x] Able to build hermosa apks with arm64 and confirm NDK downloads.

With NDK installed:
- [x] Able to build mushroom.
- [x] Able to build client linked mushroom build.
- [x] Able to build hermosa apks with arm64 and confirm NDK doesn't redownload.
---
Automatic squash commit from https://github.sc-corp.net/Snapchat/bazel/pull/84
Cooled by kbauer
chancila added a commit to chancila/bazel that referenced this pull request Jun 23, 2021
This change is very similar to the one already in Bazel that adds support for non-Android
builds that have `android_sdk_repository` in their WORKSPACE.

See bazelbuild#12070

This changes here will allow for `android_ndk_repository` to be included in a WORKSPACE
and not cause a failure until a target actually attempts to use things in the NDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android SDK and NDK paths must be set for desktop use cases after Bazel 3.5.0
3 participants