Extension fields (`x-*`) for cabal.project

Open
#12,480 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
haskell
Domain
build-system

Research direction

Start by reading the project-file parsing code and the existing .cabal extension-field support referenced by the issue. Check how top-level fields and stanza fields are parsed and reported, then define behavior for x-* fields in both locations. Done means both examples parse without unknown-field warnings and existing project-file parsing still works.

Written by the indexing model from the issue text.

Description

attention: pr-welcome type: enhancement

Describe the feature request

.cabal files already support extension fields. The feature could be extended to cabal.project and its stanzas.

Currently cabal emits a warning. Top level:

Warnings found while parsing the project file, cabal.project:
 - cabal.project: Unrecognized field 'x-foo' on line 10

Inside a stanza:

Warnings found while parsing the project file, cabal.project:
 - cabal.project: ???:10:0: Unknown field: "x-foo"

Additional context

We have a tool that modifies cabal.project files and it'd be nice if we could specify directives for it next to the piece of data it affects.

Related issues:

Dominant language
Haskell
Stars
1.8k
Forks
766
Avg merge
5d 21h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/cabal

All issues in haskell/cabal

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.