Your project’s nix-env [maintainer=@Profpatsch]

Related tags

System tools lorri
Overview

lorri

https://github.com/nix-community/lorri

built with nix CI

lorri is a nix-shell replacement for project development. lorri is based around fast direnv integration for robust CLI and editor integration.

👉 Check out our blog post to see how lorri improves on the nix-shell experience during everyday development as well as in common scenarios like channel updates and Nix garbage collection.

The project is about experimenting with and improving the developer's experience with Nix. A particular focus is managing your project's external dependencies, editor integration, and quick feedback.

lorri supports Linux and macOS.

Demo

This screencast shows lorri and direnv working together to reload the development environment as shell.nix is updated:

lorri screencast

Setup on NixOS or with home-manager on Linux

If you are using NixOS or home-manager on Linux and a Nixpkgs channel at least as recent as nixos-19.09, you can get started with lorri as follows. Otherwise see the next section, Setup on other platforms.

  1. Enable the daemon service. Set services.lorri.enable = true; in your NixOS configuration.nix or your home-manager home.nix.

    This will automatically install the lorri command.

    Note: There's a known issue preventing the lorri daemon from starting automatically upon installation. Until it's resolved, you'll have to reload the user daemon by hand by running systemctl --user daemon-reload, or reboot.

  2. Install direnv. Add pkgs.direnv to environment.systemPackages in your NixOS configuration.nix or to home.packages in your home-manager home.nix.

  3. Set up the direnv hook for your shell. See this section of the direnv documentation.

  4. Activate the lorri integration. Run lorri init in your project directory to create a shell.nix and .envrc file. This will not overwrite existing files.

    In your shell, you will now see the following message from direnv:

    direnv: error .envrc is blocked. Run `direnv allow` to approve its content.

    Activate the integration by running direnv allow.

From this point on, lorri monitors your shell.nix and its dependencies and triggers builds as required. Whenever a build succeeds, direnv automatically reloads your environment.

See Usage for more details.

Setup on other platforms

If you are running Nix on a Linux distribution other than NixOS or on macOS, the following instructions will help you get started with lorri.

  1. Install lorri. If you are using a Nixpkgs channel at least as recent as nixos-19.09, you can install lorri using nix-env -i lorri.

    Otherwise, install lorri from the repository as follows:

    $ nix-env -if https://github.com/nix-community/lorri/archive/canon.tar.gz
  2. Start the daemon. For testing, you can start the daemon in a separate terminal by running lorri daemon.

    See contrib/daemon.md for ways to start the daemon automatically in the background.

  3. Install direnv v2.19.2 or later. If you are using a Nixpkgs channel at least as recent as nixos-19.03, you can install a compatible version of direnv using nix-env -i direnv.

    Otherwise, you can install direnv from source as follows:

    $ nix-env -if https://github.com/direnv/direnv/archive/master.tar.gz
  4. Set up the direnv hook for your shell. See this section of the direnv documentation.

  5. Activate the lorri integration. Run lorri init in your project directory to create a shell.nix and .envrc file. This will not overwrite existing files.

    In your shell, you will see the following message from direnv:

    direnv: error .envrc is blocked. Run `direnv allow` to approve its content.

    Activate the integration by running direnv allow.

From this point on, lorri monitors your shell.nix and its dependencies and triggers builds as required. Whenever a build succeeds, direnv automatically reloads your environment.

See Usage for more details.

Usage

Once the daemon is running and direnv is set up, the daemon process will continue monitoring and evaluating the Nix expressions in your project's shell.nix, and direnv will automatically reload the environment as it changes.

direnv will continue to load the cached environment when the daemon is not running. However, the daemon must be running for direnv to reload the environment based on the current shell.nix and its dependencies.

Editor integration

With the right setup, you can use lorri and direnv to customize your development environment for each project.

If you use Emacs, our direnv-mode tutorial is there to help you get started.

