Skip to content

common_api feature collection doesn't build on it's own #22497

@Seliksi

Description

@Seliksi

On current main (commit 7b03032):

  1. cargo build --no-default-features -Fcommon_api fails to compile.
Cargo build output
error[E0277]: `SmolStr` does not implement `GetTypeRegistration` so cannot be registered for reflection
   --> crates/bevy_text/src/text.rs:264:12
    |
264 |     Family(SmolStr),
    |            ^^^^^^^ the trait `GetTypeRegistration` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]`
    = help: the following other types implement trait `GetTypeRegistration`:
              &'static Path
              &'static std::panic::Location<'static>
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 326 others
    = note: required for `SmolStr` to implement `RegisterForReflection`

error[E0277]: `SmolStr` does not implement `Typed` so cannot provide static type information
   --> crates/bevy_text/src/text.rs:264:12
    |
264 |     Family(SmolStr),
    |            ^^^^^^^ the trait `Typed` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]`
    = help: the following other types implement trait `Typed`:
              &'static Path
              &'static std::panic::Location<'static>
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 327 others
    = note: required for `SmolStr` to implement `MaybeTyped`
note: required by a bound in `UnnamedField::new`
   --> crates/bevy_reflect/src/fields.rs:86:36
    |
 86 |     pub fn new<T: PartialReflect + MaybeTyped + TypePath>(index: usize) -> Self {
    |                                    ^^^^^^^^^^ required by this bound in `UnnamedField::new`

error[E0277]: `SmolStr` does not implement `PartialReflect` so cannot be introspected
   --> crates/bevy_text/src/text.rs:249:24
    |
249 | #[derive(Clone, Debug, Reflect, PartialEq)]
    |                        ^^^^^^^ the trait `bevy_reflect::PartialReflect` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]`
    = help: the following other types implement trait `bevy_reflect::PartialReflect`:
              &'static Path
              &'static std::panic::Location<'static>
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 334 others
    = note: required for the cast from `&SmolStr` to `&dyn bevy_reflect::PartialReflect`
    = note: this error originates in the derive macro `Reflect` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `SmolStr` does not implement `PartialReflect` so cannot be introspected
   --> crates/bevy_text/src/text.rs:249:24
    |
249 | #[derive(Clone, Debug, Reflect, PartialEq)]
    |                        ^^^^^^^ the trait `bevy_reflect::PartialReflect` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]`
    = help: the following other types implement trait `bevy_reflect::PartialReflect`:
              &'static Path
              &'static std::panic::Location<'static>
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 334 others
    = note: required for the cast from `&mut SmolStr` to `&mut (dyn bevy_reflect::PartialReflect + 'static)`
    = note: this error originates in the derive macro `Reflect` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `SmolStr` does not implement `FromReflect` so cannot be created through reflection
   --> crates/bevy_text/src/text.rs:264:12
    |
264 |     Family(SmolStr),
    |            ^^^^^^^ the trait `bevy_reflect::FromReflect` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]`
    = help: the following other types implement trait `bevy_reflect::FromReflect`:
              &'static Path
              &'static std::panic::Location<'static>
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 321 others

error[E0277]: `SmolStr` does not implement `TypePath` so cannot provide static type path information
   --> crates/bevy_text/src/text.rs:264:12
    |
264 |     Family(SmolStr),
    |            ^^^^^^^ the trait `bevy_reflect::TypePath` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]` or `#[derive(TypePath)]`
    = help: the following other types implement trait `bevy_reflect::TypePath`:
              &'static T
              &'static mut T
              &'static std::panic::Location<'static>
              ()
              (P,)
              (P1, P0)
              (P1, P2, P0)
              (P1, P2, P3, P0)
            and 357 others

error[E0277]: `SmolStr` does not implement `PartialReflect` so cannot be introspected
   --> crates/bevy_text/src/text.rs:264:12
    |
264 |     Family(SmolStr),
    |            ^^^^^^^ the trait `bevy_reflect::PartialReflect` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]`
    = help: the following other types implement trait `bevy_reflect::PartialReflect`:
              &'static Path
              &'static std::panic::Location<'static>
              &'static str
              ()
              (A, B)
              (A, B, C)
              (A, B, C, D)
              (A, B, C, D, E)
            and 334 others

error[E0277]: `SmolStr` does not implement `TypePath` so cannot provide static type path information
   --> crates/bevy_text/src/text.rs:264:12
    |
264 |     Family(SmolStr),
    |            ^^^^^^^ the trait `bevy_reflect::TypePath` is not implemented for `SmolStr`
    |
    = note: consider annotating `SmolStr` with `#[derive(Reflect)]` or `#[derive(TypePath)]`
    = help: the following other types implement trait `bevy_reflect::TypePath`:
              &'static T
              &'static mut T
              &'static std::panic::Location<'static>
              ()
              (P,)
              (P1, P0)
              (P1, P2, P0)
              (P1, P2, P3, P0)
            and 357 others
