-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
libcurl iOS build added #1008
libcurl iOS build added #1008
Conversation
All green in build 1 (
|
thanks a lot for the feedback (so far)! |
recipes/libcurl/all/conanfile.py
Outdated
params.append("--enable-threaded-resolver") | ||
params.append("--disable-verbose") | ||
# if there is anything special for arm or simulator, add it here | ||
if "arm" in self.settings.arch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's nice to leave code blocks doing nothing right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe for documentation purpose it is OK ?
raise ConanInvalidConfiguration("Unsuported iOS arch {}".format(self.settings.arch)) | ||
|
||
cc = tools.XCRun(self.settings, iphoneos).cc | ||
sysroot = "-isysroot {}".format(tools.XCRun(self.settings, iphoneos).sdk_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a helper method to get sysroot flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean? I thought I use it ?
tools.XCRun(self.settings, iphoneos).sdk_path
arch_flag = "-arch {}".format(configure_arch) | ||
ios_min_version = "-miphoneos-version-min={}".format(ios_dev_target) | ||
bitcode = "-fembed-bitcode" if self.options.enable_bitcode else "" | ||
extra_flag = "-Werror=partial-availability" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need -Werror
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we don't, but if we have a build config that is incorrect by using something not available on all deployment targets, maybe the build shall fail?
autotools_vars['LDFLAGS'] = "{} {}".format(arch_flag, sysroot) | ||
autotools_vars['CPPFLAGS'] += extra_def | ||
|
||
elif self.settings.os == "Android": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, pls avoid adding empty code blocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall I also remove the system_requirements
. function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, if it does nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is documentation, like, it should be like this, or hey, for Android, its tested but there is nothing to do, I think I prefer having this in the file, since it is documentation
But I removed the parts that did nothing and had no docu purpose
|
||
if self.settings.os == "iOS" and self.settings.arch == "x86_64": | ||
# please do not autodetect --build for the iOS simulator, thanks! | ||
self._autotools.configure(vars=autotools_vars, args=configure_args, build=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a bug in conan that it doesn't properly deduce build for iOS simulator?
I am asking cause we already had similar PR for another package in the past
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a bug, I do not know,
it will generate a wrong --build
argument for configure run, the default (auto detection) from automake gets it right , so it is better to not let conan detect the --build
argument for the simulator, since it will get it wrong
recipes/libcurl/all/conanfile.py
Outdated
autotools_vars['CFLAGS'] = "{} {} {} {} {}".format( | ||
sysroot, arch_flag, ios_min_version, bitcode, extra_flag | ||
) | ||
autotools_vars['LDFLAGS'] = "{} {}".format(arch_flag, sysroot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it would be better to manipulate the properties of AutoToolsBuildEnvironment
(cflags, link_flags) instead of overriding environment variables. the primary reason that user may have set CFLAGS
/LDFLAGS
within his conan profile, and such flags would be lost here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will check what is possible, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not work, with not using the environment variables
reduced to the smallest example, using the -isysroot
flag
having it in the environment
configure:4717: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -arch armv7 -miphoneos-version-min=10 -Werror=partial-availability -DHAVE_SOCKET -DHAVE_FCNTL_O_NONBLOCK conftest.c >&5
configure:4717: $? = 0
configure:4730: result: none needed
using self._autotools.flags.append(sysroot)
, where sysroot is the exact same path
configure:4717: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -arch armv7 -miphoneos-version-min=10 -Werror=partial-availability -DHAVE_SOCKET -DHAVE_FCNTL_O_NONBLOCK conftest.c >&5
conftest.c:10:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
configure:4717: $? = 1
configure: failed program was:
......
so obviously, this is not the same for configure, the values are not passed on
I have now invested some hours in this and will not continue not using the env_var, if you think you can improve, please provide a working example
|
||
if tools.cross_building(self.settings): | ||
if self.settings.os == "iOS": | ||
ios_dev_target = str(self.settings.os.version).split(".")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dangerous, as settings.os.version
is not always there. use self.settings.get_safe("os.version")
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will it not 'just crash' ?
but ok, what to do if get_safe
returns None
raise a configuration error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, raise a ConanInvalidConfiguration.
All green in build 2 (
|
* remove code doing nothing * use inbuild tools instead of self made functionality
An unexpected error happened and has been reported. Help is on its way! 🏇 |
There was an error contacting the server. Relaunching the CI... |
An unexpected error happened and has been reported. Help is on its way! 🏇 |
I assume the not successful check, for which I can not see any details due to permissions, are a side effect of #1020 , yes? |
All green in build 6 (
|
An unexpected error happened and has been reported. Help is on its way! 🏇 |
An unexpected error happened and has been reported. Help is on its way! 🏇 |
Sorry, we are experiencing some networking issues today. I have relaunched once again the job. |
All green in build 9 (
|
All green in build 10 (
|
libcurl/7.78.0 iOS build added ( and Android build checked)
conan-center hook activated.
see #955 ,
maybe wait for possible feedback from the issue