Skip to content
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

Merged
merged 2 commits into from Mar 21, 2024
Merged

Conversation

matlabbe
Copy link
Contributor

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

@github-actions github-actions bot added the new formula PR adds a new formula to Homebrew/homebrew-core label Feb 13, 2024
Copy link
Contributor

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.

@matlabbe
Copy link
Contributor Author

The error is that it cannot download the tar file from github.

Full fetch rtabmap --build-bottle output
  ==> Downloading https://github.com/introlab/rtabmap/archive/refs/tags/0.21.3-noetic.tar.gz
  ==> Downloading from https://codeload.github.com/introlab/rtabmap/tar.gz/refs/tags/0.21.3-noetic
  Downloaded to: /Users/brew/Library/Caches/Homebrew/downloads/b8cc8ca7ce6a8421755800db09b1ad9754c3c8530ef9f3b9bf76a98668818564--rtabmap-0.21.3-noetic.tar.gz
  SHA256: d7fc662d19a6ff772c81cc96365862afdb9bac7f41aeb4d6c543ed3a2477fb01
  ==> Retrying download in 2s... (4 tries left)
  ==> Downloading https://github.com/introlab/rtabmap/archive/refs/tags/0.21.3-noetic.tar.gz
  ==> Downloading from https://codeload.github.com/introlab/rtabmap/tar.gz/refs/tags/0.21.3-noetic
  Downloaded to: /Users/brew/Library/Caches/Homebrew/downloads/b8cc8ca7ce6a8421755800db09b1ad9754c3c8530ef9f3b9bf76a98668818564--rtabmap-0.21.3-noetic.tar.gz
  SHA256: d7fc662d19a6ff772c81cc96365862afdb9bac7f41aeb4d6c543ed3a2477fb01
  ==> Retrying download in 4s... (3 tries left)
  ==> Downloading https://github.com/introlab/rtabmap/archive/refs/tags/0.21.3-noetic.tar.gz
  ==> Downloading from https://codeload.github.com/introlab/rtabmap/tar.gz/refs/tags/0.21.3-noetic
  Downloaded to: /Users/brew/Library/Caches/Homebrew/downloads/b8cc8ca7ce6a8421755800db09b1ad9754c3c8530ef9f3b9bf76a98668818564--rtabmap-0.21.3-noetic.tar.gz
  SHA256: d7fc662d19a6ff772c81cc96365862afdb9bac7f41aeb4d6c543ed3a2477fb01
  ==> Retrying download in 8s... (2 tries left)
  ==> Downloading https://github.com/introlab/rtabmap/archive/refs/tags/0.21.3-noetic.tar.gz
  ==> Downloading from https://codeload.github.com/introlab/rtabmap/tar.gz/refs/tags/0.21.3-noetic
  Downloaded to: /Users/brew/Library/Caches/Homebrew/downloads/b8cc8ca7ce6a8421755800db09b1ad9754c3c8530ef9f3b9bf76a98668818564--rtabmap-0.21.3-noetic.tar.gz
  SHA256: d7fc662d19a6ff772c81cc96365862afdb9bac7f41aeb4d6c543ed3a2477fb01
  ==> Retrying download in 16s... (1 try left)
  ==> Downloading https://github.com/introlab/rtabmap/archive/refs/tags/0.21.3-noetic.tar.gz
  ==> Downloading from https://codeload.github.com/introlab/rtabmap/tar.gz/refs/tags/0.21.3-noetic
  curl: (7) Failed to connect to codeload.github.com port 443 after 5 ms: Couldn't connect to server
  Error: Failed to download resource "rtabmap"
  Download failed: https://github.com/introlab/rtabmap/archive/refs/tags/0.21.3-noetic.tar.gz

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.

assert_match "RTAB-Map: #{version}", output

# Test c++ library
ENV.delete "CPATH" # error xcode headers missing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does everyone need this?

Copy link
Contributor Author