note: required by a bound in `reflect_clone_and_take`
   --> crates/bevy_reflect/src/reflect.rs:325:15
    |
323 |     fn reflect_clone_and_take<T: 'static>(&self) -> Result<T, ReflectCloneError>
    |        ---------------------- required by a bound in this associated function
324 |     where
325 |         Self: TypePath + Sized,
    |               ^^^^^^^^ required by this bound in `PartialReflect::reflect_clone_and_take`
  1. cargo build --no-default-features -Fcommon_api -Fbevy_reflect/smol_str does not compile (?!)

I can't use cargo tree to see why not:

$ cargo tree --no-default-features -i bevy_reflect -e features,no-dev -Fcommon_api,'bevy_reflect/smol_str'

thread 'main' (1913553) panicked at src/tools/cargo/src/cargo/ops/tree/graph.rs:661:25:
missing dep graph connection for CLI feature `bevy_reflect/smol_str` for member Some(Package { package_id: PackageId { name: "bevy", version: "0.18.0-dev", source: "/home/cat/programming/bevycantcompile" }, features: ["bevy_animation", "bevy_camera", "bevy_color", "bevy_gizmos", "bevy_image", "bevy_mesh", "bevy_shader", "bevy_text", "common_api", "hdr", "png"], kind: Host })
Please file a bug report at https://github.com/rust-lang/cargo/issues
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  1. cargo build --no-default-features -Fcommon_api -Fbevy_gilrs does compile (?!)

The difference in the dependency tree between (1) and (3) is: (fish shell)

$ diff (cargo tree --no-default-features -Fcommon_api -e normal | psub) (cargo tree --no-default-features -Fcommon_api -Fbevy_gilrs -e normal --prune bevy_gilrs | psub) -u
@@ -96,6 +96,8 @@
     │   │   │   │   │   └── serde_derive v1.0.228 (proc-macro) (*)
     │   │   │   │   ├── serde v1.0.228 (*)
     │   │   │   │   ├── smallvec v1.15.1
+    │   │   │   │   ├── smol_str v0.2.2
+    │   │   │   │   │   └── serde v1.0.228 (*)
     │   │   │   │   ├── thiserror v2.0.17
     │   │   │   │   │   └── thiserror-impl v2.0.17 (proc-macro)
     │   │   │   │   │       ├── proc-macro2 v1.0.105 (*)
@@ -455,6 +457,7 @@
     │   │   │   ├── bevy_reflect v0.18.0-dev (/home/cat/programming/bevycantcompile/crates/bevy_reflect) (*)
     │   │   │   ├── derive_more v2.1.1 (*)
     │   │   │   ├── log v0.4.29
+    │   │   │   ├── smol_str v0.2.2 (*)
     │   │   │   └── thiserror v2.0.17 (*)
     │   │   ├── bevy_math v0.18.0-dev (/home/cat/programming/bevycantcompile/crates/bevy_math) (*)
     │   │   ├── bevy_platform v0.18.0-dev (/home/cat/programming/bevycantcompile/crates/bevy_platform) (*)
@@ -581,7 +584,7 @@
     │   │   ├── skrifa v0.39.0
     │   │   │   ├── bytemuck v1.24.0 (*)
     │   │   │   └── read-fonts v0.36.0 (*)
-    │   │   ├── smol_str v0.2.2
+    │   │   ├── smol_str v0.2.2 (*)
     │   │   ├── swash v0.2.6
     │   │   │   ├── skrifa v0.37.0
     │   │   │   │   ├── bytemuck v1.24.0 (*)
@@ -597,7 +600,7 @@
     │   │   └── unicode-segmentation v1.12.0
     │   ├── serde v1.0.228 (*)
     │   ├── smallvec v1.15.1
-    │   ├── smol_str v0.2.2
+    │   ├── smol_str v0.2.2 (*)
     │   ├── sys-locale v0.3.2
     │   ├── thiserror v2.0.17 (*)
     │   ├── tracing v0.1.44 (*)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Cross-CuttingImpacts the entire engineC-BugAn unexpected or incorrect behaviorP-Compile-FailureA failure to compile Bevy appsS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions