GithubHelp home page GithubHelp logo

Comments (9)

dudebout avatar dudebout commented on September 13, 2024

This is a known shortcoming but not a very bad one. GHC_PACKAGE_PATH used to be working for everything. With cabal 1.16, this variable became forbidden for cabal while still working for ghc. This lead to a "complete rewrite" of hsenv. In particular, there are mutiple tests for the different versions of ghc etc.

Unfortunately, the emacs module does not use an hsenv binary. It is in effect a complete reimplementation in emacs lisp of <dir>/.hsenv/bin/activate. To do it properly it would have to mimick the tests for all the ghc versions.

As @tmhedberg mentioned in other issues, we do not know if hsenv will be needed much longer as cabal talks about doing sandboxing itsels. Therefore, I am not really willing to spend that much time rewriting hsenv.el.

On the bright side, everything works inside of emacs except for cabal with version greater than 1.16. So the only thing you cannot do easily is install packages. IMHO, this is an event rare enought that I can drop to a shell and use activate instead of relying on emacs for it.

Feel free to write a pull request to fix it.

from hsenv.

tmhedberg avatar tmhedberg commented on September 13, 2024

Just to reinforce what @dudebout said, the GHC_PACKAGE_PATH variable has been quite a thorn in our collective sides since it was "forcibly deprecated" in Cabal. Older versions of Cabal (which are unfortunately not old enough to have fallen completely out of use) require it to be set in order to work properly with hsenv, while newer versions (as you have seen) will refuse to run if it is set. So anything hsenv-related that invokes Cabal must be able to configure itself differently depending on which version of Cabal is available; there is no mechanism that works correctly for all versions of Cabal. This means that additional logic must be added in various places in order to ensure portability across multiple versions.

In any case, a pull request would indeed be welcomed. :)

from hsenv.

lambdageek avatar lambdageek commented on September 13, 2024

Thanks. Makes sense. I'll try to spend a couple hours with Elisp this weekend and send a pull request if I get anywhere.

from hsenv.

nominolo avatar nominolo commented on September 13, 2024

Actually, not being able to use Cabal from within Emacs is a huge issue if you're trying to use something IDE-like (I'm building something like that) from within Emacs. Fortunately, #27 fixes this.

from hsenv.

dudebout avatar dudebout commented on September 13, 2024

huge is a little strong ;-)

from hsenv.

nominolo avatar nominolo commented on September 13, 2024

Well, the correct phrasing would be "completely unusable". Since Scion (WIP) automatically configures a package using Cabal and thus it would break for every single package.

from hsenv.

tmhedberg avatar tmhedberg commented on September 13, 2024

I believe this is now fixed thanks to #27. Can any Emacs users confirm this?

from hsenv.

nominolo avatar nominolo commented on September 13, 2024

Confirmed fixed.

from hsenv.

tmhedberg avatar tmhedberg commented on September 13, 2024

Thanks.

from hsenv.

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.