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

Haskell support #2745

Open
hasufell opened this issue Nov 11, 2020 · 19 comments
Open

Haskell support #2745

hasufell opened this issue Nov 11, 2020 · 19 comments
Labels
Keep Exempt this from being marked by stalebot T: new-ecosystem Requests for new ecosystems/languages

Comments

@hasufell
Copy link

The Haskell ecosystem often suffers from outdated package bounds. Various attempts have been made to improve the situation, but ultimately developers need a convenient method to update their bounds.

Haskell uses PVP for versioning (which is somewhat similar to semver). It then uses Cabal for package and version management (similar to rusts cargo). Packages are shared and uploaded on hackage.

I think the main hurdle of adding support here is that the cabal file format is custom. Obviously there exists a haskell parser in the Cabal library. There also seems to be some documentation on the file format. I'm not sure if that's enough to re-implement a parser or if a regexp solution would be possible.

@hasufell hasufell added the T: feature-request Requests for new features label Nov 11, 2020
@jurre
Copy link
Member

jurre commented Nov 11, 2020

Thanks for opening this issue @hasufell.

Unfortunately it might be a while before our team has the capacity to pick up a new ecosystem like Haskell.

However, when we do get around to it, I think our preferred way to deal with parsing the Cabal files would be to write a native helper, like this one in Haskell, and shell out to that, instead of trying to parse the file and keeping up with any changes made to the format.

@expipiplus1
Copy link

It's worth noting that many Haskell packages are described in YAML using the schema described here: https://github.com/sol/hpack

@hasufell
Copy link
Author

hasufell commented Nov 11, 2020

It's worth noting that many Haskell packages are described in YAML using the schema described here: https://github.com/sol/hpack

Hpack is an optional tool that generates cabal files. It isn't a standard though.

I guess it could be debated whether users also want their hpack files to be updated. But I believe the main focus should be cabal files.

@KiaraGrouwstra
Copy link

related thread

@KiaraGrouwstra
Copy link

for transparency, I opened a PR for my wip attempt to add haskell support at #3195.

@brightly-salty
Copy link

With regard to the hpack issue, I think if it would be annoying to have the cabal updated without the package.yaml being updated, because it will be overwritten the next time you build. I feel it would be a good first step to focus on package.yaml files first before or in addition to .cabal files being added and updated.

@hasufell
Copy link
Author

I feel it would be a good first step to focus on package.yaml files first before or in addition to .cabal files being added and updated.

package.yaml aren't canonical files that are properly specified. Haskell has only one file format for building packages: cabal. Everything else is custom stuff that some ppl use, some don't. Everyone uses cabal files.

@brightly-salty
Copy link

I agree that everyone uses cabal files, but I think that updating cabal files without updating package.yaml files would break many people's workflows. For example, I don't keep my cabal files in git because it results in needless noisey changes whenever a file is deleted or created, and instead just keep my package.yaml in git. Maybe it would be good to have a configuration option with this, but I think universally updating cabal files without regard to package.yaml files would deter me from using dependabot on my projects, and may do so for others as well.

@hasufell
Copy link
Author

For example, I don't keep my cabal files in git

That's bad. Please commit them. Otherwise you're breaking cabal users ability to use your repository via source-repository-package stanza.

Note: I'm not advocating against supporting package.yaml, but I think it's an unreasonable proposal to support a 3rd party tool before the canoncial package definition format.

@Anton-Latukha
Copy link

Anton-Latukha commented Nov 11, 2021

#2745 (comment)

but I think that updating cabal files without updating package.yaml files would break many people's workflows.

There is some puzzlement. An the implicit assumption that people that use HPack would somehow be taken hostage & forced to merge Dependabot automation for Cabal in their repositories. For Dependabot Cabal support to break their HPack-configured projects.

I am an HNix developer - I do not conceive to ask to support Cabal Nix & NixPkgs integration setup before regular Cabal.

Every packaging tool in the Haskell system depends on a minimal Cabal <-> Hackage infrastructure loop.


About not including Cabal in source

Not including Cabal description into source tree, but then it somehow magically appears for Hackage upload & source tarball downloaded from Hackage. & now pipeline & maintainers downstream are puzzled - why tarball builds but the source from the official repository does not & why there is a file difference in those, they need to decipher what gets injected behind the scenes. It also means the project is not reproducible, so https://reproducible-builds.org/projects/ & https://tests.reproducible-builds.org/debian/reproducible.html.

As the whole Haskell ecosystem (& even NixPkgs haskellPackage set - depend on Cabal package description format. Currently.) - because everything depends on Cabal - please do not exclude Cabal descriptions from the source code, & if using HPack - just treat Cabal file as a state update details file that needs to be included in source code commits from time to time.

@Anton-Latukha
Copy link

Anton-Latukha commented Nov 11, 2021

The Haskell ecosystem often suffers from outdated package bounds.

I resonate strongly with that idea. Ecosystem would benefit immensely just by having a default way of notifying maintainers & suggesting updates. Some community members have ~100+ packages, that was created by not well supported & there always would be such thing of people spreading thin. For old history to not repeat itself - the default way of automation would be tremendously beneficial. If someone up the stack can merge a new base bound without searching them out through social networking.


Because of Haskell strong typing system & referential transparency of the language - FFI with Haskell can give the highest guarantees of stability.

I noticed that Dependabot formerly had docs on FFI. & it currently seems to require https://github.com/ffi/ffi somewhere inside package descriptions in the bundler. If GitHub can not provide Haskell support - the next best option for both sides is community-managed implementation through FFI.

@jurre
Copy link
Member

jurre commented Nov 11, 2021

Fwiw we're starting to think about a way to push down a lot of the functionality that is currently implemented in dependabot-core into the package ecosystem itself, leaving dependabot-core as a thing wrapper around the native functionality. While this is still mostly in an idea/prototyping stage, I do think that once something like that lands it would open up support for more ecosystems again.

Once we have something substantial to share I'll loop back in this thread.

@eborden
Copy link

eborden commented Dec 6, 2021

@jurre I'm curious if any of those ideas have crystallized? Are they documented anywhere?

@jurre
Copy link
Member

jurre commented Dec 7, 2021

@jurre I'm curious if any of those ideas have crystallized? Are they documented anywhere?

Not quite there yet but we're working on it, I'll make sure to update here when we have something to share

@domenkozar
Copy link

@jurre any updates?

@domenkozar
Copy link

Also worth keeping an eye on: renovatebot/renovate#8187

@jeffwidman jeffwidman added T: new-ecosystem Requests for new ecosystems/languages and removed T: feature-request Requests for new features labels Sep 16, 2022
@ArturGajowy
Copy link

@jurre any updates on supporting more ecosystems / outsourcing the support?

@mihaimaruseac
Copy link

Any update here? I was mistakenly thinking that Haskell support was already implemented :(

@jonjanego jonjanego added the Keep Exempt this from being marked by stalebot label May 2, 2024
@ysangkok
Copy link

I have submitted a PR to add Cabal support to Renovate, please have a look:

This currently only supports version constraints of the form >=X.Y && <V.W. I'd be open to suggestions for next steps, please just tag me in the Renovate discussion system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Keep Exempt this from being marked by stalebot T: new-ecosystem Requests for new ecosystems/languages
Projects
None yet
Development

No branches or pull requests