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

Remove "ndk/"-prefixed include path compatibility workarounds #32

Open
ahumesky opened this issue Jan 11, 2023 · 2 comments
Open

Remove "ndk/"-prefixed include path compatibility workarounds #32

ahumesky opened this issue Jan 11, 2023 · 2 comments
Labels

Comments

@ahumesky
Copy link
Collaborator

With the way that the native version of android_ndk_repository structured / symlinked the NDK into bazel's external repository directory, the way to include things like cpu-features was

#include "ndk/sources/android/cpufeatures/cpu-features.h"

With the way the Starlark version of android_ndk_repository structures the NDK symlinks, the ndk/ prefix is not needed:

#include "sources/android/cpufeatures/cpu-features.h"

However this presents a migration issue for projects that use the native version of the rule, so a workaround was introduced to allow including the headers with the ndk/ prefix (by adding another symlink that results in the previous include path). We should migrate projects and remove this workaround.

@ahumesky ahumesky added the P2 label Jan 11, 2023
@DanAlbert
Copy link

IMO, better to go a step further and migrate people to https://github.com/google/cpu_features. The only reason the NDK still ships its own is because we don't want to break existing builds that depend on it. If someone needs to put in effort to migrate, they might as well migrate to the new thing that's actually maintained (there's even an interface that's compatible with the old NDK one for use as a drop-in replacement: https://github.com/google/cpu_features/tree/main/ndk_compat)

@ahumesky
Copy link
Collaborator Author

I wasn't aware of the separate cpu_features project -- I'll add a note about this!
For now, some users are blocked from moving to the starlark version of android_ndk_repository because other projects aren't migrated to either https://github.com/google/cpu_features or non-ndk/-prefixed include paths (this is all pretty new so they're probably not even aware, and I'm sure we'll uncover other migration issues).

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

No branches or pull requests

2 participants