Stream: beginners

Topic: upgrading nix issues


view this post on Zulip Mario (Oct 14 2022 at 09:44):

Hey all – bit stuck trying to refresh my roc env after some time.

Reinstalled nix to get latest version, and now getting this odd error:

# mario ~/dev/projects/roc ± main o                                                                                                                                              10:40:31
$ nix develop --show-trace
error: getting status of '/nix/store/6pakgwxwz07gifgrzgckj6730qmk9k1g-source': No such file or directory

       … while realising the context of path '/nix/store/6pakgwxwz07gifgrzgckj6730qmk9k1g-source/flake.nix'

       at «string»:20:19:

           19|
           20|           flake = import (sourceInfo + (if subdir != "" then "/" else "") + subdir + "/flake.nix");
             |                   ^
           21|

       … while evaluating anonymous lambda

       at «string»:10:13:

...etc

Have tried nix store delete --all to clear everything out, destroying the target folder... can't seem to find where/why this nix pkg ref is occurring nor how to progress this any further.

view this post on Zulip Mario (Oct 14 2022 at 09:44):

$ nix --version
nix (Nix) 2.11.1

view this post on Zulip Luke Boswell (Oct 14 2022 at 09:56):

I'm not sure I can help you much. I'm running nix 2.11.0 on macOS and the latest main and it seems to be working fine. I upgraded to the latest stable nix version which was the same version. I wonder if there is an issue being 2.11.1?

view this post on Zulip Anton (Oct 14 2022 at 10:19):

Hi Mario, can you confirm that this is a recent main without any changes (git status)?

view this post on Zulip Mario (Oct 14 2022 at 10:45):

$ git reset --hard origin/main
HEAD is now at 89a4522fa Merge pull request #4178 from roc-lang/macos-11-nightly

# mario ~/dev/projects/roc ± main o                                                                                                                                              11:45:18
$ nix develop
error: getting status of '/nix/store/6pakgwxwz07gifgrzgckj6730qmk9k1g-source': No such file or directory
(use '--show-trace' to show detailed location information)

view this post on Zulip Anton (Oct 14 2022 at 11:00):

