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
How to override glibc with a patch for a specific package? #50329
Comments
CC @Ericson2314 @dtzWill as you may know this from the cross compilation efforts. |
According to the documentation of overlays you should be able to use overlays. Now, if that doesn't work, this shouldn't be a question, but it should be filed as a bug. |
I think you will need to do it by overriding stdenv. You should be able to do this with stdenvOverrides: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/stage.nix#L99-L103 But it will be a mass rebuild causing because GCC needs glibc. With my PR here: You should be able to do what you are asking without a mass rebuild using |
@matthewbauer I'm not familiar with that, how do I do it? Do I stick (mass rebuild is OK to me, since it'll be confided to everything built on top of the so-modified nixpkgs import) |
Maybe you don't need stdenvOverrides, actually. I think something like this should work:
|
Hmm, that gets me |
Here's my error:
|
This is going to suck until libc is just a regular library. Until then, overriding stdenv is the right approach. |
@nh2 Have you a working stdenv with your patched glibc? |
@dguibert No, I didn't manage to get that, and used |
Got it working with: let
unmodified_nixpkgs = import <nixpkgs> {};
nixpkgs = import <nixpkgs> {
overlays = [ (self: super: {
glibc = ....;
})];
};
in nixpkgs nixpkgs contains a stdenv with the modified glibc. ps: the functions |
@dguibert Can you post the full |
@thongpv3, here is the content of the overriden glibc let
nixpkgs = import <nixpkgs> {
overlays = [ (final: prev: {
glibc = prev.glibc.overrideAttrs (old: {
name = "my-patched-glibc-${old.version}";
patches = [
#https://patches-gcc.linaro.org/patch/21643/raw/
./malloc-Fix-missing-accounting-of-top-chunk-in-malloc_info-BZ-24026.diff
];
});
})];
};
in nixpkgs |
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel. |
Still important to me. |
I marked this as stale due to inactivity. → More info |
A bit related: #129595 |
I marked this as stale due to inactivity. → More info |
My Haskell app calls
malloc_info()
for online memory usage reporting.I have patched a bug in glibc that makes some values show up as always 0.
I would like to build only my Haskell package so that it uses the patched glibc (so that I don't have to rebuild all the other packages, like Chromium, that my package merely
execve()
s).I'm considering:
But my Haskell package doesn't seem to pick up this
glibc
override; it is not compiled at all.@cleverca22 thinks it's due to
nixpkgs/pkgs/top-level/default.nix
Lines 91 to 97 in 0249f7d
How can I make an override, overlay, or otherwise, to have my package use my patched glibc?
The text was updated successfully, but these errors were encountered: