-
Notifications
You must be signed in to change notification settings - Fork 33
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
Run hsthrift CI with LD_BIND_NOW=1 environment variable #90
Comments
This was referenced Jul 12, 2022
dsp
added a commit
to dsp/hsthrift
that referenced
this issue
Jul 12, 2022
Issue facebookincubator#88 and facebookincubator#90 describe that depending on system GHC can lazily link all symbols or strictly link them at link time. To ensure we consistently test that all the symbols in the binary are available, we need to set LD_BIND_NOW to a non empty string. This will force ld to resolv all symbols (see https://man7.org/linux/man-pages/man8/ld.so.8.html) at link time.
facebook-github-bot
pushed a commit
that referenced
this issue
Jul 12, 2022
Summary: The following PR addresses various build issues that occur when GHC does load symbols strictly at build times. exi's did an investigation in #90. GHC on NixOS is compiled with _GNU_SOURCE leading to dlsym using RTLD_DEFAULT, causing strict loading. For hsthrift his means various symbols cannot be found at compile time and error out. With the following stack I am able to build hsthrift and Glean NixOS. However I have **not** tested it on any other platform just yet (Notable the docker image). I want to highlight commit 83ed60e, since it moves Utils/Executor.cpp to cpp/Executor.cpp and I am not sure if that's okay. The rest of the PR should be straight forward. This is branch includes PR #89 and should cleanly rebase if needed. Pull Request resolved: #91 Reviewed By: pepeiborra Differential Revision: D37779175 Pulled By: dsp fbshipit-source-id: ddd593f77b7c99eb037c9e469bf2a5c62c76fe98
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The GHC version obtained via ghcup seems to be build without the _GNU_SOURCE compiler macro.
This causes it to default to lazy symbol loading .
This in turn hides compilation errors because missing symbols will only show up when they are actually called.
hsthrift compilation fails under nixos because it is compiling GHC with _GNU_SOURCE and in turn does not default to lazy loading of symbols, this causes "undefined symbol" errors during compilation.
To reproduce this run:
This will correctly fail with the following error:
PR #89
Already addresses this particular compilation issue but I think it would be prudent to disable lazy loading in the CI to catch these errors in the future.
The text was updated successfully, but these errors were encountered: