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

Prisma cli build failed #256

Closed
Alivers opened this issue Feb 21, 2023 · 13 comments
Closed

Prisma cli build failed #256

Alivers opened this issue Feb 21, 2023 · 13 comments
Labels
bug Something isn't working lib

Comments

@Alivers
Copy link

Alivers commented Feb 21, 2023

My Cargo.toml config:

prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.4" }

Prisma cli build failed with the error:

  Compiling quaint v0.2.0-alpha.13 (https://github.com/prisma/quaint?rev=fb4fe90682b4fecb485fd0d6975dd15a3bc9616b#fb4fe906)
error[E0599]: no method named `with_pkcs12_path` found for struct `SslOpts` in the current scope
   --> /Users/aliver/.cargo/git/checkouts/quaint-9f01e008b9a89c14/fb4fe90/src/connector/mysql.rs:187:41
    |
187 |                     ssl_opts = ssl_opts.with_pkcs12_path(Some(Path::new(&*v).to_path_buf()));
    |                                         ^^^^^^^^^^^^^^^^ method not found in `SslOpts`

error[E0599]: no method named `with_password` found for struct `SslOpts` in the current scope
   --> /Users/aliver/.cargo/git/checkouts/quaint-9f01e008b9a89c14/fb4fe90/src/connector/mysql.rs:191:41
    |
191 |                     ssl_opts = ssl_opts.with_password(Some(v.to_string()));
    |                                         ^^^^^^^^^^^^^ method not found in `SslOpts`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `quaint` due to 2 previous errors
@Alivers
Copy link
Author

Alivers commented Feb 21, 2023

quaint update mysql_async dependency 19h ago. How can we upgrade to fix this break changes?
https://github.com/prisma/quaint

@Brendonovich Brendonovich added bug Something isn't working lib labels Feb 23, 2023
@Brendonovich
Copy link
Owner

Brendonovich commented Feb 23, 2023

I'm pretty sure this couldn't have been solved with [patch] since it's to do with nested git dependencies. I've forked quaint and locked it to a specific commit of mysql_async. Try using rev = "6fbef57fcd08fd1daeb70b49b14f5144b15898aa" of PCR.
I'm gonna try get Prisma's engines team to prefer using specific commits rather than branch references going forward. It'd be way more reliable.

@Alivers
Copy link
Author

Alivers commented Feb 23, 2023

After I change rev to 6fbef57fcd08fd1daeb70b49b14f5144b15898aa, the generated code did not work with my project.
The error is:

error[E0425]: cannot find function `is_empty` in module `snapshot_meta::error_versions`
   --> src/core/prisma_processor_metadata.rs:185:48
    |
185 |                 snapshot_meta::error_versions::is_empty(false),
    |                                                ^^^^^^^^ not found in `snapshot_meta::error_versions`

error[E0425]: cannot find function `is_empty` in module `snapshot_meta::interested_versions`
   --> src/core/prisma_processor_metadata.rs:208:53
    |
208 |                 snapshot_meta::interested_versions::is_empty(false),
    |                                                     ^^^^^^^^ not found in `snapshot_meta::interested_versions`

And also, my schema.prisma definition has no change, above two fields are defined in Bigint[]:

    interested_versions BigInt[]
    error_versions      BigInt[]

@Brendonovich
Copy link
Owner

Hmm, using mysql I'm not even allowed to use BigInt[] as a field type - postgresql works though, and that doesn't have the is_empty filter. That's on both 0.6.4 and 6fbef57fcd08fd1daeb70b49b14f5144b15898aa.

@Alivers
Copy link
Author

Alivers commented Feb 23, 2023

Sorry, I missed the db. I'm using mongodb, a few days ago I am using 0.6.3, it works correctly.
0.6.3 generates the code as below, but when I move to rev 6fbef57fcd08fd1daeb70b49b14f5144b15898aa or 0.6.4, I clouldn't get the same generated code.
image

@Brendonovich
Copy link
Owner

Ohh you're not using default-features = false, features = ["mongodb"], gotcha. Looks like a regression to do with scalar lists. Will be fixed soon.

@Alivers
Copy link
Author

Alivers commented Feb 23, 2023

Thanks for your insight and reminder! I really should use default-features = false, features = ["mongodb"] to avoid unnecessary build.

@Brendonovich
Copy link
Owner

@Alivers check new issue for fix: #257

@MachariaK
Copy link

The proposed fix is not working for me.

Cargo.toml:

prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "1f6474396363bab8c4cdd70c342055779b36909d" } prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "1f6474396363bab8c4cdd70c342055779b36909d" }
Error:

