Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[RFC] relax parsing of dune-package files #2147

Closed
ghost opened this issue May 13, 2019 · 3 comments
Closed

[RFC] relax parsing of dune-package files #2147

ghost opened this issue May 13, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented May 13, 2019

Currently, the following scenario is annoying:

  1. install the development version of dune
  2. install a bunch of things with opam
  3. reinstall the latest released version of dune

The dune installed in step 3 cannot read dune-package installed by dune in step 1. This mean that we have to reinstall all the packages installed in step 2.

I propose to improve this scenario as follow: when dune v.x read a dune-package file with (lang dune v.y) and y > x, then dune can still read the file but will silently ignore any field it doesn't understand. For this to work well, we must be conservative in the encoding of dune-package between minor versions. i.e., we can add new fields but we cannot rename them.

mlasson added a commit to LexiFi/gen_js_api that referenced this issue May 26, 2020
@kit-ty-kate
Copy link
Member

kit-ty-kate commented Sep 28, 2020

Apart from the interaction with opam, this issue also affects dune itself when using the --workspace option.
For instance, with the following dune-workspace.dev:

(lang dune 1.0)

(context (opam (switch 4.11)))
(context (opam (switch 4.12)))

Calling dune with the following command:

$ dune build @install @runtest --workspace dune-workspace.dev

Results in the following error:

File "/home/kit_ty_kate/.opam/4.12/lib/stdlib-shims/dune-package", line 1, characters 11-14:
1 | (lang dune 2.8)
               ^^^
Error: Version 2.8 of the dune language is not supported.
Supported versions of this extension in version 2.8 of the dune language:
- 1.0 to 1.12
- 2.0 to 2.7

The issue is that the version of dune used during the first call is not the latest one and fails if some development version is used or simply if the current version of dune used is not the highest across of all the opam switches used.

@c-cube
Copy link

c-cube commented May 20, 2021

Having dune as a{build} dep would be indeed pretty great.

@rgrinberg
Copy link
Member

I remember talking about this with Jeremie in private and I'm pleased to say that I convinced him that this was a bad idea. Let's keep dune-package as an implementation detail and leave all the optimization to dune's cache.

@rgrinberg rgrinberg closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2022
Niols added a commit to colis-anr/morbig that referenced this issue Apr 1, 2023
I don't exactly know why, but if we have it the linter of the OPAM repository gets upset with us with:

> Warning in `morbig.0.10.4`: The package tagged dune as a build dependency. Due to a bug in dune (ocaml/dune#2147) this should never be the case. Please remove the `{build}` tag from its filter.
sanette added a commit to sanette/bogue-tutorials that referenced this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants