Big Release! Flox 1.9.0 is now available with some major updates!

TLDR; The activation subsystem was rewritten from Bash to Rust, and process parentage was reworked to allow automated invocations of Flox (such as third-party service managers) to track processes. There are a few breaking changes to make note of, as well as a number of performance improvements and a few outstanding bug fixes.

Changes to flox activate:

  • [breaking change] It is recommended to exit all current activations or reboot after installing, especially if you are using Flox services.
  • [breaking change] flox activate -- <command> will now exec() the provided command without invoking your user shell or profile scripts, which is both more efficient and maintains the same PID throughout.
  • A new flox activate -c "<command_script>" feature has been added which provides the previous semantics of --. This can be used to run scripts in your default shell where flox activate -- <shell> -c "<command_script>" might have previously been used.

Additional changes to activate:

  • The core of activation has been rewritten from Bash to Rust which has reduced the startup latency for activations, in addition to improving reliability and testability.
  • flox activate now maintains the same PID all the way through to the command or interactive shell that you execute which makes it possible for automated invocations of Flox (such as third-party service managers) to track the process.
  • Activation hooks will now re-run whenever the modification of an environment is activated, even if it has been activated previously. Concurrent activations of modified environments will block on each other with a warning to prevent conflicts between concurrent runs of the activation hooks.
  • Concurrent activations of an environment in different modes (e.g. run and dev) are now prevented. If you find yourself accidentally using the wrong mode then set options.activate.mode in the environment manifest. This avoids a bug where exiting an activation in one mode could stop services even when an activation in a different mode is still running (Share services between all activation modes of an environment ยท Issue #2357 ยท flox/flox ยท GitHub).
  • flox-activations executive replaces flox-watchdog, which is responsible for tracking state for activations. Only one instance of the process will be started for all activations of an environment, itโ€™s now more efficient at tracking attachments to an activation, and more reliable at recovering from failures

Services:

  • Services and their child processes are now parented to flox-activations executive which makes them easier to identify in process listings. Linux platforms additionally enable a sub-reaper to ensure that zombie processes get parented and reaped by the executive.
  • Services are no longer restarted from scratch when there are no modifications to the environment, which speeds up some uses of flox services start and flox services restart.
  • Impure environment variables (not set in your manifest) will no longer leak into services in subsequent flox services start, flox services restart, and flox activate -s invocations.
  • A warning will be return if flox services start or flox services restart are called from hook.on-activate in order to prevent deadlocks. If you want to start services with an activation then flox activate -s should be used.

Other features and fixes:

  • flox init detects .node-version files in addition to .nvmrc for Node.js version detection.
  • flox init prefers LTS (even-numbered) Node.js versions when auto-detecting which package to install.
  • Commands without explicit --dir or --remote flags no longer error when they detect an active FloxHub environment.
  • Expired FloxHub tokens are no longer automatically deleted, so activating environments under your handle no longer triggers a โ€œdo you want to trust this environment?โ€ prompt after expiry, and a persistent reminder to re-authenticate is shown instead.

Notes and download links here!

1 Like