Manager for Haskell Cabal files #31493
Replies: 5 comments 10 replies
-
We would need a
Yes, I have glanced through your code. The order of PRs is:
With that ordering users can also already use the data even without the manager via custom manager.
It makes sense to start with a subset features, like you do, though foundation has to be still reliable and well tested. Regarding tests, look at our development docs in Finally there shouldn't be any code changes for the general processing logic needed ( |
Beta Was this translation helpful? Give feedback.
-
As far as I understand from the semver cheatsheet, semver does support ranges, though the
The reason I patched
I totally agree, but I am not sure what would be considered a reasonable subset. For example, I am worried that adding range support across the codebase might be too hard. Maybe it would make sense to add just NPM-style bounds first with semver. As far as I understand, this means that there would be no versioning changes. Is this correct? One issue with adding PVP support, is that But all of these concerns do not really affect the data source. I could add the data source, specifying semver as its versioning. It would be correct for some packages, incorrect for others. But it would be a start. Would this be acceptable? Or do you think one of the other previously mentioned areas should be done first? |
Beta Was this translation helpful? Give feedback.
-
Ok, so I think I have a fairly clear understanding of how the datasource should work, which is the next step after #32298. But the manager (the subject of this discussion) is more tricky. The main reason is that Cabal files use a custom whitespace sensitive syntax. See the multi-line value example. I see no way around writing a custom parser in the manager, which involves a bunch of code. My draft manager currently the following string-based approach:
The reason I opted for this approach, is such that Renovate doesn't include parsing code for structures it doesn't need. A hypothetical alternate approach would be to develop a full Cabal parser that would parse stanzas/sections (e.g. There is a regression test suite in the Cabal people that I have tested with, and the string-based parser can parse all of it. So please, if you have a preference around Cabal file parsing, please let me know. Otherwise, I'd submit something similar to my draft once the Hackage datasource has been merged. |
Beta Was this translation helpful? Give feedback.
-
I just noticed the customManager for JSON: When YAML support is added to this (which seems planned), it should allow for parsing a subset of package.yaml files. Given that PVP has already been merged, this means that only Hackage would need to get added before some real world testing could happen: The customManager for JSON includes examples which split up a string with JSONata, which I think should also allow parsing stuff like I'd note that a proper cabal manager would still be useful, since not all packages use Hpack to generate the Cabal file. I am just pointing out that there is this additional way this could get used. |
Beta Was this translation helpful? Give feedback.
-
Ideas for upcoming features:
Maybe not for Renovate:
|
Beta Was this translation helpful? Give feedback.
-
The Cabal build system supports version constraints, see example. It would be nice if Renovate could parse the Cabal files and bump the version bounds contained within. @secustor requested on #31434 that I start a discussion for this:
Cabal doesn't specify the versioning scheme that packages should use, but some operators are designed for use with PVP , for example the
^>=
operator. It would be nice if Renovate supported PVP, but strictly speaking this is a separate concern from adding Cabal file parsing and dependency extraction.I am a committer for the Hackage-server, which proves a web API that the Cabal client command line tools interacts with, e.g. the commands in
cabal-install
. Hackage has a JSON endpoint that lists versions available for a package, e.g. https://hackage.haskell.org/package/base.json . However, this is also not really relevant to the discussion of the manager, since this functionality would be covered by the datasource (subject to future discussion, but see the PR for an idea of how it could work). See also #8187, which has a discussion on a Hackage data source.Have you had a look at the Cabal file parsing code in the linked PR, and do you have some ideas for how to implement a parser for the format? I would love to hear them.
Have you looked at the tests in the PR? Do you think they adequately test the minimum functionality? Let's start out with a solid MVP such that we can iterate on it with smaller PRs. What do you consider the most important features to support in a Cabal file? Does the linked PR attempt to handle those MVP features?
Beta Was this translation helpful? Give feedback.
All reactions