-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
getrandom()
backwards compatibility shim
#21158
base: stable
Are you sure you want to change the base?
Conversation
Thanks for your pull request, @0xEAB! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + dmd#21158" |
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.
Thanks for looking into solutions for this.
Before we get something like this in, can we please consider all other options that don't involve new build configurations? These tend to stack up into an unmaintainable mess for Martin (or another unfortunate soul) to thanklessly untangle later.
Asking users to build their own version of the library and the compiler is bad UX, especially since the linker error they see doesn't hint to the existence of this flag. And the change didn't just break usage of std.random.unpredictableSeed, it reportedly broke an empty D program. I'd be pretty annoyed if I had to jump through hoops just because a module I don't even use was changed.
- Can we make the symbol link on an as-needed basis, perhaps by making the functions that depend on
getrandom
templates? - Can we define the
getrandom
stub as a weak symbol so it automatically links it when the (hopefully strong) GLibC symbol is missing? - Can we use late binding (dlopen / dlsym) to try to link
getrandom
at runtime?
Actually… Thanks for reviewing this.
Sure thing! :)
The more sustainable, the better. |
Sorry for the additional noise, but I’m already phrasing and typing my messages for the second time. I accidentally lost my first draft by hitting the back button on my mouse.
As we are dealing with a linker error, that’s is a given, ain’t it?
Fair enough. You either didn’t jump through the sys upgrade hoop either or are using a very LTS distro to avoid additional sys upgrade hoop. Or in other words, this inconvenience affects the exact person that would be annoyed the most by running into it. Yeah, it’s not exactly nice. So let me clarify this… I didn’t write this patch this way because I thought it was the most ideal solution but because it was the most straightforward one. And especially because submitting a PR would hopefully show that I do care about the issue at hand. |
Fair question. I’m afraid that this change would bubble up a bit and could do so a bit too much. Luckily, most of
We could. At least to my understanding of the matter. However, if someone were to write a shim that did actually perform the proper
|
Curl is third party/optional however. This is about different abi versions of a core library dependency. If there's a version it should be opt-in rather than opt-out.
|
Thanks for all the feedback, everyone! |
People have been unhappy about the new
getrandom()
dependency.Check out the sibling PR dlang/phobos#10741 for further details.