-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-40248: [R] fallback to the correct libtool when we find a GNU one #40259
Conversation
@github-actions crossbow submit test-r-install-local |
Revision: 77188a0 Submitted crossbow builds: ursacomputing/crossbow @ actions-c1bc1ae976
|
@github-actions crossbow submit test-r-install-local This should fail because we find the GNU libtool in the R.Framework dir first |
Revision: 19461ca Submitted crossbow builds: ursacomputing/crossbow @ actions-89df1d84e3
|
@github-actions crossbow submit test-r-install-local And now this should work because we find the apple-provided one first |
Revision: a62b889 Submitted crossbow builds: ursacomputing/crossbow @ actions-2975d7310c
|
cpp/cmake_modules/BuildUtils.cmake
Outdated
# if it's not found in obvious places, check on the standard path | ||
if(LIBTOOL_MACOS-NOTFOUND) | ||
set(LIBTOOL_MACOS "libtool") | ||
endif() |
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 believe this could technically be find_program(LIBTOOL_MACOS libtool)
and that would find libtool along the search path, but be a no-op if line 106 above it found libtool.
Does that look better? Or just an obfuscated version of this?
cpp/cmake_modules/BuildUtils.cmake
Outdated
if(NOT "${LIBTOOL_V_OUTPUT}" MATCHES ".*cctools-([0-9.]+).*") | ||
message(FATAL_ERROR "libtool found appears to be the incompatible GNU libtool") | ||
endif() |
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.
We might consider raising this as a warning and proceeding anyway. If it is GNU libtool, it fails pretty clearly next. That would insulate us incase Apple's libtool has a slightly different version string or something (although with a spurious error). I'm split on if this is better or not.
This is ready for review. The CI failure (C++ / AMD64 macOS 12 C++) is the same on main so I believe unrelated to this change. CC @kou |
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.
+1
cpp/cmake_modules/BuildUtils.cmake
Outdated
PATHS /usr/bin /Library/Developer/CommandLineTools/usr/bin | ||
NO_DEFAULT_PATH) | ||
|
||
# if it's not found in obvious places, check on the standard path | ||
if(LIBTOOL_MACOS-NOTFOUND) | ||
set(LIBTOOL_MACOS "libtool") | ||
endif() |
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.
How about just using default paths? $PATH
is used after PATHS
.
PATHS /usr/bin /Library/Developer/CommandLineTools/usr/bin | |
NO_DEFAULT_PATH) | |
# if it's not found in obvious places, check on the standard path | |
if(LIBTOOL_MACOS-NOTFOUND) | |
set(LIBTOOL_MACOS "libtool") | |
endif() | |
PATHS /usr/bin /Library/Developer/CommandLineTools/usr/bin) |
https://cmake.org/cmake/help/latest/command/find_program.html
Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed or by setting the CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH to FALSE.
- The directories in PATH itself.
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 can try this. I will admit I read that list in the find docs a few times and was not 100% certain it would follow the path I was hoping it would (use our provided paths first, then project paths, then system paths).
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.
Ok, this works though I had to switch from PATHS
to HINTS
since HINTS
is higher in the search. This is a bit funny given the docs:
- Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
But it does seem to work!
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
@github-actions crossbow submit test-r-install-local |
Revision: e1cac51 Submitted crossbow builds: ursacomputing/crossbow @ actions-3f3456c02e
|
@github-actions crossbow submit test-r-install-local |
Revision: ee8e590 Submitted crossbow builds: ursacomputing/crossbow @ actions-e25ea07ad4
|
Could you run |
Yup, I should have done this before sending that last commit, sorry! |
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 2fbf22a. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…40259) ### Rationale for this change On the CRAN build machines the GNU libtool is on the path in front of the macOS libtool. Though these are named the same thing, they are actually very different and don't actually appear to be substitutes I checked on a non-developer's machine to see if `/usr/bin/libtool` exists, and it did. So I believe we _should_ be ok with this even if xcode / command line tools haven't been installed. One note: it's possible that we could get the GNU libtool in link mode to work with the right incantation (something like `libtool --mode=link --tag=CXX ${cmake_compiler} -o ...` but when I tried this I kept getting symbol not found errors. Ultimately, I think any mac that we are on will have the apple-provided libtool, so decided to go the route of finding it. ### What changes are included in this PR? When we detect we are on a GNU libtool, we look to `/usr/bin/libtool` instead. ### Are these changes tested? Yes. See a broken config failing at #40259 (comment) and then the next one passes ### Are there any user-facing changes? We will remain on CRAN **This PR contains a "Critical Fix".** * GitHub Issue: #40248 Lead-authored-by: Jonathan Keane <jkeane@gmail.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
…U one (apache#40259) ### Rationale for this change On the CRAN build machines the GNU libtool is on the path in front of the macOS libtool. Though these are named the same thing, they are actually very different and don't actually appear to be substitutes I checked on a non-developer's machine to see if `/usr/bin/libtool` exists, and it did. So I believe we _should_ be ok with this even if xcode / command line tools haven't been installed. One note: it's possible that we could get the GNU libtool in link mode to work with the right incantation (something like `libtool --mode=link --tag=CXX ${cmake_compiler} -o ...` but when I tried this I kept getting symbol not found errors. Ultimately, I think any mac that we are on will have the apple-provided libtool, so decided to go the route of finding it. ### What changes are included in this PR? When we detect we are on a GNU libtool, we look to `/usr/bin/libtool` instead. ### Are these changes tested? Yes. See a broken config failing at apache#40259 (comment) and then the next one passes ### Are there any user-facing changes? We will remain on CRAN **This PR contains a "Critical Fix".** * GitHub Issue: apache#40248 Lead-authored-by: Jonathan Keane <jkeane@gmail.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
…40259) ### Rationale for this change On the CRAN build machines the GNU libtool is on the path in front of the macOS libtool. Though these are named the same thing, they are actually very different and don't actually appear to be substitutes I checked on a non-developer's machine to see if `/usr/bin/libtool` exists, and it did. So I believe we _should_ be ok with this even if xcode / command line tools haven't been installed. One note: it's possible that we could get the GNU libtool in link mode to work with the right incantation (something like `libtool --mode=link --tag=CXX ${cmake_compiler} -o ...` but when I tried this I kept getting symbol not found errors. Ultimately, I think any mac that we are on will have the apple-provided libtool, so decided to go the route of finding it. ### What changes are included in this PR? When we detect we are on a GNU libtool, we look to `/usr/bin/libtool` instead. ### Are these changes tested? Yes. See a broken config failing at #40259 (comment) and then the next one passes ### Are there any user-facing changes? We will remain on CRAN **This PR contains a "Critical Fix".** * GitHub Issue: #40248 Lead-authored-by: Jonathan Keane <jkeane@gmail.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
Rationale for this change
On the CRAN build machines the GNU libtool is on the path in front of the macOS libtool. Though these are named the same thing, they are actually very different and don't actually appear to be substitutes
I checked on a non-developer's machine to see if
/usr/bin/libtool
exists, and it did. So I believe we should be ok with this even if xcode / command line tools haven't been installed.One note: it's possible that we could get the GNU libtool in link mode to work with the right incantation (something like
libtool --mode=link --tag=CXX ${cmake_compiler} -o ...
but when I tried this I kept getting symbol not found errors. Ultimately, I think any mac that we are on will have the apple-provided libtool, so decided to go the route of finding it.What changes are included in this PR?
When we detect we are on a GNU libtool, we look to
/usr/bin/libtool
instead.Are these changes tested?
Yes. See a broken config failing at #40259 (comment) and then the next one passes
Are there any user-facing changes?
We will remain on CRAN
This PR contains a "Critical Fix".