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

Building v0.8.1 fails with feature "postgres" enabled #3460

Closed
oleggtro opened this issue Aug 24, 2024 · 3 comments · Fixed by #3459
Closed

Building v0.8.1 fails with feature "postgres" enabled #3460

oleggtro opened this issue Aug 24, 2024 · 3 comments · Fixed by #3459
Labels

Comments

@oleggtro
Copy link

Bug Description

On enabling the "postgres" feature building of the sqlx-postgres crate fails.

Minimal Reproduction

Add sqlx v0.8.1 with feature "postgres" enabled in your Cargo.toml and try building.

Info

  • SQLx version: 0.8.1
  • SQLx features enabled: ["postgres", "chrono", "macros", "migrate", "tls-rustls", "uuid", "derive", "runtime-tokio"]
  • Database server and version: Postgres
  • Operating system: macOS Sonoma 14.6.1
  • rustc --version: rustc 1.79.0 (129f3b996 2024-06-10)
@oleggtro oleggtro added the bug label Aug 24, 2024
@oleggtro
Copy link
Author

okay nevermind, building with rustc 1.80.1 succeeds.
It failed with some error having to to with some size_of::<>() function, I don't remember exactly.

So for anyone reading this: Try running rustup update to update your toolchain and then it should work fine.

@CommanderStorm
Copy link
Contributor

CommanderStorm commented Aug 24, 2024

The reason for this is that size_of was added to the prelude in 1.80.0

Note

Relevant disclaimer about MSRV of sqlx.

Given that this is a quite simple fix, I think changing what #3457 has proposed is reasonable.
@mallo-c: was closing the PRs (#3457, #3456) intentional?

@mallo-c
Copy link

mallo-c commented Sep 1, 2024

was closing the PRs (#3457, #3456) intentional?

Yes. I did rustup update and the problem disappeared so I thought that sqlx should work on latest Rustc and there is no guarantee that sqlx will work on the older versions. Sorry for my confusion.

reivilibre added a commit to element-hq/matrix-authentication-service that referenced this issue Oct 4, 2024
sqlx-postgres 0.8.1 does not compile on Rust 1.79 or earlier
(against MSRV policy).
This was fixed in 0.8.2.

Upstream: launchbadge/sqlx#3460
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants