-
Notifications
You must be signed in to change notification settings - Fork 371
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
New depexts #3074
New depexts #3074
Conversation
It's not nice to see `file_name conjunction` instead of `string list`...
This closes ocaml#2919 This replaces the current obscure and verbose depexts format by lists of system package names and filters based on opam variables, e.g. : depexts: [ ["libssl-dev"] { os-distribution = "debian" | os-distribution = "ubuntu" } ["openssl-devel"] { os-distribution = "centos" & os-version >= "7.2" } ] The old format still parses, and is rewritten by the package migration function (older packages in 2.0 format won't be rewritten and may get broken depexts, as we don't want to retain compatibility with beta format versions) All tags currently present in `opam-repository` are supported, except for `source`, which is discarded (they were in the same namespace and now need to be classified between `arch`, `os`, etc.) Note that the rewrite needs to know about the variables defined and their values. This is based on ocaml#3058 and https://gist.github.com/AltGr/5bfc8cea6f01e74b95de79ceaba39369, version 4, but may still change. Opam itself does not define these variables at the moment (except for `arch` and `os`, but not with the same normalisation yet), and the command-line format changes too, which means that current `opam-depext` will be broken by the changes. The new format is opam list --external --vars arch=x86_64,os=linux,os-distribution=debian instead of opam list --external=x86_64,linux,debian which was more ambiguous and less generic, if shorter. The idea is that the variables will later be built in opam, so the user won't need to declare them for normal usage.
it wouldn't work with the new scheme (variables+filters instead of tags) anyway
On aspect that doesn't seem to be handled that was present in #2919 is the ability to specify a version constraint for the package (to be handled by the sys package managers of course). |
Well, I don't see how we could better handle sys package versions. What is already possible is, if the package manager supports it, to give a version within the sys-package string: for example, you could use
I don't think it's worth having more built-in, as it would be difficult to map to the package managers, may not even be supported in most of the cases, and most PMs only have one version per package anyway. |
This occurs quite often and is painful for CI, I still think it would be better to abstract this into
|
Why can't this versioning be handled by e.g.
The common case is that an upstream package is present in (e.g.) Ubuntu 17.04 and that needs to be encoded. The precise version would be nice, but not necessary for us to track. |
I think using |
I'm not sure about that, e.g. think of But indeed the |
May be useful for os-specific conflicts, for example: conflicts: "foo" {os = "linux"}
There is now a matching version of |
Agreed, but homebrew is something of a special case since users are expected 'brew update' and keep on the master to solve compatibility problems. The significant version on osx is the base macos revision, which can be tracked by os-version. I'm happy with the existing scheme in this PR; it's a huge improvement :-) |
That looks great to me too. |
This closes #2919
This replaces the current obscure and verbose depexts format by lists of
system package names and filters based on opam variables, e.g. :
The old format still parses, and is rewritten by the package migration
function (older packages in 2.0 format won't be rewritten and may get
broken depexts, as we don't want to retain compatibility with beta
format versions)
All tags currently present in
opam-repository
are supported, exceptfor
source
, which is discarded (they were in the same namespace andnow need to be classified between
arch
,os
, etc.)Note that the rewrite needs to know about the variables defined and
their values. This is based on #3058 and
https://gist.github.com/AltGr/5bfc8cea6f01e74b95de79ceaba39369, version
4, but may still change.
Opam itself does not define these variables at the moment (except for
arch
andos
, but not with the same normalisation yet), and thecommand-line format changes too, which means that current
opam-depext
will be broken by the changes. The new format is
instead of
which was more ambiguous and less generic, if shorter. The idea is that
the variables will later be built in opam, so the user won't need to
declare them for normal usage.