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

support boolean literals in package dependencies #11447

Open
v-gb opened this issue Feb 5, 2025 · 1 comment
Open

support boolean literals in package dependencies #11447

v-gb opened this issue Feb 5, 2025 · 1 comment
Labels
config-file Everything related to dune configuration file (workspace, project, dune) feature-request User wanted features

Comments

@v-gb
Copy link

v-gb commented Feb 5, 2025

Desired Behavior

In the depends fields of package stanzas of dune-project files, I'd like to be able to say true and false in places where variables like with-dev-setup are currently allowed. Currently, AFAICT, this is not possible (although you can write :false to get a variable named false, which I suppose kind of works, but is weird).

The context is my project vendors library L, and thus my dune-project needs to incorporate library L's dune-project dependencies. But L's dune-project contains references to with-dev-setup that I claim should always be off (because I'm not vendoring the tests, but I may use with-dev-setup for my own purpose). Obviously, I could manually simplify any boolean away, but the inclusion of L's dependency is done with a script.

Currently, I'm using (= 1 0) when I need false, but opam maintainers are not necessarily happy about that.

Example

I'd like to be able to write this sort of things in a dune-project:

(package
  (depends
   (alcotest
     (and
      false ;; <---
      (>= 1.3.0)))
@maiste maiste added feature-request User wanted features config-file Everything related to dune configuration file (workspace, project, dune) labels Feb 6, 2025
@rgrinberg
Copy link
Member

rgrinberg commented Feb 9, 2025

Do we accept things like (and pkg1 pkg2)? If we do, we'll need to escape false and true as :false or :true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config-file Everything related to dune configuration file (workspace, project, dune) feature-request User wanted features
Projects
None yet
Development

No branches or pull requests

3 participants