-
Notifications
You must be signed in to change notification settings - Fork 98
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
nix-shell failure #3041
Comments
Perhaps NixOS/nixpkgs#153686 will help. I'll give it a try. |
That worked but then I ran into this:
|
I suspect a newer version of @ggreif, it looks like you may have been trying to do that via NixOS/nixpkgs#109571. Do you have any suggestions? |
That version of |
It looks like I can work around those with the Now running into nmattia/niv#332 |
With the following changes I was successfully able to enter a diff --git a/nix/default.nix b/nix/default.nix
index 70f10a5a..187928ff 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -88,6 +88,46 @@ let
};
})
+ (self: super: {
+ # https://github.com/nmattia/niv/issues/332#issuecomment-958449218
+ niv = self.haskell.lib.compose.overrideCabal (drv: { enableSeparateBinOutput = false; }) super.haskellPackages.niv;
+
+ # https://github.com/NixOS/nixpkgs/pull/109571
+ wasmtime = with self; rustPlatform.buildRustPackage rec {
+ pname = "wasmtime";
+ version = "0.32.0";
+
+ src = fetchFromGitHub {
+ owner = "bytecodealliance";
+ repo = pname;
+ rev = "v${version}";
+ sha256 = "sha256-iko2G2cUIQYv7Sia8fLtb7d6XCbpOKz31ST62eE19B0";
+ fetchSubmodules = true;
+ };
+
+ cargoSha256 = "sha256-z8x004BbRWi9cRf2I27uiFuu2Jnr1Z3Ey992S5hdyNs";
+
+ nativeBuildInputs = [ python cmake clang ];
+ buildInputs = [ llvmPackages.libclang ] ++
+ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
+ LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
+
+ configurePhase = ''
+ export HOME=$TMP;
+ '';
+
+ doCheck = true;
+
+ meta = with lib; {
+ description = "Standalone JIT-style runtime for WebAssembly, using Cranelift";
+ homepage = "https://github.com/bytecodealliance/wasmtime";
+ license = licenses.asl20;
+ maintainers = [ maintainers.matthewbauer ];
+ platforms = platforms.unix;
+ };
+ };
+ })
+
];
};
in
diff --git a/nix/sources.json b/nix/sources.json
index 0eec0718..31f4acbc 100644
--- a/nix/sources.json
+++ b/nix/sources.json
@@ -97,16 +97,16 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
- "branch": "release-21.11",
+ "branch": "backport-153630-to-release-21.11",
"builtin": true,
"description": "Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels",
"homepage": null,
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "d1e59cfc49961e121583abe32e2f3db1550fbcff",
- "sha256": "03ldf1dlxqf3g8qh9x5vp6vd9zvvr481fyjds111imll69y60wpm",
+ "rev": "17de6590083e80981c4459354530ca6411de485b",
+ "sha256": "05fvgqh4j01wfriqzrhfsaf3sb4knv14gmj1682f88xjfbl4qwgi",
"type": "tarball",
- "url": "https://github.com/NixOS/nixpkgs/archive/d1e59cfc49961e121583abe32e2f3db1550fbcff.tar.gz",
+ "url": "https://github.com/NixOS/nixpkgs/archive/17de6590083e80981c4459354530ca6411de485b.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs-mozilla": { |
@paulyoung Great that you can use
So don't hold your breath just yet :-) |
this is supposed to improve testing frobbed from dfinity/motoko#3041
For what it’s worth, I learned the I don’t think I have |
I've come back to this after a while and now I'm somehow seeing a different wasmtime error:
|
I'm getting the same error trying to install |
With bytecodealliance/rustix#275, rustix now works on macOS versions that lack |
Related: NixOS/nixpkgs#166965 |
I was able to build moc binaries on aarch64 with a simpler nix file. It has been tested with nix 2.8.0 and unstable channel on a 2021 m1 mbp running OS X 12.3.1. In particular, I think the nix configuration should let users choose their own |
As an option, certainly. But by default we do want to pin nixpkgs, right? |
Yes of course |
Let me elaborate a bit. On CI I think it is always good to pin a nixpkg version, do static build, cross compiling, etc etc. On a dev's machine, having the exact setup as CI should be optional, because it is rarely needed, especially when native platform differs. I spent some time yesterday on this because I wanted to have a fully working nix-shell of https://github.com/dfinity/ic on my new work laptop (m1 MBP). It was a lot simpler to use rustup for that purpose, but for testing, I need to pull in dependencies which include the motoko repo. So I spent some time to get nix-build working on m1. I might spend a bit more time to clean up a few things and upstream my patches (and also to get dfx compiling too) but no guarantees... |
I’d say, in that case CI should also run that particular native platform :-) Especially with things like using a specific nightly or even patching this I think the default should be that |
Normally I'd agree with you, but buildRustPackage is such a pain... unless somebody solves the incremental build problem for using rust in nix, I'd prefer a very impure dev environment like rustup |
Note that we do have a separate (make- and/or cargo based) incremental build setup where nix only provides the tools. We are not using nix-build for incremental work. |
@ninegua I tried your branch and ran into this:
I tried again with |
Which version of nixpkgs are you using? |
@paulyoung For m1 OS X, you have to switch to use unstable channel, which has wasmtime 0.36.0. For m1 Linux, you need to stay with the 21.11 channel, which has wasmtime 0.21.0. It is unfortunate that 0.21.0 panics in wasmtime testing on m1 OS X, while 0.36.0 panics in testing on m1 Linux. Edit: If your failure if related to NIXPKGS_ALLOW_BROKEN, then you should also add Also, wasmtime is not needed for compilation, so if it gets in the way, you can comment it out from |
I was able to build all binaries on aarch64 OS X and Linux. You can try it out https://github.com/ninegua/ic-nix |
I'm encountering the following when trying to enter a
nix-shell
.macOS Monterey, Version 12.0.1 (21A559)
The text was updated successfully, but these errors were encountered: