-
Notifications
You must be signed in to change notification settings - Fork 351
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
depexts for MSYS2 #5348
depexts for MSYS2 #5348
Conversation
e603a40
to
c67efb9
Compare
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.
Thanks a lot! That looks great! My only issue is on the msys2-nativedir
variable / msys2 detection story, but the rest looks ok.
Oh, also I think the |
@@ -130,6 +138,15 @@ let family ~env () = | |||
"External dependency handling for macOS requires either \ | |||
MacPorts or Homebrew - neither could be found" | |||
| "suse" | "opensuse" -> Suse | |||
| "windows" -> |
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.
Something like that would also need to be done (see how it's done for BSDs above)
| "windows" -> | |
| "windows" -> | |
begin match OpamSysPoll.os_distribution env with | |
| Some "msys2" -> |
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.
Fixing! Did a search in fdopen for os-distribution = "win32"
; nothing found, so it is safe for existing Diskuv users. Thanks
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.
For posterity the setting of os-distribution
was done in diskuv/dkml-runtime-distribution@ff42f08 (used by the Diskuv OCaml installer).
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.
Added the Some "msys2"
on top of existing match. Once we decide on a global variable for the package manager binary (C:\Users\beckf\AppData\Local\Programs\DiskuvOCaml\tools\MSYS2\usr\bin\pacman.exe
) then the match clause will simplify.
Can you suggest to me what the values should be? I have no idea what the distinction is between
Do you want:
Note: I've been using opam switch variables rather than opam global variables for the Also, which opam variable can be used to indicate which Windows C library (SDK+headers) to use when compiling C programs? The choices boil down to Windows SDK (I've been calling this native Windows) or the GNU C library (MinGW/Cygwin). Rust for example equates the binary choice to a choice in the ABI: https://rust-lang.github.io/rustup/installation/windows.html. It would be nice to have an opam variable that clearly said which Windows ABI to use. Today a package maintainer can look at the lack of the |
I think the values should be:
Also thinking about the
and let opam infer which is the current subsystem (using either the |
Thanks.
Sigh; most but not all packages have versions for each subsystem. Common executables like Perhaps we could use a label? Example:
|
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.
Thanks for this!
We need to be concerned about OPAMCONFIRMLEVEL
being respected - and we're going to be meeting shortly to discuss how to deal with the detection of MSYS2 in this case, so that can be added separately.
After discussion, we introduce |
Thanks. I added Looks good! |
Sorry, @jonahbeckford, we've just been discussing again trying to reconcile how this variable works for all the package managers, and in doing so we've come back round to something that's closer to where you started! For this PR, with apologies for yet another tweak needed in dkml-runtime, could the variable by For a later PR, the plan is then to have In particular, that means that for everything which isn't Cygwin or MSYS2, opam would just use a default. i.e. on Debian/Ubuntu, you could choose to set |
- Second alignment with ocaml/opam#5348
No problem. diskuv/dkml-runtime-distribution@316f67e for posterity. |
ce80b31
to
d435910
Compare
gentoo fix in #5410 |
d435910
to
b3d5666
Compare
Thanks! |
MSYS2 on Windows uses the same package manager as Arch Linux (
pacman
). It targets several ABIs (compilers, bitiness and Windows C libraries).This PR builds on the opam global variables that are registered when Diskuv OCaml (DKML) is installed. Those variables became available with DKML 1.1: https://gitlab.com/diskuv/diskuv-ocaml/-/blob/bd5b461b7d267ff897d053a67cce6ed5c26f27b4/CHANGES.md. Any MSYS2 distribution (not just DKML) can set those opam variables:
Testing
With the following change to
conf-pkg-config
:we can now do:
(If it wasn't a test the command line would simply be
opam install conf-pkg-config
)