Skip to content

fix: Derive GetTypeDependency without explicit "core" dependency. #409

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

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

shanecelis
Copy link
Contributor

@shanecelis shanecelis commented Apr 4, 2025

Problem

The derive macro GetTypeDependencies required the bevy_mod_scripting_core to be an explicit dependency for users.

Solution

I altered it to refer to ::bevy_mod_scripting::core instead of bevy_mod_scripting_core so that it works with the usual dependency of bevy_mod_scripting.

Alternative

The user can add "bevy_mod_scripting_core" as a dependency.

Testing

  • It works in my project now.
  • I did not add a test.
  • I did run the tests; there were two unrelated failures that I looked into but it wasn't clear to me how to fix it.
error[E0433]: failed to resolve: could not find `function_scope` in `profiling`
  --> crates/bevy_mod_scripting_core/src/bindings/globals/core.rs:29:20
   |
29 |         profiling::function_scope!("app finish");
   |                    ^^^^^^^^^^^^^^ could not find `function_scope` in `profiling`

error[E0433]: failed to resolve: could not find `function_scope` in `profiling`
  --> crates/bevy_mod_scripting_core/src/bindings/globals/core.rs:88:20
   |
88 |         profiling::function_scope!("registering core globals");
   |                    ^^^^^^^^^^^^^^ could not find `function_scope` in `profiling`

@makspll
Copy link
Owner

makspll commented Apr 4, 2025

The clippy failure is due to the recent rust update, I fixed it on main now

The derive macro `GetTypeDependencies` required the `bevy_mod_scripting_core`
to be an explicit dependency. I altered it to refer to
`::bevy_mod_scripting::core` instead of `bevy_mod_scripting_core` so
that it works with the usual dependency of `bevy_mod_scripting`.
Copy link
Contributor

github-actions bot commented Apr 4, 2025

🐰 Bencher Report

Branchmacro-fix
Testbedlinux-gha
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
component/access Lua📈 view plot
🚷 view threshold
3,455.90 ns
(-29.80%)Baseline: 4,923.09 ns
6,395.96 ns
(54.03%)
component/access Rhai📈 view plot
🚷 view threshold
6,018.80 ns
(-11.10%)Baseline: 6,770.36 ns
8,011.17 ns
(75.13%)
component/get Lua📈 view plot
🚷 view threshold
2,023.70 ns
(-30.01%)Baseline: 2,891.57 ns
3,596.64 ns
(56.27%)
component/get Rhai📈 view plot
🚷 view threshold
4,727.20 ns
(-4.42%)Baseline: 4,945.93 ns
6,005.71 ns
(78.71%)
conversions/Mut::from📈 view plot
🚷 view threshold
81.32 ns
(-40.12%)Baseline: 135.80 ns
250.70 ns
(32.44%)
conversions/Ref::from📈 view plot
🚷 view threshold
82.12 ns
(-38.73%)Baseline: 134.03 ns
248.33 ns
(33.07%)
conversions/ScriptValue::List📈 view plot
🚷 view threshold
300.34 ns
(-53.30%)Baseline: 643.18 ns
1,104.40 ns
(27.19%)
conversions/ScriptValue::Map📈 view plot
🚷 view threshold
1,182.40 ns
(-29.23%)Baseline: 1,670.84 ns
2,229.67 ns
(53.03%)
conversions/ScriptValue::Reference::from_into📈 view plot
🚷 view threshold
25.31 ns
(-38.11%)Baseline: 40.90 ns
59.10 ns
(42.82%)
conversions/Val::from_into📈 view plot
🚷 view threshold
269.52 ns
(-20.80%)Baseline: 340.32 ns
457.90 ns
(58.86%)
function/call 4 args Lua📈 view plot
🚷 view threshold
1,606.30 ns
(-23.60%)Baseline: 2,102.42 ns
2,525.57 ns
(63.60%)
function/call 4 args Rhai📈 view plot
🚷 view threshold
1,398.40 ns
(-23.35%)Baseline: 1,824.51 ns
2,217.52 ns
(63.06%)
function/call Lua📈 view plot
🚷 view threshold
224.07 ns
(-20.12%)Baseline: 280.53 ns
338.06 ns
(66.28%)
function/call Rhai📈 view plot
🚷 view threshold
460.07 ns
(-13.60%)Baseline: 532.47 ns
664.11 ns
(69.28%)
math/vec mat ops Lua📈 view plot
🚷 view threshold
6,639.70 ns
(-14.87%)Baseline: 7,799.73 ns
9,238.56 ns
(71.87%)
math/vec mat ops Rhai📈 view plot
🚷 view threshold
6,060.10 ns
(-18.84%)Baseline: 7,467.17 ns
8,612.81 ns
(70.36%)
query/10 entities Lua📈 view plot
🚷 view threshold
18,320.00 ns
(-26.26%)Baseline: 24,842.61 ns
30,638.25 ns
(59.79%)
query/10 entities Rhai📈 view plot
🚷 view threshold
21,225.00 ns
(-12.96%)Baseline: 24,385.18 ns
28,689.51 ns
(73.98%)
query/100 entities Lua📈 view plot
🚷 view threshold
39,704.00 ns
(-20.84%)Baseline: 50,156.58 ns
61,420.20 ns
(64.64%)
query/100 entities Rhai📈 view plot
🚷 view threshold
33,978.00 ns
(-13.70%)Baseline: 39,373.12 ns
47,748.96 ns
(71.16%)
query/1000 entities Lua📈 view plot
🚷 view threshold
257,380.00 ns
(-17.84%)Baseline: 313,253.03 ns
386,585.83 ns
(66.58%)
query/1000 entities Rhai📈 view plot
🚷 view threshold
172,430.00 ns
(-22.29%)Baseline: 221,879.39 ns
300,089.92 ns
(57.46%)
reflection/10 Lua📈 view plot
🚷 view threshold
5,449.20 ns
(-17.04%)Baseline: 6,568.70 ns
7,603.75 ns
(71.66%)
reflection/10 Rhai📈 view plot
🚷 view threshold
15,074.00 ns
(-8.43%)Baseline: 16,462.27 ns
18,024.49 ns
(83.63%)
reflection/100 Lua📈 view plot
🚷 view threshold
46,359.00 ns
(-13.44%)Baseline: 53,559.76 ns
60,725.01 ns
(76.34%)
reflection/100 Rhai📈 view plot
🚷 view threshold
728,230.00 ns
(-1.17%)Baseline: 736,847.27 ns
870,309.23 ns
(83.67%)
resource/access Lua📈 view plot
🚷 view threshold
3,055.90 ns
(-29.52%)Baseline: 4,335.66 ns
5,550.22 ns
(55.06%)
resource/access Rhai📈 view plot
🚷 view threshold
5,342.20 ns
(-11.76%)Baseline: 6,054.18 ns
7,447.61 ns
(71.73%)
resource/get Lua📈 view plot
🚷 view threshold
1,698.50 ns
(-29.56%)Baseline: 2,411.42 ns
3,032.82 ns
(56.00%)
resource/get Rhai📈 view plot
🚷 view threshold
4,110.00 ns
(-4.38%)Baseline: 4,298.26 ns
5,330.29 ns
(77.11%)
🐰 View full continuous benchmarking report in Bencher

@makspll makspll merged commit bf42aa4 into makspll:main Apr 4, 2025
9 of 19 checks passed
@github-actions github-actions bot mentioned this pull request Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants