-
Notifications
You must be signed in to change notification settings - Fork 415
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 findlib toolchain handling for dune install. #3501
Conversation
… paths. Signed-off-by: Rizo I <[email protected]>
This is achieved by filtering contexts with the provided findlib toolchain and using that toolchain for install path detection. Signed-off-by: Rizo I <[email protected]>
8438b9f
to
145b703
Compare
Related to ocaml/opam#4204 and ocaml/opam#2476. Am I correct in assuming that there's currently no way to instruct opam to install the |
This was designed for the ocaml-cross repositories where the package names are suffixed with Regarding For instance, IIRC BTW, while the new interpretation seems fine, it is also technically a breaking change, so we need to assess the impact before going through it. |
Thanks for the explanation, @jeremiedimino! Indeed, I later noticed that Let me know what's your preference, I'm happy to implement it. |
Well, I also like the proposed interpretation better, though I usually prefer to be strict about backward compatibility. That being said, I was reading the doc and the doc seems to suggest that if you have no Just ccing @avsm and @samoht to make sure this won't impact mirage; right now you if you do |
I appreciate you checking in on the Mirage usecase. I don't believe this would affect it, since we don't use |
@samoht is on vacation - I’m 99% sure this is fine, so go ahead and we will work around any (unlikely) issues in Mirage |
I'm happy to give it a shot, @rgrinberg. Will try to submit a PR in a few days. |
Thanks. Feel free to ask questions if anything is unclear.
…On Jul 29, 2020, 8:16 AM -0700, Rizo I ***@***.***>, wrote:
I'm happy to give it a shot, @rgrinberg. Will try to submit a PR in a few days.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Problem
For a given package
$PKG
, when explicitly providing a findlib toolchain with-x $TOOLCHAIN
,dune install
does two things that, in my understanding, are incorrect:$TOOLCHAIN
; and_build/default.$TOOLCHAIN/$PKG.install
instead of_build/default.$TOOLCHAIN/$PKG-$TOOLCHAIN.install
.These two points can be validated currently on
master
by updating./test/blackbox-tests/test-cases/cross-compilation/run.t
as follows:As stated in point 1, even though
-x foo
was passed,_build/default/p.install
is expected to be present. And, as stated in point 2, the install file location is_build/default.foo/p.install
, but should be_build/default.foo/p-foo.install
. At least given my understanding of dune's path conventions for non-default toolchains.Solution
See the proposed behaviour in the first commit 479158e for comparison with the current behaviour.
More specifically, in the presence of the
-x
option, the implementation ofdune install
:Alternatives
Regarding 1
Keep the current functionality where
dune install -x $TOOLCHAIN ...
installs targets from the contexts that don't have the$TOOLCHAIN
. As a workaround to only install the desired toolchain targets,dune install -x $TOOLCHAIN --context=default.$TOOLCHAIN
can be used, assuming thedefault
context.I think this would be fine, even though the user has explicitly passed a toolchain. This behaviour is somewhat unexpected, but at least can be tuned.
Regarding 2
The naming convention for install files could be changed in the build folder. Currently the generated files (with
--promote-install-files
) are:./_build/default.$TOOLCHAIN/$PKG-$TOOLCHAIN.install
and;./$PKG-$TOOLCHAIN.install
Instead, dune could generate
./_build/default.$TOOLCHAIN/$PKG.install
internally. To my knowledge, no collisions are possible, because thedefault.$TOOLCHAIN
context is used as a namespace.This would also work, but introduces an unnecessary inconsistency for the install filenames.