-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add info for nixos (opam2nix) #14477
Conversation
Commit: 6efed3f @bobot has posted 19 contributions. 🌩️ opam-lint errors 6efed3f
☀️ Installability check (+2)
🌤️ 1 ignored non-opam files:
|
Thanks @bobot ! The os-distribution opam2nix declares is (I debated this, but nixpkgs is the name of the package set, so it seemed the most appropriate) |
There is a problem in my proposition, I followed other packages which uses "nixos" as the name of the os for depext. But opam2nix still uses "nixpkgs". @timbertson What is the right name to use? I'm going to add for now "nixpkgs" as a copy of "nixos" dependencies it could be removed once the name is choosen. EDIT: Sorry the comments updated after I send this. My comments is outdated. |
It should be clarified in opam which uses in some way both names: https://github.com/ocaml/opam/blob/master/src/state/opamFormatUpgrade.ml#L24 For now I'm going to duplicate all the lines. |
packages/opus/opus.0.1.2/opam
Outdated
@@ -23,6 +23,7 @@ depexts: [ | |||
["opus-devel"] {os-distribution = "fedora"} | |||
["opus-devel"] {os-family = "suse"} | |||
["libopus"] {os-distribution = "nixos"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the nixos
line if it's not used instead? (it's definitely not used by opam-depext)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true that depext doesn't detect this os. But there is code in opam (for upgrade) which take into account nixos
(and prefers it compared to nix). Does people use nixos
themselves in depext?
I can remove the nixos line, I have no opinion on the previous question.
Do we have a list of the nomenclature for os-family
, os
, os-distribution
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I clarify this in #14477 (comment)
You can see how opam detects distribution/os/os-family here: https://github.com/ocaml/opam/blob/c35eb977d19457d3f13b31c1aa60de4fb210865d/src/state/opamSysPoll.ml
What is the ID
field in /etc/os-release
in NixOS?
This is only the format upgrade module, some parts are not actually used by opam-depext. However, if it were to be used at some point this needs to match the |
Uh, that code is just wrong I'm afraid. |
Soemone perhaps used opam in nixos directly (like opam on ubuntu, ...). It is a different use from opam2nix. |
@timbertson I have some problems with I will recheck this MR. |
I'd like to find out where (if anywhere) @AltGr , It looks like the first introduction of From the comments in the related issue "NixOs" was casually mentioned, I'm wondering if that accidental inaccuracy simply made its way into the code unchecked? Or do you know of a tool which actually uses "nixos"? (opam2nix doesn't, it only uses "nixpkgs") |
Indeed we should not have both nixos and nixpkgs. And I think @kit-ty-kate is right, we should look at what nixos choose for /etc/os-release, and it is |
I use fedora with nixpkgs, so opam's builtin depext is always going to do the wrong thing there. Is it ever going to support Maybe using "os" for depexts is just wrong in general, the information you really want is "which package sets are available". For most distros one implies the other, but not when third-party package managers come into it. I assume OSX/Windows would have the same kind of thing, since there are a number of package managers which might be present. |
Why will it always do the wrong thing? If you use opam directly depexts should use fedora package; if you use opam2nix it will use nixos package. I don't think opam directly but using nix package is a real use case thanks to opam2nix. |
Sorry for stalling for so long on this. I have in the past added So since the current code doesn't have any effect since nobody's actually using While we're at it, any thoughts on |
9a1eb2b
to
ae699e3
Compare
Ok done, the new version 1.7a should not be needed anymore since zarith 1.9.1 is released. But I haven't tested it in nix. |
The CI seems to have been canceled. What is the error? |
* backport handling of absolute CC * conf-pkg-config for nixos * add conf-gcc
(thanks kit-ty-kate)
Because in nix each package is installed in its own prefix
The CI doesn't pass on this MR, but the opam files of the failing packages are not semantically modified. They would fail before this MR. |
The CI was cancelled several times on this PR to avoid freezing the whole CI as it modifies a lot of packages. Is this PR ready to be reviewed? Is there a consensus? |
It has already been reviewed, it could be again. I think the most contentious point was the name of the os-distribution ( |
Agreed, as the source of contention for the distribution name (sorry 'bout that) I'm happy with this PR now 👍 |
["gcc"] {os-distribution = "debian"} | ||
["gcc"] {os-distribution = "ubuntu"} | ||
["gcc"] {os-distribution = "nixos"} | ||
["gcc"] {os-distribution = "archlinux"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
["gcc"] {os-distribution = "archlinux"} | |
["gcc"] {os-distribution = "arch"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor comment, but can fix that as part of #15789
Mainly add nixos precise packages, for use with @timbertson's opam2nix.