-
Notifications
You must be signed in to change notification settings - Fork 694
Nix: provide stacks-common #5973
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
base: feat/clarity-wasm-develop
Are you sure you want to change the base?
Nix: provide stacks-common #5973
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: stacks-network/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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we wait for 627 to merge, then we can get rid of this.
pname = name; | ||
src = fileSetForCrate ../..; | ||
dummySrc = commonArgs.src; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this still be needed when stacks-network/clarity-wasm#627 is merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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