-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Support for library with different name than crate name #1100
Support for library with different name than crate name #1100
Conversation
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.
This looks good.
I feel like we ought to document this somewhere, but pgx' "documentation" is kinda disorganized. We'll get this documented somewhere later.
Oh, one change, @azam: could you also update the |
Also, looks like it needs a |
@eeeebbbbrrrr |
Got to put a hold on this, I am stuck at getting the lib name here. Should we read the cargo manifest to get it, since there is no env var set for lib name (there is for binaries though |
That's a sneaky line of code! Yeah, so I think now it makes sense to centralize the manifest handling, and use it here. I think what might be okay is to add a I'd go for the absolutely minimal implementation of this new What do you think? |
edit: and I suppose this means moving some of |
I could do that, thinking on the line of exporting these functions:
Should I do this? |
Yeah, that seems fine. Thanks! |
@eeeebbbbrrrr |
Since we just renamed to And if there's any references to "pgx" in your changeset they'll now need to be "pgrx". Sorry for the trouble! Growing pains! |
@eeeebbbbrrrr |
This looks good. I'm letting CI run it now. Thanks @azam! |
I'm not sure if you're allowed to see the test runner output? https://github.com/tcdi/pgrx/actions/runs/4738921279/jobs/8425118139 But basically the tests are failing with:
Oh, and this is for the |
|
||
let mut library_file = None; | ||
for message in build_command_messages { | ||
match message { | ||
cargo_metadata::Message::CompilerArtifact(artifact) => { | ||
if artifact.target.name != *crate_name { | ||
if artifact.target.name != *target_name { |
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.
artifact.target.name
is filled with crate name as-is (ie pgrx-tests
) or lib name, depending on whether lib name has a name override or not, but cargo_manifest::Manifest
auto fills lib name with crate name with hyphen replaced with underscore (ie pgrx_tests
). Added target_name
on PgrxManifestExt
to return a value matching what cargo_metadata
expects
@eeeebbbbrrrr |
No need to apologize! It's a complex system and that's why we have CI. We appreciate your efforts on this PR! |
This resolves #1099