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

Switch to cabal repl --build-depends=tidal by default? #156

Open
yaxu opened this issue Jun 16, 2021 · 5 comments
Open

Switch to cabal repl --build-depends=tidal by default? #156

yaxu opened this issue Jun 16, 2021 · 5 comments

Comments

@yaxu
Copy link
Member

yaxu commented Jun 16, 2021

As per advice here: haskell/cabal-userguide#1 (comment)

This could work around the problems with the cabal install tidal --lib command.

To run a repl we could do: cabal repl --build-depends=tidal

It is a bit slower than running ghci and prints out some confusing things about fake packages but works.

If tidal isn't installed then it will install it first, but only if cabal update has already been run. To build everything in advance we can just do cabal install tidal but then there is a heavy warning that doesn't apply to us.

@ndr-brt
Copy link
Collaborator

ndr-brt commented Jun 17, 2021

Interesting.
I tried to execute:

➜  cabal update
Downloading the latest package list from hackage.haskell.org
Updated package list of hackage.haskell.org to the index-state 2021-06-17T03:31:32Z
To revert to previous state run:
    cabal v2-update 'hackage.haskell.org,2021-06-11T10:10:37Z'

➜  cabal repl --build-depends=tidal              
Resolving dependencies...
Error:
    Dependency cycle between the following components: library
    In the inplace package 'tidal-1.7.7'

@ndr-brt
Copy link
Collaborator

ndr-brt commented Jun 17, 2021

ok, now it's working. Nice and clean, and all the output would be printed on the console inside atom.
Just a question, can we assert that everyone has cabal installed and in $PATH?
Or cabal path should be configurable as ghci?

@yaxu
Copy link
Member Author

yaxu commented Jun 17, 2021

I think cabal has the same situation as ghci - it will either be in the path, or in same folder as ghci.

@ndr-brt
Copy link
Collaborator

ndr-brt commented Jun 17, 2021

Do you know what's the minimum cabal version needed for this command?

@yaxu
Copy link
Member Author

yaxu commented Jun 18, 2021

It looks like it's been there many years, but originally as new-repl. E.g. in 2.0: https://cabal.readthedocs.io/en/2.0/nix-local-build.html?highlight=new-repl#cabal-new-repl

The build-depends option isn't mentioned in the new-repl section until 2.4, but it might have worked before: https://cabal.readthedocs.io/en/2.4/nix-local-build.html#cabal-new-repl

As it's still usable as new-repl we could use that in the editor plugins.

A downside is that if someone has installed a particular version of tidal with v1-install, then this would install a newer version, afresh..

In the nearish future hopefully we'll have a binary distribution of tidal and this will become largely moot..

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

No branches or pull requests

2 participants