Skip to content

How to use insta-cmd with Crane #534

Closed Answered by ipetkov
msfjarvis asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like you have to build your actual binary before running the tests which require it:

diff --git a/flake.nix b/flake.nix
index 8df72eb..aed0d96 100644
--- a/flake.nix
+++ b/flake.nix
@@ -63,8 +63,14 @@
         cargoToml = ./adx/Cargo.toml;
       };
 
-      cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {doCheck = false;});
-      adx = craneLib.buildPackage (commonArgs // {doCheck = false;});
+      cargoArtifacts = craneLib.buildDepsOnly commonArgs;
+      adx-build = craneLib.cargoBuild (commonArgs // {
+        inherit cargoArtifacts;
+      });
+      adx = craneLib.buildPackage (commonArgs // {
+        cargoArtifacts = adx-build;
+        doCheck = false;
+      });

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@msfjarvis
Comment options

@ipetkov
Comment options

Answer selected by msfjarvis
@msfjarvis
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants