Closed grnnja closed 7 months ago
Probably the locked nixpkgs version is too old.
cc @hacker1024
Ah yep, sorry about that!
We should maybe start using lib.getOutput
when using specific outputs, as that handles missing outputs gracefully. In this case, the cxxdev
output is not needed on older Nixpkgs revisions that don't have it.
I'm not sure how that can be implemented in rosdistro, though - we might just need to split on the period in Super Flore.
A silly workaround for immediate use would be to add an opencv
overlay like so:
self: super:
{
opencv = super.opencv.override ({ passthru ? { }, ... }: self.lib.optionalAttrs (!super.opencv ? cxxdev) {
passthru = passthru // { cxxdev = self.opencv; };
});
}
@hacker1024 I assume its super.opencv.overrideAttrs
, since passthru is an attribute and not the argument.
By chance, is it possible to easily fix this? If i just override opencv, my computer has to rebuild a lot of packages.
I updated nixpkgs. Probably will break 10 new things though...
Build is fixed now, but Gazebo just seems to hang without ever opening a window when I tested it.
Build is fixed now, but Gazebo just seems to hang without ever opening a window when I tested it.
I've seen this happen when the pinned Nixpkgs gets too old in comparison to the revision used to build NixOS.
Is it related to this? https://github.com/lopsided98/nix-ros-overlay/issues/323
I patched my devshell with this and it stopped roscore from hanging, not sure if it is the same issue.
Here I have similar problems. I was using flakes to build the project and it succeeded. However, when I tried to run the launch file, it gave me the same outcome as shown in the second case of the original post. The same thing happened when I simply ran 'roscore' from the terminal.
Is it related to this? #323
I patched my devshell with this and it stopped roscore from hanging, not sure if it is the same issue.
It looks like this is in fact the issue. It originates from this issue in ros_comm https://github.com/ros/ros_comm/issues/2352
which is fixed by this pull request: https://github.com/ros/ros_comm/pull/2353
which is where the patch in https://github.com/lopsided98/nix-ros-overlay/issues/323 originates from.
@grnnja can you share the last working commit of this repo (nix-ros-overlay) that you were using before making this issue?
Hi all, having the same issue with roscore hanging with the following versions: nixpkgs: branch: nixpkgs-unstable hash: 0fbcc4b2e8571f4af39be41752581ea09dd9ab06 nix-ros-overlay: branch: master hash: 5f5fc569845b81487033d553c748e140e2ef4ca2
I can also provide a minimal example if that's helpful
@MatthewCroughan @taylorpool I don't have the exact commit where nix-ros-overlay worked for me, but I have it working right now after applying the rosgraph patch I mentioned here https://github.com/lopsided98/nix-ros-overlay/issues/343#issuecomment-1937419031.
Here is a minimal flake and the patch.
flake.nix
:
{
description = "A basic flake with a shell";
inputs =
{
nixpkgs.url = "github:lopsided98/nixpkgs/nix-ros";
flake-utils.url = "github:numtide/flake-utils";
ros-flake.url = "github:lopsided98/nix-ros-overlay";
};
outputs = { self, nixpkgs, flake-utils, ros-flake }:
flake-utils.lib.eachDefaultSystem (system:
let
# fixes roscore hanging
# https://github.com/lopsided98/nix-ros-overlay/issues/323
fix-ros-logging = (final: prev: {
rosPackages.noetic = prev.rosPackages.noetic.overrideScope (rosSelf: rosSuper: {
rosgraph = rosSuper.rosgraph.overrideAttrs ({ patches ? [ ], ... }: {
patches = patches ++ [
./rosgraph.patch
];
});
});
});
pkgs = import nixpkgs
{
inherit system;
overlays = [
ros-flake.overlays.default
fix-ros-logging
];
};
ros = pkgs.rosPackages.noetic;
in
{
devShell = pkgs.mkShell
{
buildInputs = with pkgs; [
ros.ros-core
];
};
});
# I had to add myself as a trusted user in my nixos config for this to work
# https://discourse.nixos.org/t/nix-build-trying-to-build-basic-tools-for-all-packages-from-scratch/11097/4
nixConfig = {
substituters = "https://cache.nixos.org https://ros.cachix.org";
trusted-public-keys = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=";
};
}
rosgraph.patch
:
diff --git a/ros_comm-release-release-noetic-rosgraph-1.16.0-1/src/rosgraph/roslogging.py b/ros_comm-release-release-noetic-rosgraph-1.16.0-1-patched/src/rosgraph/roslogging.py
index 9ecc121..5adc95f 100644
--- a/src/rosgraph/roslogging.py
+++ b/src/rosgraph/roslogging.py
@@ -69,6 +69,8 @@ class RospyLogger(logging.getLoggerClass()):
break
if f.f_back:
f = f.f_back
+ else: # Reached the last stack frame and found no matching one.
+ raise ValueError("Could not find function [%s] on the framestack"%func_name)
# Jump up two more frames, as the logger methods have been double wrapped.
if f is not None and f.f_back and f.f_code and f.f_code.co_name == '_base_logger':
That worked! Thank you so much!
e239e71fd2ce40ce1f7499328a4c92e9473fec88
Hi! I'm having difficulty running the example turtlebot flake command. It tries to find
opencv.cxxdev
but can't. Not sure if this is a problem on my end.with the nix shell example, it pulls the packages and compiles successfully but I am unable to run the demo. I let it sit for a few minutes and nothing happened before I ctrl+c'd the process. Again I'm not sure if this is a problem on my end or not.