shift to a single package for selecting cross-target#4
Draft
avsm wants to merge 2 commits into
Draft
Conversation
Owner
|
Thanks @avsm . Can I ask if you've tried this layout with dependencies? I started with something like this but ran into problems quickly with it |
Author
|
Not yet, it’s very lightly tested. I’m going to try getting Core working when I get a chance this week. I’d like to aim for something more usable than renaming all the opam packages with the target suffix; there’s a got to be a more elegant way! (But i have no idea what yet, many have tried…) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've successfully got this cross-compiling some binaries to my raspberry pi, from my mac now! I experimented with a different layout here to make it easier to add targets, added here as a draft PR to show you:
conf-zig-crossconfigures the zig_triple and ocaml_triple opam variables. There are multiple versions of this package depending on your target (conf-zig-cross.rpi or conf-zig-cross.x86_64-al2023 for example)conf-zig-wrapperinstalls the wrapper scripts, after querying conf-zig-crosszig-ocaml-crossinstalls the cross toolchain ascross-sysrootquerying conf-zig-crossWith this I can now do:
opam install conf-zig-cross.rpi zig-ocaml-crossto get the rpi cross compiler, and then use thezig-cross-*wrappers to set CC/CXX/etc in my C library Makefile to do a full cross compile. The dune command isdune build -p rgb_matrix -x cross.