-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
ocamlPackages: init a bunch of libraries for the MirageOS xen target #118066
Conversation
518d02f
to
c2344a4
Compare
@ofborg build ocamlPackages.mirage-net-xen ocamlPackages.mirage-bootvar-xen |
Result of 1 package marked as broken and skipped:
53 packages skipped due to time constraints:
36 packages built successfully:
Result of 18 packages marked as broken and skipped:
7 packages failed to build:26 packages skipped due to time constraints:
33 packages built successfully:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
-prefix=${pcfiledir}/../.. | ||
-exec_prefix=${prefix} | ||
-libdir=${exec_prefix}/lib | ||
+libdir=${pcfiledir}/../ |
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.
Hmm normally we keep prefix
and friends? And prefix is set to $out
by default as a best effort.
I went into the rabbit hole a bit, looking at ocaml/dune#1253 and linked issues like:
- Get rid of calls to opam when using opam mirage/mirage-solo5#61
install
subcommand design ocaml/dune#680- Sites, locations, relocation ocaml/dune#3104
It looks like perhaps the pieces are there and those issues can be resolved?
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.
Oh right, I completely forgot about that. I quickfixed this on a local branch and was meaning to follow up. I'll see what this is all about :)
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.
The issue boils down to the following: The pkg config file in the repository has been manually created and assumes the default relation between dune's prefix and libdir (which would be "${prefix}/lib"
for the latter). However for ocamlPackages
we install libraries into a version specific site-lib, so that doesn't work out.
This is probably fixable in mirage-xen
's build system, but they probably have little interest in fixing that before the upcoming rework.
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.
Should be better now!
mirage/mirage#969 mirage/mirage#1195 also make me begin to understand the pkg-config might duplicate functionality for the OCaml -> OCaml case (vs OCaml -> C or C -> OCaml case), and why they thus might want to get rid of it. |
Yep, I talked to them on IRC and basically they want to use |
c2344a4
to
10547c5
Compare
I don’t understand why the |
The location of the .pc files is OCaml-specific unfortunately, but I don't think we'll need this in the long term (since MirageOS 4 promises to get rid of pkg-config), so I think I'll move it into an |
Unfortunately this requires a bit of trickery with pkg-config to get to work. The root issue is that the mirage-xen assumes that we use the default libdir of dune ($out/lib) whereas we install to an OCaml version-specific site-lib directory. Thus the manually created pkg-config file makes wrong assumptions (which warrants a patch) and the .pc file is installed to the wrong location (which is fixed with a mv invocation).
10547c5
to
4f7a661
Compare
I believe, I've cleaned this up now: We don't need a new setup hook or the likes, we can just install the |
Was waiting for you to say you think it's ready. LGTM! |
Motivation for this change
#23955
cc @Ericson2314 as well, I'd love to hear your thoughts on the
pkg-config
specific changes to thefindlib
setup hook.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)