Multi-version configuration files
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Currently, the config file in $XDG_CONFIG_HOME/dune/config sets a lower bound on the Dune version useable on one's machine (via the lang stanza):
File "/home/.config/dune/config", line 1, characters 11-14:
1 | (lang dune 2.1)
^^^
Error: Version 2.1 of dune is not supported.
Supported versions:
- 1.0 to 1.12
- 2.0
In order to access the latest features (such as the cache), I need to update all projects on my machine in lockstep. I think it would be nice to allow projects to be upgraded independently while allowing access to the newest features. Here's two potential strategies:
Proposal 1 - Multi-version config file
We could make all configuration settings forwards-compatible by adding some sort of conditional stanza:
(for-version
(>= 2.1.0)
(cache enabled))
- advantages: retains a single source of truth for Dune config.
- disadvantages: makes it harder to change the config file parser in future, and makes the
langstanza in the config files mostly redundant.
Proposal 2 - Multiple config files
We could have version-specific config files that are read in some sort of preference order, for instance:
$XDG_CONFIG_HOME/dune/config.2.0.1 (* Read by >= 2.0.1 *)
$XDG_CONFIG_HOME/dune/config.1.11.2 (* Read by >= 1.11.2 & < 2.01 *)
$XDG_CONFIG_HOME/dune/config (* Read by < 1.11.2 *)
- advantages: logic for parsing the config is the same as before, and retains the same 'lang header' / 'body' parser distinction as the other Dune files.
- disadvantages: config parameters will likely be duplicated in the files.
Personally, I prefer the second option for not violating my expectations of the lang stanza. I'm happy to implement whatever solution is deemed best.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the configuration file at $XDG_CONFIG_HOME/dune/config and how its lang stanza limits supported Dune versions. Compare the proposed conditional-stanza and version-specific-file approaches, then define how independent project upgrades and access to newer features should work. Done means a decided configuration design that supports multiple Dune versions without requiring all projects to upgrade together.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100