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

neverlink errors for AARs #535

Open
cpsauer opened this issue Mar 13, 2021 · 2 comments
Open

neverlink errors for AARs #535

cpsauer opened this issue Mar 13, 2021 · 2 comments

Comments

@cpsauer
Copy link

cpsauer commented Mar 13, 2021

First and foremost, thanks for such a useful set of rules!

I was using this for an Android project and noticed an edge case that I thought I should give a heads up about: Neverlink doesn't seem to work Maven AARs.

As a minimal example, I've got:

maven_install(
    artifacts = [
        maven.artifact("com.facebook.fbjni", "fbjni", "0.2.0", neverlink = True),
    ],
    repositories = [
        "https://jcenter.bintray.com/",
    ],
)

And the error is @maven//:com_facebook_fbjni_fbjni: no such attribute 'neverlink' in 'aar_import' rule. Indeed checking the generated BUILD file, you see neverlink added to the aar_import rule.

A good workaround might be to wrap the aar_import rule in an android_library, which supports neverlink. Alternatively, and probably better, neverlink support could be added to aar_import?

Tagging @jin, because it looks like he was the original author.

@jin
Copy link
Collaborator

jin commented Mar 16, 2021

I checked with @ahumesky and there isn't nothing particularly blocking to implement neverlink in aar_import. Feel free to open an issue in the core bazel repository!

In the mean time, I'm open to accepting a PR (with tests) that goes with the first approach, since that wouldn't require a Bazel release.

@cpsauer
Copy link
Author

cpsauer commented Mar 16, 2021

Sounds good. Will do on the issue.

[May come back on the PR, but it turns out that neverlink itself is broken in ways that make it unusable. See https://github.com/bazelbuild/bazel/issues/13216]

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

No branches or pull requests

2 participants