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 nowexec()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 whereflox 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 activatenow 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.
runanddev) are now prevented. If you find yourself accidentally using the wrong mode then setoptions.activate.modein 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 executivereplacesflox-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 executivewhich 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 theexecutive. - Services are no longer restarted from scratch when there are no modifications to the environment, which speeds up some uses of
flox services startandflox services restart. - Impure environment variables (not set in your manifest) will no longer leak into services in subsequent
flox services start,flox services restart, andflox activate -sinvocations. - A warning will be return if
flox services startorflox services restartare called fromhook.on-activatein order to prevent deadlocks. If you want to start services with an activation thenflox activate -sshould be used.
Other features and fixes:
flox initdetects.node-versionfiles in addition to.nvmrcfor Node.js version detection.flox initprefers LTS (even-numbered) Node.js versions when auto-detecting which package to install.- Commands without explicit
--diror--remoteflags 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!