-
Notifications
You must be signed in to change notification settings - Fork 986
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
[question] How to guarantee that a specific Android NDK is used for resolving packages #16453
Comments
Hi @elvisdukaj The default settings already include:
From our understanding the |
Hi @memsharded, thank you for the quick feedback! I am aware of the Android API level and Android NDK version unfortunately are not stricly correlated. As an example building a library using Even worst is that it's impossible to distinguish between these 2 ndk, they have same compiler version for instance :\ |
About the os api_level is meant to be forward compatible, that means that if I built with With the actual implementation instead I need to rebuild all the packages even when moving for instance from API Level 30 to 31 even if there is no need. I will work on a fix that is setting the api level to the minimum required instead to avoid dupplications. |
In any case, if you want to add an Something like:
And from there you can add |
I was thinking to add something similar as the
Maybe I will propose an MR if that works internally. For making this even nicer I need to change the recipes in of |
No you didn't miss anything, this is exactly how I would like to proceed. I just want to point out that this is not just my special case, but I think it's a missing parameter in the actual settings. |
The problem is that this forces Android users to define a ndk_version, which would be breaking. At the very least it should be I am not so sure that the binary compatibility is so bad in the general case for different NDK versions. Is this something that happens in your case all the time for all the packages using different NDK versions? Or it is more like it fails in some special, particular cases? |
Android unfortunately is not consistent in keeping ABI compatibility between different ndk, in our internal expirience the ABI compatibility between NDKs was missing, despite the toolchain major and minor build was the same. I am fine to keep this as internal setting for now, the only downside I see is that I need to fork the |
I wanted to point out that |
I am not sure what does it mean. The |
Essentially in the Something like: class AndroidNDKConan(ConanFile):
# Even better if this is defined in the YAML file instead of here?
@property
def _ndk_version(self):
version_map = {
"r19c": "19.2",
"r20b": "20.1",
"r21e": "21.2",
"r21d": "21.3",
"r22": "22",
"r22b": "22.1",
# [...]
}
return version_map[self.version]
# [...]
def package_info(self):
# [...]
??? Force self.settings.os.ndk_version = self._ndk_version
# [...] I don't know really if this is possible at all though 🤔 |
No, not possible, see: https://docs.conan.io/2/knowledge/guidelines.html#forbidden-practices
|
I see, I guess the best option I have then is to put it inside the profile for now. Thank you for the help! |
I got feedback from other user about the binary incompatibility from different NDK versions, so:
|
Thank you for the feedback! That will be awesome already! |
What is your question?
In the settings of a package it's possible to set up a lot of parameters, like the
os
,compiler.version
and others. When building using the Android NDK unfortunately thecompiler.version
is not enough to guarantee an ABI compatibility between packages. There are cases where also a change of the minor version of the ndk is causing abi issues.The problem is that both ndks have the same compiler version (
clang 9.0.8
) and there is no way to distinguish between them in the current state.Probably in case of an Androiod build, a
settings.os.ndk.version
settings could be added to compute thepackage_id
. The android ndk version could be deduced from the ndk itself by reading the<ndk_path>/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/android/ndk-version.h
header file or by the name of packages itself (21a -> 21.0, 21b -> 21.1, 25c -> 25.2).Is there any proposal to handle this case? Are there similar scenario with other toolchains?
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: