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

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

Closed
philderbeast opened this issue May 3, 2024 · 3 comments · Fixed by #9985
Closed

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

philderbeast opened this issue May 3, 2024 · 3 comments · Fixed by #9985

Comments

@philderbeast
Copy link
Collaborator

philderbeast commented May 3, 2024

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
@philderbeast
Copy link
Collaborator Author

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.

@philderbeast
Copy link
Collaborator Author

philderbeast commented May 3, 2024

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

@philderbeast philderbeast self-assigned this May 3, 2024
@philderbeast
Copy link
Collaborator Author

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant