NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.73k stars 13.17k forks source link

`protobuf.override` doesn't work as expected #272151

Open lilyball opened 7 months ago

lilyball commented 7 months ago

Describe the bug

protobuf and the version-specific variants (e.g. protobuf3_20, protobuf3_21, etc) are implemented internally using callPackage. This means I can’t override them myself because they're exposed in the top-level pkg set as callPackage that invokes callPackage, and so the only arg visible to override is callPackage.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Try to override protobuf with something like protobuf.override { stdenv = myCustomizedStdenv; }

Expected behavior

I should get a modified protobuf derivation with my new stdenv.

Additional context

Add any other context about the problem here.

Notify maintainers

@jonringer

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix run nixpkgs#nix-info -- -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.60, NixOS, 23.11 (Tapir), 23.11.20231029.0cbe9f6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.1`
 - nixpkgs: `/etc/nix/inputs/nixpkgs`

Add a :+1: reaction to issues you find important.

jonringer commented 7 months ago

maybe we should just create a small package set and move all the protobuf logic into that...

I'll try and create something tonight.