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

--enable-multi-repl errors with multi-out-25793/paths does not exist #10696

Open
philderbeast opened this issue Jan 1, 2025 · 4 comments
Open

Comments

@philderbeast
Copy link
Collaborator

philderbeast commented Jan 1, 2025

Describe the bug
Within this project at 62073c9, I tried bringing up a REPL with tar as the TARGET and followed instructions for multiple components but that ultimately lead to a "No such file or directory" error:

To Reproduce

$ git rev-parse HEAD
62073c99833111dc7369dd22524f3b2a250a5f1d

$ cabal install cabal-install:exe:cabal --overwrite-policy=always

$ cabal repl tar
...
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Error: [Cabal-7076]
Cannot open a repl for multiple components at once. The target 'tar' refers to the package tar
which includes the libraries tar-internal and tar.

Your compiler supports a multiple component repl but support is not enabled.
The experimental multi repl can be enabled by
  * Globally: Setting multi-repl: True in your .cabal/config
  * Project Wide: Setting multi-repl: True in your cabal.project file
  * Per Invocation: By passing --enable-multi-repl when starting the repl

$ cabal repl tar --enable-multi-repl
Warning: this is a debug build of cabal-install with assertions enabled.
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
/.../dist-newstyle/multi-out-25793/paths:
getDirectoryContents:openDirStream: does not exist (No such file or directory)

$ ls dist-newstyle
build/  cache/  tmp/

Expected behavior
Either a warning or error to say that it is not possible to bring up a REPL for tar or for the REPL with --enable-multi-repl to come up. I also think the suggestion about multiple components could say (as another option) that the user could choose to bring up a REPL for just one of the components.

System information

$ ghc --numeric-version
9.10.1

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.10
Release:	24.10
Codename:	oracular
@ulysses4ever
Copy link
Collaborator

ulysses4ever commented Jan 1, 2025

Again, this is a variant of #7963 but with the multi-repl twist. Why are you trying to repl unrelated packages? This was never meant to work, and you're supposed to use --build-depends. The only issue is that cabal doesn't error in a nice way, as discussed in #7963

Since this involves multi-repl, I'm hesitant whether it should be closed or not.

@philderbeast
Copy link
Collaborator Author

philderbeast commented Jan 1, 2025

From #7963, trying --build-depends leaks fake-package-0 and doesn't bring up a REPL:

$ cabal repl --build-depends tar
...
- cabal.project
Error: [Cabal-7076]
Internal error when trying to open a repl for the package fake-package-0. The package is
not in the set of available targets for the project plan, which would suggest an inconsistency
between readTargetSelectors and resolveTargets.

$ cabal repl --build-depends network-uri
...
Configuration is affected by the following files:
- cabal.project
Error: [Cabal-7076]
Internal error when trying to open a repl for the package fake-package-0. The package is
not in the set of available targets for the project plan, which would suggest an inconsistency
between readTargetSelectors and resolveTargets.

@philderbeast
Copy link
Collaborator Author

Why are you trying to repl unrelated packages?

I'm testing cabal-install:exe:cabal to see how it responds to using a dependency as the target of the repl command.

@ulysses4ever
Copy link
Collaborator

I believe --build-depends is meant to be used outside a project context. So, cabal repl --ignore-project --build-depends tar seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants