Skip to content
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

"ROS" packages already in nixpkgs #536

Open
nim65s opened this issue Dec 8, 2024 · 3 comments · May be fixed by #538
Open

"ROS" packages already in nixpkgs #536

nim65s opened this issue Dec 8, 2024 · 3 comments · May be fixed by #538

Comments

@nim65s
Copy link
Contributor

nim65s commented Dec 8, 2024

Hi,

Could we override some packages from the overlay to directly use those provided by nixpkgs, instead of trying to re-declare and re-build things from ROS ?

Context: I'm the maintainer (upstream + nixpkgs + ROS) of a few things (eg. eigenpy / hpp-fcl / pinocchio): pinocchio is in better shape in nixpkgs than in ROS. For example in nixpkgs we can enable the casadi optional dependency, while in ROS that's harder since casadi is not packaged in ubuntu.

Also, since pinocchio requires lot of RAM and time to build, I think it would be very beneficial for your build & cache infra :)

NB: I'm speaking of non-ROS-only packages, which are packaged in rosdistro. Maybe it make little or no difference for pure ROS packages, but version constraints might be harder.

@nim65s
Copy link
Contributor Author

nim65s commented Dec 8, 2024

Hum, wait, that's already the case, isn't it ?
You're wonderful, thank you.

@nim65s nim65s closed this as completed Dec 8, 2024
@nim65s
Copy link
Contributor Author

nim65s commented Dec 8, 2024

Actually, that's half the case, this is why I was mislead in the first place:

$ nix repl
Lix 2.91.1
Type :? for help.
nix-repl> :lf github:lopsided98/nix-ros-overlay
Added 17 variables.

nix-repl> outputs.legacyPackages.x86_64-linux.humble.pinocchio                 
«derivation /nix/store/ka5slb3x93ky1k8s1i7710qdpbwlq1fi-ros-humble-pinocchio-2.6.21-r1.drv»

nix-repl> outputs.legacyPackages.x86_64-linux.humble.python3Packages.pinocchio
«derivation /nix/store/gac53bw2ryvinpyf40rfwc3b5mpkskgw-pinocchio-3.2.0.drv»

Pinocchio is both available as a C++ library and a python module, and, here, the 2.6.21r1 C++ library is from rosdistro, and the 3.2.0 python module from nixpkgs

@nim65s nim65s reopened this Dec 8, 2024
nim65s pushed a commit to nim65s/nix-ros-overlay that referenced this issue Dec 8, 2024
@nim65s nim65s linked a pull request Dec 8, 2024 that will close this issue
nim65s added a commit to nim65s/nix-ros-overlay that referenced this issue Dec 8, 2024
@hacker1024
Copy link
Contributor

hacker1024 commented Jan 21, 2025

This occurs because ROS packages are in one scope, while Python packages are in another. Using a ROS callPackage will shadow Nixpkgs packages from the scope above, but not packages in the Python scope.

i.e.

rosPackages.rolling.callPackage ({
  buildRosPackage
, pinocchio # Shadowed by the ROS definition
, python3Packages # Not defined by this overlay, so straight from Nixpkgs
}: buildRosPackage { /* ... */ }) { };

It would probably be a good idea to check for existing packages either in Superflore or in a step after running it.


rtabmap is another shadowed package that would benefit from this. I have a personal overlay that uses the Nixpkgs definition with the nix-ros-overlay version and source:

rtabmap = self.rtabmap.overrideAttrs {
  inherit (rosSuper.rtabmap)
    pname
    version
    src;
};

nim65s added a commit to nim65s/nix-ros-overlay that referenced this issue Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants