DeterminateSystems/riff

Riff shell broken on aarch64-darwin

sphw opened this issue ยท 4 comments

sphw commented

I tried to run riff shell on an M1 MBP, and received the following error:

โœ“ ๐Ÿฆ€ rust: bzip2, cargo, clang, cmake, darwin.apple_sdk.frameworks.CoreFoundation, darwin.apple_sdk.frameworks.Security, llvm, llvmPackages.libclang, pkg-config, protobuf, rustPlatform.bindgenHook, rustc, rustfmt, zlib (LIBCLANG_PATH)
error: flake 'path:/var/folders/fg/8bpf1rk10rs3mhnf6m911jqr0000gn/T/.tmpo7femD' does not provide attribute 'devShells.aarch64-darwin.devShell.aarch64-darwin', 'packages.aarch64-darwin.devShell.aarch64-darwin', 'legacyPackages.aarch64-darwin.devShell.aarch64-darwin', 'devShell.aarch64-darwin' or 'defaultPackage.aarch64-darwin'
Error:
   0: Unable to parse output produced by `nix print-dev-env` into our desired structure
   1: EOF while parsing a value at line 1 column 0

Location:
   src/nix_dev_env.rs:13

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

I successfully ran riff shell on a M1 Pro MBP. So this is likely project-related?

sphw commented

I successfully ran riff shell on a M1 Pro MBP. So this is likely project-related?

I tried this in a fresh a Rust project as well, and got the same error. It might be related to my local Nix configuration, but I'm not sure why that would be the case.

โžœ  ~ cargo init --bin xyz
     Created binary (application) package
โžœ  ~ cd xyz/
โžœ  xyz git:(master) โœ— riff shell
โœ“ ๐Ÿฆ€ rust: cargo, rustc, rustfmt
error: flake 'path:/var/folders/fg/8bpf1rk10rs3mhnf6m911jqr0000gn/T/.tmpuubIMv' does not provide attribute 'devShells.aarch64-darwin.devShell.aarch64-darwin', 'packages.aarch64-darwin.devShell.aarch64-darwin', 'legacyPackages.aarch64-darwin.devShell.aarch64-darwin', 'devShell.aarch64-darwin' or 'defaultPackage.aarch64-darwin'
Error:
   0: Unable to parse output produced by `nix print-dev-env` into our desired structure
   1: EOF while parsing a value at line 1 column 0

Location:
   src/nix_dev_env.rs:13

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Consider reporting this error using this URL: https://github.com/DeterminateSystems/riff/issues/new?title=%3Cautogenerated-issue%3E&body=%23%23+Error%0A%60%60%60%0AError%3A+%0A+++0%3A+Unable+to+parse+output+produced+by+%60nix+print-dev-env%60+into+our+desired+structure%0A+++1%3A+EOF+while+parsing+a+value+at+line+1+column+0%0A%60%60%60

Could you check if #115 fixes this for you? It seems to me like you're running a slightly older version of Nix that doesn't yet look for devShells.<arch>.default for the default shell environment. However, devShell.<arch> should also work and resolve your issue.

EDIT: Thanks for the report!

EDIT2: There's a prebuilt aarch64 binary available from https://buildkite.com/organizations/determinate-systems-inc/pipelines/riff/builds/43/jobs/018314b3-e03c-4c69-88b2-ee656c11a03e/artifacts/018314b4-1f79-492b-a988-ea24377ea478. (If that doesn't work, visit https://buildkite.com/determinate-systems-inc/riff/builds/43#018314b3-e03c-4c69-88b2-ee656c11a03e, and then click the Artifact tab.)

sphw commented

Could you check if #115 fixes this for you? It seems to me like you're running a slightly older version of Nix that doesn't yet look for devShells..default for the default shell environment. However, devShell. should also work and resolve your issue.

I just tried out the pre-built binary that you linked and it fixed the issue. Thanks for the quick fix and response!