-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
abseil-cpp: lock in provided vocabulary type #196718
base: staging
Are you sure you want to change the base?
abseil-cpp: lock in provided vocabulary type #196718
Conversation
Abseil provides a special header that allows software distributions to override compile option dependent features. If this file is left as-is downstream packages will usually fail to link due to undefined references. See the upstream documentation for a more comprehensive explanation: https://github.com/abseil/abseil-cpp/blob/lts_2021_11_02/absl/base/options.h Up till now we allowed to bulid abseil itself with different C++ Standards to overcome this problem, but that approach didn't fully solve it: * The override is an optional argument, so its easy to overlook. * Processes that see multiple variants of the library (becausse they get pulled into the closure by different dependencies) are subject to undefined behavior.
@@ -26,6 +26,10 @@ stdenv.mkDerivation rec { | |||
sha256 = "sha256-dEYMPWpa3J9EqtCq3kubdUYJivNRTOKUpNDx3UC1IcQ="; | |||
}; | |||
|
|||
patches = [ | |||
./absl-string_view.patch |
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.
The patch should have a comment explaining its purpose.
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.
if this works, then it is a really great complexity reducer
This is a respin of #186490, and my comments there still apply. Abseil supports multiple C++ standards versions, and downstream packages have conflicting requirements on this version. The fact that you needed to patch one is proof. There’s no reason to suspect we won’t need more such patches in the future if we try to deviate from upstream in this way. If the goal is to prevent shared library conflicts at runtime, then we should allow |
This is still an issue with static linking, thankfully it should fail when linking a shared object or executable and not at runtime. Edit: Corrected option values. |
Having them in the same package closure isn’t a problem. I can even load Having them in the same link command would be a problem. Is that a problem we have? Seems to me the appropriate response is “don’t do that, then”—just like it would be if you tried to link both
If you write an incorrect derivation, a build failure sounds like the right result to me. |
I have that problem right now trying to build |
Description of changes
Abseil provides a special header that allows software distributions
to override compile option dependent features. If this file is left
as-is downstream packages will usually fail to link due to undefined
references.
See the upstream documentation for a more comprehensive explanation:
https://github.com/abseil/abseil-cpp/blob/lts_2021_11_02/absl/base/options.h
Up till now we allowed to bulid abseil itself with different C++
Standards to overcome this problem, but that approach didn't fully
solve it:
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notescc @andersk @ilya-fedin @SuperSandro2000