I think nix store delete --all is being a bit too careful, I would give rm -rf /nix/store/* a try.

view this post on Zulip Mario (Oct 14 2022 at 12:15):

Doing that means nix binary disappears as well (same cycle I went through before). Re-ran the nix install again, now failing here

view this post on Zulip Mario (Oct 14 2022 at 12:15):

~~> Setting up the default profile

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo HOME=/var/root /nix/store/dmk5m3nlqp1awaqrp1f06qhhkh3l102n-nix-2.11.1/bin/nix-env -i /nix/store/dmk5m3nlqp1awaqrp1f06qhhkh3l102n-nix-2.11.1

to install a bootstrapping Nix in to the default profile

installing 'nix-2.11.1'
error: opening file '/nix/store/m2qh5gz2m9y8wjyag4i05gkhj5cy1shl-user-environment.drv': No such file or directory

---- oh no! --------------------------------------------------------------------
Jeeze, something went wrong. If you can take all the output and open
an issue, we'd love to fix the problem so nobody else has this issue.

:(

We'd love to help if you need it.

You can open an issue at https://github.com/nixos/nix/issues

Or feel free to contact the team:
 - Matrix: #nix:nixos.org
 - IRC: in #nixos on irc.libera.chat
 - twitter: @nixos_org
 - forum: https://discourse.nixos.org

view this post on Zulip Mario (Oct 14 2022 at 12:15):

It's all feeling really wrong :/

view this post on Zulip Mario (Oct 14 2022 at 12:16):

1600 issues on nix repo so doubt I'll get much help there

view this post on Zulip Mario (Oct 14 2022 at 12:17):

# mario ~/dev/projects/roc ± main o                                                                                                                                              13:14:26
$ nix
zsh: command not found: nix

view this post on Zulip Mario (Oct 14 2022 at 12:17):

Whelp, that's the end of roc play time for today :sweat_smile:

view this post on Zulip Anton (Oct 14 2022 at 12:21):

Yeah sorry, I'd recommend looking up how you can remove all files and folders created by nix for your OS and doing a clean nix install.
If you just want to write roc without contributing to the source code you can try the nightly releases.

view this post on Zulip Mario (Oct 14 2022 at 13:27):

Yeah okay, sadly uninstalling is confusingly involved, so I'll have to return to that later. I wanted to make a inconsequential contribution to docs styling and figured I could get the cargo stuff running quickly that way as I was having issues using cargo build directly.

view this post on Zulip Anton (Oct 14 2022 at 13:46):

I'd be happy to try and fix the regular cargo build as well if you're willing to share the error message. I've setup building on many devices, VMs and CI machines so it's likely to be a familiar error.

view this post on Zulip Mario (Oct 14 2022 at 14:45):

Sure!

# mario ~/dev/projects/roc/crates/docs ± main o                                                                                                                                  15:44:58
$ cargo build
   Compiling toml v0.5.9
   Compiling sized-chunks v0.6.5
   Compiling backtrace v0.3.66
   Compiling snafu-derive v0.7.1
   Compiling tracing-attributes v0.1.22
   Compiling strum_macros v0.24.3
   Compiling roc_builtins v0.0.1 (/Users/mario/dev/projects/roc/crates/compiler/builtins)
error: failed to run custom build command for `roc_builtins v0.0.1 (/Users/mario/dev/projects/roc/crates/compiler/builtins)`

Caused by:
  process didn't exit successfully: `/Users/mario/dev/projects/roc/target/debug/build/roc_builtins-688c7de844a01c2d/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=build.rs
  Compiling host ir to: /Users/mario/dev/projects/roc/crates/compiler/builtins/bitcode/builtins-host.ll
  Compiling 64-bit bitcode to: /Users/mario/dev/projects/roc/crates/compiler/builtins/bitcode/builtins-host.bc

  --- stderr
  thread 'main' panicked at 'zig failed: No such file or directory (os error 2)', crates/compiler/builtins/build.rs:244:24
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

view this post on Zulip Mario (Oct 14 2022 at 14:47):

Ah – if 'zig failed' means zig wasn't installed (looks like its missing now since nix broke), installing it and re-running gives:

view this post on Zulip Mario (Oct 14 2022 at 14:48):

# mario ~/dev/projects/roc/crates/docs ± main x                                                                                                                                  15:47:20
$ cargo build
   Compiling crossbeam v0.8.2
error: failed to run custom build command for `roc_builtins v0.0.1 (/Users/mario/dev/projects/roc/crates/compiler/builtins)`

Caused by:
  process didn't exit successfully: `/Users/mario/dev/projects/roc/target/debug/build/roc_builtins-688c7de844a01c2d/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=build.rs
  Compiling host ir to: /Users/mario/dev/projects/roc/crates/compiler/builtins/bitcode/builtins-host.ll
  Compiling 64-bit bitcode to: /Users/mario/dev/projects/roc/crates/compiler/builtins/bitcode/builtins-host.bc

  --- stderr
  thread 'main' panicked at 'zig failed 10 times in a row. The following error is unlikely to be a flaky error: error: unable to find zig installation directory '/Users/mario/.local/bin/zig': FileNotFound
  ', crates/compiler/builtins/build.rs:235:25
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Which is weird cause

# mario ~/dev/projects/roc/crates/docs ± main x                                                                                                                                  15:47:23
$ ls -alh `which zig`
-rwxr-xr-x  1 mario  staff   140M 13 Oct 19:25 /Users/mario/.local/bin/zig

view this post on Zulip Richard Feldman (Oct 14 2022 at 14:49):

what does zig version output?

view this post on Zulip Mario (Oct 14 2022 at 14:49):

# mario ~/.local/bin                                                                                                                                                             15:49:48
$ zig version
0.10.0-dev.4333+f5f28e0d2

view this post on Zulip Mario (Oct 14 2022 at 14:51):

Ah, have installed 0.9.1 and it seems to be carrying on :thumbs_up:

view this post on Zulip Mario (Oct 14 2022 at 14:51):

Didn't realise I installed master as it was listed at top of zig install page

view this post on Zulip Richard Feldman (Oct 14 2022 at 14:52):

nice, yeah we can't upgrade to 10 until we upgrade llvm versions, which is nontrivial

view this post on Zulip Richard Feldman (Oct 14 2022 at 14:52):

so we're still on 0.9.1

view this post on Zulip Mario (Oct 14 2022 at 14:52):

Cool. So I guess I can perhaps crack on without nix for now? Are there docs somewhere for how to build the docs?

view this post on Zulip Mario (Oct 14 2022 at 14:53):

My rust is... rusty :D cargo build fine but seems cargo run is a no go on crates or something like that.

view this post on Zulip Mario (Oct 14 2022 at 14:57):

Will follow https://github.com/roc-lang/roc/blob/main/BUILDING_FROM_SOURCE.md a little further later and see if I manage to get further

view this post on Zulip Anton (Oct 14 2022 at 15:18):

Are there docs somewhere for how to build the docs?

Not yet I believe, I think you can extract what you need from www/build.sh.

view this post on Zulip Richard Feldman (Oct 14 2022 at 15:18):

this is how we build the docs on CI: https://github.com/roc-lang/roc/blob/89a4522faa20ee0b3ed0cdeaab07379873b95c3f/www/build.sh#L28

view this post on Zulip Anton (Oct 14 2022 at 15:19):

My rust is... rusty :D cargo build fine but seems cargo run is a no go on crates or something like that.

Most crates are libraries so you can not run them.

view this post on Zulip Mario (Oct 14 2022 at 17:26):

Awesome, got it building :) thanks for the help!


Last updated: Jul 05 2025 at 12:14 UTC