Skip to content
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

0.12.0-beta prerelease bug tracking #1769

Open
workingjubilee opened this issue Jul 9, 2024 · 3 comments
Open

0.12.0-beta prerelease bug tracking #1769

workingjubilee opened this issue Jul 9, 2024 · 3 comments

Comments

@workingjubilee
Copy link
Member

workingjubilee commented Jul 9, 2024

Please file all your complaints about the beta series of releases here. In addition to breaking certain unsound patterns on purpose, I am expecting considerable bugs or failures to compile extensions that should compile, so if there is a compiler error, then please try to post the full error with the code that appears to produce it. If you cannot post your original code, then please post a reasonable approximation of it, including e.g. linking to a crate in a repository somewhere I can git clone. Fixes for these will be released about as fast as fixes get in, but for some cases it may be decided that the issue is not fixable.

Current versions

0.12.0-beta issues fixed in 0.12.0-beta.3

Other improvements during beta series

@the-kenny
Copy link
Contributor

A PgRelation argument for a pg_extern function used to work in 0.11 but triggers a build error in 0.12.0-beta.2:

#[pg_extern(immutable, parallel_safe)]
fn foo(relation: PgRelation) -> Option<&'static str> {
    unimplemented!()
}

0.11 translated this to:

CREATE  FUNCTION "foo"(
	"relation" regclass /* pgrx::rel::PgRelation */
) RETURNS TEXT /* core::option::Option<&str> */
IMMUTABLE STRICT PARALLEL SAFE
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', 'foo_wrapper';

Error in 0.12.0-beta.2:

error[E0277]: the trait bound `pgrx::PgRelation: ArgAbi<'_>` is not satisfied
   --> src/utility_fns.rs:31:31
    |
30  | #[pg_extern(immutable, parallel_safe)]
    | -------------------------------------- in this procedural macro expansion
31  | fn foo(relation: PgRelation) -> Option<&'static str> {
    |        ^^^^^^^^ the trait `ArgAbi<'_>` is not implemented for `pgrx::PgRelation`
    |
    = help: the following other types implement trait `ArgAbi<'fcx>`:
              &'fcx CStr
              &'fcx [u8]
              &'fcx str
              *mut FunctionCallInfoBaseData
              AnyArray
              AnyElement
              AnyNumeric
              BOX
            and 34 others
note: required by a bound in `pgrx::callconv::Args::<'a, 'fcx>::next_arg_unchecked`
   --> .cargo/registry/src/index.crates.io-6f17d22bba15001f/pgrx-0.12.0-beta.2/src/callconv.rs:823:41
    |
823 |     pub unsafe fn next_arg_unchecked<T: ArgAbi<'fcx>>(&mut self) -> Option<T> {
    |                                         ^^^^^^^^^^^^ required by this bound in `Args::<'a, 'fcx>::next_arg_unchecked`
    = note: this error originates in the attribute macro `pg_extern` (in Nightly builds, run with -Z macro-backtrace for more info)

I'm not sure if this is intentional (or expected), but it used to work in 0.11. Workaround should be easy on my side, so feel free to mark this as 'works as intended' :-)

@workingjubilee
Copy link
Member Author

Hm. I am trying to decide if it being usable as an argument is useful or correct. I opened that as #1773.

I will impl ArgAbi for it depending on the answers to that.

@workingjubilee
Copy link
Member Author

Workaround should be easy on my side, so feel free to mark this as 'works as intended' :-)

We don't make mistakes, we have happy accidents.

@workingjubilee workingjubilee changed the title The "0.12.0-beta sucks!" post 0.12.0 beta megabug Jul 23, 2024
@workingjubilee workingjubilee changed the title 0.12.0 beta megabug 0.12.0-beta prerelease bug tracking Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants