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

rqt-{robot,common}-plugins is pulling in multiple python-qt-binding packages and failing to build #301

Open
kjeremy opened this issue Sep 8, 2023 · 3 comments

Comments

@kjeremy
Copy link
Contributor

kjeremy commented Sep 8, 2023

I threw the following under examples/ and did a nix-build ./ros-blah.nix:

{ pkgs ? import ../. {} }:
with pkgs;
with rosPackages.noetic;

mkShell {
  nativeBuildInputs = [
    (buildEnv {
      paths = [
        rqt-robot-plugins
      ];
    })
  ];
}

I get this error:

building
error: collision between `/nix/store/rhl1f35rrqgm6kz8yjvijdxb17x3h0fv-ros-noetic-python-qt-binding-0.4.4-r1/share/python_qt_binding/cmake/sip_configure.py' and `/nix/store/hk76klg7vwy20n2kpagmp16d3f508kp3-ros-noetic-python-qt-binding-0.4.4-r1/share/python_qt_binding/cmake/sip_configure.py'
error: builder for '/nix/store/ivdccsrwk3m9pa18mbb18v4ds62lxr21-ros-env.drv' failed with exit code 25;
       last 2 log lines:
       > building
       > error: collision between `/nix/store/rhl1f35rrqgm6kz8yjvijdxb17x3h0fv-ros-noetic-python-qt-binding-0.4.4-r1/share/python_qt_binding/cmake/sip_configure.py' and `/nix/store/hk76klg7vwy20n2kpagmp16d3f508kp3-ros-noetic-python-qt-binding-0.4.4-r1/share/python_qt_binding/cmake/sip_configure.py'
       For full logs, run 'nix log /nix/store/ivdccsrwk3m9pa18mbb18v4ds62lxr21-ros-env.drv'.
error: 1 dependencies of derivation '/nix/store/advq9q3s7hhsr4q0cib548wznsgyga11-nix-shell.drv' failed to build

The same thing occurs if you replace rqt-robot-plugins with rqt-common-plugins and enable NIXPKGS_ALLOW_INSECURE=1 for qtwebkit-5.212.0-alpha4

@kjeremy kjeremy changed the title rqt-robot-plugins is pulling in multiple python-qt-binding packages and failing to build rqt-{robot,common}-plugins is pulling in multiple python-qt-binding packages and failing to build Sep 8, 2023
@hacker1024
Copy link
Contributor

hacker1024 commented Sep 12, 2023

This is because rqt-robot-plugins includes rqt-rviz, and RViz uses a modified version of python-qt-binding.

I suggest removing rqt-rviz. You can still use it at the same time by building another environment just for it, if that helps.

{ pkgs ? import ../. {} }:
with pkgs;
with rosPackages.noetic;

mkShell {
  nativeBuildInputs = [
    (buildEnv {
      paths = [
        (rqt-robot-plugins.overrideAttrs ({ propagatedBuildInputs ? [ ], ... }: {
          propagatedBuildInputs = lib.remove rqt-rviz propagatedBuildInputs;
        }))
      ];
    })
  ];
}

@kjeremy
Copy link
Contributor Author

kjeremy commented Sep 12, 2023

This is from a much larger derivation:

rqtScript =
    let
      env = (with rosDistro; buildEnv {
        name = "configured-rqt-env";
        paths = [
          ros-environment
          rospack

          rqt-gui-bin
          # rqt-robot-plugins seems to pull in conflicting versions of python-qt5 and python-qt-binding
          # rqt-common-plugins does something similar.
          # https://github.com/lopsided98/nix-ros-overlay/issues/301
          #rqt-common-plugins
          #rqt-robot-plugins
        ] ++ extraMsgs;
      }).override ({ paths, ... }: {
        paths = paths ++ (with rosDistro.python.pkgs; [
          # many plugins require these
          pycryptodomex
          python-gnupg
          defusedxml

          # rqt-bag
          pillow
          pycairo
          cairocffi
          cffi

          # process monitor
          psutil

          # rqt-graph
          pydot

          # rqt-plot requires one of these:
          pyqtgraph
          matplotlib

          # navigation viewer
          pyopengl

          # web
          # JAK: Disable to avoid collisions with gazebo_sims. Maybe there's an alternative for this.
          # pyqt5_with_qtwebkit
        ]
        # We no longer install dev outputs by default, which means we don't get
        # propagatedBuildInputs from non-ROS packages in buildEnv.  Propagate
        # pyqt's PyQt5.sip dependency manually.
        #++ pyqt5_with_qtwebkit.propagatedBuildInputs
        );
      });

      defaultArgs = if (defaultRqtConfig == null) then [ ] else [ defaultRqtConfig ];
    in
    writeConfiguredScriptBin "configured-rqt" ''
      # Fix up the python path so rqt can find its plugins
      export PYTHONPATH="${env}/${rosDistro.python.sitePackages}''${PYTHONPATH:+:$PYTHONPATH}"

      # If no args are explicitly given, use a platform-specific config file
      if [[ $# == 0 ]]; then set -- ${lib.escapeShellArgs defaultArgs}; fi

      exec ${env}/bin/rqt "$@"
    '';

That makes it's way into a .desktop file eventually and is installer in a per-robot development environment.

@ZaneReda
Copy link

ZaneReda commented Mar 20, 2024

New to this whole process and working with nix. Is there a way to solve this globally? I have a ROS module being imported from a flake nixosConfiguration and I would like to just be able to use 'desktop' for simplicity sake. I am looking into overriding the package but I am unsure how this works with such a large dependency tree. Can I 'iteratively' override packages and their respective dependencies? Would this even solve the problem? Not sure if I have the domain knowledge to ask this properly so I apologize in advance. Here is my ROS.nix module:

{config, pkgs, ...}:
{

  nixpkgs.config.permittedInsecurePackages = [
    "qtwebkit-5.212.0-alpha4"
  ];
  
imports = let
    nix-ros-overlay = builtins.fetchTarball {
      url = https://github.com/lopsided98/nix-ros-overlay/archive/develop.tar.gz;
      sha256 = "sha256:06mfh4mg8bqm9kbqis4j9xfdrqy2g37lijccdhcf4h371zf2y4yx";
    };
in [ (nix-ros-overlay + "/modules/ros1/ros.nix")
     (nix-ros-overlay + "/modules/ros1/core.nix")
     (nix-ros-overlay + "/modules/ros1/nodes.nix")
     (nix-ros-overlay + "/modules/common.nix") ]; # Makes ros usable and initializes the roscore service, can check with systemctl status roscore.service


  services.ros = {
    enable = true;
    distro = "noetic";
    pkgs = pkgs.rosPackages.noetic;
    systemPackages = p: with p; [ 
    desktop # Some override here??
    ];
  };

  nix = {
    settings = {
      extra-substituters = [ "https://ros.cachix.org" ];
      extra-trusted-public-keys = [ "ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=" ];
    };
  };



}

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

No branches or pull requests

3 participants