error[E0433]: failed to resolve: could not find ClientIdentityinmysql_async--> C:\Users\Tim\.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:282:45 | 282 | let identity = mysql_async::ClientIdentity::new(path).with_password(pw); | ^^^^^^^^^^^^^^ could not findClientIdentityinmysql_async`

error[E0433]: failed to resolve: could not find ClientIdentity in mysql_async
--> C:\Users\Tim.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:286:45
|
286 | let identity = mysql_async::ClientIdentity::new(path);
| ^^^^^^^^^^^^^^ could not find ClientIdentity in mysql_async

error[E0599]: no method named with_client_identity found for struct SslOpts in the current scope
--> C:\Users\Tim.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:283:26
|
283 | ssl_opts.with_client_identity(Some(identity))
| ^^^^^^^^^^^^^^^^^^^^ method not found in SslOpts

error[E0599]: no method named with_client_identity found for struct SslOpts in the current scope
--> C:\Users\Tim.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:287:26
|
287 | ssl_opts.with_client_identity(Some(identity))
| ^^^^^^^^^^^^^^^^^^^^ method not found in SslOpts

Some errors have detailed explanations: E0433, E0599.
For more information about an error, try rustc --explain E0433.
error: could not compile quaint due to 4 previous errors `

@Brendonovich
Copy link
Owner

Brendonovich commented Mar 3, 2023

@MachariaK Does using version 0.6.5 fix this? I haven't seen those errors before.

@MachariaK
Copy link

@MachariaK Does using version 0.6.5 fix this? I haven't seen those errors before.

Doesn't fix.

I am getting the following errors:

error[E0433]: failed to resolve: could not find ClientIdentity in mysql_async
--> C:\Users\Tim.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:282:45
|
282 | let identity = mysql_async::ClientIdentity::new(path).with_password(pw);
| ^^^^^^^^^^^^^^ could not find ClientIdentity in mysql_async

error[E0433]: failed to resolve: could not find ClientIdentity in mysql_async
--> C:\Users\Tim.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:286:45
|
286 | let identity = mysql_async::ClientIdentity::new(path);
| ^^^^^^^^^^^^^^ could not find ClientIdentity in mysql_async

error[E0599]: no method named with_client_identity found for struct SslOpts in the current scope
--> C:\Users\Tim.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:283:26
|
283 | ssl_opts.with_client_identity(Some(identity))
| ^^^^^^^^^^^^^^^^^^^^ method not found in SslOpts

error[E0599]: no method named with_client_identity found for struct SslOpts in the current scope
--> C:\Users\Tim.cargo\git\checkouts\quaint-453f07acedd929b5\b12fef8\src\connector\mysql.rs:287:26
|
287 | ssl_opts.with_client_identity(Some(identity))
| ^^^^^^^^^^^^^^^^^^^^ method not found in SslOpts

Some errors have detailed explanations: E0433, E0599.
For more information about an error, try rustc --explain E0433.
error: could not compile quaint due to 4 previous errors

@Brendonovich
Copy link
Owner

@MachariaK Does cargo update -p prisma-client-rust fix things?

@MachariaK
Copy link

@MachariaK Does cargo update -p prisma-client-rust fix things?

Running perfectly now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib
Projects
None yet
Development

No branches or pull requests

3 participants