Skip to content

Bad error when referring to local repo by git url #12935

Open
@roberth

Description

@roberth

Describe the bug

Easy mistake:
inputs.url = "file:///home/user/src/foo";

       … while fetching the input 'file:///home/user/src/foo'

       error: Failed to open archive (Unrecognized archive format)

(Solution: use git+file://)

Steps To Reproduce

Easier reproducer:

$ nix build file://$HOME/src/nixpkgs#hello
error:
       … while fetching the input 'file:///home/user/src/nixpkgs'

       error: Failed to open archive (Unrecognized archive format)

Expected behavior

Error message contains relevant info

  • file URLs are for tarballs only
  • the path is a directory
  • bonus points: provide a suggestion if it's a repo

Metadata

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugerror-messagesConfusing messages and better diagnosticsfetchingNetworking with the outside (non-Nix) world, input locking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions