-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
It's possible to compile bevy_image with feature = "dds", without also doing the same for bevy_core_pipeline or bevy_gltf, resulting in a compilation error #17290
Copy link
Copy link
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesP-Compile-FailureA failure to compile Bevy appsA failure to compile Bevy appsS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Description
When running cargo clippy --tests --all-features --package bevy_image (--tests isn't technically required, but it prevents currently-existing errors with bevy_math from surfacing), bevy_core_pipeline will fail to compile due to not providing a required argument to bevy_image::Image::from_buffer().
Full compilation error log
error[E0061]: this function takes 7 arguments but 6 arguments were supplied
--> crates\bevy_core_pipeline\src\tonemapping\mod.rs:447:5
|
447 | Image::from_buffer(
| ^^^^^^^^^^^^^^^^^^
...
450 | bytes,
| ----- argument #1 of type `std::string::String` is missing
|
note: associated function defined here
--> crates\bevy_image\src\image.rs:873:12
|
873 | pub fn from_buffer(
| ^^^^^^^^^^^
help: provide the argument
|
447 | Image::from_buffer(/* std::string::String */, bytes, image_type, CompressedImageFormats::NONE, false, image_sampler, RenderAssetUsages::RENDER_WORLD)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For more information about this error, try `rustc --explain E0061`.
error: could not compile `bevy_core_pipeline` (lib) due to 1 previous errorAfter some investigation, I found the issue: if debug assertions are enabled, and bevy_image is compiled with --features dds, then bevy_core_pipeline must also be compiled with --features dds, otherwise a compilation error will occur with bevy_core_pipeline. To explain:
- Assume debug assertions are on
bevy_image::Image::from_buffer()takes anameparameter - but only if--features bevy_image/ddsis specified [1]bevy_core_pipelinewill, under certain circumstances, callImage::from_buffer(). If--features bevy_core_pipeline/ddsis specified, thenbevy_core_pipelinewill pass in thenameparameter. [1] [2] [3]- The
bevy_core_pipeline/ddsfeature will enablebevy_image/ddsif it isn't already [1] - However, because
bevy_image/ddsdoes not enablebevy_core_pipeline/dds, it's possible to compile withbevy_image/ddsbut withoutbevy_core_pipeline/dds, leading to this compilation error.
I am unsure how to resolve this issue, hence I'm making this bug report.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesP-Compile-FailureA failure to compile Bevy appsA failure to compile Bevy appsS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished