-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
8.11.0 - macOS getpass_r error building CMake #15557
Comments
|
This comment was marked as resolved.
This comment was marked as resolved.
This look to be the culprit:
Could be a sibling to issue #15525. One common pattern is the use of Where to find this file? |
It's not offered by Apple operating system, but in some cases it may get mis-detected when using `check_function_exists()`, then making the build fail later. A better fix would be to figure out why are these mis-detections. One common pattern seen is this option, but it may or not be the cause: ``` -DCMAKE_TOOLCHAIN_FILE=[...]/toolchains/ios.toolchain.cmake ``` Ref: curl#15525 Regression from 8e34505 curl#15164 Reported-by: Dan Rosser Fixes curl#15557 Closes curl#15558
It's not offered by Apple operating system, but in some cases it may get mis-detected when using `check_function_exists()`, then making the build fail later. A better fix would be to figure out why are these mis-detections. One common pattern seen is this option, but it may or not be the cause: ``` -DCMAKE_TOOLCHAIN_FILE=[...]/toolchains/ios.toolchain.cmake ``` Ref: curl#15525 Regression from 8e34505 curl#15164 Reported-by: Dan Rosser Fixes curl#15557 Closes curl#15558
It's not offered by Apple operating system, but in some cases it may get mis-detected when using `check_function_exists()`, then making the build fail later. A better fix would be to figure out why are these mis-detections. One common pattern seen is this option, but it may or not be the cause: ``` -DCMAKE_TOOLCHAIN_FILE=[...]/toolchains/ios.toolchain.cmake ``` Ref: curl#15525 Regression from 8e34505 curl#15164 Reported-by: Dan Rosser Fixes curl#15557 Closes curl#15558
It's not offered by Apple operating systems, but in some cases it gets mis-detected when using `check_function_exists()`. Then making the build fail later. A better fix would be to figure out why are these mis-detections. One common pattern seen is this option, but it may or not be the cause: ``` -DCMAKE_TOOLCHAIN_FILE=[...]/toolchains/ios.toolchain.cmake ``` Ref: curl#15525 Regression from 8e34505 curl#15164 Reported-by: Dan Rosser Fixes curl#15557 Closes curl#15558
https://github.com/leetal/ios-cmake |
I could trace this back to an issue in The same issue is causing this pre-existing workaround in OP: |
It's not offered by Apple operating systems, but in some cases it gets mis-detected when using `check_function_exists()`. Then making the build fail later. A better fix would be to figure out why are these mis-detections. One common pattern seen is this option, but it may or not be the cause: ``` -DCMAKE_TOOLCHAIN_FILE=[...]/toolchains/ios.toolchain.cmake ``` Ref: curl#15525 Regression from 8e34505 curl#15164 Reported-by: Dan Rosser Fixes curl#15557 Closes curl#15558
Fix builds with CMake configured to falsely return successful detection when using `check_function_exists()` (and `check_library_exists()`, and anything based on `try_compile()` that's relying on the linker). After such mis-detection the build fails when trying to use the feature that doesn't in fact exist. The mis-detection is caused by this CMake setting: ``` set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) ``` It is set by default (or on conditions) when using 3rd-party toolchain: https://github.com/leetal/ios-cmake/blob/master/ios.toolchain.cmake After this patch the curl build overrides this setting for the duration of feature tests, and logs a message about it. Also preset and skip feature tests for known mis-detections: - `connect()` in `libsocket` - `getpass_r()` - `eventfd()` (did not cause an issue due to a separate bug) - `sendmmsg()` (did not cause an issue because it's Linux-only) If mis-detections are still seen, the workaround is to force-set the specific feature by passing `-DHAVE_*=OFF` to cmake. Also consider passing `-DENABLE_STRICT_TRY_COMPILE=ON` for `ios.toolchain.cmake` to fix the root cause. Interestingly curl itself uses this setting to speed up compile-only detections: be17f29 #3744 Also: - OtherTests.cmake: restore original value of `CMAKE_TRY_COMPILE_TARGET_TYPE`. Before this patch it reset it to empty. - OtherTests.cmake: unset a local variable after use, quote a string. Follow-up to 8e34505 #15164 Follow-up to 8b76a8a #15525 Ref: leetal/ios-cmake#47 Ref: https://gitlab.kitware.com/cmake/cmake/-/issues/18121 Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.html Reported-by: Dan Rosser Fixes #15557 Closes #15559
I did this
Error on getpass
Building with CMake
fulllog.log
I expected the following
Build success
curl/libcurl version
curl 8.11.0
operating system
buildinfo.configure.generator: Unix Makefiles
buildinfo.configure.make: /usr/bin/make
buildinfo.host.cpu: arm64
buildinfo.host.os: Darwin
buildinfo.target.cpu: x86_64
buildinfo.target.os: Darwin
buildinfo.target.flags: APPLE UNIX CROSS
buildinfo.compiler: AppleClang
buildinfo.compiler.version: 15.0.0.15000309
buildinfo.sysroot: /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
on macOS latest runner GitHub Actions https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
The text was updated successfully, but these errors were encountered: