Some notes for people migrating to flox 0.9.0

Hi there,

Here are some notes from my attempt to migrate from flox 0.3.6 to 0.9.0.

After downloading and installing 0.9.0, I tried flox list:

  • My first error was expected to be on the right side of–`` because I had flox activate -e flox/default in my .zshrc file

  • Then I tried flox help and flox list and got the message Could not parse config: missing field 'search_strategy'. I fixed this by renaming my ~/.config/flox/flox.toml file.

  • I tried again flox list and got an error, with a red cross,No environment found in "/Users/etorreborre". This is a bit harsh :-).

  • Then I wanted to recreate my environments. So I logged in with flox auth login. Everything good

  • I tried to search for one of my packages with flox search atuin. It’s taking forever, so I stopped and had a look at the search options, finally decided to use -v. That printed "This may take a while the first time you run it". I think it would make sense to display the message without the -v flag at first.

  • But then, very cool flox show atuin is super fast! Even searching for another package, that was not installed is instantaneous. Yes!

  • I tried to install with flox install atuin -r etorreborre/default. I was expecting the environment to be created by default remotely but that didn’t work

  • So I created a default environment with flox init and installed atuin with flox install atuin.

  • Then I pushed with flox push. All good!

  • I then created a folder scala under /Users/etorreborre/.local/state/flox to create a scala environment (is it the right XDG place to do this?) and started recreating my Scala environment.

  • I must say that I love the new conceptual model, of a .flox directory that you can push and pull! This is a lot better than the environment / project distinction that existed before.

  • Then I installed a lot more stuff.

  • Some versions seem to be missing. For example I previously installed dune-3.12.1 but now I can only search and install 3.11.1

  • flox list could present the data on 2 columns, with the version in the second column (like it was before). Right now it is something like:

atuin: atuin (17.0.1)
bat: bat (0.24.0)
bottom: bottom (0.9.6)
btop: btop (1.2.13)
curl: curl (8.4.0)
direnv: direnv (2.32.3)
....
  • I am getting an error for flox install opam
ERROR: Failed to build package 'opam': error: builder for '/nix/store/31gs99583z3wmbx2y8zm55l2ppx7saah-opam-2.1.5.drv' failed with exit code 2;
       last 10 log lines:
       >       ml2c_property(Virtual_packages*, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, CUDFProperty*, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const, CUDFProperty*>>>*, long) in libmccs_stubs.a(mccs_stubs.o)
       >       ml2c_package(Virtual_packages*, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, CUDFProperty*, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const, CUDFProperty*>>>*, int&, long) in libmccs_stubs.a(mccs_stubs.o)
       >       ml2c_propertydef(Virtual_packages*, long) in libmccs_stubs.a(mccs_stubs.o)
       >       ml2c_propertydeflist(Virtual_packages*, long) in libmccs_stubs.a(mccs_stubs.o)
       >       ...
       > ld: symbol(s) not found for architecture arm64
       > clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
       > File "caml_startup", line 1:
       > Error: Error during linking (exit code 1)
       > make: *** [Makefile:135: build-opam] Error 1
       For full logs, run 'nix-store -l /nix/store/31gs99583z3wmbx2y8zm55l2ppx7saah-opam-2.1.5.drv'.

But I am left in the dark on what to do. I was able to install it ok with the previous flox version (I retried an install today and it works ok).

  • I was also not able to re-install

    • nodePackages.pnpm even though I can see it in search.nixos.org
    • ormolu. It conflicts with ghcid ❌ ERROR: 'ghcid' conflicts with 'ormolu'. Both packages provide the file '/lib/links/libgmpxx.4.dylib' even if I was able to install it previously. I edited the environment to add an ormolu.optional = true entry and got a message telling me that I could set the priority of the preferred package to something < 5. I tried ormolu.priority = 3 and that worked. This is a lot of guesswork though.
    • the exact version of Apache Kafka I’m using apache-kafka-2.13-3.3.1. I can’t use another version for … reasons :-).
    • ‘unfree’ packages. For example _1password: ERROR: package '_1password' failed to evaluate: Package ‘1password-cli-2.23.0’. I tried to do export NIXPKGS_ALLOW_UNFREE=1 as suggested but that did not help.
  • I have the same issue with the terraform package.

  • I got an error when listing one of my environments

flox list -d ockam
❌ ERROR: failed to parse contents of locked manifest: invalid type: null, expected a string
  • Unfortunately I’m stuck on the error above. I tried to remove the lock file, and get it to be recreated with flox list but I end up with the same error.

  • The issue seems to be caused by this package

      "influxdb2": {
        "attr-path": [
          "legacyPackages",
          "aarch64-darwin",
          "influxdb2"
        ],
        "info": {
          "broken": false,
          "description": null,
          "license": null,
          "pname": "influxdb2",
          "unfree": false,
          "version": null
        },
        "input": {
          "attrs": {
            "lastModified": 1708174113,
            "narHash": "sha256-L5/HWtl7UIsM4K/UO9CwIKVLXvT+WBU0BY8ElBKP5p8=",
            "owner": "NixOS",
            "repo": "nixpkgs",
            "rev": "8aa544c473432bff526fdf2995f8efdcc8f5a033",
            "type": "github"
          },
          "fingerprint": "69c92929d8a509bc1903b475004a45e454c254a35c63c066231bf25f2129af02",
          "url": "github:NixOS/nixpkgs/8aa544c473432bff526fdf2995f8efdcc8f5a033"
        },
        "priority": 5
      },

