-
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
fix(x-compilation): find host ppx dependencies in the host context #7415
Conversation
e783536
to
312f778
Compare
Would this mean you could have two opam switches and use the ppx from one when compiling packages depending on the other? |
I'm not too familiar with how contexts and opam switches are related, but I think there's a relation. If they're 1:1 I suspect that should be possible. |
312f778
to
9f8c810
Compare
Reading the docs and the code a little more, it seems like this is in fact the case if you're setting up your cross compilation environment in OPAM. I think it might be even a bit more restrictive: you can only depend on PPXes in the other switch. |
That still seems OK to me. I wouldn't consider ppx a "runtime dependency" i.e. something that needs to be around when the code is executing but rather a "build time dependency". Modifying source code should be independent of platform, so whether this is performed in the target context or the host context doesn't really matter. |
Note that this doesn't exclude PPXes from being cross-compiled. This change just interprets the library dependencies in |
@anmonteiro Could you add a note about that in the cross-compilation section? i.e. that deps from pps are interpreted in the host? |
I believe this is already covered, it's just that it's broken. From https://dune.readthedocs.io/en/stable/cross-compilation.html#how-does-it-work :
|
a3adfed
to
10e71cc
Compare
10e71cc
to
688354f
Compare
688354f
to
91ced91
Compare
I tested this PR in my cross-compilation setup and everything seems to work as expected 👍 |
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.
LGTM. Don't forget a CHANGES entry
let host = | ||
let host = | ||
Memo.Lazy.create @@ fun () -> | ||
let+ installed_libs = Lib.DB.installed ~host:None host_context in |
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.
One day we should allow host contexts to have their host contexts as well.
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
91ced91
to
9dc3cc7
Compare
Rebased on |
Just to be clear about the terminology, since this always confuses me, are we saying:
|
In my understanding, it's actually a triplet: build, host and target. This is how I think about it:
|
That's great, thank you for the fix @anmonteiro ! |
…ntext (ocaml#7415)" This reverts commit 16a7e88.
…ntext (ocaml#7415)" This reverts commit 16a7e88.
…ntext (ocaml#7415)" This reverts commit 16a7e88.
…ntext (ocaml#7415)" This reverts commit 16a7e88.
…ntext (ocaml#7415)" This reverts commit 16a7e88. Signed-off-by: Etienne Millon <[email protected]>
…ntext (ocaml#7415)" This reverts commit 16a7e88. Signed-off-by: Etienne Millon <[email protected]>
* Revert "fix(x-compilation): delay evaluation of `ppx_runtime_deps` until context is known" This reverts commit ab74a71. Signed-off-by: Etienne Millon <[email protected]> * Revert "test(x-compilation): demonstrate overlap check failure with ppx_runtime_libraries" This reverts commit 096fc97. Signed-off-by: Etienne Millon <[email protected]> * Revert "fix(x-compilation): find host ppx dependencies in the host context (#7415)" This reverts commit 16a7e88. Signed-off-by: Etienne Millon <[email protected]> * Changelog Signed-off-by: Etienne Millon <[email protected]> --------- Signed-off-by: Etienne Millon <[email protected]>
* Revert "fix(x-compilation): delay evaluation of `ppx_runtime_deps` until context is known" This reverts commit ab74a71. Signed-off-by: Etienne Millon <[email protected]> * Revert "test(x-compilation): demonstrate overlap check failure with ppx_runtime_libraries" This reverts commit 096fc97. Signed-off-by: Etienne Millon <[email protected]> * Revert "fix(x-compilation): find host ppx dependencies in the host context (ocaml#7415)" This reverts commit 16a7e88. Signed-off-by: Etienne Millon <[email protected]> * Changelog Signed-off-by: Etienne Millon <[email protected]> --------- Signed-off-by: Etienne Millon <[email protected]>
* Revert "fix(x-compilation): delay evaluation of `ppx_runtime_deps` until context is known" This reverts commit ab74a71. * Revert "test(x-compilation): demonstrate overlap check failure with ppx_runtime_libraries" This reverts commit 096fc97. * Revert "fix(x-compilation): find host ppx dependencies in the host context (#7415)" This reverts commit 16a7e88. * Changelog --------- Signed-off-by: Etienne Millon <[email protected]>
CHANGES: - Fix a crash when using a version of Coq < 8.13 due to the native compiler config variable being missing. We now explicitly default to `(mode vo)` for these older versions of Coq. (ocaml/dune#7847, fixes ocaml/dune#7846, @Alizter) - Duplicate installed Coq theories are now allowed with the first appearing in COQPATH being preferred. This is inline with Coq's loadpath semantics. This fixes an issue with install layouts based on COQPATH such as those found in nixpkgs. (ocaml/dune#7790, @Alizter) - Revert ocaml/dune#7415 and ocaml/dune#7450 (Resolve `ppx_runtime_libraries` in the target context when cross compiling) (ocaml/dune#7887, fixes ocaml/dune#7875, @emillon)
This reverts commit 886df09.
This reverts commit 886df09. Signed-off-by: Antonio Nuno Monteiro <[email protected]>
This reverts commit 886df09. Signed-off-by: Antonio Nuno Monteiro <[email protected]>
This reverts commit b566e50.
…ocaml#7890)""" This reverts commit d7ee814.
While researching the cross-compilation story to fix #6191, I found about this failing test case from #4155 that never got fixed
cc @TheLortex