-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Goal: Limited, configurable cross-compilation #955
Comments
This will effectively impose an API requirement that we essentially not need to use the C shim for anything that PGX relies on at the "basic level". It's fine to use it for e.g. a |
First of all, sadly, the way schema is generated right now means we have to build the extension twice - both for host and for target. Or rather, run codegen and linker twice - I'm not overly familiar with Rust's build process, but some parts are reused when compiling within the same tree for multiple targets. Lack of cshim would be a great help, since it's generating quite some pain. But it being there is actually not a deal breaker from what I'm seeing - it just needs two more flags (or environmental variable, but those prove to be problematic in the long run). What I'd need to support it being there cross-compilatiom is two more flags, for sysroots - for host and target. I hope to have working 0.5.4 soon, but it will require a large cleanup and rebasing on top of devel, so an actual PR won't happen in the next week or two. Of course, there's the big ticket item - On second thought: We probably won't be able to run away from environment variables - there's just too many things to configure, and traditionally this kind of thing was supplied through them. Just off the top of my head:
|
Another thing - because schema generation needs both native and cross builds, we need postgresql twice, so we can link both against native and target. Which means two |
I'm not bothered by the notion of setting environment variables, I just prefer that it be done via CLI arguments or configuration files where possible, so as to let us see what you are setting with maximal ease. Using an explicit contract boundary like that to set environment variables
Environment variables work best for things that are true about the environment (and thus are not going to be randomly changed, e.g. during a build), for things everyone knows to use an "append, not clobber" mode for (e.g. |
So far, in my experimental branch, I have taken the approach to specify the target (because it's for Cargo, not C) and the sysroots as arguments, while the rest is passed as environment variables - those are well known and have been used for a long time. The only little snag is terminology: whether to use the prefix |
Yes, the "traditional" ones are well-understood and, in many cases, have an actual rulebook as to how you should handle them. One you can print out and eat and everything. |
Yeah, where possible we should use |
@thomcc a little word of caution: don't assume that |
I'm well aware. |
My end-goal here is to have
I am not sure if there should be included in this issue, or separate issues on their own. |
cshim
feature flag #958--target
support to cargo-pgx@jaskij and @thomcc probably have other thoughts, comments, requirements, or requests.
The text was updated successfully, but these errors were encountered: