-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat(autoware.repos): add glog with v0.6.0 as a ros pkg #4614
Conversation
Signed-off-by: Takamasa Horibe <[email protected]>
@mitsudome-r @xmfcx I've made this PR to improve the logging system. What do you think? Thank you for your comment. |
@TakaHoribe It makes sense to add this. How long does it take to compile glog, just out of curiosity? Also, I don't know if compiling glog requires additional dependencies. But we can add and see, thanks! |
@TakaHoribe instead of updating to the latest version, this solution will probably work too with the old version:
We could just create a simple header file like this and call it. Since we are using version When updated to the Ubuntu 24.04 we can remove the header and keep using the same function. This way we don't recompile the glog on Autoware machines. |
@xmfcx Thank you, Fatih. The build of glog takes only 10 seconds:
I'll try this as well! |
@TakaHoribe you should also remove the ccache, or displace it temporarily to get the real numbers. 10s sounds too fast. You can do |
@xmfcx It is the result without ccache. With ccache, the build time is only 6s. |
@TakaHoribe I have also confirmed it is quite fast, so, for me either way it works. glog forkPros:
Cons:
extra headerPros:
Cons:
I leave the decision to you, either way is ok with me. |
@xmfcx Thank you for the summary! I tried the "extra-header" way, and it seems to work. I've noticed some drawbacks.
In contrast, upgrading to a new version via a fork is simpler. When we switch to Ubuntu 24.04, we'll just need to change the .repos file and switch the dependency. I assume we'll update Ubuntu soon (at least it is not far future), so let us go with the glog-fork approach. |
I'm not using a docker, so if I have already installed |
You shouldn't need to uninstall it. But after the latest glog related update, It should use the glog from the workspace. |
mfc@mfc-leo:~$ apt list | grep libgoogle-glog
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libgoogle-glog-dev/jammy,now 0.5.0+really0.4.0-2 amd64 [installed]
libgoogle-glog-doc/jammy 0.5.0+really0.4.0-2 all
libgoogle-glog0v5/jammy,now 0.5.0+really0.4.0-2 amd64 [installed,automatic] I have this on my Ubuntu 22.04 and I can build and run the latest Autoware without problems on it. colcon automatically uses it from the autoware workspace. |
thanks, cleaning the cmake cache worked for me. |
Description
Currently, We are using Google's glog library to capture stack traces when a process dies, which is very useful for development. See examples in Autoware: ex1, ex2.
Due to the way of ROS 2 component launch procedure, glog sometimes be loaded as a module. However, it's not permissible to initialize glog multiple times, and glog will terminate the process if this occurs.
We can find some discussions about that, for example here.
To avoid this, it's necessary to use the
IsGoogleLoggingInitialized()
API, introduced in version v0.6.0 of glog. However, the glog deb package distributed with Ubuntu 22 is based on version v0.4.0. I plan to resolve this issue by registering version v0.6.0 in the repos.I note that the Ubuntu 24 glog deb package adopts version v0.6.0, so updating to Ubuntu 24 will allow us to eliminate this dependency.
Related links
Tests performed
kill -15 <pid>
will show the glog on terminalNotes for reviewers
Interface changes
None
Effects on system behavior
None (glog version will be updated. We need to follow the update in each package)
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.