Coder Social home page Coder Social logo

cabal v2-repl broken with head about cabal HOT 11 CLOSED

TeofilC avatar TeofilC commented on June 15, 2024
cabal v2-repl broken with head

from cabal.

Comments (11)

mpickering avatar mpickering commented on June 15, 2024 2

Patch here: #9720

from cabal.

TeofilC avatar TeofilC commented on June 15, 2024 1

@ulysses4ever Here's a standalone reproducer:
Checkout https://github.com/TeofilC/cabal-repl-repro
Then

cabal build foo
cabal repl foo

I think the key detail is having a custom setup somewhere in the project. It seems to be necessary to build first too.

I'm building with GHC 9.4.8.

Adding the following to cabal.project:

allow-newer:
  *:Cabal,
  *:Cabal-syntax

source-repository-package
    type: git
    location: https://github.com/haskell/cabal.git
    subdir: Cabal Cabal-syntax

Makes the issue go away. So it seems like it's an issue with mixing a new cabal with an old Cabal lib?

from cabal.

ulysses4ever avatar ulysses4ever commented on June 15, 2024

I can't reproduce it. What timestamp do you have on that binary? (We really should start embedding commit SHA into the --version info.) Also, what is foo, any chance for a self-contained reproducer?

from cabal.

Benjamin-McRae-Tracsis avatar Benjamin-McRae-Tracsis commented on June 15, 2024

I ran this command a couple of hours ago: ghcup install cabal --force -u https://github.com/haskell/cabal/releases/download/cabal-head/cabal-head-Linux-x86_64.tar.gz head. The ls timestamp is Feb 14 10:20

from cabal.

TeofilC avatar TeofilC commented on June 15, 2024

foo is an arbitrary component in our project. Perhaps there's something peculiar to this project that is triggering it. FWIW cabal build seems to work fine.
I'll extract a reproducer at some point this afternoon.

I was using the latest Linux-static build.

from cabal.

Benjamin-McRae-Tracsis avatar Benjamin-McRae-Tracsis commented on June 15, 2024

/home/username/.ghcup/bin/cabal-head repl aeson seems to clone a bunch of neccessary stuff and then just exits as described.

from cabal.

Benjamin-McRae-Tracsis avatar Benjamin-McRae-Tracsis commented on June 15, 2024

running /home/username/.ghcup/bin/cabal-head repl in a non-package environement (just ~) lets me enter the repl:

$ /home/username/.ghcup/bin/cabal-head repl
Warning: this is a debug build of cabal-install with assertions enabled.
Warning: Parsing the index cache failed (Data.Binary.Get.runGet at position
16: Non-matching structured hashes: f46da61e7afa58a5e8fd1d2b6fb79899;
expected: d81bdd513f41b5d7ee4cd28455adadbe). Trying to regenerate the index
cache...
Resolving dependencies...
Build profile: -w ghc-9.4.7 -O1
In order, the following will be built (use -v for more details):
 - fake-package-0 (interactive) (lib) (first run)
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring library for fake-package-0...
Warning: this is a debug build of cabal-install with assertions enabled.
Warning: No exposed modules
GHCi, version 9.4.7: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /tmp/cabal-repl.-239669/setcwd.ghci
ghci> :i head
head :: GHC.Stack.Types.HasCallStack => [a] -> a
        -- Defined in ‘GHC.List’
ghci>

from cabal.

mpickering avatar mpickering commented on June 15, 2024

I am looking into this.

from cabal.

mpickering avatar mpickering commented on June 15, 2024

With 9.6.2 I get:

/home/matt/cabal-bisect/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal repl foo

with 9.4.8 I get

[matt@nixos:~/cabal-bisect/cabal-repl-repro]$ /home/matt/cabal-bisect/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal repl foo
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...

from cabal.

mpickering avatar mpickering commented on June 15, 2024

Seems that this was broken by the multi-repl patch.

from cabal.

TeofilC avatar TeofilC commented on June 15, 2024

Thanks for fixing this so quickly @mpickering !

from cabal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.