Skip to content

Incomprehensible "imported by" noise when package doesn't exist #9971

Closed

Description

@philderbeast

Using this repo' for the repro', I can't make sense of this "using configuration(s) from" message.

$ echo "packages: pkg-doesnt-exist" >> cabal.project

$ cabal build pkg-doesnt-exist --dry-run
When using configuration(s) from cabal.project, project-cabal/constraints.config
  imported by: cabal.project, project-cabal/ghc-latest.config
  imported by: cabal.project, project-cabal/ghc-options.config
  imported by: cabal.project, project-cabal/pkgs.config
  imported by: cabal.project, project-cabal/pkgs/benchmarks.config
  imported by: project-cabal/pkgs.config
  imported by: cabal.project, project-cabal/pkgs/buildinfo.config
  imported by: project-cabal/pkgs.config
  imported by: cabal.project, project-cabal/pkgs/cabal.config
  imported by: project-cabal/pkgs.config
  imported by: cabal.project, project-cabal/pkgs/install.config
  imported by: project-cabal/pkgs.config
  imported by: cabal.project, project-cabal/pkgs/integration-tests.config
  imported by: project-cabal/pkgs.config
  imported by: cabal.project, project-cabal/pkgs/tests.config
  imported by: project-cabal/pkgs.config
  imported by: cabal.project, the following errors occurred:
The package location 'pkg-doesnt-exist' does not exist.

$ git rev-parse HEAD
570960c448f08f91b647a2d5182c7ca89f32dddb

Activity

  1. philderbeast commented on May 3, 2024

    @philderbeast
    CollaboratorAuthor

    It looks like a formatting problem. The message is more legible with the indenting fixed;

    $ cabal build pkg-doesnt-exist --dry-run
    When using configuration(s) from: 
      cabal.project
      project-cabal/constraints.config
        imported by: cabal.project
      project-cabal/ghc-latest.config
        imported by: cabal.project
      project-cabal/ghc-options.config
        imported by: cabal.project
      project-cabal/pkgs.config
        imported by: cabal.project
      project-cabal/pkgs/benchmarks.config
        imported by: project-cabal/pkgs.config
        imported by: cabal.project
      project-cabal/pkgs/buildinfo.config
        imported by: project-cabal/pkgs.config
        imported by: cabal.project
      project-cabal/pkgs/cabal.config
        imported by: project-cabal/pkgs.config
        imported by: cabal.project
      project-cabal/pkgs/install.config
        imported by: project-cabal/pkgs.config
        imported by: cabal.project
      project-cabal/pkgs/integration-tests.config
        imported by: project-cabal/pkgs.config
        imported by: cabal.project
      project-cabal/pkgs/tests.config
        imported by: project-cabal/pkgs.config
        imported by: cabal.project
    The following errors occurred:
    The package location 'pkg-doesnt-exist' does not exist.
    
  2. philderbeast commented on May 3, 2024

    @philderbeast
    CollaboratorAuthor

    This would be even more legible as a tree (as originally envisaged and if we could display unicode) 😭

    $ tree -P '*.project|*.config' --prune -L 3
    ...
    └── project-cabal
        ├── constraints.config
        ├── ghc-latest.config
        ├── ghc-options.config
        ├── pkgs
        │   ├── benchmarks.config
        │   ├── buildinfo.config
        │   ├── cabal.config
        │   ├── install.config
        │   ├── integration-tests.config
        │   └── tests.config
        └── pkgs.config
    
  3. self-assigned this
    on May 3, 2024
  4. philderbeast commented on May 4, 2024

    @philderbeast
    CollaboratorAuthor

    I'm working on a fix where the output looks like a tree but we could fallback to displaying a list too;

    When using configuration(s) from:
      cabal.project
      project-cabal/
        constraints.config
        ghc-latest.config
        ghc-options.config
        pkgs.config
        pkgs/
          benchmarks.config
          buildinfo.config
          cabal.config
          install.config
          integration-tests.config
          tests.config
    The following errors occurred:
      - The package location 'pkg-doesnt-exist' does not exist.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions