lopsided98 / nix-ros-overlay

ROS overlay for the Nix package manager
Apache License 2.0
173 stars 69 forks source link

Fix overriding in ignition.fuel-tools4 #349

Closed mikepurvis closed 4 months ago

mikepurvis commented 5 months ago

This aligns it to the other ones:

       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'gazebo-11.14.0'
         whose name attribute is located at /nix/store/rz50qm74nicyhql7wrsibvanlj5kdm78-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'propagatedBuildInputs' of derivation 'gazebo-11.14.0'

         at /nix/store/rz50qm74nicyhql7wrsibvanlj5kdm78-source/pkgs/stdenv/generic/make-derivation.nix:402:7:

          401|       depsHostHostPropagated      = elemAt (elemAt propagatedDependencies 1) 0;
          402|       propagatedBuildInputs       = elemAt (elemAt propagatedDependencies 1) 1;
             |       ^
          403|       depsTargetTargetPropagated  = elemAt (elemAt propagatedDependencies 2) 0;

       error: function 'anonymous lambda' called with unexpected argument 'ignition-msgs'

       at /nix/store/135xw2s8a4wmi65nzwbfwywc81d9j7x5-source/pkgs/ignition/fuel-tools/4.nix:1:1:

            1| { callPackage, ignition } @ args :
             | ^
            2|

For now I'll pass it instead using the ignition scope, but it would be nice to have this consistent.

mikepurvis commented 5 months ago

Related to this, I would suggest adding a protobuf key to the ignition scope and pulling from it by default in the ignition packages. I'm currently porting us forward to nixos-23.11 and having to override protobuf individually in several places in order to achieve binary coherence:

  ignition = prev.ignition // {
    protobuf = final.pkgs.protobuf3_20;
    msgs5 = prev.ignition.msgs5.override {
      inherit (final.ignition) protobuf;
    };
    transport8 = (prev.ignition.transport8.override {
      inherit (final.ignition) protobuf;
    }).overrideAttrs (old: {
      # SES-3788: Not strictly a runtime dependency, but adding it as one here for development ease.
      propagatedBuildInputs = old.propagatedBuildInputs ++ [ final.ignition.cmake2 ];
    });
  };
  gazebo_11 = prev.gazebo_11.override {
    boost = final.ros-boost;
    inherit (final.ignition) protobuf;
  };

If that's an acceptable change, lmk and I'll send a separate PR for it.