ocaml / ocaml/dune

OCAML_DUNE_PRETEND_VERSION

Open
#11,484 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

config
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

I'm the Debian packager for elpi and coq-elpi, both using dune, and I have been having some issues with their latest versions.

The elpi tarball on github relies on dune using it's .git to determine the version (%%VERSION_NUM%% substitutions and building a coherent META file) ; unfortunately, it is a .git-less tarball, so it doesn't quite work as expected.

For packagers (I guess other distributions will also find it hard), it would be nice to have an environment variable to bypass the current mechanism to find the version, and I propose OCAML_DUNE_PRETEND_VERSION ; the usage being:

  • if it's defined, take that as a basis for version and version_num everywhere ;
  • if it isn't, fall back to the current git/hg tricks.

Such a mechanism isn't unheard of: python's setuptools-scm system provides a SETUPTOOLS_SCM_PRETEND_VERSION which does exactly that ; and if you look at the debian/rules files here, you'll see how useful it is.

Thanks

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating Dune's existing Git/Hg version-detection and %%VERSION_NUM%%/META version handling; no source files or tests are named. Trace how an OCAML_DUNE_PRETEND_VERSION value should supply version and version_num, then verify that the current fallback remains unchanged when the variable is unset.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.