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

Migrating the ecosystem to use build-tool-depends #5412

Open
Ericson2314 opened this issue Jul 4, 2018 · 3 comments
Open

Migrating the ecosystem to use build-tool-depends #5412

Ericson2314 opened this issue Jul 4, 2018 · 3 comments

Comments

@Ericson2314
Copy link
Collaborator

Ericson2314 commented Jul 4, 2018

For a decent while now, build-tool-depends has been the correct way to add built-time executable dependencies. Cabal, Stack, and cabal2nix all support it to my knowledge. Many packages throughout the ecosystem however still expect to get the executables of any package; probably the biggest example of this would be hspec-discover. This is bad because because it pulls back against the "componentization" that all the tools are striving for, and also harms cross as libraries and build-time tools are built for different platforms.

We tried just "machete-ing" our way through this for Nix in NixOS/nixpkgs#41420, but the number of overrides needed was deemed excessive. First we need to declare Cabal min version after which packages are required to do things properly (probably 3 with the deprecation of old-build?). Second, we need to decide what to do with older Cabal files.

CC @matthewbauer

@hvr
Copy link
Member

hvr commented Jul 5, 2018

First we need to declare Cabal min version after which packages are required to do things properly

I'm not sure how you propose we do this. Currently if you don't declare your dependencies properly, cabal new-build will just not work properly; e.g. on https://matrix.hackage.haskell.org/ (which is powered by new-build) the build reports will simply fail. (and if you use the travis-script-generator, those CI jobs would fail too)

That being said, there's a few cases we can actually validate on Hackage uploads. And for those I see no reason to provide any grace-period, as there's no reason to keep allowing inaccurate dependency specs being uploaded when we can detect them and doing it properly doesn't harm older cabals.

Second, we need to decide what to do with older Cabal files.

Fwiw, when I notice this while performing hackage meta-data revisions, I try to add the missing build-tools/build-tool-depends declarations via revisions. Luckily, hspec-discover is rather unimportant, as it only affects test-components which have little relevance for non-local packages in install-plans.

Based on the data I have, In general, it's rather few packages that happen to be underspecified in terms of their build tool dependencies; and those can easily be handled via revisions. We just need to make sure that new uploads are validated better.

@domenkozar
Copy link
Collaborator

I've opened #5561 to at least explain the current situation a bit better hopefully. wdyt?

@andreabedini
Copy link
Collaborator

It looks like there's nothing more to do here.

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

5 participants