This section needs to be fleshed out more (#244).

Associated Projects

lorri embodies a Unix philosophy of doing one thing well. As a result, it works very well with other tools to provide a powerful and streamlined development experience.

direnv is lorri's chief collaborator. From its website:

[direnv] augments existing shells with a new feature that can load and unload environment variables depending on the current directory.

As a foundation, lorri relies on Nix and Nixpkgs to install and manage software packages.

For pinning versions of software during development, niv is very helpful.


Support & Questions

Please use the issue tracker for any problems or bugs you encounter. We are on #lorri on freenode (Webchat), though we might not be responsive at all times.

Why is lorri not on crates.io?

Command line tools written in Rust are commonly available as Rust crates on crates.io. lorri is not distributed in this way, for good reasons.

lorri can only be built within a Nix environment, and it can only be installed via Nix. This is because lorri specifies its runtime dependencies as a Nix closure, and because Nix is itself a runtime dependency of lorri.

In addition to these technical reasons, there is simply no point in running lorri if you don't have Nix installed. And if you have Nix installed, then you're best off installing lorri via Nix.

How To Help

All development on lorri happens on the Github repository, in the open. You can propose a change in an issue, then create a pull request after some discussion. Some issues are marked with the “good first issue” label, those are a good place to start. Just remember to leave a comment when you start working on something.

Debugging

Set these environment variables when debugging:

RUST_LOG=lorri=debug RUST_BACKTRACE=1 lorri watch

lorri reevaluates more than expected

lorri sometimes recursively watches a directory that the user did not expect. This can happen for a number of reasons:

  1. When using a local checkout instead of a channel for nixpkgs, lorri watches that directory recursively, and will trigger on any file change.
  2. When specifying src via a path, (like the much-used src = ./.;) lorri watches that path recursively (see https://github.com/target/lorri/issues/6 for details). To get around this, use a builtins.filterSource-based function to filter src, e.g., use nix-gitignore: src = pkgs.nix-gitignore.gitignoreSource [] ./., or one of the functions in nixpkgs/lib/sources.nix

Upgrading

Upgrading lorri is easy with the lorri self-upgrade command.

By default, the upgrade command will upgrade from the canon branch.

Other upgrade options are available, including upgrading from a local clone. See lorri self-upgrade --help for more details.

Evaluator + watch design

The evaluator should eagerly reevaluate the Nix expressions as soon as anything material to their output changes. This takes place in a few stages.

Initial evaluation

builder::run() instantiates (and builds) the Nix expression with nix-build -vv. The evaluator prints each imported Nix file, and each copied source file. builder::run() parses the log and notes each of these paths out as an "input" path.

Each input path is the absolute path which Nix examined.

Each input path is then passed to PathReduction which examines each path referenced, and reduces it to a minimum set of paths with the following rules:

  1. Discard any store paths which isn't a symlink to outside the store: they are immutable.
  2. Replace any store path which is a symlink to outside the store to the destination of the symlink.
  3. Replace a reference to a Nix Channel with the updateable symlink root of the channel. Concretely, replace the path /nix/var/nix/profiles/per-user/root/channels/nixos/default.nix with /nix/var/nix/profiles/per-user/root/ to watch for the channels symlink to change.

Initial testing collapses over 2,000 paths to just five.

Loop

Each identified path is watched for changes with inotify (Linux) or fsevent (macOS). If the watched path is a directory, all of its sub-directories are also watched for changes.

Each new batch of change notifications triggers a fresh evaluation. Newly discovered paths are added to the watch list.

Garbage Collection Roots

lorri creates an indirect garbage collection root for each .drv in $XDG_CACHE_HOME/lorri (~/.cache/lorri/ by default) each time it evaluates your project.

License & Copyright

Copyright 2019–2020 Target, Copyright 2021 The Nix Community License: Apache 2.0 (see LICENSE file)


ASCII Art
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
#################( )############################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################
################################################################

(Nix as observed by LORRI on 2015-07-13)

Comments
  • Remove varlink and bring back the native server/client socket serialization

    Remove varlink and bring back the native server/client socket serialization

    Fixes https://github.com/nix-community/lorri/issues/4

    Please see commit messages.

    The lorri internal stream-events output probably changes a lot, I didn’t spend any time keeping it backwards compatible. But since it’s experimental and internal we don’t have to care as much. It’s still using serde Serialize instances, but some care was taken to split it from the internal representation.

    • [ ] Amended the changelog in release.nix (see release.nix for instructions)
    opened by Profpatsch 12
  • feature: add a command to remove gc roots for old or removed projects

    feature: add a command to remove gc roots for old or removed projects

    I copied the functionality and option names of nix-store --gc --print-roots and nix-collect-garbage --delete-older-than. To print the original project a gc root corresponds to, I store a symlink to the shell.nix file along with the gc root.

    • [x] Amended the changelog in release.nix (see release.nix for instructions)
    opened by symphorien 9
  • filterSource support

    filterSource support

    Motivation: use nix-gitignore and not have to rebuild on each git fetch I decided accurately respecting the filter in filterSource was too complex, so this implements an approximation.

    • adds a way to watch only directory not recursively
    • when using filtersource on a path, the path is watch non-recursively, and the children satisfying the filter are watched recursively. This way, .git it ignored.
    • [x] Amended the changelog in release.nix (see release.nix for instructions)
    opened by symphorien 9
  • CI: update nixpkgs, add workflow dispatch

    CI: update nixpkgs, add workflow dispatch

    For debugging CI failures.

    Updated Nixpkgs pin, and added workflow_dispatch

    • [ ] Amended the changelog in release.nix (see release.nix for instructions)
    opened by nyarly 7
  • lorri direnv reset `XDG_DATA_DIRS`.

    lorri direnv reset `XDG_DATA_DIRS`.

    Describe the bug

    XDG_DATA_DIRS is overrided which breaks actions like xdg-open with custom mimeapps.list.

    To Reproduce Steps to reproduce the behavior:

    1. Enter a dir
    2. lorri init
    3. shell.nix with patchelf
    4. echo $XDG_DATA_DIRS
    5. direnv allow
    6. After shell updating, echo $XDG_DATA_DIRS

    Expected behavior

    Some variable should not be override or append with its old value like XDG_DATA_DIRS.

    Metadata

    $ lorri info
    lorri version: 1.5
    GC roots exist, shell_gc_root: /home/vonfry/.cache/lorri/gc_roots/c32f056103b9fc7dbad5c6b925e2be4e/gc_root/shell_gc_root
    
    $ uname -a
    Linux pc-lab-shmtu 5.10.37 #1-NixOS SMP Fri May 14 07:50:46 UTC 2021 x86_64 GNU/Linux
    

    Additional context

    nix-direnv doesn't have the problem. It do sth like this.

    opened by Vonfry 7
  • Fix build loop

    Fix build loop

    fix(build_loop): always schedule at most one other build 80e8eb1

    This switches the build loop from blockingly running a build for every event that ever appeared, to always at most running one additional build as soon as the current one finishes.

    Whenver we start a new build, we take the current state of the environment to run nix, which means that all events that happen while a build is running (e.g. pings, filesystem events &c.) should be collapsed into one (1) extra build to be scheduled right after the current build finishes.

    So there is now a stateful current_build variable, which contains one BuildState that is mutably updated from NotRunning to Running and if it’s already running to RunningAndScheduled. Then the “build finished” event becomes just another handler in our giant select!, meaning that as soon as a build finishes we can either go back to NotRunning or go to Running if there had been another build scheduled.

    For now this means inlining once_with_send into the build loop, further refactors to follow to make the logic easier to understand.

    Checklist

    • [ ] Updated the documentation (code documentation, command help, ...)
    • [ ] Tested the change (unit or integration tests)
    • [ ] Amended the changelog in release.nix (see release.nix for instructions)
    opened by Profpatsch 7
  • Lorri daemon does not start automatically with systemd

    Lorri daemon does not start automatically with systemd

    Lorri requires a running daemon, which is expected to be managed by systemd. However, systemd refuses to start lorri, as it claims lorri is configured to refuse manual start/stop, and is by default loaded but inactive. Launching lorri's daemon via command line works.

    To Reproduce

    1. Install lorri via home-manager, stable
    2. Run systemctl --user daemon-reload as indicated (or reboot)
    3. Create a new directory, do lorri init, then direnv allow
    4. Lorri will immediately prompt a warning, stating that 'lorri daemon is not running and this project has not yet been evaluated, please run lorri daemon'

    Expected behavior The daemon should not be handled by hand, but automatically started by anyone (systemd, lorri itself, ...) but me.

    Metadata OS: NixOS 21.05 / Kernel 5.10.66 Lorri: Lorri 1.5 (installed via home-manager, stable channel)

    opened by jthulhu 6
  • RFC: use failure crate for errors

    RFC: use failure crate for errors

    Our current code just uses a primitive “enum error wrapping approach”, which boils down to defining an Error enum type on every level of abstraction, which mostly just wraps the underlying errors that could happen. Then, on some top-level, it dies with a status ≠ 0 and prints the Debug of the outer error.

    This has multiple problems in practice:

    • The resulting error loses all stack traces, no line numbers for where the inner errors were thrown
    • The final backtrace only points to the place where the whole thing is printed (or an expect() fails). The initial causes are not visible and have to be manually tracked through the code
    • Some inner error variants don’t provide much context, e.g. IO::ErrorKind does not want to allocate (for rather obvious reasons), so it does not provide the file name on a “file not found” type situation. We need to annotate these errors with better information.
    • Either we print the Debug representation, which is not very user friendly, or we print a very simple Display that loses all the information.

    We kind of tried to keep errors from users so far by using human-panic, which we can continue using, but the error reports generated were generally of low value and did not help debugging the problem or even reproducing it.

    There is multiple approaches to solving this in the rust ecosystem:

    1. The std::error::Error trait
    2. anyhow + eyre
    3. failure 4 Probably more that I didn’t see

    First, anyhow and its fork eyre both look like promising approaches which will use the new restructuring of the std::errortrait to provide backtraces and make it possible to annotate errors. However, the std::error trait is in the process of being refactored, so all features, especially backtraces, are only available on nightly.

    failures is the experimental crate which originally lead to the redesign of std::error, and it even goes a bit further than the rather conservative changes std is introducing. Its biggest con is that it’s not compatible with the rest of std, so if we provided a library we’d want to use the standard error trait. However, since lorri is an executable we are not restricted by this. Its biggest pro is that it provides extremely detailed usage instructions, complete with usage patterns that the library enables.

    Given that failures has the best story, and we don’t have to care about being downward-compatible with the rest of the ecosystem as a library, I’d propose we go with failures and start converting the existing errors to implement its custom fail type pattern, and annotate any kind of IO error with some more information.

    opened by Profpatsch 6
  • lorri breaks tab completion

    lorri breaks tab completion

    Describe the bug

    To Reproduce Steps to reproduce the behavior on a NixOS system with the lorri daemon running and git and direnv installed:

    1. Enter a basic Nix shell:
      cd "$(mktemp --directory)"
      cat > shell.nix <<EOF
      { pkgs ? import
          (
            fetchTarball {
              name = "21.11";
              url = "https://github.com/NixOS/nixpkgs/archive/a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31.tar.gz";
              sha256 = "162dywda2dvfj1248afxc45kcrg83appjd0nmdb541hl7rnncf02";
            })
          { }
      }:
      pkgs.mkShell {
        name = "test";
      }
      EOF
      nix-shell
      
    2. Verify that commands like git st followed by a Tab auto-suggest "stage stash status".
    3. Enable lorri default configuration:
      exit
      lorri init
      direnv allow
      
    4. Verify that git st followed by a Tab no longer auto-suggests.

    Expected behavior

    Git auto-complete should continue working.

    Metadata

    $ lorri info
    error: The following required arguments were not provided:
        --shell-file <nix_file>
    
    USAGE:
        lorri info --shell-file <nix_file>
    
    For more information try --help
    $ lorri info --shell-file shell.nix
    lorri version: 1.5
    GC roots exist, shell_gc_root: /home/victor/.cache/lorri/gc_roots/167ffda1a9ddc154c50c4959bb23edc3/gc_root/shell_gc_root
    
    $ uname -a
    Linux whenua 5.10.81 #1-NixOS SMP Sun Nov 21 12:46:37 UTC 2021 x86_64 GNU/Linux
    

    Additional context

    Console session with relevant commands and their outputs:

    $ cd "$(mktemp --directory)"
    $ cat > shell.nix <<EOF
    { pkgs ? import
        (
          fetchTarball {
            name = "21.11";
            url = "https://github.com/NixOS/nixpkgs/archive/a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31.tar.gz";
            sha256 = "162dywda2dvfj1248afxc45kcrg83appjd0nmdb541hl7rnncf02";
          })
        { }
    }:
    pkgs.mkShell {
      name = "test";
    }
    EOF
    $ nix-shell
    $ git st
    stage    stash    status
    $ lorri init
    Dec 20 15:59:51.546 INFO file already exists, skipping, message: Make sure shell.nix is of a form that works with nix-shell., path: ./shell.nix
    Dec 20 15:59:51.546 INFO wrote file, path: ./.envrc
    Dec 20 15:59:51.546 INFO done
    direnv: error /tmp/tmp.KtyfnccVGx/.envrc is blocked. Run `direnv allow` to approve its content
    $ direnv allow
    direnv: loading /tmp/tmp.KtyfnccVGx/.envrc
    Dec 20 16:00:04.003 INFO lorri has not completed an evaluation for this project yet, nix_file: /tmp/tmp.KtyfnccVGx/shell.nix
    direnv: export +IN_NIX_SHELL
    $ lorri info
    error: The following required arguments were not provided:
        --shell-file <nix_file>
    
    USAGE:
        lorri info --shell-file <nix_file>
    
    For more information try --help
    $ lorri info --shell-file shell.nix
    lorri version: 1.5
    GC roots exist, shell_gc_root: /home/victor/.cache/lorri/gc_roots/167ffda1a9ddc154c50c4959bb23edc3/gc_root/shell_gc_root
    $ uname -a
    Linux whenua 5.10.81 #1-NixOS SMP Sun Nov 21 12:46:37 UTC 2021 x86_64 GNU/Linux
    
    opened by l0b0 5
  • slog panics when I pipe the output to another command

    slog panics when I pipe the output to another command

    e.g.

    > cargo run -- -v internal stream-events | jq
    …
        Finished dev [unoptimized + debuginfo] target(s) in 0.06s
         Running `target/debug/lorri -v internal stream-events`
    parse error: Invalid numeric literal at line 1, column 4
    thread 'main' panicked at 'slog::Fuse Drain: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', /home/philip/.cargo/registry/src/github.com-1ecc6299db9ec823/slog-2.7.0/src/lib.rs:1944:33
    stack backtrace:
       0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
    …
    
    opened by Profpatsch 5
  • lorri 1.3 evaluates shell.nix on all pings

    lorri 1.3 evaluates shell.nix on all pings

    Describe the bug lorri 1.3 evaluates shell.nix on all pings, an not only on the first one.

    To Reproduce Steps to reproduce the behavior:

    1. create a folder /tmp/foobar with shell.nix:
    with import <nixpkgs> {}; mkShell {}
    
    1. start lorri:
    strace -fe trace=execve -e status=successful --quiet=attach,exit target/release/lorri daemon
    
    1. in /tmp/foobar
    $  for i in $(seq 1 10); do date; lorri internal ping shell.nix; sleep 5; done
    ven. 05 mars 2021 17:47:52 CET
    ven. 05 mars 2021 17:47:57 CET
    ven. 05 mars 2021 17:48:02 CET
    ven. 05 mars 2021 17:48:07 CET
    ven. 05 mars 2021 17:48:12 CET
    ven. 05 mars 2021 17:48:17 CET
    ven. 05 mars 2021 17:48:22 CET
    ven. 05 mars 2021 17:48:27 CET
    ven. 05 mars 2021 17:48:32 CET
    ven. 05 mars 2021 17:48:37 CET
    

    Log:

    $  strace -fe trace=execve -e status=successful --quiet=attach,exit target/release/lorri daemon
    execve("target/release/lorri", ["target/release/lorri", "daemon"], 0x7fffc7c58a20 /* 155 vars */) = 0
    Mar 05 17:47:17.396 INFO ready
    Mar 05 17:47:19.681 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3203] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmppBq7Hr/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3214] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3203, si_uid=1000, si_status=0, si_utime=67, si_stime=12} ---
    [pid  3304] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp8tr87X/result", "--", "/run/user/1000/.tmppBq7Hr/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3305] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3304, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:47:20.755 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:47:23.722 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3360] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpYLmAvD/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3373] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3360, si_uid=1000, si_status=0, si_utime=65, si_stime=12} ---
    [pid  3439] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpmXVt0Y/result", "--", "/run/user/1000/.tmpYLmAvD/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3440] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3439, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:47:24.762 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:47:52.753 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3478] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpbjELxN/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3479] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3478, si_uid=1000, si_status=0, si_utime=62, si_stime=10} ---
    [pid  3495] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp4656ya/result", "--", "/run/user/1000/.tmpbjELxN/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3497] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3495, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:47:53.696 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:47:57.766 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3524] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpVrXEaq/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3526] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3524, si_uid=1000, si_status=0, si_utime=62, si_stime=10} ---
    [pid  3541] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpoaSJCr/result", "--", "/run/user/1000/.tmpVrXEaq/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3522] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3541, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:47:58.757 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:02.781 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3564] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpUatCzq/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3562] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3564, si_uid=1000, si_status=0, si_utime=61, si_stime=12} ---
    [pid  3584] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpQMrnUp/result", "--", "/run/user/1000/.tmpUatCzq/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3586] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3584, si_uid=1000, si_status=0, si_utime=1, si_stime=0} ---
    Mar 05 17:48:03.800 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:07.797 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3607] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpS0Dpws/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3608] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3607, si_uid=1000, si_status=0, si_utime=69, si_stime=12} ---
    [pid  3633] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp247CyY/result", "--", "/run/user/1000/.tmpS0Dpws/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3635] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3633, si_uid=1000, si_status=0, si_utime=1, si_stime=1} ---
    Mar 05 17:48:08.868 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:12.812 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3656] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmp0ZM8TA/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3657] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3656, si_uid=1000, si_status=0, si_utime=68, si_stime=13} ---
    [pid  3673] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpYwzBB8/result", "--", "/run/user/1000/.tmp0ZM8TA/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3654] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3673, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:48:13.876 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:17.826 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3697] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpLlQZ73/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3699] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3697, si_uid=1000, si_status=0, si_utime=62, si_stime=11} ---
    [pid  3714] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpcL6sdt/result", "--", "/run/user/1000/.tmpLlQZ73/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3715] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3714, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:48:18.831 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:22.843 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3745] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpk3IZdS/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3747] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3745, si_uid=1000, si_status=0, si_utime=71, si_stime=14} ---
    [pid  3763] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpKuHVRL/result", "--", "/run/user/1000/.tmpk3IZdS/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3765] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3763, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:48:23.937 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:27.860 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3825] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpJbpqz4/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3828] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3825, si_uid=1000, si_status=0, si_utime=68, si_stime=13} ---
    [pid  3847] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpiaphwB/result", "--", "/run/user/1000/.tmpJbpqz4/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3849] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3847, si_uid=1000, si_status=0, si_utime=1, si_stime=0} ---
    Mar 05 17:48:28.938 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:32.875 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3889] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpdAN3fh/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3890] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3889, si_uid=1000, si_status=0, si_utime=61, si_stime=13} ---
    [pid  3915] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpipr79T/result", "--", "/run/user/1000/.tmpdAN3fh/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3917] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3915, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:48:33.890 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:37.891 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  3943] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpBnP510/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3944] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3943, si_uid=1000, si_status=0, si_utime=68, si_stime=13} ---
    [pid  3992] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmpv887FQ/result", "--", "/run/user/1000/.tmpBnP510/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  3993] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3992, si_uid=1000, si_status=0, si_utime=1, si_stime=0} ---
    Mar 05 17:48:38.959 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    Mar 05 17:48:42.967 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/tmp/foobar/shell.nix"), reason: PingReceived })
    [pid  4060] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-instantiate", ["nix-instantiate", "-vv", "--add-root", "/run/user/1000/.tmpEZlLbv/result", "--indirect", "--argstr", "runTimeClosure", "/nix/store/3ly3k012pnba0nh7bpwvk"..., "--argstr", "src", "/tmp/foobar/shell.nix", "--", "/home/symphorien/.cache/lorri/ca"...], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  4074] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4060, si_uid=1000, si_status=0, si_utime=70, si_stime=13} ---
    [pid  4152] execve("/nix/store/805c9njn1zfhzwh5nj7zzr0lv87lpxfd-nix-2.3.5/bin/nix-build", ["nix-build", "--out-link", "/run/user/1000/.tmp9s78Qy/result", "--", "/run/user/1000/.tmpEZlLbv/result"], 0x7ffde1b7db30 /* 155 vars */) = 0
    [pid  4154] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4152, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
    Mar 05 17:48:44.079 INFO build status, message: BuildEvent(Completed { nix_file: NixFile("/tmp/foobar/shell.nix"), rooted_output_paths: OutputPaths { shell_gc_root: RootPath("/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root") } })
    

    Expected behavior Lorri should evaluate shell.nix (that is, run nix-instantiate) only:

    1. on the first ping after daemon startup
    2. after inotfy events

    Metadata

    $  lorri info --shell-file shell.nix
    lorri version: 1.3
    GC roots exist, shell_gc_root: "/home/symphorien/.cache/lorri/gc_roots/08be9354969d3ba205c42fa1686caa00/gc_root/shell_gc_root"
    
    $ uname -a
    Linux bete 5.10.17 #1-NixOS SMP Wed Feb 17 10:02:30 UTC 2021 x86_64 GNU/Linux
    

    Reproduced on top of a26745e404c3a201fe98af4c000bb27f910542b1

    opened by symphorien 5
  • Lorri Crash Report

    Lorri Crash Report

    I think this happened because I ran git checkout in a local nixpkgs checkout eval depended on which caused git to delete some files.

    name = 'lorri'
    operating_system = 'unix:Unknown'
    crate_version = '1.6.0'
    explanation = '''
    Panic occurred in file 'src/build_loop.rs' at line 238
    '''
    cause = '''
    Unrecoverable error:
    Io {
        msg: "Error { kind: Io(Os { code: 2, kind: NotFound, message: \"No such file or directory\" }), paths: [] }",
    }'''
    method = 'Panic'
    backtrace = '''
    
       0: 0x55b40a585f59 - lorri::build_loop::BuildLoop::forever::h90b55c6f6d2ef7d5
       1: 0x55b40a549ff4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4f4bdb6de68914b0
       2: 0x55b40a59ad27 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hdca413b472e1bf16
       3: 0x55b40a73ded3 - std::sys::unix::thread::Thread::new::thread_start::h1f2eb64c3e9233cd
       4: 0x7fb48fe16e86 - start_thread
       5: 0x7fb48fe9dc60 - __clone3
       6:        0x0 - <unresolved>'''
    
    opened by sternenseemann 0
  • `lorri self-upgrade` sets inaccurate `lorri` version number 0.1.0?

    `lorri self-upgrade` sets inaccurate `lorri` version number 0.1.0?

    Describe the bug I had lorri 1.5.0 installed. Then, lorri self-upgrade:

    replacing old 'lorri-1.5.0'
    installing 'lorri'
    building '/nix/store/fzai4pbd1a5iyvv98fy3gq78y33c6xif-user-e
    Nov 06 22:48:22.192 INFO upgrade successful
    

    Now the version appears to be 0.1.0:

    lorri -V                        
    lorri 0.1.0
    

    I see this command installs the rolling release:

    USAGE:
        lorri self-upgrade [SUBCOMMAND]
    
    ...
        rolling-release    Upgrade to the current rolling-release version, will be fetched from git and built locally.
                           rolling-release is expected to be more stable than master. (default)
    

    Has it actually installed a version newer than 1.5.0, but the -V is inaccurate? Has it actually installed a very old version 0.1.0?

    The location of lorri 1.5.0 and lorri 0.1.0 is identical. I have verified this by re-installing 1.5.0 with nix-env -iA nixpkgs.lorri. Both versions are located at:

    /home/peterbecich/.nix-profile/bin/lorri
    

    To Reproduce Steps to reproduce the behavior:

    Repeated lorri self-upgrade re-installs lorri, and the version is always 0.1.0. I doubt it is important to start from lorri 1.5.0.

    Expected behavior

    After lorri self-upgrade from version 1.5.0, lorri -V would print some version >= 1.5.0

    Metadata There is no lorri project to print here. I am only trying to install the latest version of lorri, or verify the latest version is already installed.

    $ uname -a
    Linux neptune 5.16.0-0.bpo.4-amd64 #1 SMP PREEMPT Debian 5.16.12-1~bpo11+1 (2022-03-08) x86_64 GNU/Linux
    

    Additional context Using Nix on Debian

    Thank you

    opened by peterbecich 0
  • lorri daemon fails with

    lorri daemon fails with "No such file or directory (os error 2)", but lorri watch succeeds

    Describe the bug

    The lorri daemon fails to build my project's environment, saying "No such file or directory (os error 2)" in the logs. But running lorri watch successfully builds it.

    To Reproduce Steps to reproduce the behavior:

    1. Start journalctl --user -u lorri.service --no-pager -f to monitor the lorri daemon log
    2. In a separate terminal, cd into the project using lorri
    3. The lorri daemon log shows an error
      Jul 28 01:12:50 host lorri[358780]: Jul 28 01:12:50.503 INFO build status, message: BuildEvent(Started { nix_file: NixFile(AbsPathBuf("/home/avh4/workspace/music/shell.nix")), reason: PingReceived })
      Jul 28 01:12:50 host lorri[358780]: Jul 28 01:12:50.503 INFO build status, message: BuildEvent(Failure { nix_file: NixFile(AbsPathBuf("/home/avh4/workspace/music/shell.nix")), failure: Spawn { cmd: "\"nix-instantiate\" \"-vv\" \"--add-root\" \"/tmp/.tmpedU3ei/result\" \"--indirect\" \"--argstr\" \"runTimeClosure\" \"/nix/store/69pg642v7d9s1z0nb0i3n2jynkmjkd9n-runtime-closure.nix\" \"--argstr\" \"src\" \"/home/avh4/workspace/music/shell.nix\" \"--\" \"/home/avh4/.cache/lorri/cas/de251a4170888ea8b8fb1ece0590735a\"", msg: "No such file or directory (os error 2)" } })
      
    4. Run lorri watch in the project directory (it succeeds)
      Jul 28 01:14:59.356 INFO build message, message: BuildEvent(Started { nix_file: NixFile(AbsPathBuf("/home/avh4/workspace/music/shell.nix")), reason: PingReceived }), nix_file: /home/avh4/workspace/music/shell.nix
      Jul 28 01:15:04.476 INFO build message, message: BuildEvent(Completed { nix_file: NixFile(AbsPathBuf("/home/avh4/workspace/music/shell.nix")), rooted_output_paths: OutputPath { shell_gc_root: RootPath(AbsPathBuf("/home/avh4/.cache/lorri/gc_roots/96cf60f25c1bca4f0bab7e20322abdeb/gc_root/shell_gc_root")) } }), nix_file: /home/avh4/workspace/music/shell.nix
      

    Expected behavior

    The lorri daemon build should succeed.

    Metadata

    $ lorri info
    error: The following required arguments were not provided:
        --shell-file <nix_file>
    
    USAGE:
        lorri info --shell-file <nix_file>
    
    For more information try --help
    $ lorri info --shell-file shell.nix 
    lorri version: 1.5
    GC roots exist, shell_gc_root: /home/avh4/.cache/lorri/gc_roots/96cf60f25c1bca4f0bab7e20322abdeb/gc_root/shell_gc_root
    
    $ uname -a
    Linux host 5.15.0-41-generic #44-Ubuntu SMP Wed Jun 22 14:20:53 UTC 2022 x86_64 GNU/Linux
    

    Additional context

    After restarting the daemon with systemctl --user restart lorri.service, the result is the same.

    opened by avh4 2
  • If the first build crashes, discovered nix files are not watched

    If the first build crashes, discovered nix files are not watched

    Describe the bug We are using a separate .toml file in our project, which gets loaded into the shell.nix (builtins.fromTOML`) where most of the packages are added.

    Now if I start the lorri build loop for this project, and the first build fails, lorri will not pick up the paths from that build, meaning if I fix the issue in the .toml the lorri build will not restart.

    To Reproduce Steps to reproduce the behavior:

    create a shell.nix:

    import ./foo.nix
    

    create foo.nix:

    let pkgs = import <nixpkgs> {};
    in pkgs.mkShell {
       buildInputs = [ pkgs.this-does-not-exist ];
    }
    

    tell the lorri daemon to pick up this project (make sure it hasn’t tried to evaluate it before while runnning, otherwise restart the lorri daemon to clean its cache). Running lorri watch should also work.

    Watch the build fail, then change foo.nix to

    let pkgs = import <nixpkgs> {};
    in pkgs.mkShell {
       buildInputs = [ pkgs.hello ];
    }
    

    Note that the build does not restart.

    Expected behavior

    lorri should use the info it gained even in the failing build to watch the nix files it discovered in the first run, so that when we re-run it can pick up where it failed before.

    Bonus points for also working if there’s a syntax error in foo.nix.

    If it’s not possible to do that, there should be a per-project option to tell lorri which set of files to watch.

    opened by Profpatsch 0
  • current maintenance status of project

    current maintenance status of project

    Describe the bug This project makes somewhat of a messy/neglected impression- the latest github release seems the same as the one in nixpkgs, but is apparently outdated (nixpkgs still points to the old target/lorri repo) and to get the latest version, one needs to use the lorri self-upgrade command, after which the version information printed by lorri -V will remain unchanged. Documentation also seems outdated in some parts- the help text for lorri self-upgrade reads:

    rolling-release    Upgrade to the current rolling-release version, will be fetched from git and built locally.
                           rolling-release is expected to be more stable than canon. (default)
    

    But using that default seems to "upgrade" to an older version than the one in nixpkgs. (Doesn't the idea of having a self-upgrade command go against the idea of nix anyway, since this is mutable state outside of the nix config?) There are several stale PRs e.g. #63 https://github.com/nix-community/lorri/blob/canon/MAINTAINERS.md seems outdated (release.nix numbers don't seem to follow semantic versioning)

    Expected behavior lorri version in nix should be the current version should lorri self-upgrade be removed? documentation/help text/default upgrade channel should be updated or at least outdated documentation removed Is this repository currently maintained? Who is/are the current maintainer(s)?

    opened by NANASHI0X74 2
  • Nix flake support

    Nix flake support

    Feature description Would it be interesting/chanllenging/hard for lorri to support nix flakes ? By flake, I mean a flake having a devShell output section. This is more a question of rather than a feature request.

    Target users More and more nix(os) users that are migrating to flakes.

    opened by GaetanLepage 1
Releases(1.6.0)
  • 1.6.0(Oct 2, 2022)

    Added

    • Add a lorri gc command to allow the gc to operate on old or removed projects.

    Fixed

    • Fix another file descriptor leak in the daemon.
    • Fix the behaviour of the --verbose flag’s logging output. Some messages were logged but not printed.
    • Fix default .envrc generated by lorri init. Add a fallback to direnv’s use nix in case lorri is not installed.
    • Provide a better error message when the user tries to use flakes, which we don’t support yet.
    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(May 11, 2021)

    Add support for builtins.filterSource, refine builtins.readDir

    The filter of filterSource is only respected for direct children of the source root. For example, if you use nix-gitignore, .git is not watched.

    builtins.readDir’ed paths are now not watched recursively, which should greatly reduce inotiy resource consumption.


    Fix watcher not starting if the first nix build fails.

    We were not actually watching the nix file, only indirectly picking it up from the first nix build; so if that failed, we’d not watch any file.

    Now lorri will always add the shell.nix to the watchlist, ensuring it triggers a rebuild as soon as it is fixed again.


    Various fixes to lorri internal stream-events after daemon socket protocol rewrite. It would hang and leak file descriptors in the daemon.

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Mar 28, 2021)

    Rewrite the internal daemon socket protocol.

    This should be a purely internal change, but if you have been using lorri internal stream-events in your scripts, the json output might have changed. Since the command is internal and not yet stable, not much time was spent keeping it compatible, so beware.

    The --socket-address command to lorri ping was removed for now, since only having it for this command doesn’t make much sense, it looks like it was originally introduced for debugging purposes. In the long run we could add a LORRI_SOCKET environment variable.

    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Mar 11, 2021)

    Fix lorri direnv triggering an unconditional rebuild every time it is run.

    After fixing up the build loop people suddenly started noticing that lorri was evaluating every time something ran lorri direnv, which could potentially be every time the user switched between buffers in the editor.

    This is not the intended behaviour, since we should run an unconditional build only the first time the project is added to the watcher, and after rely on the watcher to notify us of any file changes (or the user running lorri internal ping to force a rebuild).

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Mar 5, 2021)

    Fix the build loop.

    Previously, any change (for example a direnv ping or a change in the nix files) would add a new build invocation to the queue, and the builds would all be done one after the other.

    However, a new build will always use the newest state of the files anyway, so the CPU time spent on all the other builds will be wasted (and hog your processor).

    Now lorri will only

    1. finish the current build (if running)
    2. schedule at maximum one additional build if requested

    This should improve the resource use drastically in some situations.


    Make lorri daemon exit with exit code 0 instead of 130/143 on SIGINT or SIGTERM.


    Add lorri self-upgrade branch sub-subcommand. This enables us to point users to a branch name, in order to test out fixes from repository branches.

    Source code(tar.gz)
    Source code(zip)
Owner
Nix community projects
A project incubator that works in parallel of the @NixOS org
Nix community projects
Nix language server that evaluates code

nix-eval-lsp Still use nix-community/rnix-lsp. This repo is a work in progress. nix-eval-lsp is an experimental language server for Nix

Aaron Janse 51 Oct 30, 2022
This project now lives on in a rewrite at https://gitlab.redox-os.org/redox-os/parallel

MIT/Rust Parallel: A Command-line CPU Load Balancer Written in Rust This is an attempt at recreating the functionality of GNU Parallel, a work-stealer

Michael Murphy 1.2k Nov 20, 2022
A project for automatically generating and maintaining Debian repositories from a TOML spec.

Debian Repository Builder A simple utility for constructing and maintaining Debian repositories. Configuration of a repo is based on the directory hie

Pop!_OS 52 Feb 7, 2022
A faster way to navigate your filesystem

zoxide A faster way to navigate your filesystem Table of contents Introduction Examples Getting started Step 1: Install zoxide Step 2: Install fzf (op

Ajeet D'Souza 8.7k Jan 8, 2023
:stars: Manage your shell commands.

Pueue Pueue is a command-line task management tool for sequential and parallel execution of long-running tasks. Simply put, it's a tool that processes

Arne Beer 3.3k Jan 8, 2023
gt your desired path with minimal keystrokes

goto (gt) gt is a simple and user-friendly way to jump to your indexed directories. gt is short for "goto", which is basically what you want to do wit

Sylvester Chin 25 Nov 7, 2022
Count your code, quickly.

Tokei (時計) Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code,

null 7.5k Jan 9, 2023
CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path

Move Links CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path (or name). Usage execu

Ben Mefteh 18 May 22, 2022
📊 Fetch & monitor your server's resource usage through Lua

?? gmsv_serverstat Simple serverside binary module which can expose information about system resource usage to Lua. Installation Download the relevant

William 21 Jul 30, 2022
subd - a place to reward your subscribers from any platform

subd subd's goal is to create a link between the various ways viewers support you as a live content creator, and the interactions that can be triggere

TJ DeVries 37 Jul 6, 2023
Keeps `.env` files in sync with `env.sample`.

envsync This is a Rust port of env-sample-sync. It keeps .env files in sync with env.sample. It checks whether the local repository has an .env file a

Matthias Endler 2 Dec 22, 2022
📁 A not-so-true-to-life implementation of .env (dot env) for gmod

gmsv_dot_env A not-so-true-to-life implementation of a .env file for gmod. Place a .env at ./garrysmod/.env and any variables set in it will be access

Owain 12 Feb 14, 2023
Generate Nix fetcher calls from repository URLs [maintainer=@figsoda]

nurl Generate Nix fetcher calls from repository URLs $ nurl https://github.com/nix-community/patsh v0.2.0 2>/dev/null fetchFromGitHub { owner = "nix

Nix community projects 103 Jan 29, 2023
Snapshot testing tool for Nix based on haumea [maintainer=@figsoda]

namaka Snapshot testing tool for Nix based on haumea nix shell github:nix-community/namaka namaka check # run checks namaka review # review pending sn

Nix community projects 30 Apr 17, 2023
A `nix` and `nix-shell` wrapper for shells other than `bash`

nix-your-shell A nix and nix-shell wrapper for shells other than bash. nix develop and nix-shell use bash as the default shell, so nix-your-shell prin

Mercury 15 Apr 10, 2023
Progress In Nix - Pacman inspired frontend for Nix

Progress In Nix Pinix is a Pacman inspired frontend for Nix. It wraps a regular Nix command and replaces the output with a more modern and informative

Rémi Dupré 23 Mar 9, 2024
Envwoman is an application, to sync your .env-files across multiple machines

Envwoman is an application, to sync your .env-files across multiple machines. The main goal is to make Envwoman secure and trustworthy, so everything is open-source and the data will never in plain-text on the server. Encryption happens client-sided via aes-gcm.

Mawoka 3 Sep 28, 2022
Control your .env like a boss

envctl ?? Take full control over your .env environment variables usage $ envctl --help Environment Variable Control Usage: envctl <COMMAND> Commands

Yuichiro Luke Smith 4 Apr 18, 2023
⚡️(cd with env) Is a configurable cd wrapper that lets you define your environment per directory.

⚡️cdwe (cd with env) A simple configurable cd wrapper that provides powerful utilities for customizing your envionment per directory. (For ZSH / BASH

teo 20 Aug 6, 2023
envelope - a command line utility and tool to help you manage your .env files

envelope envelope is a command line utility and tool to help you manage your .env files. How it works envelope is basically a command line utility tha

Mattia Righetti 6 Oct 14, 2023