Nix: provide stacks-common#5973
Nix: provide stacks-common#5973malikwirin wants to merge 5 commits intostacks-network:feat/clarity-wasm-developfrom
Conversation
|
Thanks @malikwirin! Incidentally I did have a local patch that fixes the I see this is marked as WIP. Let me know once it's ready for review and I'll take a look. |
I already have a PR that fixes the clarity-wasm immutable source issue: stx-labs/clarity-wasm#627 but maybe you got a more elegant solution Using the patch causes the build of stacks-common to fail for a new reason which I am not yet really sure about. A short excerpt: |
|
I did a bit of digging and I think the problem is as follows:
stacks-core/.cargo/config.toml Line 17 in fa0a21c It seems |
|
Update, I think I made quite some progress. So the reason we had that failure is that when So the fix was to add For completeness, here's the full |
|
@aldur I believe its ready for review. The build of stacks-common doesn't currently terminate on the computer I have currently available because it only has 16gb of ram |
contrib/nix/flake.nix
Outdated
| isClarityWASM = p: lib.hasPrefix "git+https://github.com/stacks-network/clarity-wasm.git" p.source; | ||
|
|
||
| cargoVendorDir = craneLib.vendorCargoDeps ( | ||
| baseArgs | ||
| // { | ||
| # Use this function to override crates coming from git dependencies | ||
| overrideVendorGitCheckout = | ||
| ps: drv: | ||
| if lib.any (p: isClarityWASM p) ps then | ||
| drv.overrideAttrs | ||
| (_old: { | ||
| patches = [ | ||
| (builtins.fetchurl { | ||
| url = "https://github.com/stacks-network/clarity-wasm/pull/627.patch"; | ||
| sha256 = "sha256:161mx1m21770lrsc2lfqlwzyydhy8f9bc7pmqb26rcki7s2ar31r"; | ||
| }) | ||
| ]; | ||
| }) | ||
| else | ||
| # Nothing to change, leave the derivations as is | ||
| drv; | ||
|
|
||
| # Use this function to override crates coming from any registry checkout | ||
| overrideVendorCargoPackage = p: drv: drv; | ||
| } | ||
| ); |
There was a problem hiding this comment.
If we wait for 627 to merge, then we can get rid of this.
| inherit version; | ||
| pname = name; | ||
| src = fileSetForCrate ../..; | ||
| dummySrc = commonArgs.src; |
There was a problem hiding this comment.
Can you add a comment to remember us why we need this? Effectively, this is disabling pre-building any cargo dependency. I think it's an unfortunate byproduct of how the workspace is structured right now, so not much we can do until we fix that.
There was a problem hiding this comment.
Would this still be needed when stx-labs/clarity-wasm#627 is merged?
There was a problem hiding this comment.
Unfortunately yes, because of how dependencies refer to each other (with WASM depending on stacks-common).
I have tried building it and it succeeded, despite the build taking 22 minutes. |
feba1c4 to
537dda6
Compare
Can or should we decrease the checking? |
We should but I am not sure we can -- I'll compare with a build from EDIT: I did two builds, one from |
|
Closing this for now since there's an alternative solution for Clarinet: stx-labs/clarinet#1515 (comment). We can revisit this if it becomes relevant again. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
This PR aims to provide stacks-common via its flake.nix for it to be used in a nix package definition of clarinet.
Applicable issues
Additional info (benefits, drawbacks, caveats)
The impurity in the build process of clar2wasm issue gets patched in the flake.nix