-
Notifications
You must be signed in to change notification settings - Fork 0
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
Consider cross-compilation in TH mode #342
Comments
Cross compilation doesn't really make sense for the current TH setup. TH is always run on the target architecture, so for now the TH story is actually quite straight forward. |
@phadej I don't understand what you mean. Surely TH is always run on the host, not the target? We must mean different things. Here's the kind of thing I had in mind. Suppose we are on platform A, and are compiling for platform B, and we're using
We then read this environment variable, set appropriate libclang flags, and generate splices as normal, for platform B. The code is running on platform A, but that's fine: the code that's running is code that generates code; it doesn't matter what platform that runs on, as long as it generates code for B. Do you see a problem with that setup? |
TH is always run on the target. GHCJS runs
The TH has to be run on platform B. I found this post https://medium.com/@zw3rk/cross-compiling-template-haskell-7e38c00c2914 explaining E.g. https://www.tweag.io/blog/2020-11-25-asterius-th/ says
|
I see. Thank you for that clarification, that certainly connected a few dots for me! |
We need to consider what the workflow will look like; how does the user start a build on their host machine for a particular target machine, and importantly, how do those flags then make it to the TH splice? We could require users to do set this up themselves (as long as we accept clang args, #341, that's at least possible), but it would be good to provide some out-of-the-box support.
The text was updated successfully, but these errors were encountered: