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

variables for selecting builds based on compiler/arch/os #838

Open
avsm opened this issue Jun 1, 2018 · 2 comments
Open

variables for selecting builds based on compiler/arch/os #838

avsm opened this issue Jun 1, 2018 · 2 comments

Comments

@avsm
Copy link
Member

avsm commented Jun 1, 2018

It would be useful to be able to select build rules based on some variables other than the presence of libraries. For example:

  • ocaml-version: Merlin needs to select a module based on the current switch
  • arch: C bindings need to select arm/x86 specific modules (nocrypto)
  • os: platform bindings (e.g. mirage-xen/mirage-unix)

For each of these, it is possible to do a configurator/jbuild-generation pass, but the big advantage of having variable rules directly is that they work when embedded in a Duniverse of related packages. For example, with a manually assembled Mirage duniverse, the default dune build rule doesnt work as it selects the Linux- and macOS-only packages simultaneously. If Dune could handle these parameters as part of the build scanning process, then package embedding works great.

As a longer term consideration, this also expands our ability to generate accurate package management scripts as well -- for example, opam files could have accurate available: constraints added based on these build rules as well.

@dra27
Copy link
Member

dra27 commented Jun 8, 2018

Related to #397

@avsm
Copy link
Member Author

avsm commented Jun 8, 2018

The code from opam-depext could be vendored in to help with the os variables -- there's a lot of fairly clean code there that generates the variables in opam2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants