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
rtabmap 0.21.4 (new formula) #162576
rtabmap 0.21.4 (new formula) #162576
Conversation
Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request. |
The error is that it cannot download the tar file from github.
But if we click on https://codeload.github.com/introlab/rtabmap/tar.gz/refs/tags/0.21.3-noetic or https://github.com/introlab/rtabmap/archive/refs/tags/0.21.3-noetic.tar.gz in the browser, it is downloading... Is it just an internet connection issue? Restarting the build may fix the issue. |
Formula/r/rtabmap.rb
Outdated
assert_match "RTAB-Map: #{version}", output | ||
|
||
# Test c++ library | ||
ENV.delete "CPATH" # error xcode headers missing |
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 everyone need this?
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.
On my system yes (M1 - sonoma), not sure for everyone. There is something slightly different in the build environment that I cannot put my finger on it between the build and test phases. I added a new commit to add depends_on
cmake for test, but it didn't help. The current workaround was inspired by
homebrew-core/Formula/p/pcl.rb
Line 116 in 7a51bbf
ENV.delete "CPATH" # `error: no member named 'signbit' in the global namespace` |
For me, there are many xcode related errors (missing headers), but here is the first one:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/cmath:320:5: error: <cmath> tried
including <math.h> but didn't find libc++'s <math.h> header. This usually means that your header search
paths are not configured properly. The header search paths should contain the C++ Standard Library
headers before any C Standard Library, and you are probably using compiler flags that make that not
be the case.
The compilation command not working:
/Library/Developer/CommandLineTools/usr/bin/clang++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB
-DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -
DBOOST_IOSTREAMS_NO_LIB -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SERIALIZATION_NO_LIB -
DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DEIGEN_HAS_CXX17_OVERALIGN=0 -DQT_CORE_LIB
-DQT_GUI_LIB -DQT_NO_DEBUG -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -
Dkiss_fft_scalar=double -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/Cellar/rtabmap/0.21.3/
include/rtabmap-0.21 -isystem /opt/homebrew/Cellar/opencv/4.9.0_2/include/opencv4 -isystem /opt/homebrew/
include/pcl-1.14 -isystem /opt/homebrew/include -isystem /opt/homebrew/opt/libpcap/include -isystem /Library/
Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include -isystem /opt/homebrew/include/vtk-9.2 -isystem /
opt/homebrew/include/vtk-9.2/vtknlohmannjson/include -isystem /opt/homebrew/include/vtk-9.2/vtkfreetype/
include -isystem /opt/homebrew/lib/QtOpenGL.framework/Headers -iframework /opt/homebrew/lib -isystem /opt/
homebrew/lib/QtCore.framework/Headers -isystem /opt/homebrew/share/qt/mkspecs/macx-clang -isystem /opt/
homebrew/lib/QtGui.framework/Headers -isystem /opt/homebrew/lib/QtWidgets.framework/Headers -isystem /opt/
homebrew/lib/QtOpenGLWidgets.framework/Headers -Os -w -pipe -mmacosx-version-min=14 -isysroot/Library/
Developer/CommandLineTools/SDKs/MacOSX14.sdk -std=gnu++17 -arch arm64 -isysroot /Library/Developer/
CommandLineTools/SDKs/MacOSX14.sdk -ffloat-store -MD -MT CMakeFiles/test.dir/test.cpp.o -MF CMakeFiles/
test.dir/test.cpp.o.d -o CMakeFiles/test.dir/test.cpp.o -c /tmp/rtabmap-test-20240214-2050-b8d70e/test.cpp
The compilation command working (with ENV.delete
):
/Library/Developer/CommandLineTools/usr/bin/clang++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB
-DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -
DBOOST_IOSTREAMS_NO_LIB -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SERIALIZATION_NO_LIB -
DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DEIGEN_HAS_CXX17_OVERALIGN=0 -DQT_CORE_LIB
-DQT_GUI_LIB -DQT_NO_DEBUG -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -
Dkiss_fft_scalar=double -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/Cellar/rtabmap/0.21.3/
include/rtabmap-0.21 -isystem /opt/homebrew/Cellar/opencv/4.9.0_2/include/opencv4 -isystem /opt/homebrew/
include/pcl-1.14 -isystem /opt/homebrew/include -isystem /opt/homebrew/opt/libpcap/include -isystem /opt/
homebrew/include/vtk-9.2 -isystem /opt/homebrew/include/vtk-9.2/vtknlohmannjson/include -isystem /opt/
homebrew/include/vtk-9.2/vtkfreetype/include -isystem /opt/homebrew/lib/QtOpenGL.framework/Headers -
iframework /opt/homebrew/lib -isystem /opt/homebrew/lib/QtCore.framework/Headers -isystem /opt/homebrew/
share/qt/mkspecs/macx-clang -isystem /opt/homebrew/lib/QtGui.framework/Headers -isystem /opt/homebrew/lib/
QtWidgets.framework/Headers -isystem /opt/homebrew/lib/QtOpenGLWidgets.framework/Headers -Os -w -pipe -
mmacosx-version-min=14 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -std=gnu++17 -
arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -ffloat-store -MD -MT
CMakeFiles/test.dir/test.cpp.o -MF CMakeFiles/test.dir/test.cpp.o.d -o CMakeFiles/test.dir/test.cpp.o -c /tmp/
rtabmap-test-20240214-1399-n4wkj8/test.cpp
Note also that if I go directly in the /tmp/rtabmap-test-20240214-2050-b8d70e
directory, remove the CMakeCache.txt
and do simply cmake .
, make
, it works.
I'll give a try today on a Mac Intel at work and see if it is just my computer the issue.
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.
Confirmed it was also happening on CI: https://github.com/Homebrew/homebrew-core/actions/runs/7983978459/job/21800145992?pr=162576
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/c++/v1/cmath:642:26: error: no template named 'numeric_limits'
I added ENV.delete "CPATH"
back to fix this issue.
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.
That really sounds like it's hiding a real issue. Do you know why it's running into this issue?
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.
Here is an easier view to compare without (left) and with (right) ENV.delete "CPATH"
:
It seems that cmake in "test" phase added an extra path:
-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include
Is there a way to compare the cmake command line used in "build" phase and the one in "test" phase. It feels the cmake toolchain or version is not he same used between the two phases. I am not sure why adding that include path would produce those errors:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/cmath:320:5:
error: <cmath> tried including <math.h> but didn't find libc++'s <math.h> header.
It seems there is a missing include path to be able to find <math.h>
, when we add /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include
.
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 searched for all other Formulas using ENV.delete "CPATH"
:
https://github.com/search?q=repo%3AHomebrew%2Fhomebrew-core%20ENV.delete%20%22CPATH%22&type=code
Here some related discussions:
Based on CI at #91763, it seems that it's the CPATH setting that's the culprit. My guess is that it ends up mixing headers from Xcode and the CLT and that breaks things.
- In qt formula they added it in this commit matlabbe@c844c6d, seems related to MacOS versions since Catalina:
ENV.delete "CPATH" if OS.mac? && MacOS.version > :mojave
I cannot find the related PR to see if there was a discussion about it.
For all other formulas, I see it often when they use Qt with qmake or cmake.
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.
Found some PRs mentionning it:
https://github.com/search?q=repo%3AHomebrew%2Fhomebrew-core+ENV.delete+%22CPATH%22&type=pullrequests
My local builds seem to work as I have mentioned root-project/root#7881 (comment). The failing logs of this PR still have -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include which I think makes it fail.
Have you tried adding a depends_on :xcode on Catalina and earlier? depends_on xcode: :build might also work. This will make brew stop trying to use the CLT. This is otherwise a lot more involved than just the content of std_cmake_args.
Yes, that would make it switch from the Xcode 10.15 SDK to the CLT 10.14 SDK. It's also why you suddenly needed a ENV.delete "CPATH" in your test (qmake doesn't like CLT SDKs very much).
Work around "error: no member named 'signbit' in the global namespace"
ENV.delete("SDKROOT") if DevelopmentTools.clang_build_version >= 900
Since the 2nd failure seems to be related to C header files, I added ENV.delete("CPATH"), and that seems to be enough.
@apjanke Do we have any way to require CLT be installed? Even with ENV.delete("SDKROOT") or with Homebrew/brew#251 baresip will fail if only Xcode is installed.
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'm not concerned about this in a test but would like to see a better comment and more finely scoped if possible.
ENV.delete "CPATH" # error xcode headers missing | |
# Required to avoid missing Xcode headers | |
# https://github.com/Homebrew/homebrew-core/pull/162576/files#r1489824628 | |
ENV.delete "CPATH" if OS.mac? && !MacOS::CLT.installed? |
or similar
92887ec
to
d755512
Compare
3df9ac5
to
f1015ab
Compare
bfb6abb
to
335eb75
Compare
335eb75
to
fe9f280
Compare
PR ready! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This PR is stuck on this comment: #162576 (comment) about the usage of |
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.
Thanks @matlabbe! One small tweak and should be good to go here.
Formula/r/rtabmap.rb
Outdated
assert_match "RTAB-Map: #{version}", output | ||
|
||
# Test c++ library | ||
ENV.delete "CPATH" # error xcode headers missing |
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'm not concerned about this in a test but would like to see a better comment and more finely scoped if possible.
ENV.delete "CPATH" # error xcode headers missing | |
# Required to avoid missing Xcode headers | |
# https://github.com/Homebrew/homebrew-core/pull/162576/files#r1489824628 | |
ENV.delete "CPATH" if OS.mac? && !MacOS::CLT.installed? |
or similar
ffc8ca8
to
c9c484f
Compare
77e160a
to
c9c484f
Compare
4a392d3
to
0844190
Compare
bc31e75
to
86ba5ea
Compare
86ba5ea
to
9789bca
Compare
I added the suggestions and fixed the CI. thx |
Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @matlabbe! |
I tested the official generated binaries for arm/sonoma and it works as expected, thx! |
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?