Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OCAML_DUNE_PRETEND_VERSION #11484

Open
SnarkBoojum opened this issue Feb 15, 2025 · 2 comments
Open

OCAML_DUNE_PRETEND_VERSION #11484

SnarkBoojum opened this issue Feb 15, 2025 · 2 comments
Labels
config Everything related to dune configuration (workspace, project, dune, env) feature-request User wanted features

Comments

@SnarkBoojum
Copy link

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

@rgrinberg
Copy link
Member

It's fine to have this, but why do you want a runtime configuration option. Wouldn't it be better to have a build time option? E.g. ocaml configure.ml --set-version FOO?

@SnarkBoojum
Copy link
Author

I don't get your point : it is a runtime configuration for dune, but it's used at build time for the software currently built -- which is the one we want to pretend the version of.

@maiste maiste added feature-request User wanted features config Everything related to dune configuration (workspace, project, dune, env) labels Feb 24, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
config Everything related to dune configuration (workspace, project, dune, env) feature-request User wanted features
Projects
None yet
Development

No branches or pull requests

3 participants