[Haskell-cafe] cabal v2 global install status

Travis Cardwell travis.cardwell at extrema.is
Mon May 9 11:25:53 UTC 2022


Hi Ivan,

Here is some information about Cabal's script functionality:

https://cabal.readthedocs.io/en/3.4/cabal-commands.html#cabal-v2-run

Cheers,

Travis

On Mon, May 9, 2022 at 8:09 PM Ivan Perez <ivanperezdominguez at gmail.com> wrote:
>
> Hi,
>
> I'd love to know more about that script capability, if you can spare the time to explain a bit.
>
> It can be a separate thread or via private email if that may be noise in the conversation.
>
> All the best,
>
> Ivan
>
> On Thu, 5 May 2022 at 15:11, Brandon Allbery <allbery.b at gmail.com> wrote:
>>
>> Cabal has a script capability, although it's poorly documented.
>>
>> For one-liners, there is `cabal repl --build-depends='...'. Not ideal,
>> perhaps, but works well enough for me.
>>
>> On Thu, May 5, 2022 at 3:06 PM amindfv--- via Haskell-Cafe
>> <haskell-cafe at haskell.org> wrote:
>> >
>> > On Thu, May 05, 2022 at 05:50:01AM -0400, Ivan Perez wrote:
>> > > This workflow (installing packages in
>> > > a store in the project directory) should be not just supported, but
>> > > *encouraged*. Keeping all changes local *should be the default*. Experts,
>> > > and those who want to optimize installation times, avoid re-compilation,
>> > > those who know how to navigate $HOME/.cabal if need be, etc., can then
>> > > choose to share that installation directory across projects and use
>> > > $HOME/.cabal instead (or whatever else they want). But that's a conscious
>> > > choice made by an expert who understands the choice.
>> >
>> > I'm actually coming from a bit of the opposite perspective. :)
>> >
>> > I'm pretty happy, overall, with `cabal new-repl`, `cabal new-build`, etc. What I miss is the ability to have global installs. More specifically, I want to *pay all my costs at install time*. I'm okay with futzing with package dependencies, etc. (e.g. resolving conflicts in transitive dependencies) when installing a new package, but once I've paid that cost I want to be able to simply run `ghci` and have my curated set of packages available to me. I don't want to have to `mkdir foo ; cd foo ; cabal init ; $EDITOR cabal.project ; cabal new-repl` just to run a simple one-liner in ghci. I also like being able to write quick scripts and run them with `runghc` without creating an entire project for each and every one.
>> >
>> > Cheers,
>> > Tom
>> > _______________________________________________
>> > Haskell-Cafe mailing list
>> > To (un)subscribe, modify options or view archives go to:
>> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> > Only members subscribed via the mailman list are allowed to post.
>>
>>
>>
>> --
>> brandon s allbery kf8nh
>> allbery.b at gmail.com
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.


More information about the Haskell-Cafe mailing list