Skip to content

maintenance-depends and a new tool selector for it #10253

Open

Description

@geekosaur

Describe the feature request
The idea is to support things that are per-project or per-package, but aren't strictly build tools: formatters, changelog-d, etc. This would also provide a more principled approach to cabal exec ghc (see #10196).

Additional context
Other build tools, such as npm, already support the concept of dev tools independent of build tools. But the primary reason for this is for code formatters, which in the Haskell ecosystem require you to pin formatter versions. There are currently few ways to deal with multiple projects that require different versions of e.g. fourmolu without resorting to external facilities (nix-shell, direnv, etc.).

This proposal involves two changes:

  1. maintenance-depends for tools that are part of development but not of building/testing/etc.
  2. A new selector (currently spitballing tool but I'm not wedded to it) to select these, ghc (replacing the cabal exec ghc hack), and possibly build-tool-depends.

Activity

  1. geekosaur commented on Aug 11, 2024

    @geekosaur
    CollaboratorAuthor

    There are a number of things that need to be ironed out here, the most important of which is that in many cases you may want tools to be per project instead of per package: consider our own use of changelog-d and fourmolu. But I think selectors are by package, so that may be the wrong approach for maintenance tools if we want those in cabal.project instead of package cabal files.

  2. ulysses4ever commented on Aug 11, 2024

    @ulysses4ever
    Collaborator

    A silly question to those more knowledgeable than I: is it impossible to add this new field to the project file format and teach cabal to cabal run them anyway, without touching the package format?

  3. geekosaur commented on Aug 11, 2024

    @geekosaur
    CollaboratorAuthor

    I think project-level information doesn't support dependencies; cabal considers that package level. It is possible that doing this with cabal as it currently exists would require a utils-type package.

  4. pranaysashank commented on Aug 14, 2024

    @pranaysashank

    Related issues others have opened over the years: #9230, #10016

  5. ulysses4ever commented on Aug 14, 2024

    @ulysses4ever
    Collaborator

    Should we close this as a dup of #9230? The description here is valuable but at least it's linked from #9230 now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions