Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: do not crash when tab-completing import errors #10778

Merged
merged 2 commits into from
May 27, 2024

Commits on May 25, 2024

  1. libutil/source-accessor: custom error if source does not exist

    This allows better error handling by catching this error in particular.
    Mic92 committed May 25, 2024
    Configuration menu
    Copy the full SHA
    f97da4b View commit details
    Browse the repository at this point in the history
  2. repl: do not crash when tab-completing import errors

    File not found while importing is not currently caught by the tab-completion handler.
    
    Original bug report: https://git.lix.systems/lix-project/lix/issues/340
    Fix has been adapted from https://gerrit.lix.systems/c/lix/+/1189
    
    Example crash:
    
    $ cat /tmp/foo.nix
    {
      someImport = import ./this_file_does_not_exist;
    }
    $ ./src/nix/nix repl --file /tmp/foo.nix
    warning: unknown experimental feature 'repl-flake'
    Nix 2.23.0pre20240517_dirty
    Type :? for help.
    Loading installable ''...
    Added 1 variables.
    nix-repl> someImport.<TAB>
    Pierre Bourdon authored and Mic92 committed May 25, 2024
    Configuration menu
    Copy the full SHA
    ffe6ba6 View commit details
    Browse the repository at this point in the history