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

[FR] unchecked "prebuilt" library type #1559

Closed
DanAlbert opened this issue Aug 11, 2021 · 5 comments
Closed

[FR] unchecked "prebuilt" library type #1559

DanAlbert opened this issue Aug 11, 2021 · 5 comments
Assignees
Projects

Comments

@DanAlbert
Copy link
Member

Similar to #676

The fix for https://issuetracker.google.com/120166563 is going to require the ability to import modules that are not owned by ndk-build but also are not yet present on disk (have missing "sources"), since Android Studio needs to be able to run ndk-build in a "configure" mode even though ndk-build has no such mode.

We can fake this well enough by adding a new library type that behaves identically to PREBUILT_* but without the safety net. This way PREBUILT_* can still help by failing-fast but prefab can generate more permissive build scripts that fail late.

Open to ideas on the name, but I was thinking EXTERNALLY_BUILT_SHARED_LIBRARY.

@alexcohn
Copy link

This is exactly what I proposed few years ago, isn't it?

@DanAlbert
Copy link
Member Author

We discussed it here: #676 (comment)

(Apparently I'd subconsciously remembered that because I even picked the same name despite not remembering it)

This is forked from the other bug because the other bug was pushing hard for completely removing the validation, which we will not be doing.

@DanAlbert
Copy link
Member Author

https://android-review.googlesource.com/c/platform/ndk/+/1833066 does this. I opted for LOCAL_ALLOW_MISSING_PREBUILT rather than a separate module type because it was easier to implement it that way, but it'd be easy to make a new module type that just wraps the old one and sets the property automatically if anyone thinks that's worthwhile.

@DanAlbert DanAlbert self-assigned this Sep 22, 2021
@alexcohn
Copy link

I opted for LOCAL_ALLOW_MISSING_PREBUILT

In my humble opinion, this is good enough, but preferably AGP should be taught to recognize the case when this is required to resolve inter-module dependencies in a multi-module Android project, and set the flag for you.

@DanAlbert
Copy link
Member Author

In practice no one will ever need to set that manually. Prefab will do it for you. The only reason anyone would ever need to use it explicitly would be rolling their own inter-module dependencies, which there isn't much reason to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
r24
  
Merged
Development

No branches or pull requests

2 participants