Open lockshaw opened 5 months ago
To debug this, you can move the outputs to the build directory using the following patch and then preserve them with nix build .#rapidcheckPatched --keep-failed -L
:
--- a/rapidcheckPatched.nix
+++ b/rapidcheckPatched.nix
@@ -31,6 +31,11 @@ stdenv.mkDerivation (finalAttrs: {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
+ postFixup = ''
+ cp -r "$out" outOutput
+ cp -r "$dev" devOutput
+ '';
+
meta = with lib; {
description = "A C++ framework for property based testing inspired by QuickCheck";
inherit (finalAttrs.src.meta) homepage;
The build log will end with something like the following:
note: keeping build directory '/tmp/nix-build-rapidcheck-unstable-2023-12-14-patched.drv-2'
Then, to find the cycle, you can search for the dev
output reference in the out
tree:
$ rg /nix/store/8jca2z8r3yiv1xgz8m5nbc2lf2wyb8nc-rapidcheck-unstable-2023-12-14-patched-dev /tmp/nix-build-rapidcheck-unstable-2023-12-14-patched.drv-2/source/build/outOutput/
/tmp/nix-build-rapidcheck-unstable-2023-12-14-patched.drv-2/source/build/outOutput/share/rapidcheck/cmake/rapidcheckConfig.cmake
62: INTERFACE_INCLUDE_DIRECTORIES "/nix/store/8jca2z8r3yiv1xgz8m5nbc2lf2wyb8nc-rapidcheck-unstable-2023-12-14-patched-dev/include"
Apparently, a cmake file referring to the dev
output is responsible for the cycle, because it remained in out
.
The solution is to either remove the reference (which would break builds since the reference is used to find headers), or move the cmake file to dev
output.
We actually have a setup hook for that but it does not support cmake files in datadir, only in libdir:
Describe the bug
Along the lines of https://discourse.nixos.org/t/could-weve-implemented-multi-output-packages-better/6597/6, the cmake configuration for the rapidcheck package (
share/rapidcheck/cmake/rapidcheckConfig.cmake
) expects theinclude
directory to exist, but it is instead in thedev
output which is located at a different path, yielding the resulting error message:I attempted the fix recommended by @jtojnar in https://github.com/jtojnar/cmake-snips in https://github.com/lockshaw/rapidcheck/commit/7f82845ac2b10fa854c739ce2af4497cd8604387 (definitely possible my attempted fix is incorrect, it was blind guesswork based on the previous
fmt
PR), but when I try to build the new package locally to test the fix I encounter the following error:Steps To Reproduce
See https://github.com/lockshaw/rapidcheck-issue for a minimal example (also contains a workaround that provides the expected behavior)
Notify maintainers
@Ericson2314
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.