-
Notifications
You must be signed in to change notification settings - Fork 83
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
depthai* packages fail to build downloading hunter dependencies to /homeless-shelter #412
Comments
Hi! The root of the problem is that the package tries to download the dependencies at build time. Nix builds are run in a sandbox without network access, so the build would fail even if you create the directory (as you're trying in your example). We solve these issues in this overlay with the help of I'm not sure whether it's possible to persuade cmake not to use hunter, but system-provided dependencies. There is a So I ended here. You can continue by studying how Hunter works and how to replace it with Nix. It will require patching of cmake code and maybe other things. This is the derivation I ended up experimenting with: new-depthai = ros.humble.depthai.overrideAttrs (old: {
postPatch = ''
sed -i -e '2a find_package(PkgConfig REQUIRED)' CMakeLists.txt
'';
cmakeFlags = [ "-DHUNTER_ENABLED=OFF" ];
nativeBuildInputs = old.nativeBuildInputs ++ [
pkgs.pkg-config
];
propagatedBuildInputs = old.propagatedBuildInputs ++ [
pkgs.bzip2
];
}); |
@wentasah it looks like pre-populating the |
Yeah, this might work. Actually, this would be similar to how Gradle applications are packaged in nixpkgs. Their dependencies are provided as a fixed-output derivation (FOD). This has the advantage that FODs can access network to download the dependencies. Then, the application has this FOD as one of the buildInputs. Here, in the simplest case, one could set With respect to updating the hash - yes, it would be annoying, but IMO updating a single hash is still better than requiring everybody to build the package manually. It seems depthai in ROS has just a few updates a year so it won't be big problem. And if it is, update of the hash could be automated in the CI. |
the depthai packages are failing to build because they try to download dependencies to /homeless-shelter
here is a minimal flake with the issue, it contains my attempt to fix it by setting HOME in an override (which i don't think is correct)
The text was updated successfully, but these errors were encountered: