Add findlib toolchain handling for dune install.#3501
Add findlib toolchain handling for dune install.#3501rizo wants to merge 2 commits intoocaml:mainfrom
Conversation
… paths. Signed-off-by: Rizo I <rizo@odis.io>
This is achieved by filtering contexts with the provided findlib toolchain and using that toolchain for install path detection. Signed-off-by: Rizo I <rizo@odis.io>
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 installdoes two things that, in my understanding, are incorrect:$TOOLCHAIN; and_build/default.$TOOLCHAIN/$PKG.installinstead of_build/default.$TOOLCHAIN/$PKG-$TOOLCHAIN.install.These two points can be validated currently on
masterby updating./test/blackbox-tests/test-cases/cross-compilation/run.tas follows:As stated in point 1, even though
-x foowas passed,_build/default/p.installis 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
-xoption, 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.$TOOLCHAINcan be used, assuming thedefaultcontext.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.installand;./$PKG-$TOOLCHAIN.installInstead, dune could generate
./_build/default.$TOOLCHAIN/$PKG.installinternally. To my knowledge, no collisions are possible, because thedefault.$TOOLCHAINcontext is used as a namespace.This would also work, but introduces an unnecessary inconsistency for the install filenames.