I suppose that "version": null is the unexpected field.

  • When I activate an environment I am getting some errors messages
flox activate -r etorreborre/scala                                                                                                                                                                                                                       ✅ You are now using the environment etorreborre/scala (remote).
To stop using this environment, type 'exit'
❌ ERROR: expected `<cmd>` to be on the right side of `--`
❌ ERROR: expected `<cmd>` to be on the right side of `--`
flox [etorreborre/scala etorreborre/dotfiles etorreborre/default] etorreborre@eric-mbp ~ %

And my custom starship prompt gets broken. I suspect that this is due to my own setup somehow. I was expecting an old command flox activate -e command to be somewhere but I can’t find anything like this. If you have a hunch, please tell!

  • One question: how can I manage flox with flox itself? flox search flox returns nothing :-).

  • I discovered that FloxHub was accessible at https://hub.flox.dev. It’s gorgeous and I think it deserves a mention in the help because otherwise there’s no way to list all the remote environments I have created.

  • The notion of a catalog is still a bit obscure to me. It is supposed to be

  • There’s a bug in the doc where @ for a package version ends-up being interpreted as 'email protected`

  • I like the emoticons in the various messages

That’s it for today. This is overall very positive and I can’t wait to get the full experience including publishing my own packages (I have one or 2).

1 Like

Wow, such a thorough write up. Apologies for us missing the config migration…Really appreciate it <3

your RC file can now be flox activate -r etorreborre/default

I tried to search for one of my packages with flox search atuin. It’s taking forever, so I stopped and had a look at the search options, finally decided to use -v. That printed "This may take a while the first time you run it". I think it would make sense to display the message without the -v flag at first.

the first search should display that message about it taking awhile the first time. and should take about 30 seconds. sounds like it took much longer than that and didn’t display. will do some poking with your theme to see if I can get it to not display for me.

I then created a folder scala under /Users/etorreborre/.local/state/flox to create a scala environment (is it the right XDG place to do this?) and started recreating my Scala environment.

The intent is for a project environment to be in the repo. So, if you have a scala project you would run flox init in, for example, ~/scala-project/ root. But flox is flexible so you can store environments wherever you want…and if the same environment is useful across multiple scala project you might consider pushing the environment and then pulling the same environment in each of the scala project roots.

Some versions seem to be missing.

We are working on this with top priority (same with the search performance).

I am getting an error for flox install opam

We’ll take a look! Subscribe to this issue for updates

[can’t install] nodePackages.pnpm

We don’t include all of nixpkgs in flox’s search results…yet but should be able to fix in an upcoming release very soon. same with unfree (which I +1’d on your behalf)

Unfortunately I’m stuck on the error above. I tried to remove the lock file, and get it to be recreated with flox list but I end up with the same error.

Created a bug for this. Thanks for reporting!

One question: how can I manage flox with flox itself? flox search flox returns nothing :-).

We will get back to delivering flox with flox soon but needed to take a pause to undo the circular dependency when we made some disruptive changes.

And my custom starship prompt gets broken.

+1’d this improvement on your behalf

The notion of a catalog is still a bit obscure to me. It is supposed to be

It’s very thin right now, Flox ships with a catalog that you search. We’re going to be expanding its functionality soon!

There’s a bug in the doc where @ for a package version ends-up being interpreted as 'email protected`

Thanks! will fix

the first search should display that message about it taking awhile the first time. and should take about 30 seconds

I think it took more than 30 seconds for me and my connection was pretty bad this afternoon.

The intent is for a project environment to be in the repo. So, if you have a scala project you would run flox init in, for example, ~/scala-project/ root

I was more aiming to create a Scala environment that I could reuse across all my Scala projects. I was just wondering if you already had some XDG best practices for storing these kind of environments.

And my custom starship prompt gets broken.

I fixed this. First I used -v to get more info about what was running on flox activate. I saw that /bin/zsh was invoked and, after a bit of searching I found a .zshrc which I didn’t realize I had (with old-style flox commands).
Then I remove the setup I had where one of my environments was called dotfiles and was mostly having a hook to start a zsh shell with the right ZDOTDIR. Now I just have the right .zshrc file, at the right place. In that file I have:

eval "$(flox activate -d $XDG_STATE_HOME/flox/default)"
eval "$(starship init zsh)"

and now the prompt displays ok.

Thanks for your help!

1 Like

I realize there’s a mix-up between ormolu and opam. This issue should mention opam not ormolu.

On the other hand I had an issue with ormolu where installing both ghcid and ormulu returned an error Both packages provide the file '/lib/links/libgmpxx.4.dylib. The trick I used was to manually change the priority for ormolu but there were no clear indications:

  1. That I would have to do that
  2. That it was even possible

Yes, @ the priority thing we are working on that error message up and will hopefully make it a bit more clear. Thanks again!

Just wanted to say that I have been using 0.9.0 for most of the week now.
Aside from the issues mentioned in this thread, I have had 0 issues.

Not only that, but switching environments is noticeably faster. Good job, team!

1 Like