SeaQL / sea-orm

🐚 An async & dynamic ORM for Rust
https://www.sea-ql.org/SeaORM/
Apache License 2.0
6.56k stars 459 forks source link

Fix doc build #2267

Closed workingjubilee closed 4 days ago

workingjubilee commented 1 week ago

@billy1624 You reported this in https://github.com/rust-lang/rust/issues/125319#issuecomment-2182393108 and this is the fix.

PR Info

billy1624 commented 4 days ago

Seems the breaking change in time crate has been patched in 0.3.36 but not in 0.3.35

time v0.3.35

DATABASE_URL="sqlite::memory:" cargo test --all --features default,sqlx-sqlite,runtime-async-std
   Compiling bitflags v2.6.0
   Compiling syn v2.0.68
   Compiling strum v0.26.3
   Compiling libsqlite3-sys v0.27.0
   Compiling rustix v0.38.34
   Compiling serde_derive v1.0.203
   Compiling tracing-attributes v0.1.27
   Compiling futures-macro v0.3.30
   Compiling enum-ordinalize-derive v4.3.1
   Compiling thiserror-impl v1.0.61
   Compiling tokio-macros v2.3.0
   Compiling inherent v1.0.11
   Compiling sea-bae v0.2.0
   Compiling ouroboros_macro v0.17.2
   Compiling async-stream-impl v0.3.5
   Compiling async-trait v0.1.80
   Compiling actix-macros v0.2.4
   Compiling async-stream v0.3.5
   Compiling sea-orm-macros v1.0.0-rc.6 (/Users/billy/Projects/sea-orm/sea-orm-macros)
   Compiling tokio v1.38.0
   Compiling enum-ordinalize v4.3.0
   Compiling futures-util v0.3.30
   Compiling thiserror v1.0.61
   Compiling tracing v0.1.40
   Compiling ouroboros v0.17.2
   Compiling educe v0.5.11
   Compiling serde v1.0.203
   Compiling polling v3.7.2
   Compiling tracing-subscriber v0.3.18
   Compiling async-io v2.3.3
   Compiling futures-executor v0.3.30
   Compiling async-signal v0.2.8
   Compiling futures v0.3.30
   Compiling async-process v1.8.1
   Compiling smol v1.3.0
   Compiling async-global-executor v2.4.1
   Compiling actix-rt v2.10.0
   Compiling async-std v1.12.0
   Compiling deranged v0.3.11
   Compiling uuid v1.9.1
   Compiling rust_decimal v1.35.0
   Compiling chrono v0.4.38
   Compiling serde_json v1.0.117
   Compiling either v1.12.0
   Compiling time v0.3.35
   Compiling sea-query v0.31.0-rc.8 (/Users/billy/Projects/sea-query)
   Compiling sqlx-core v0.7.4
warning: use of deprecated type alias `time::format_description::FormatItem`: use `BorrowedFormatItem` instead for clarity
   --> /Users/billy/Projects/sea-query/src/value.rs:628:35
    |
628 |     use time::format_description::FormatItem;
    |                                   ^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated type alias `time::format_description::FormatItem`: use `BorrowedFormatItem` instead for clarity
   --> /Users/billy/Projects/sea-query/src/value.rs:631:31
    |
631 |     pub static FORMAT_DATE: &[FormatItem<'static>] = format_description!("[year]-[month]-[day]");
    |                               ^^^^^^^^^^

warning: use of deprecated type alias `time::format_description::FormatItem`: use `BorrowedFormatItem` instead for clarity
   --> /Users/billy/Projects/sea-query/src/value.rs:632:31
    |
632 |     pub static FORMAT_TIME: &[FormatItem<'static>] =
    |                               ^^^^^^^^^^

warning: use of deprecated type alias `time::format_description::FormatItem`: use `BorrowedFormatItem` instead for clarity
   --> /Users/billy/Projects/sea-query/src/value.rs:634:35
    |
634 |     pub static FORMAT_DATETIME: &[FormatItem<'static>] =
    |                                   ^^^^^^^^^^

warning: use of deprecated type alias `time::format_description::FormatItem`: use `BorrowedFormatItem` instead for clarity
   --> /Users/billy/Projects/sea-query/src/value.rs:636:38
    |
636 |     pub static FORMAT_DATETIME_TZ: &[FormatItem<'static>] = format_description!(
    |                                      ^^^^^^^^^^

   Compiling sqlx-sqlite v0.7.4
error[E0432]: unresolved import `time::format_description::FormatItem`
   --> /Users/billy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-sqlite-0.7.4/src/types/time.rs:192:72
    |
192 |     use time::format_description::{modifier, Component::*, FormatItem, FormatItem::*};
    |                                                                        ^^^^^^^^^^ `FormatItem` is a type alias, not a module

error[E0425]: cannot find function, tuple struct or tuple variant `Component` in this scope
   --> /Users/billy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-sqlite-0.7.4/src/types/time.rs:194:34
    |
194 |     const YEAR: FormatItem<'_> = Component(Year({
    |                                  ^^^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
192 +     use time::format_description::BorrowedFormatItem::Component;
    |
192 +     use time::format_description::OwnedFormatItem::Component;
    |

time v0.3.36

❯ DATABASE_URL="sqlite::memory:" cargo test --all --features default,sqlx-sqlite,runtime-async-std
   Compiling time v0.3.36
   Compiling sea-query v0.31.0-rc.8 (/Users/billy/Projects/sea-query)
   Compiling sqlx-core v0.7.4
   Compiling sea-orm v1.0.0-rc.6 (/Users/billy/Projects/sea-orm)
   Compiling sqlx-sqlite v0.7.4
   Compiling sea-orm-codegen v1.0.0-rc.6 (/Users/billy/Projects/sea-orm/sea-orm-codegen)
   Compiling sqlx v0.7.4
   Compiling sea-query-binder v0.6.0-rc.3 (/Users/billy/Projects/sea-query/sea-query-binder)
warning: unused import: `rust_decimal::prelude::ToPrimitive`
  --> /Users/billy/Projects/sea-query/sea-query-binder/src/sqlx_sqlite.rs:98:25
   |
98 |                     use rust_decimal::prelude::ToPrimitive;
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `bigdecimal::ToPrimitive`
   --> /Users/billy/Projects/sea-query/sea-query-binder/src/sqlx_sqlite.rs:103:25
    |
103 |                     use bigdecimal::ToPrimitive;
    |                         ^^^^^^^^^^^^^^^^^^^^^^^

warning: `sea-query-binder` (lib) generated 2 warnings (run `cargo fix --lib -p sea-query-binder` to apply 2 suggestions)
   Compiling sea-orm-macros v1.0.0-rc.6 (/Users/billy/Projects/sea-orm/sea-orm-macros)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 1m 27s
     Running unittests src/lib.rs (target/debug/deps/sea_orm-a936e19c1eaffd37)
billy1624 commented 4 days ago

We gitignore Cargo.lock file because we want CI to always build with latest dependency.

github-actions[bot] commented 4 days ago

:tada: Released In 1.0.0-rc.7 :tada:

Thank you everyone for the contribution! This feature is now available in the latest release. Now is a good time to upgrade! Your participation is what makes us unique; your adoption is what drives us forward. You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

billy1624 commented 4 days ago

Thanks @workingjubilee for the help!!

workingjubilee commented 4 days ago

0.3.36

Ah, serves me right for trusting what anyone says. :^) Thanks.