@matlabbe matlabbe Feb 14, 2024

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

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-b8d70edirectory, 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.

Copy link
Contributor Author

@matlabbe matlabbe Feb 21, 2024

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.

Copy link
Member

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?

Copy link
Contributor Author

@matlabbe matlabbe Feb 22, 2024

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":
image

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.

Copy link
Contributor Author

@matlabbe matlabbe Feb 22, 2024

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Suggested change
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

@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Feb 14, 2024
@matlabbe matlabbe force-pushed the new_rtabmap_formula branch 4 times, most recently from 92887ec to d755512 Compare February 16, 2024 05:44
@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Feb 16, 2024
@matlabbe matlabbe force-pushed the new_rtabmap_formula branch 2 times, most recently from 3df9ac5 to f1015ab Compare February 17, 2024 02:09
@matlabbe matlabbe force-pushed the new_rtabmap_formula branch 2 times, most recently from bfb6abb to 335eb75 Compare February 21, 2024 04:24
@matlabbe matlabbe changed the title rtabmap 0.21.3 (new formula) rtabmap 0.21.4 (new formula) Feb 21, 2024
@matlabbe
Copy link
Contributor Author

PR ready!

Copy link
Contributor

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.

@github-actions github-actions bot added the stale No recent activity label Mar 15, 2024
@matlabbe
Copy link
Contributor Author

This PR is stuck on this comment: #162576 (comment) about the usage of ENV.delete "CPATH" for the tests. Without it, tests fail, with it, everything fine. As an I am not a maintainer for homebrew, it is difficult for me to debug more than observing that other repos also use it to fix their tests.

@github-actions github-actions bot removed the stale No recent activity label Mar 16, 2024
@SMillerDev SMillerDev requested a review from a team March 18, 2024 08:17
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a 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.

assert_match "RTAB-Map: #{version}", output

# Test c++ library
ENV.delete "CPATH" # error xcode headers missing
Copy link
Member

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.

Suggested change
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

@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Mar 20, 2024
@github-actions github-actions bot added automerge-skip `brew pr-automerge` will skip this pull request and removed autosquash Automatically squash pull request commits according to Homebrew style. labels Mar 20, 2024
@matlabbe matlabbe requested a review from a team as a code owner March 20, 2024 02:22
@github-actions github-actions bot added the workflows PR modifies GitHub Actions workflow files label Mar 20, 2024
@github-actions github-actions bot added new formula PR adds a new formula to Homebrew/homebrew-core and removed automerge-skip `brew pr-automerge` will skip this pull request autobump labels Mar 20, 2024
@matlabbe matlabbe force-pushed the new_rtabmap_formula branch 2 times, most recently from 4a392d3 to 0844190 Compare March 20, 2024 02:34
Formula/r/rtabmap.rb Outdated Show resolved Hide resolved
Formula/r/rtabmap.rb Outdated Show resolved Hide resolved
Formula/r/rtabmap.rb Outdated Show resolved Hide resolved
@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Mar 21, 2024
@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Mar 21, 2024
@matlabbe
Copy link
Contributor Author

I added the suggestions and fixed the CI. thx

@MikeMcQuaid
Copy link
Member

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @matlabbe!

Copy link
Contributor

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Mar 21, 2024
@BrewTestBot BrewTestBot added this pull request to the merge queue Mar 21, 2024
Merged via the queue into Homebrew:master with commit 92af37d Mar 21, 2024
13 checks passed
@matlabbe matlabbe deleted the new_rtabmap_formula branch March 24, 2024 22:53
@matlabbe
Copy link
Contributor Author

I tested the official generated binaries for arm/sonoma and it works as expected, thx!

@github-actions github-actions bot added the outdated PR was locked due to age label Apr 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. new formula PR adds a new formula to Homebrew/homebrew-core outdated PR was locked due to age workflows PR modifies GitHub Actions workflow files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants