emilk/egui

Errors in epaint update 0.30.0 related to `profiling`

Closed this issue · 5 comments

   Compiling epaint v0.30.0
error[E0433]: failed to resolve: could not find `function_scope` in `profiling`
  --> /Users/frankvangompel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/epaint-0.30.0/src/mesh.rs:88:20
   |
88 |         profiling::function_scope!();
   |                    ^^^^^^^^^^^^^^ could not find `function_scope` in `profiling`

error[E0433]: failed to resolve: could not find `function_scope` in `profiling`
   --> /Users/frankvangompel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/epaint-0.30.0/src/mesh.rs:114:20
    |
114 |         profiling::function_scope!();
    |                    ^^^^^^^^^^^^^^ could not find `function_scope` in `profiling`

error[E0433]: failed to resolve: could not find `function_scope` in `profiling`
    --> /Users/frankvangompel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/epaint-0.30.0/src/tessellator.rs:1606:20
     |
1606 |         profiling::function_scope!();
     |                    ^^^^^^^^^^^^^^ could not find `function_scope` in `profiling`

error[E0433]: failed to resolve: could not find `function_scope` in `profiling`
    --> /Users/frankvangompel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/epaint-0.30.0/src/tessellator.rs:2001:20
     |
2001 |         profiling::function_scope!();
     |                    ^^^^^^^^^^^^^^ could not find `function_scope` in `profiling`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `epaint` (lib) due to 4 previous errors

Confirmed - I just tried updating and I am getting the same errors. I also tried cloning the repo instead of using the cargo.io release and the problem is still there.

A bad merge, perhaps?

I can reproduce this, but I'm not really sure why it would happen, it looks like it should be working 🤔
As a workaround, you can add the following to your cargo.toml:

profiling = { version = "1", features = ["type-check"], default-features = false }

@teddemunnik can you have a look at this?

To reproduce this, the following cargo.toml has this problem for me:

[package]
name = "egui_playground"
version = "0.1.0"
edition = "2021"

[dependencies]
eframe = "0.30.0"
egui = "0.30.0"

Ah, it's because profiling::function_scope was added in profiling 1.0.16 and egui only has a dependency on 1.0, so we should update the profiling dependency to be >=1.0.16

So the proper way to fix this in your project is to run cargo update profiling

Ah my bad, sorry about that! Thank you for the quick fix @lucasmerlin

Probably epaint 0.30 should be yanked then and replaced with 0.30.1 that uses correct minimal version.
Or people like me would step on this rake again