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

glog flags like --logtostderr are missing on a clean build #28

Closed
jeroen-dhollander opened this issue May 24, 2018 · 3 comments
Closed

Comments

@jeroen-dhollander
Copy link

Please use this template for reporting suspected bugs or requests for help.

Issue Description

If you run the build_openr.sh script on a clean system where OpenR has not been compiled before,
the glog flags are missing from the openr binary (so you do not see them in the help, and trying to use them complains about these flags being missing).

The reason for this is that build_openr.sh builds glog before gflags:

#
# install other dependencies from source
#
install_glog
install_gflags

Which means the glog installation can't find gflags, so it doesn't include those.

This can be seen for example in the logging.h file.

On the first compile:

└─⊳ grep -1 gflags\.h deps/glog/src/glog/logging.h
#if 0
#include <gflags/gflags.h>
#endif

On the second compile:

└─⊳ grep -1 gflags\.h deps/glog/src/glog/logging.h
#if 1
#include <gflags/gflags.h>
#endif

The fix is to simply reorder those lines so gflags is always created before glog

Environment

  • tag or commit hash on which this occured
  • OS version: <e.g. ubuntu-16.04>
    I used 439a9cd890e37749de4a1c94aa5091c61ef79090, but the issue is still present on master

Minimal test code / Steps to reproduce the issue

  1. do a clean compilation of openr

What's the actual result?

openr --logtostderr
openr[5961]: Starting OpenR daemon.
ERROR: unknown command line flag 'logtostderr'

What's the expected result?

openr --logtostderr
openr[6010]: Starting OpenR daemon.
I0524 18:05:40.330364  6013 Main.cpp:419] Starting Watchdog thread ...
I0524 18:05:40.340278  6017 NetlinkSystemHandler.cpp:114] Initializng Netlink from server thread
I0524 18:05:40.340450  6017 Main.cpp:480] Starting NetlinkSystem server...
I0524 18:05:40.340917  6018 Main.cpp:504] Starting ConfigStore thread...
I0524 18:05:40.341977  6020 Main.cpp:524] Starting ZmqMonitor thread...
I0524 18:05:40.343966  6022 Main.cpp:549] Starting KvStore thread...
<snip>
@saifhhasan
Copy link
Contributor

saifhhasan commented May 24, 2018

Thanks @jeroen-dhollander for finding issue as well as root-causing it. Would you be interested in authoring pull request with the fix?

And maybe same for fbzmq as open/r depends on fbzmq to compile it ?
https://github.com/facebook/fbzmq/blob/master/build/build_fbzmq.sh#L244

We can send it out internally if you're running busy :)

@jeroen-dhollander
Copy link
Author

I'll try to create a pull request later today.

facebook-github-bot pushed a commit to facebookarchive/fbzmq that referenced this issue May 25, 2018
Summary:
To support glog's command line arguments like --logtostderr, it requires gflags.

If gflags is not found, glog will still compile but the command line arguments will be absent.

As glog was created before gflags, that was the case on a clean build.
Note that on subsequent builds gflags already existed, so a second build 'magically' made the command line arguments appear.

Title: glog flags like --logtostderr are missing on a clean build

Description:

See facebook/openr#28
Closes #10

Differential Revision: D8168516

Pulled By: saifhhasan

fbshipit-source-id: b8185bcc8ba7411254b66e8ed0a9edc9d689efaf
facebook-github-bot pushed a commit that referenced this issue May 29, 2018
Summary:
To support glog's command line arguments like --logtostderr, it requires gflags.

If gflags is not found, glog will still compile but the command line arguments will be absent.

As glog was created before gflags, that was the case on a clean build.
Note that on subsequent builds gflags already existed, so a second build 'magically' made the command line arguments appear.

Pull Request Template
Title: glog flags like --logtostderr are missing on a clean build

Description:

See #28
Closes #29

Differential Revision: D8168498

Pulled By: saifhhasan

fbshipit-source-id: 419f29a6c103cfecd38693fa66187568bbe9c3f9
@saifhhasan
Copy link
Contributor

Issue has been resolved. Closing

facebook-github-bot pushed a commit that referenced this issue Mar 14, 2022
Summary:
X-link: facebook/fb303#28

X-link: facebook/fboss#115

X-link: facebook/folly#1736

X-link: facebook/proxygen#403

X-link: facebook/fbthrift#488

This adds a way to pass arguments to the `b2` build tool, used by Boost. This is needed in order to link a getdeps built boost into an relocatable `.so`. The motivating use case is that we need to statically link Boost into a native library used by a python wheel, which must be relocatable. This functionality already exists for CMake-based projects.

Reviewed By: mackorone

Differential Revision: D34796774

fbshipit-source-id: 0d6a9f4703865dc02048b87e77394c44ef646af6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants