#bevy_cli

6847 messages · Page 7 of 7 (latest)

small turret
#
error[E0514]: found crate `bevy` compiled by an incompatible version of rustc
 --> src/main.rs:2:5
  |
2 | use bevy::{ecs::query::Has, prelude::*};
  |     ^^^^
  |
  = note: the following crate versions were found:
          crate `bevy` compiled by rustc 1.92.0-nightly (844264add 2025-10-14): /tmp/tmp.uTwD31e880/target/debug/deps/libbevy-7c197d731b9df74d.rmeta
  = help: please recompile that crate using this compiler (rustc 1.92.0-nightly (4645a7988 2025-09-17)) (consider running `cargo clean` first)

Wait, so you need to compile your project with the same compiler as bevy_lint? 😔

pale viper
#

If you do use nightly Rust, though, it may help reduce check times and the size of your target directory if you synchronize the version!

small turret
#

Is there a reason bevy_lint is depending on a specific compiler version?

#

Weird I tried cargo clean and it's still giving me this error 🤔
I think it's still compiling with the version in my environment for some reason.

small turret
#

Ok I think I get the problem now. bevy_lint is correctly using the cargo from 4645a7988 2025-09-17 (I've also set BEVY_LINT_SYSROOT), but cargo itself is spawning rustc from my environment which is a different version.

#

While bevy lint is compiling:

$ readlink /proc/(pgrep cargo)/exe
/nix/store/18wi184p3n0xnkpapsiwka1sb32wbr40-cargo-1.92.0-nightly-2025-09-18-x86_64-unknown-linux-gnu/bin/cargo

$ readlink /proc/(pgrep rustc)/exe
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
/nix/store/955a0iarjbyp9x9z7mpgr0bzbh8hb4a7-rust-default-1.92.0-nightly-2025-10-15/bin/rustc
#

The rustc version is the one from my environment and cargo is the version bevy_lint is invoking.

limber wedge
small turret
kindred island
#

I tested it with my game, and it worked without any changes in Rust. I'll make a pr and test that it works in an empty project. Are there docs on installing a local build of bevy_cli?

small turret
# small turret Well, I got it to "work" by setting `RUSTC` manually 😅

I think the behavior when a custom sysroot is used is not completely correct here: https://github.com/TheBevyFlock/bevy_cli/blob/203cc077990b6b7c2652dd5d977cfd13860cb8f7/bevy_lint/src/bin/bevy_lint.rs#L39
RUSTC probably needs to be set so that the right version is called. I think rustup does this automatically, but on non-rustup environments you need to do it yourself.

GitHub

A Bevy CLI tool and linter. Contribute to TheBevyFlock/bevy_cli development by creating an account on GitHub.

small turret
limber wedge
foggy basin
limber wedge
twilit dew
#

The reason is that lifecycle observers are IME almost always uses to define invariants

#

But when someone spawns something with a default filter, they would skip out on setting up those invariants

#

Then when the default filter is removed later, you get entity in an invalid state

#

Ideally this should not be just allowing Disabled, but all default filters, as the user can define their own.

#

But we currently have no way to express that

#

So at least it should allow Disabled. Last time this was discussed, where was broad agreement about this, and I PRd something the other day to Bevy itself with the same motivation

#

technically it should nowadays be even more boilerplate

#

(Allow<Disabled>, Allow<Internal>), for the rare user that likes to put components on observers

#

But I think this is niche enough that I would go with the slim Allow<Disabled> for bow until we have an upstream AllowAll

limber wedge
#

is there a reason this is not handled the inverse way? that AllowAll is the default?

#

fn on_disable(trigger: On<Add, (Disabled, Internal)>, query: Query<&Foo, (Allow<Disabled>, Allow<Internal>)>) is a bit bavy

twilit dew
#

But yes, they should be the default for observers

#

There’s a few proposals out there

limber wedge
#

i see i see thank you!!

twilit dew
molten merlin
limber wedge
twilit dew
pale viper
#

bevy_lint_driver acts as a replacement to rustc, so running the Bevy linter should never invoke rustc

small turret
small turret
pale viper
#

Nope! Technically speaking, bevy_lint_driver can fully compile Rust programs

small turret
#

Weird, when I run bevy lint I can see rustc running in the background...

#

And all the usual compile logs in the output too...

small turret
limber wedge
#

i guess BD ment more invoke directly. its more like bevy_lint -> cargo -> bevy_lint_driver -> rustc (with the specific configuration that the driver sets up). correct me if im wrong @pale viper

pale viper
# small turret Like am I seeing things here, who's compiling my Rust 😂 ```bash $ bevy lint --...

More specifically, rustc the executable links to the dynamic library librustc_driver.so, which does all the actual compiling. bevy_lint_driver also links to librustc_driver.so, and is able to do the same thing

A dynamic library is a library that contains functions and data that can be consumed by a computer program at run-time as loaded from a file separate from the program executable. Dynamic linking or late binding allows for using a dynamic library by linking program library references with the associated objects in the library either at load-time ...

#

bevy_lint_driver should not be spawning any processes beyond running cargo metadata

limber wedge
#

I thought run_compiler or how the function is called will actually invoke rustc TIL

pale viper
#

So I just tested it: bevy_lint uses rustc to compile dependencies and bevy_lint_driver to compile crates in the workspace

#

As most projects spend their time compiler dependencies, that might be why you thought the linter always used rustc

#

I think this is because we use RUSTC_WORKSPACE_WRAPPER, rather than RUSTC_WRAPPER to override the Rust compiler

limber wedge
pale viper
#

build.rustc-workspace-wrapper

Sets a wrapper to execute instead of rustc, for workspace members only. When building a single-package project without workspaces, that package is considered to be the workspace. The first argument passed to the wrapper is the path to the actual executable to use (i.e., build.rustc, if that is set, or "rustc" otherwise). It affects the filename hash so that artifacts produced by the wrapper are cached separately.

#

Actually, I wonder...

#

If we switched to RUSTC_WRAPPER, do you think that would fix using RUSTFLAGS to configure lints?

#

Right now doing something like RUSTFLAGS="--deny bevy::unit_in_bundle" fails because the dependencies don't recognize the lint

#

But if we used RUSTC_WRAPPER, the linter would be used to compile dependencies as well. Because the linter registers bevy as a tool, it's equivalent to adding #![register_tool(bevy)] to all of the dependencies

#

That might mean that cargo check and bevy_lint won't share dependency artifacts, though, which might not be worth it

limber wedge
#

Would be an interesting exploration imo

#

But this would not mean that all lints are also run on all dependencies?

pale viper
#

Yeah, good point. We probably don't want to lint dependencies, as the user won't be able to fix any of the warnings

#

(Though I believe Cargo does something to silence warnings when compiling dependencies, so the user doesn't see them)

small turret
#

So in the end, I had to run RUSTC="$BEVY_LINT_SYSROOT"/bin/rustc bevy lint to make it work.

#

I'm nut sure how RUSTC_WRAPPER ties to all of this.

#

I feel that the most reasonable way to use bevy lint is to tie your project compiler to the version used by bevy_lint and that's kinda unfortunate.

pale viper
#

What if the linter targeted the latest stable Rust release? Would it be easier or harder to work with?

#

-# We'd have to use some RUSTC_BOOTSTRAP wizardry, and would need to get rid of clippy_utils, but it technically is feasible

limber wedge
#

i love clippy_utils ferris_sob

pale viper
#

Hah, ditching it may be a no-go!

#

Though, there's a chance it would be API-compatible with the latest stable Rust release, since they're released at the same time

limber wedge
#

imo its unfortunate but not too big of an issue and in a CI environment i think its no issue at all

#

and i think if someone is already using nightly i dont see a big downside of using the same nightly version we use?

limber wedge
small turret
small turret
small turret
limber wedge
#

Yea makes sense

limber wedge
#

There is surprisingly little documented on Trait Checking in the clippy Development guide (besides how to check if a given type implements a trait) if you have found any additional useful blogs let me know 🥺 @pale viper

pale viper
#

If you can find a Clippy lint that does something similar to what you want, I found looking at its source code is a great source of practical knowledge!

#

Are you working on the zst_query Has<T> issue? I tried working on it a week ago, but ran into a wall where I wasn't sure how to handle resolving the associated type. My current approach tries going through the HIR, looking for the impl QueryData for T and resolving the type of type Item, but maybe you have a better approach that goes through the type system

limber wedge
limber wedge
rigid bluff
#

Hello, something that would really help me is a "watch" mode for bevy run web where it rebuilds whenever I save a file, similar to how other web frameworks do it.
If someone knows how this kind of thing is implemented I could try and work on it

pale viper
limber wedge
foggy basin
limber wedge
foggy basin
#

I think the problem was that it didn't know that we also have to execute the wasm bundling after building so it didn't know when the rebuild completed
Also instead of killing the server every time we could keep the server running and instead send a reload event

foggy basin
#

Oh actually the CLI can also be used to just emit the events as json and process them yourself. This is actually perfect for us: we get maximum flexibility without increasing the CLI binary too much

limber wedge
limber wedge
#

If possible i would want to avoid having multiple „watch“ binaries but i guess we will see how we can integrate subsecond once they had time to split it out (if they still want to)

rigid bluff
#

Hello, I get this error on web:

bevy_kart.js:1056  GET http://localhost:4000/assets/sprites/karts.png.meta net::ERR_ABORTED 404 (Not Found)

Whenever I load a picture, like it expects a meta file everytime, i'm not sure how to get rid of it

foggy basin
pale viper
#

I had some fun writing unit tests for the sym module! I don't usually get to write those, as the linter makes it hard to setup all the moving parts necessary to test

#

Happy Halloween 👻 🎃 🍬

limber wedge
#

I will be prepared for spooky jump scares in the pr boo

pale viper
#

Ohhhhh, no jumpscares :(

#

This is the best I can do in that category:

limber wedge
foggy basin
#

Ok this is super cool:
I finished setting up my new Desktop PC for faster compile times.
And on my laptop, I set it up to connect via tailscale, so in VS Code I can SSH into my desktop PC to use it as a build machine.
The catch: I can't actually run Bevy games, because the GUI can't be forwarded.
But wait: I can just use bevy run web and VS Code automatically forwards the port!
So now I can properly develop when I'm on the go while keeping my laptop at 2% CPU and the fans quiet, enjoying faster compile times, while still being able to see if the examples work :)

limber wedge
#

I love my personal setup at home

#

I got a bit nerdsniped and im experimenting with a watch command

limber wedge
foggy basin
foggy basin
#

I might play around a bit more with that, especially for RustWeek next year it would come in handy.
Last time, I probably spent more than half of my time waiting for compiles haha

limber wedge
limber wedge
#

So i would use notify to watch for changes

#

(Same crate watchexec uses under the hood)

foggy basin
#

Curious to see how it will turn out!

limber wedge
#

Same lol

pale viper
#

I’m glad you got a better setup, what specs did you end up going with for the PC?

heady fog
#

Hey TIMMÄH,
been reading through some of your messages about the Bevy CLI and that remote compile setup, really slick stuff.
The tailscale + VS Code flow you described sounds like a dream for cross-device dev work.

#

Would love to pick your brain sometime about your workflow optimizations, especially how you handle hot reload and bundling between native/web targets.
You’ve clearly been deep in the weeds on this, so figured it’d be cool to connect.

limber wedge
#

Just my personal opinion and maybe unjust but I prefer poorly written messages (like mine) compared to ai generated once. I can understand that it can be scary to write in a language you are not fluent in and i feel that too but it just feels a bit rude to me when someone uses ai to talk with me.

#

But i agree would be maybe a cool blog post for the blog you have been wanting to start (;

foggy basin
foggy basin
limber wedge
#

Wdym overdue? You are perfectly on time for the 6th birthday

limber wedge
#

rust-analyzer 1.93.0-nightly (d5419f1 2025-10-30) does not like the tokio::select! macro ferris_spooky code completions go from instant to 1.5-2s lol

#

even in a fresh project just adding tokio::select! will result in noticeable perf loss

pale viper
#

Looking at select!'s source code, I'm not surprised. That declarative macro is super recursive and generates a surprising amount of code!

limber wedge
#

yea i was more surprised that this is only an issue with the ra version from this toolchain (not when using nightly-2025-09-18). I guess that its the new trait solver?

pale viper
#

Maybe? I thought the new solver was supposed to be faster, but maybe I'm misremembering

#

Do we use select! in the CLI?

limber wedge
rigid bluff
#

Hello, for the default 2d project (the one that has github actions for itch.io and other stuff), does it enable all necessary optimizations to run in a production environment or do I have to set it up myself ?

pale viper
#

They're the ones who maintain the 2D template

rigid bluff
#

Thanks, also i'm wondering if bevy run web can work for examples ?

pale viper
foggy basin
shrewd monolith
#

Oh, interesting. I'd say something similar to "the bad" has happened to #1236113088793677888. I imagine that'll be common for bigger initiatives, especially those that require upstreaming.

Upstreaming is, well... kinda boring, long, and review-heavy.

#

So working group members are probably more likely to want to add new fun features.

foggy basin
foggy basin
shrewd monolith
limber wedge
foggy basin
# limber wedge nice blog! the design is very cute too<a:broovy:757678546213798038>

There's still a lot I want to add, but I kept procrastinating writing the actual blog by fiddling around with the design so I had to stop bavy
I'm not good at design so I used the Catppuccino color palette which does the heavy lifting

A soothing pastel theme for the high-spirited! We are a community-driven color scheme, perfect for coding, designing, and more. Explore our color palettes, discover our wide range of ports, and view our vibrant community.

shrewd monolith
#

colors are definitely hard for me to pull out of thin air 😅

foggy basin
#

And I'm a sucker for pastel colors, so this palette was a great fit for me

limber wedge
limber wedge
foggy basin
limber wedge
#

The experiment will continue its more an exploration anyway

#

Its going great cold reloading for web and native works but there is a lot to clean up hahaa

#

And like dx improvements with how the build process -> web app and file watcher communicate with eachother

foggy basin
#

In the future we could make it really powerful, that it waits for the bundling to finish, then loads the new JS/Wasm on the JS side in the background and only switches it out once it's fully loaded, so we don't get any disruption from a loading screen

foggy basin
#

Has bevy with default features always been so huge?
Either there is a bug in the CLI or even with our size optimizations the minimal template is 74 MB

#

I feel like it was less before, but maybe I'm misremembering

limber wedge
limber wedge
limber wedge
pale viper
pure sierra
#

hey guys - i'm trying to use bevy_cli to bundle a wasm build but it's just over 30mb (and cloudflare has a strict 25mb limit) - any ideas to get the wasm file smaller? i tried using wasm-opt but it seems to have corrupted the build:

(index):1 Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #526 "wbg" "__wbindgen_cast_aa9220ff3b257619": function import requires a callable
limber wedge
#

wasm-opt does the most so maybe try to play around a bit with the different flags / passes? Another thing that could help is setting panic = 'abort'

twilit dew
#

Also disabling debug info

#

And disabling the debug feature in Bevy

#

Remove reflection where possible

rigid bluff
#

Hello, I tried replacing the default index.html for my web build, but now when I run bevy run web, it runs in fullscreen rather than in a frame like before.

Is that normal ?

#

It seems like that's what the html contains, but now I wonder why there is a difference with the default one. I'm also worried it might break the itch.io

pale viper
foggy basin
pale viper
#

I think we have a few of these in our issue tracker already, but they're good to note!

pale viper
#

And another thing: I'm sorry for being quite inactive in the past few weeks! School and friends have been eating up a lot of my time, and I've been procrastinating reviewing the PRs that have been building up. I'll probably be inactive for a little bit longer (finals week is coming up!), but I do want to return to the linter and CLI soon

#

I've been quietly working on a side-project that will hopefully make the Rustup process easier for the linter, but that's not quite ready yet

fresh scaffold
#

commands.spawn(A).insert(B).insert(C) -> commands.spawn((A, B, C))
#135
Something tricky there: For automatic fixes, when some of the inserts are guarded by cfg, that cfg needs to be moved too but the linter doesn't know about it (as far as I understand)

GitHub

Calling multiple .insert()s causes more archetype moves and generally just distracts from how simple an operation is. This also applies if .spawn() is called first and .insert is called immediately...

limber wedge
rocky oxide
#

We're talking about making web builds require nightly

foggy basin
# rocky oxide We're talking about making web builds require nightly

I would suggest to be cautious with that:

  • The CLI is not upstreamed yet and of was an explicit goal to make using it optional, making the multi threading required would almost force you to use the CLI
  • There will definitely users who can't or don't want to use nightly. On some platforms rustup also won't be available, then we couldn't help with installing the nightly toolchain.
  • Game jams work best with web builds, so this could make participation harder (or require testers to download more games)
#

That said, multi threading definitely gives a lot of benefits for web games, especially avoiding audio stutters is great

shrewd monolith
# foggy basin I would suggest to be cautious with that: - The CLI is not upstreamed yet and of...

Well, part of the conversation was that upstreaming the CLI is very compelling for this. I think both efforts could take a similar amount of time, so we can't rush into it, to be clear.

In any case, I don't mind a world where people are heavily encouraged to use the CLI. After all, even with guides for how to tune your manifest for fast compilation, how many new users actually do it? How many people continue to have unnecessarily long compile times? I'm just guessing, of course, but I bet it's more than you'd think.

I'm also curious on how impactful platforms without rustup would be. Does this maybe comprise just nix for now? And do you think it would make game jam web builds harder assuming an upstreamed CLI? We've only done jams on itch.io as far as I know, and the only thing you have to do is check a box for the headers. (Certainly more than nothing, but hopefully not enough friction to be prohibitive.)

#

(I guess the "compilation performance" is only true if you seek out a template, but... the rest of my point should stand. Also, building for the web is already almost prohibitive for newcomers!)

foggy basin
#

To be clear, I'm not really personally opposed to the idea, I just anticipate that it might receive some pushback and should be handled carefully :)
Multithreading definitely has a lot to offer

snow linden
#

one interesting thing i dug up while looking into this, the same source headers that unlock shared memory also unlock goodies like high-precision timers.

snow linden
# foggy basin I would suggest to be cautious with that: - The CLI is not upstreamed yet and of...

caution is warranted. but my argument in favor is basically:

  • web is the first point of contact for most people, through examples and game jams
  • we can't hit our baseline performance / quality targets on the web without these features. timers don't work, operations are slow, things crash, audio stutters
  • supporting these sub-par non-threaded non-nightly non-cors-header web builds costs a surprising amount (both in developer resources and in engine complexity) considering how little it benefits us
snow linden
#

right, ty

#

part of what's been historically annoying about this is that it has been technically unstable. the guidance has shifted a lot over time

#

now it's seems mostly to have stabelized, but i imagine guidence will change again in the future.

shrewd monolith
#

To be fair, those flags would work just fine. They're just no longer necessary. I don't think anything truly breaking has occurred here for a long time, but I've only been on it for a couple years.

limber wedge
#

So I think an upstreamed CLI would help a lot. Its so annoying / complex to create good web builds that i would argue that most who do not use the CLI, dont know how to create a good web builds and just haven’t heard of the CLI.

foggy basin
#

I wonder if people who use Bevy on production already use nightly.
I believe @dusky onyx and @silent shard used bevy on the web?

foggy basin
#

Regardless, this means we should improve our nightly support in the CLI.

  • Automatically running with a nightly toolchain for multi threaded builds, if not already activated
  • Automatic installation of nightly if rustup is available and nightly is missing
  • Better error messages in these cases
#

Oh and I think this also makes it worth it to add the +toolchain syntax after all, what do you think @pale viper?

dusky onyx
foggy basin
dusky onyx
silent shard
limber wedge
pale viper
#

At least, it’s better than recommending everyone do rustup run nightly bevy …

limber wedge
#

Rather that the cli uses the +toolchain syntax internally but i dont think it has to be visible to the user (unless —verbose was passed)

molten merlin
pale viper
# limber wedge How does supporting the +toolchain syntax help here? I personally dont think tha...

If we're going to make nightly mandatory for web builds, it would be nice to allow the user to configure which nightly is chosen. I could see something like this in the future if we go down this path:

# Uses stable by default
$ bevy build

# Uses nightly by default
$ bevy build web

# Override to use a specifically nightly
$ rustup run nightly-2025-11-27 bevy build web

# This is nicer to write
$ bevy +nightly-2025-11-27 build web
#

I originally discarded the +toolchain syntax for the CLI because I thought it added too much complexity, plus it made it harder to support non-Rustup systems

#

Making nightly mandatory for web does sway me a little, though. What do you think?

#

I feel like we need to figure out the story for how the CLI handles toolchains. How much user input should be needed to setup the toolchain?

limber wedge
#

A yea that make sense. I still would like to add a way so you dont have to specify each time if you dont want too. Maybe a config option or so

foggy basin
#

The automatic usage of the nightly toolchain would be more useful for one off cases like running an example in the web, I think for web projects the user would instead use a tollchain file or rustup override set nightly

twilit dew
rocky oxide
#

Similar flavor to the work y'all do here

rigid bluff
#

Hello, the itch.io github action was working fine until recently it stopped working with this error:

info: bundling JavaScript bindings...
info: optimizing with wasm-opt...
[parse exception: duplicate export name (at 0:187062)]
Fatal: error parsing wasm (try --debug for more info)
warning: failed to run wasm-opt, trying to find automatic fix...
error: command `wasm-opt --output /home/runner/work/bevy_kart/bevy_kart/target/wasm32-unknown-unknown/web-release/bevy_kart_bg.wasm /home/runner/work/bevy_kart/bevy_kart/target/wasm32-unknown-unknown/web-release/bevy_kart_bg.wasm --strip-debug -Os` exited with status code exit status: 1

Anyone familiar with it ?

limber wedge
#

hmm what error do you get when you run wasm-opt --output /home/runner/work/bevy_kart/bevy_kart/target/wasm32-unknown-unknown/web-release/bevy_kart_bg.wasm /home/runner/work/bevy_kart/bevy_kart/target/wasm32-unknown-unknown/web-release/bevy_kart_bg.wasm --strip-debug -Os ?

rigid bluff
#

the game runs fine locally

limber wedge
#

so running bevy build --locked web --bundle works fine locally but not in the github runner?

rigid bluff
#

Used to work just fine, maybe it's a version problem with it using latest and a newer coming out that breaks it or something

rigid bluff
tardy cove
#

does the bevy cli have commands for android yet?

crude mica
#

nope

#

i want to help contribute this at some point but i'm being pulled in multiple directions, if circumstances align it is likely i'll be able to contribute this in ~7 months

tardy cove
#

oof

foggy basin
#

@hollow geyser what is your concern about the editor depending on the CLI?
The current CLI prototype has a public library that you can use instead of creating a CLI process directly, is that what you mean by common API?

limber wedge
#

I think the wording in the document is just a bit unfortunate.

hollow geyser
twilit dew
#

any idea what this means? hmm

#

from bevy run web

pale viper
#

I guess wasm-bindgen has a tiny WASM interpreter built-in? I'm not quite sure...

pale viper
twilit dew
#

indeed!

#

works without the web-multi setting

pale viper
#

Huh. Looking at the code surrounding breaks_if_inlined(), the panic was caused by casting one type to another

#

I don't fully understand what is happening in there, but I'd definitely open a bug report to wasm-bindgen!

twilit dew
pale viper
twilit dew
#

oh I didn't use the newest nightly

#

maybe it's already fixed there?

pale viper
#

Be careful with the newest nightly, actually! wasm-bindgen may be broken because they changed the symbol mangling scheme

#

If you bump nightlies, make sure you're using wasm-bindgen v0.2.106

pale viper
#

Yup, gl :)

twilit dew
#

good thing that the page I'm deploying doesn't use audio

twilit dew
#

(just without multi-threading for now sadyeehaw )

limber wedge
foggy basin
pale viper
#

@limber wedge @foggy basin I've made the final touches on the CLI and linter upstreaming document. Could you take a peak at https://hackmd.io/@bevy/H15ftGooxx, and let me know if you approve? Once so, I plan on pinging the maintainers and trying to get an official consensus

#

There's a few decisions they need to make, namely:

  • Does the code go in bevyengine/bevy_cli or bevyengine/bevy?
  • Should the code be reviewed, adjusted, and transferred in separate steps? Or should the code be broken up into small segments that get reviewed and transferred individually?
  • Should past versions be released on crates.io for historical purposes?
  • What should the Discord channel be named? Are we the CLI devs, or the tooling devs?
  • Are they cool with appointing us as SMEs? What should the titles be?
#

And since it's been a hot minute, I hope you all are doing well! It's pretty cold outside where I am, but the snow on the ground and the festive cheer makes up for it :)

limber wedge
limber wedge
pale viper
pale viper
#

<@&1064695155975803020> it's been a year and 4 months since the CLI working group was created, and I think we finally have a solid plan for upstreaming the prototypes! Please take a look at https://hackmd.io/@bevy/H15ftGooxx and let us know your thoughts, opinions, and concerns super_bevy

HackMD

The Bevy CLI and Linter have grown more mature in the past year. The CLI has had two releases, and the linter has had four, all received with good feedback.

#

I'd like a few days of discussion, then ideally we can get the ball rolling by next weekend. By then I'll be in winter break and will be able to devote more time to actually doing the upstream

plush spade
#

so in fish shell for cargo i get auto-complete for example names which is SUPER helpful, it would be nice to have this work with bevy too. not sure about other shells here

limber wedge
#

bevy completion iirc

plush spade
#

ooo!

limber wedge
#

you can add this to your bash / zsh / fish profile

plush spade
#

it would be nice if it just installed? is there a limitation to that? typically i expect tools to install completions for me

vast vine
plush spade
#

it's really helpful imo i can never remember all the example names

pale viper
limber wedge
#

oh you ment for examples

#

not sure if that works i thought it does

vast vine
plush spade
pale viper
twilit dew
#

What’s the feeling on allowing custom bevy subcommands? i.e. like how the executable cargo-foo can be invoked as cargo foo. Can we have bevy-bar be run as bevy bar?
The reason is that I'm toying with the idea of creating a connectivity layer between Source 2's Hammer level editor and Bevy, and that would require a CLI. Since that CLI does not have any meaning outside a bevy context, it would be neat to have it be run as bevy hammer or something like that

limber wedge
#

I think it could be a neat idea to be able to run custom subcommands, just like there are so many third party crates that do a lot of heavy lifting that bevy cant do itself or bevy does not want to do i imagine it will be the same for the cli

twilit dew
#

I have not looked into this at all, but I imagine it would be trivial to implement, right?

#

Since you basically just invoke another CLI and forward the params

limber wedge
#

i think the tricky part is more how to integrate it in clap. iirc cargo also lists the installed external clis so they are "real" subcommands

pale viper
#

Yeah, I think it would be great if the CLI supported subcommands like that

pale viper
analog fern
# twilit dew What’s the feeling on allowing custom `bevy` subcommands? i.e. like how the exec...

Off the top of my head, the concerns that come up are:

  1. Namespacing: theres always the risk for custom command authors that we will "claim" a given command name. The onus would be on 3rd parties to pick a name that we are unlikely to claim for ourselves upstream.
  2. Consistency / quality control: We'd be allowing arbitrary 3rd parties to look and feel "official" in a way that could negatively affect our reputation (ex: malicious, UX that is inconsistent with upstream bevy_cli UX, bad / buggy UX, etc)

If we introduce some sort of "would you like to install" dialogue for custom commands that aren't installed yet, (2) becomes even more of a concern, as we'd be opening our users up to typo-hijacking (or "useful looking") malicious crates. (ex: a developer enters bevy publish, and we print "bevy publish is not a command, consider installing bevy_cli_publish, which provides the bevy publish command")

Given that people can already easily run cargo install bevy_hammer, is it really that bad to type bevy_hammer instead of bevy hammer, given that it trivially solves (1) and (2) ?

twilit dew
analog fern
#

I personally find the cost:benefit of the feature in cargo dubious

#

The balance of the "neatness" of the feature with the issues of provenance / trustability / consistency doesn't really play out from my perspective

#

Not exactly the same, but its similar to letting people nest themselves under the bevy crate as subcrates. Which I would never support, for the same reasons

#

Or letting people host arbitrary pages at bevy.org/X

#

I think it makes more sense if we were acting as some sort of "plugin host" and defining a set of protocols that they implement. But we'd literally just be proxying bevy X to bevy_X

#

Also: I'm midway through a review of the bevy_cli code and the upstreaming proposal. Not leaving comments yet as my opinions on some of these issues require a better understanding of the actual state of the code. At this point I'll just say that I'm on board to start the upstreaming process soon in one way or the other, but I'll need a bit more time to grok things.

I'm temporarily tabling my review to focus on prepping 0.18. I think its too late in the game to try landing this in 0.18.

pale viper
#

Side note: I reserved the bevy_linter crate to protect against typo-squatting / people accidentally installing that rather than bevy_lint. I'm happy to transfer ownership once the upstream is done

limber wedge
twilit dew
#

Yep exactly

analog fern
# limber wedge I think jan ment more that if you had installed a tool (with cargo install) that...

That flavor of design is certainly in some ways less risky than having the bevy cli facilitate the install (for the reasons stated). Although on the flip side it opens up new problems:

  1. Any bevy_x in the path (even one that wasn't built to be a bevy subcommand) is now available as a subcommand.
  2. We no longer have the ability to block the installation of known bad actors in the space.

That being said, even ignoring those issues, the consistency / quality control / provenance problem is enough on its own to deter me from this path. The sole functionality of this feature is "let arbitrary 3rd party tools present themselves as first party tools". There isn't any functional difference between bevy X and bevy_X. It is "just" branding.

pale viper
#

I'm really surprised by how easy the upgrade this time was! I ran cargo build and it passed the first time :D

limber wedge
#

No breaking changes!!! Imagine

pale viper
#

I know lol

#

My worst fear is that one of these upgrades has a silent logic breaking change that isn't caught in our tests

#

Hopefully our UI tests exercise the lints enough that we would catch something like that 😅

limber wedge
#

Yea thats true but i think that would only hit in edge cases since the ui test are pretty good imo

neon idol
#

Hey, any love for HTTPS planned?

rigid bluff
#

Hello, I can't seem to figure out what would be the bevy run equivalent of cargo run --example tic_tac_toe -- server

limber wedge
# neon idol Hey, any love for HTTPS planned?

Hey i think this would be nice to have but we are a bit in a limbo since we are waiting for maintainers to review our upstream proposal and what comes out of it so i think it will take some time until we support this

foggy basin
rigid bluff
rigid bluff
#

Can anyone help I still can't figure it out

limber wedge
#

so if server is the argument you want to pass to the bevy app the command is like this bevy run --example tic_tac_toe -- --server

rigid bluff
limber wedge
#

you need to remove the extra space between -- and server

#

bevy run --example tic_tac_toe -- --server

rigid bluff
limber wedge
#

what version are you using?

rigid bluff
limber wedge
#

glad to hear! 🎉

rigid bluff
# limber wedge glad to hear! 🎉
bevy run --example tic_tac_toe -- server

Works like I expect, but now i'm trying to run it on web but whever I add the web arg it gives me an error (ex: bevy run --example tic_tac_toe web -- server, do you know what is the correct way ?

tepid depot
#

I'm afk but I'm pretty sure web has to be last

limber wedge
#

the problem is that claps last is not compatible with subcommands iirc

foggy basin
#

Can you create a ticket for this? That needs to work :)

rigid bluff
#

Thanks all, I would really appreciate a fix for this, I wonder if there is a workaround in the meantime

limber wedge
rigid bluff
#

Hello, is there anything I can do to help with the web args issue ? A solution would really help me

Even though I do not know much about CLI I could try,
Is there an easy way to test changes locally for the CLI ?

limber wedge
# rigid bluff Hello, is there anything I can do to help with the web args issue ? A solution w...

Hey in my estimation support wasm cli args is a rather complex feature but a PR is always welcome! Depending on how complex the changes are I can’t promise that we would merge right away since i would like to keep the code base pretty stable until cart had the time to review the upstream proposal.

You can easily test the cli by just building your local change with cargo build —path .

#

But i think depending on your usecase maybe just „hard coding“ the behavior behind a feature flag is the easier workaround. It wont be runtime configurable but at least you could easily test by rebuilding

rigid bluff
foggy basin
#

Ah, the rebuild would be annoying. Right

rigid bluff
#

I'll work on other stuff in the mean time it's fine

foggy basin
#

Do wasm binaries support being called with arguments in general?

trail shale
foggy basin
#

Right, we just work with the JS bindings

trail shale
#

it exposes a few functions, and you call those. to pass arguments, you would have to expose a new function that takes those parameters, and change the html to call it with the correct args

foggy basin
#

Then we probably can't provide that functionality in a way that works out of the box

#

Does it make sense to run the server in the browser anyway? Is it a special form of the client?

foggy basin
#

Another workaround could be 2 different binaries using the same library for the core implementation and calling it with different arguments. But I know it's also not ideal

rigid bluff
#

Now that I think about it a reasonable solution is that whether the user is a host or not is decided at runtime, which I will have to do anyways

#

though i'm kinda sad args are not possible because it made quick tests simple, I have a hard time believing there is no way to make it work

limber wedge
#

I have my last exam this Saturday i could prepare a 0.5.0 release afterwards? I think this would make sense even tho maybe the only change is being compatible with 0.17 what do you think? @pale viper

#

Im still really motivated to work on both so cant wait until cart got some time. In the meantime i actually started creating a game for once bavy

pale viper
limber wedge
#

Whatever you like. I dont think that the release process is particularly interesting so i dont want you to always have to do it😂

pale viper
#

Yeah, you should totally give it a shot! It's good practice, plus I'll be a bit busy in the coming week

#

Good luck on your exam :)

limber wedge
#

Sounds good. I will prepare it once i have time and then just add you as a review so you get notified

limber wedge
ancient dirge
#

It mostly just does a scrape of the github api for the crates/* folders, which seems to work well (or just reads the directories in bevy/crates/* on local paths

#

also doesn't modify your Cargo.toml, just prints out the patch list

#

was thinking of improving the usability a little bit like adding a way to give it a link to a PR on bevy/some other remote and have it automatically figure out the repo/branch for you, or allowing for things like:

bevy-patch git --repo aceeri/bevy # expands to https://github.com/aceeri/bevy
#

also stuff like:
--tag v0.18 -> v0.18.0
or gives you suggestions on that

shrewd monolith
#

oh that would be so nice right inside the bevy cli

pale viper
snow linden
#

Hello all! We have a project proposal for gsoc that involves the CLI, but it only has one mentor. Do we have anyone else who would be willing to help spend some of their time mentoring a student on cli work over the summer?

limber wedge
#

ohh thats soo cool! I would have time to help out

snow linden
limber wedge
#

i can still just add myself as a mentor and we will see if anyone in the end is interested in that. imo contributing some lints would also be really interesting

snow linden
#

(sorry if i am pinging the wrong person)

snow linden
#

@limber wedge I talked to them out-of-band, they have a workaround for if we can't get a fix into wasm-bindgen. basically just patch the thing after it's been built, should be something a student could do with guidence.

#

the other dev knows how to do that bit and has a working prototype, so i think someone who knows the cli would be great as a second mentor.

limber wedge
#

okay thanks a lot for getting this sorted! will add my details

trail shale
#

@snow linden I'm pretty sure the "multiple simulatenous canvas" part is blocked by winit with will panic if more than one instance is started

#

at least it was last time I tried something similar and I haven't seen a fix for it passing through

snow linden
trail shale
#

oh nice!

limber wedge
pale viper
foggy basin
jovial quartz
#

Are there any templates making use of the new feature groups stuff

#

I did not see any updates to use the groups on the git or the template git

buoyant jasper
#

Hi, I was wondering if the linter has some warning for SubStates that you are initializing with init_state... I just had issues with this "footgun". 😅

If not already present (I don't think there's a lint for this) should I open an issue in the cli repo?

foggy basin
foggy basin
buoyant jasper
foggy basin
buoyant jasper
#

Let's say the user has a MyState struct which derives SubStates and they are initializing it with init_state, just issue a warning and add "maybe you wanted to use add_sub_state?" If that makes sense.

rigid bluff
#

Hello, just something that crossed my mind, but couldn't we get editor/compile time validation of asset types with (or maybe without) the CLI, something like checking if a gltf has a certain animation or similar

pale viper
#

Maybe! I definitely would like to improve integration between asset processing and the CLI

shrewd monolith
snow linden
#

i think this is the right call by rustc

#

although it's annoying

foggy basin
limber wedge
#

<@&1064695155975803020> Helloooo! bevy_lint is ready to release v.0.5.0 (a bit late) so we can have a released version that is compatible with bevy 0.17 before we support bevy 0.18! As per our release process we need a maintainers approval on https://github.com/TheBevyFlock/bevy_cli/pull/724 before we can release. I would appreciate if you could take some time and leave your feedback ratjam3 super_bevy

GitHub

It has been around 167 Days since the last release 😲
While there are not that many new features, this mainly serves to provide a release that is compatible with bevy 0.17.0 (So we can update to bev...

limber wedge
pale viper
snow linden
rocky oxide
#

@pale viper merging the PR; please ship at your leisure (but also please have a version that works with 0.18 out for the jam 🙏)

limber wedge
pale viper
pale viper
#

Done!

limber wedge
twilit dew
#

hey friends! Getting this in CI

rocky oxide
twilit dew
#

I'm veeeery out of the loop here, but I think that feature is now stabilized and bevy-lint is not yet on that version?

rocky oxide
#

Yes

twilit dew
#

nightly-2025-12-11

rocky oxide
#

Hmmm

molten merlin
twilit dew
molten merlin
#

I would test it on a 0.17 project to see if it does the same though, to confirm

foggy basin
dark oasis
#

why is the argument order so weird and counterintuitive on bevy_cli

#

oh, i think i get it now

#

-- options are for the arg immediately before it

pale viper
#

Is it with the bevy build web stuff?

dark oasis
#

so ⁨bevy run --example 3d_scene web⁩ is just weird looking

#

needing to put ⁨--features wasm⁩ also before web is kinda weird

#

or not wasm

#

webgpu

pale viper
#

Yup, I agree! It’s a paper cut in the argument parser

twilit dew
#

FYI it looks like bevy_lint on ⁨main⁩ is working well for me 🙂

foggy basin
quaint cipher
#

I would guess that most people are used to -- flags being independent of position in the command; ime it’s fairly rare for there to be a restriction on where you can put those flags beyond maybe “after this argument everything gets gathered and used as a shell command, so put your flags before it”

limber wedge
#

Yea i think thats the most common way

foggy basin
#

I think what would be important is that we still emit errors when flags are used in a place where they don't make sense. E.g. when you set the port when running a native instead of a web app.
I'll have to take a look which parsing options clap offers

pale viper
#

Speaking of which, I think we should probably prepare another linter release so that game jammers can use it (Bevy Jam starts in 6 days!)

#

Let me get that kicked off

pale viper
#

<@&1064695155975803020> Hi again, I feel like we keep on doing this! 😄
We are ready to release v0.6.0 of ⁨bevy_lint⁩, with the only change being Bevy 0.18 support in preparation for the upcoming jam! When you have the time, please take a look at https://github.com/TheBevyFlock/bevy_cli/pull/731 and give us a review so we can make another release. Thanks! :)

GitHub

While it is quite the fast turnaround, given we released v0.5.0 only five days ago (#724), the Bevy Jam #7 starts in 6 days. The jammers will want support for Bevy 0.18, so we are releasing with su...

rocky oxide
pale viper
#

Huh, I guess we could technically use ⁨RUST_BOOTSTRAP=1⁩. This would let us use nightly features on stable Rust

pale viper
#

Yeah... bavy

#

The Rust project definitely does not like people using ⁨RUST_BOOTSTRAP⁩, but it is an option...

pale viper
#

I'm getting deja-vu, I feel like I just did this! :)

snow linden
#

👀 👀 👀 what are the downsides

pale viper
rocky oxide
pale viper
#

That, and also we'd be technically misusing ⁨RUSTC_BOOTSTRAP⁩ and will get zero support (as Alice said)

snow linden
#

neat, didn’t know that existed. sounds like something we can’t do (but am going to go to a crossroads at midnight and try it out anyway)

pale viper
#

Lol yeah. For extra fun, set ⁨RUSTC_BOOTSTRAP=-1⁩ to convert a nightly compiler into a stable-only compiler (no ⁨#![feature(...)]⁩ support!)

#

Even if the Bevy Linter never gets upstreamed, I'm so glad I made it for all the random cursed Rust compiler knowledge it gave me

twilit dew
#

Friendos, how would y'all feel about the default page for web deployments shipping a little JS snippet that displays a text when the Bevy canvas crashes? The reason this came up is that currently, running WebGPU jam entries on unsupported browsers looks like the loading screen got stuck

#

So in that case, having a message like "you need WebGPU, enable it with blablabla" would be neat

#

And since that requires looking for exceptions, we could just as well display a message in the general case as well

#

CC @shrewd monolith @grave quarry

limber wedge
#

I like the idea!

shrewd monolith
#

Yeah I think it should be relatively easy

foggy basin
#

i think we already have an issue for better error handling somewhere :)
Definitely would be nice to have!

limber wedge
foggy basin
limber wedge
#

Yes totally!

rocky oxide
pale viper
# rocky oxide

@limber wedge and @foggy basin, definitely take a look at this! We might end up upstreaming the CLI before the linter

limber wedge
#

Glad to hear this! Im surprised by that.while the linter has its own pain points (that could be improved via upstreaming) it itself seems more like the big picture is solved since we are basically just our own clippy.

#

But the cli is definitely more useful as of now bavy

pale viper
#

@craggy valley thank you for your effort and patience!

pale viper
tardy cove
#

i've been using nix for some time now but have not touched flakes yet

pale viper
#

@limber wedge @foggy basin we should probably make a release of the CLI before the jam in 2 days. Is there any PR that you want merged before I start that process?

limber wedge
twilit dew
#

Does the new release include the new required options for Wasm multithreading?

limber wedge
#

Yes

twilit dew
#

hmm is there an issue with the nightly used for the newest CLI?

trail shale
foggy basin
#

I'm always happy to read that people have a positive experience using the CLI!

twilit dew
pale viper
limber wedge
#

I am pretty sure jan is always installing from main

pale viper
#

I was planning on shipping a release last Friday to get the fix out to everyone, but ended up having to dedicate that time to homework 😅

pale viper
shrewd monolith
silk delta
#

As a heads up, getrandom v0.4 is out now, but for Web WASM support, it does what getrandom v0.3.4 does, so there's nothing new on that front. The heads up is because bevy_rand now supports rand/rand_core v0.10 and by extension getrandom v0.4, so this likely should be accounted for by the CLI

#

I've done a PR to glam to begin the process of advancing rand support, and other crates like uuid are going to update getrandom too

#

As a plus, I think ring will update to getrandom v0.3 soon (MSRV woes means it can't update to v0.4) so the last getrandom v0.2 dep will likely finally migrate

pale viper
molten merlin
#

I've run into a situation where bevy_cli behaves differently based on whether you're compiling in dev vs release. Specifically, getrandom becomes an issue, but only if you're compiling bevy build --release web instead of bevy build web.

#

I don't really have that much time to figure out what is going on, but wanted to mention it. Not sure what approach I'm going to take to fix my build yet

pale viper
molten merlin
# pale viper Could you send the error message that you’re getting, with `—verbose`?
error: The "wasm_js" backend requires the `wasm_js` feature for `getrandom`. For more information see: https://docs.rs/getrandom/0.3.4/#webassembly-support
  --> /Users/chris/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.3.4/src/backends.rs:40:17
   |
40 | /                 compile_error!(concat!(
41 | |                     "The \"wasm_js\" backend requires the `wasm_js` feature \
42 | |                     for `getrandom`. For more information see: \
43 | |                     https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#webassembly-support"
44 | |                 ));
   | |__________________^

error[E0425]: cannot find function `fill_inner` in module `backends`
  --> /Users/chris/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.3.4/src/lib.rs:99:19
   |
99 |         backends::fill_inner(dest)?;
   |                   ^^^^^^^^^^ not found in `backends`

error[E0425]: cannot find function `inner_u32` in module `backends`
   --> /Users/chris/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.3.4/src/lib.rs:123:15
    |
123 |     backends::inner_u32()
    |               ^^^^^^^^^ not found in `backends`
    |
help: consider importing this function
    |
 33 + use crate::util::inner_u32;
    |
help: if you import `inner_u32`, refer to it directly
    |
123 -     backends::inner_u32()
123 +     inner_u32()
    |

error[E0425]: cannot find function `inner_u64` in module `backends`
   --> /Users/chris/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.3.4/src/lib.rs:137:15
    |
137 |     backends::inner_u64()
    |               ^^^^^^^^^ not found in `backends`
    |
help: consider importing this function
    |
 33 + use crate::util::inner_u64;
    |
help: if you import `inner_u64`, refer to it directly
    |
137 -     backends::inner_u64()
137 +     inner_u64()
    |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `getrandom` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
warning: failed to run cargo, trying to find automatic fix...
error: command `cargo build --config profile.web.inherits="dev" --no-default-features --profile web-release --target wasm32-unknown-unknown` exited with status code exit status: 101
#

that's without verbose unfortunately. I just flipped some dependency versions so am executing a different build at the moment

#

I more wanted to flag that its not clear as a user what accommodations bevy_cli is making to the project, especially when it comes to things like the getrandom situation (which I know is a headache all over)

silk delta
#

It looks like the getrandom wasm_js feature isn't getting applied for feature build

#

because that's what the error seems to state

shrewd monolith
limber wedge
#

will try to investage tomorrow, maybe you have already configured getrandom_backend but only for the release profile?

molten merlin
molten merlin
#

it was weird to see a difference between debug build and release build with no other changes

pale viper
molten merlin
#

so it only failed in CI, despite it working while I was developing it

#

(I later confirmed it down to dev working locally and release failing locally)

pale viper
#

Hmm. If you have a repo + commit, I can test it out, but you were compiling getrandom v0.3.4. In that version they fixed it so you no longer need --cfg getrandom_backend="wasm_js". The Bevy CLI's getrandom feature is only useful when compiling an older version

limber wedge
molten merlin
#

worth noting that the repo has bevy_rand, with getrandom 0.4, bevy with getrandom 0.3.x, and a geo's main branch, which brings a getrandom dep up from 0.2 to 0.3.

molten merlin
pale viper
vast vine
#

I just updated bevy_cli to the latest commit and now when I do bevy run --example example_name it tells me No binaries found! which doesn't make sense to me because it worked before and it works fine when I do cargo run --example example_name

#

I went back to the last release just to make sure and it does work as expected

limber wedge
#

its the latest pr that got merged that broke that i assume

limber wedge
# molten merlin I've run into a situation where bevy_cli behaves differently based on whether yo...

i think your case is because you have multiple getrandom crates in your dependency tree, and the feature "wasm_js" for getrandomv3 is only enabled by bevy_egui, which in turn is only enabled by the inspector_egui feature.

You set these features like this:

[features]
# Default to a native dev build.
default = ["dev_native"]
inspector_egui = ["dep:bevy-inspector-egui"]
free_camera = ["bevy/free_camera"]
webgl2 = []
dev = [
    # "free_camera",
    "inspector_egui",
    # Improve compile times for dev builds by linking Bevy as a dynamic library.
    "bevy/bevy_dev_tools",
    "bevy/bevy_ui_debug",
    # Improve error messages coming from Bevy
    "bevy/track_location",
]
dev_native = [
    "dev",
    # Enable asset hot reloading for native dev builds.
    "bevy/file_watcher",
    # Enable embedded asset hot reloading for native dev builds.
    "bevy/embedded_watcher",
]

And with the release profile its set to run with default-features = false so you end up without the wasm_js feature.

#

its sad that we dont catch this and give you the toml snipped we for sure can improve the detection on our side so it feels less random

molten merlin
# limber wedge i think your case is because you have multiple getrandom crates in your dependen...

Yeah, at the point I posted the message I knew a few things:

  • there were multiple getrandom inclusions (had already done some work to trim it down from 3 to 2 by git-dep'ing geo)
  • bevy_cli was doing "something" (later confirming that this was only relevant for v2)
  • it worked in dev and not release
  • bevy_new_2d trends towards a decent amount of config (I based my project on the Cargo.toml/gh actions from the template so I could answer other people's questions if they ran into things)

Additionally, when running cargo tree -i getrandom, bevy-inspector-egui hides in what is (somewhat generously with a smaller font size) 7 pages of terminal output that is all bevy_* crates that cause rand to be included, so to find it, it has to be a diff on two runs of cargo tree with dev/release features

molten merlin
limber wedge
limber wedge
#

so i would like to do better there

foggy basin
pale viper
limber wedge
tardy cove
#

zstd_c vs zstd_rust is an example

#

It should be either or, not both

limber wedge
#

ye i didnt think about the fact that you cant turn it off that is for sure dumb lol i will remove it

#

or if you have time feel free to do it im busy the next few days

atomic ravine
#

when trying to run our game with bevy build web -U multi-threading I get this error

thread 'main' (3205289) panicked at /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasm-bindgen-cli-support-0.2.106/src/interpreter/mod.rs:209:17:
__rustc[dde6fad95d619c59]::rust_begin_unwind: Condition failed: `address % width == 0` (4 vs 0)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: failed to run wasm-bindgen, trying to find automatic fix...
error: command `wasm-bindgen --no-typescript --out-name bjam --out-dir /home/user/bjam/target/wasm32-unknown-unknown/web --target web /home/user/bjam/target/wasm32-unknown-unknown/web/bjam.wasm` exited with status code exit status: 101

interestingly, when I add --release everything builds without errors but when I try running the result in the browser (either with bevy run or uploading to itch with SharedArrayBuffer support enabled), the page errors out with

bjam.js:2481 Uncaught TypeError: [object Int32Array] is not a shared typed array.
    at Atomics.waitAsync (<anonymous>)
    at imports.wbg.__wbg_waitAsync_8afec80ffd213eca (bjam.js:2481:29)
    at bjam_bg.wasm:0xff8bca
    at bjam_bg.wasm:0x139878b
    at bjam_bg.wasm:0x1cc2766
    at bjam_bg.wasm:0x1d80aca
    at wasm_bindgen_87e90c97c2bdaa7b___convert__closures_____invoke___wasm_bindgen_87e90c97c2bdaa7b___JsValue_____ (bjam.js:316:10)
    at real (bjam.js:232:20)

any pointers would be appreciated

shrewd monolith
limber wedge
#

Yea definitely update the cli version otherwise newer wasm-bindgen versions cause problems

atomic ravine
limber wedge
atomic ravine
#

that did it! thank you all, now my build isn't crackling woo!

pale viper
#

Yeah, I figured we were talking about different things when you pushed 7517b24

limber wedge
pale viper
karmic musk
foggy basin
foggy basin
#

Should we create separate, new design documents for each of these goals?
From what I have gathered so far, cart wouldn't be a fan of upstreaming everything in one go.
In that case, I think it makes sense to capture the motivation, problem space and what's implemented in the prototype in a fresh design document dedicated from the particular goal.
Then it's easier to onboard new contributors and to tackle each goal separately (and hopefully faster in the end)

limber wedge
#

i personally think we have quite a lot already for cart to look at so i rather wait his initial feedback and then go from there

snow linden
#

Hello, I would like to pitch in for the "CLI Web App Building" goal

#

anything need doing?

#

Seems like it's lacking a design document.

rocky oxide
snow linden
#

I'd love to help with this. I have some expirence with building for the web and design doc writing, but probably can't do it all on my own.

rocky oxide
# snow linden I'd love to help with this. I have some expirence with building for the web and ...

The points I want are:

  1. Why is this needed? Why do we care about web and why is it hard to build for web?
  2. What (rough) steps would this tool do?
  3. Why should we ship this as a CLI? What alternatives exist?
  4. How should that CLI be structured and built?
  5. Future work: how might this be extended? Will we eventually care about supporting other complex-to-build platforms with this same tool? What about just building for standard platforms?
foggy basin
#

So do we want a separate design document for the three CLI goals?

foggy basin
snow linden
foggy basin
#

Sure! it's late for me now, but let's talk about it tomorrow :)
(Or, if you already have something in mind feel free to DM me already and I'll get back to you later)

analog fern
#

bevy_cli

#

I've left this as a single working group for now, as it has shared culture and history. May split things out over time if that seems valuable

limber wedge
#

And not that important just now but i think maybe switching away from the derive to the functional approach in clap could reduce our code duplications a lot

foggy basin
foggy basin
pale viper
limber wedge
#

Yes and i would imagine that the big cost can be cached

pale viper
#

We might be able to make them share a target directory? Though the target lock might reduce test parallelism

pale viper
limber wedge
#

Yes you can mix derive and builder iirc

foggy basin
rigid bluff
#

I get the same message when trying to run bevy run web.

Anyone know a fix ?

limber wedge
#

You have to enable the wasm_js feature for getrandom


[target.'cfg(all(target_family = "wasm", any(target_os = "unknown", target_os = "none")))'.dependencies]
getrandom = { version = "0.3", features = ["wasm_js"] }
vast vine
#

wasn't that something that the cli was supposed to automatically do?

limber wedge
#

No we do not set the feature automatically because thats not that easy iirc

#

We set the rustflags and there should be a code suggestion that we provide

foggy basin
# vast vine wasn't that something that the cli was supposed to automatically do?

Unfortunately you can't do it for transitive dependencies without modifying Cargo.toml
And there were strong opinions against modifying Cargo.toml automatically (and I still think this is a good decision)
As Lil said we automatically handle the rustflag that needs to be set in addition to the feature and we provide means to automatically enable features for web builds when needed

#

I originally tried an approach to automatically activate the feature via --config flags, but unfortunately there are some differences on how --config behaves compared to manually modifying the Cargo.toml

vast vine
#

Right, that makes sense, I guess I had misunderstood what it was doing

foggy basin
#

That's fair, maybe it is not well communicated.
And originally, handling everything automatically was the plan

#

I just wish we had a dedicated wasm32-web target, it would make a lot of things easier

vast vine
#

tbf, I've just been using it for a while and haven't really looked at the docs in a long time so that's definitely on me

foggy basin
vast vine
# foggy basin Nobody looks at docs for CLI tools. If it doesn't explain itself, it's a bug in ...

So, here's a test case for you that I can't figure out. We recently merged examples/large_scenes/bevy_city in bevy. It uses rand 0.10. I'm trying to use the cli like this bevy run --release -p bevy_city --features bevy/webgpu web Which first gave me the instructions about adding the cfg block, but it suggested me the version for getrandom 0.2. I added it to the cargo.toml of bevy_city and now I get

error: could not compile `getrandom` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
warning: failed to run cargo, trying to find automatic fix...
error: command `cargo build --config profile.web.inherits="dev" --config profile.web-release.inherits="release" --config profile.web-release.opt-level="s" --config profile.web-release.strip="debuginfo" --package bevy_city --features bevy/webgpu --profile web-release --target wasm32-unknown-unknown` exited with status code exit code: 101
#

I tried adding the snippet you shared just above for getrandom 0.3 and it also didn't work

#

and if I use cargo tree I apparently have 3 versions of getrandom 🙃

#

All I did was add latest rand to that specific example

#

@silk delta ^ (IIRC you wanted to be pinged on anything rand/getrandom related)

#

So yeah, not sure how to fix it and what the cli could do to help here

silk delta
#

@vast vine rn, there will be three versions of getrandom for bevy, but there is movement to see ring move to v0.4 at some point (ring is on v0.2) and winit dropping ahash next version means it will no longer need v0.3

#

But lots of things in the ecosystem might reference some version other than the latest

molten merlin
#

no idea if it will work for you though... I was able to get my jam entry down to 2 getrandoms and configured 0.4 through bevy_rand and 0.3 manually

limber wedge
#

there used to be an issue that made you depend on a specific wasm-bindgen version

#

iirc if you update to the latest main branch examples should work and this issue shoudl be gone

vast vine
vast vine
# molten merlin there's a section in the docs that tries to cover multiple getrandoms: https://t...

Okay, so, I had to do this for it to work

[target.'cfg(all(target_family = "wasm", any(target_os = "unknown", target_os = "none")))'.dependencies]
getrandom = { version = "0.3", features = ["wasm_js"] }
getrandom_02 = { version = "0.2", features = ["js"], package = "getrandom" }
getrandom_04 = { version = "0.4", features = [
  "wasm_js",
], package = "getrandom" }

Essentially, I just copied what your link does and added it for 0.4

limber wedge
vast vine
#

Alright, well, it compiled but I'm hitting an unreachable 🙃

foggy basin
sand plover
vast vine
shrewd monolith
#

Okay I put together a little PR that provides a loading bar for the default HTML template. I really felt the lack of a proper indicator this jam, with lots of games taking long enough for me that I snooped the browser console to make sure nothing went wrong!

Obviously the effort here is going to be focused on upstreaming with the new goals, but I just wanted to get the ball rolling.

foggy basin
#

I think the issue is two fold: (1) no sense of progress with the loading indicator so you don't know how long it's supposed to take and (2) no proper error handling, so a long loading screen can also mean that something is broken

shrewd monolith
#

A followup I'm interested in doing is catching and displaying Rust panics, which I may have mentioned before. It should be possible, since panics will generally end up throwing an exception.

foggy basin
#

I tried both before (loading progress and displaying rust errors) but didn't find a good solution yet, so I'm happy to accept PRs for both!

foggy basin
#

One thing I wanted to do for a long time now is to split some things from index.html into smaller JS files that are imported, sort of as a "library". And then have a bevy init web command that copy pastes the default files into a web folder. That way a user could more easily customize our defaults while having access to some nice utilities for better user experience

shrewd monolith
foggy basin
#

In general, the bundling story is the weakest point of the web CLI prototype IMO.
That's something I want to mention in the design document as well.
Including the Bevy app in a larger web application is a pain with the current state of things

silk delta
#

One thing I'm going to try with bevy_rand is have the wasm_js feature apply to all getrandom versions. If I can have this work, then perhaps it will simplify things greatly for configuring Web WASM. If someone wants, once I push the branch, they could test it with their setup and confirm that it works

silk delta
#

Here is the PR, which should provide the necessary enablement without needing to stuff your Cargo.toml with lots of config

silk delta
#

Bah, it doesn't have the effect I want. I'll just have it work as part of a compat feature, but otherwise, some cargo toml config still required for transitive deps :<

twilit dew
#

friends, the CLI is running into an oops on my side (bleeding edge as always cooltofu )

#

I'm compiling for webgpu with

[package.metadata.bevy_cli.unstable]
web-multi-threading = true
#

and it works, as long as I don't have a global ~/.cargo/config.toml

#

gives me

twilit dew
#

update2: removing these lines fixes it

    "--cfg",
    "web_sys_unstable_apis"
#

hmm I guess the target-features are also no longer needed

twilit dew
pale viper
#

Maybe @foggy basin has an idea?

trail shale
#

so... either pin web-sys and know that it will break for more people later on while you're stuck on old versions, or report an issue to them 😄

#

but it's part of web_sys_unstable_apis and I think those don't follow semver, so you may be out of luck there

twilit dew
#

why would they do that in a patch ;-;

#

even if it's unstable

trail shale
#

I don't speculate on other large project maintenance practices, we all have our own issues... but yeah no semver for you here

foggy basin
#

Did we change anything here?

limber wedge
#

No but building with the newest wasm-bindgen version only works when you are using main

#

Due to the new required linker args iirc

neat oasis
#

Hello, trying to allow a lint for a specific struct, but running into an extra warning:

I got code like

#[derive(Debug, Message)]
pub struct ModLoadErrorMessage(pub Report);

and I get the suggestion from bevy lint:

warning: defined a message without a `Reflect` implementation
  --> game/src/mods.rs:58:1
   |
58 | pub struct ModLoadErrorMessage(pub Report);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: `Message` implemented here
  --> game/src/mods.rs:56:17
   |
56 | #[derive(Debug, Message)]
   |                 ^^^^^^^
   = note: requested on the command line with `-W bevy::missing-reflect`
   = note: this warning originates in the derive macro `Message` (in Nightly builds, run with -Z macro-backtrace for more info)
help: `Reflect` can be automatically derived
   |
58 + #[derive(Reflect)]
59 | pub struct ModLoadErrorMessage(pub Report);
   |

I can't implement reflect for this message because Report is external non-reflect, and it wouldn't be useful to reflect it anyway, so I tried to ignore it by following the docs:

added #![cfg_attr(bevy_lint, feature(register_tool), register_tool(bevy))] to my main.rs, and put #[cfg_attr(bevy_lint, allow(bevy::missing_reflect))] on my struct like so:

#[derive(Debug, Message)]
#[cfg_attr(bevy_lint, allow(bevy::missing_reflect))]
pub struct ModLoadErrorMessage(pub Report);

it silenced the reflect warning, but instead a new warning appeared:

warning: allow(bevy::missing_reflect) is ignored unless specified at crate level
  --> game/src/mods.rs:57:29
   |
57 | #[cfg_attr(bevy_lint, allow(bevy::missing_reflect))]
   |                             ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default
#

I can confirm that the bevy lint processes the attribute, because if I do deny the warning (#[cfg_attr(bevy_lint, deny(bevy::missing_reflect))]) I both get a warning about an unused attribute as well as an error for denied lint:

warning: deny(bevy::missing_reflect) is ignored unless specified at crate level
  --> game/src/mods.rs:57:28
   |
57 | #[cfg_attr(bevy_lint, deny(bevy::missing_reflect))]
   |                            ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default

error: defined a message without a `Reflect` implementation
  --> game/src/mods.rs:58:1
   |
58 | pub struct ModLoadErrorMessage(pub Report);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |

So I assume it's the cargo not recognizing the attribute somehow?

neat oasis
#

system info:

rustup 1.28.2
cargo 1.93.0 (083ac5135 2025-12-15)
bevy 0.1.0-dev
bevy_lint v0.6.0
---
Fedora Linux 43 (KDE Plasma Desktop Edition) x86_64
Linux 6.18.12-200.fc43.x86_64

stable toolchain

rocky oxide
foggy basin
pale viper
neat oasis
#

will try with cargo install --git https://github.com/TheBevyFlock/bevy_cli --branch missing-reflect-crate-level-only --locked bevy_lint

#

huh, can't compile bevy_lint with this command even after rustup default nightly

limber wedge
#

Would be a neat feature to build the linter from branches too instead of only releases and main

limber wedge
neat oasis
#

yeah, this works

#

I no longer get a warning about unused attr

limber wedge
#

🥳

pale viper
neat oasis
#

nice, thanks!

halcyon saddle
#

Hi all, please redirect me if needed. I've been trying to improve my web targeting story in a multithreaded app. I have the mainline bevy_cli from a few days ago, am using bevy r web -U multithreading along with the cargo web-multi-threading = true flag, have the nightly toolchain, etc... project builds and launches, and bevy_seedling works, but std::thread::spawn still panics.

So, in what sense is multithreading actually supported in bevy_cli? I tried building for wasm32-wasmp1-threads but js_sys doesn't exist for it...

I see that bevy_seedling doesn't even seem to launch threads in wasm32 builds. It uses "contexts" instead which seem to tie in with the bevy project template's wasm/restart-audio-context.js.

So... what big chunk of get-a-clue-about-web-dev am I missing here? Do I need to make a "context" instead of a thread?

shrewd monolith
#

std::thread::spawn cannot be used as a means to spawn threads on the web.

#

bevy_seedling runs audio on a separate thread — that of the web audio graph

#

If you want arbitrary threads, look into web workers

#

they behave essentially like OS threads, but the process of creating them is different

#

there are a few crates floating around that abstract over them, such as gloo_workers i believe

#

(though note that gloo is basically abandoned, so might not be the best to rely on)

halcyon saddle
#

OK, that's the clue and it answers my question. Thanks!

rigid bluff
#

Hello, since compile times are one of the major pain points of bevy and rust in general, I am very interested in the potential of this issue: https://github.com/TheBevyFlock/bevy_cli/issues/213

Is there an idea of how it would work and what it should include ? Maybe a stepping stone ?

GitHub

Add a new command (e.g. bevy fast-compiles) to guide the user through the process of improving compile times. It should be interactive, asking the user about their preferences. At the end, the user...

limber wedge
#

imo there is no clear winner for all platforms so this would just lead to a lot of code for something that is imo best documented or just part of a template. i use @twilit dew 's config that he shared once:

# Yoinked from: https://github.com/janhohenheim
[unstable]
codegen-backend = true

[profile.dev]
# Compile using cranelift for massively faster compilation
codegen-backend = "cranelift"
# If you want to attach a debugger, set this to true
debug = "line-tables-only"

# Consider compiling deps with cranelift if you want cold-compilation to be faster
[profile.dev.package."*"]
codegen-backend = "llvm"

# cranelift is `panic = abort`, so you need to compile with llvm to get `#[should_panic]` working
[profile.test.package."*"]
codegen-backend = "llvm"

# Disable cranelift for release profile
[profile.release]
codegen-backend = "llvm"

# cranelift cannot build wasm32-unknown-unknown out of the box
[profile.web]
codegen-backend = "llvm"

[target.x86_64-unknown-linux-gnu]
rustflags = [
    # Compile faster
    "-Zshare-generics=y",
    "-Zthreads=8",
]
rustdocflags = [
    # Compile faster
    "-Zshare-generics=y",
    "-Zthreads=8",
]

[target.wasm32-unknown-unknown]
rustflags = [
    # Improve performance
    "--cfg",
    "web_sys_unstable_apis",
    "-Ctarget-feature=+sign-ext,+nontrapping-fptoint",
    # Compile faster
    "-Zshare-generics=y",
    "-Zthreads=8",
]
rustdocflags = [
    # Compile faster
    "-Zshare-generics=y",
    "-Zthreads=8",
]
``` and that works really really well for me (linux).
halcyon saddle
# limber wedge imo there is no clear winner for all platforms so this would just lead to a lot ...

BTW, if you integrate this, please amend this to:

[profile.'not(cfg(target_os = "macos"))'.dev]
codegen-backend = "cranelift"

since cranelift is broken on macOS nightly (https://github.com/bevyengine/bevy/issues/20785)

GitHub

error: #[link_section = "__mod_init_func"] is not supported: unsupported section type mod_init_funcs error: could not compile bevy_reflect (lib) due to 1 previous error Bevy version and...

rigid bluff
rocky oxide
opaque anvil
foggy basin
# rigid bluff Hello, since compile times are one of the major pain points of bevy and rust in ...

I still think this would provide value.
Compared to a project template, it offers multiple advantages:

  • Interactive (you can e.g. ask the user if they want to work with stable or nightly)
  • User-wide configuration instead of project-wide configuration. Not everyone can / wants to install a custom linker, so a project config which would enforce that would prevent those people from using the project effectively.
  • Automatic tool setup. E.g. installing the nightly toolchain, installing cranelift, installing mold/wild
rigid bluff
#

I agree, we should start small with perhaps only nightly setup, then build upon it with more capabilities

foggy basin
#

First iteration could just apply @twilit dew's config, as that seems to be the current state of art (at least for Linux).
We would need to think about questions like what we do if a config already exists, e.g. overwrite / merge.
Then in later iterations we could add the interactive questions and automatic tool installation.

#

Personally, I would happily accept such contributions. Just keep in mind, when upstreaming this might not be in scope or there might be vastly other opinions on how to do this by the maintainers

limber wedge
#

Im not opposed to it i am just concerned that it adds a lot of maintenance burden on us. We constantly need to monitor all these options to check that we still install / configure them correctly and i imagine that the users who can make the interactive decisions already use / know how to do this / have their own preferences.

#

Imo we should focus more on how to configure bevy for these use cases (dyn linking for example)

foggy basin
# limber wedge Im not opposed to it i am just concerned that it adds a lot of maintenance burde...

I think right now the maintenance burden is actually higher.
When there is a new compile configuration that's faster, we have to change the config in every template and users have to manually copy them into their old projects / user config.
With a dedicated command, we can just update it once in the CLI and then users can just run the command again to update.
Templates wouldn't need to include it at all, since the user configuration applies to all Bevy projects

foggy basin
foggy basin
limber wedge
foggy basin
limber wedge
#

Tho i guess we could start easy (just choosing nightly or stable) since there used to be discussions about web requiring nightly anyway

foggy basin
#

One good thing is that it could be nicely isolated, so it could be upstreamed completely independently of the other stuff (or not at all if it doesn't turn out to work well)

#

I do like the vision for the onboarding of new users though,
Instead of "install nightly, copy this random file to this location, remember to comment out/on these lines depending on your setup" you can just say "run bevy init fast-compiles"

limber wedge
#

bevy init slow-compiles ferris_spooky

#

Yea that would be nice. Maybe worth just checking how it feels

#

And how stable it is

foggy basin
#

I see your points though. Maybe worth to check the opinion of maintainers / other contributors first.

twilit dew
twilit dew
foggy basin
silk delta
#

So can be situational

opaque anvil
vague brook
#

btw shouldn't "-Zthreads=8", be =0 for auto-detection of the system available parallelism ?

foggy basin
#

Jan's config is for a high-end system though so we might need to make adjustments for a general purpose config

limber wedge
#

yes 100% this is just the config i saw once, possible that its not even up to date. Was more ment as an idea not that we should 100% use that

foggy basin
twilit dew
twilit dew
#

Worth noting I use the same config on my crappy university computer

foggy basin
#

@shrewd monolith I'm very sorry, I totally missed your replies on the loading indicator PR!
I left a response now :)

trail shale
#

has there been experiments in the CLI to split the wasm file into several smaller ones loaded on demand?

#

dioxus and leptos both do it, but differently I think but didn't look too much into it
leptos add a #[lazy] macro that replaces functions with an async variant that triggers the wasm load on their first call
dioxus split the wasm binary by routes called

#

I'm guessing / hopping we could do something similar to dioxus by splitting by schedules?

foggy basin
#

Sounds like something to do after upstreaming though :)

#

But binary size will definitely need more research I recon. It's quite bad right now

trail shale
#

or sounds like something highly experimental that would be better tried out of tree 😄

#

but yeah, it depends if it needs changes in Bevy itself

#

I don't know

#

the leptos way would need Bevy changes, not sure about the dioxus way

#

as far as I understand it it's

  • build the wasm binary
  • parse it and split it depending on when functions are called
  • add a wrapper that loads the correct bin on demand
foggy basin
#

Interesting that it works on the final wasm binary, that would be quite cool without any code changes.
But I wonder how well that function analysis works for Bevy's architecture

trail shale
#

yup me too

#

I hope there's an easy split between the ecs and renderer init on one side, and all the renderer usage on the other

#

for many things you need the types at init time, but the functions dealing with them only later, like sound playing, image reading, gltf parsing, ...

foggy basin
#

Wasn't there also a problem with dead code analysis, that it's difficult for the Rust compiler to detect what's not used so the binary size is large when you don't disable as many features as possible?
We might have similar problems with this approach

trail shale
#

the issue with dead code analysis is that systems are still in the schedule even if they won't match any entity

#

it shouldn't be an issue if we split by schedule

foggy basin
#

Ah I see

#

How easy would it be to detect schedules in a wasm binary?

trail shale
#

lots of unknowns 😄

#

it's a big experimental project, but it could blow away all issues with wasm binary size if it works

foggy basin
#

Yea definitely sounds high-value, especially if it works "out of the box"

#

I wonder though, what happens when a chunk is not loaded yet when you need it? :D

civic dirge
foggy basin
#

I'll leave it open for a day or so in case someone else also wants to chime in, but looks good to me. Thanks!

limber wedge
#

You are german? @foggy basin

limber wedge
foggy basin
rocky oxide
#

I am particularly interested in feedback from members of this group (cc @twilit dew), as it gives detailed advice on what good project setups look like

foggy basin
snow linden
#

@foggy basin if i'm using the cli to serve a web app, how do i use the https asset loader? what url do i put in?

#

will it host an ./assets directory?

foggy basin
snow linden
opaque anvil
#

I've tested it with the proposed fixes applied and it just works

potent lotus
opaque anvil
#

Should I open a new PR?

potent lotus
#

BD103 is an active user here. I don't want to tag in case your comment on github already pings him but you can tag him and offer to do that ofc

limber wedge
#

I can apply the fixed and merge them today. I think its just rather slow since none of us really uses nix

limber wedge
#

We are all rather inactive since we are waiting on upstreaming in some form

opaque anvil
limber wedge
#

Not recently. Its mostly dependent on Cart and he had more important work to do with bsn! But there exists a goal at least now

karmic musk
karmic musk
karmic musk
#

Is there a way to benefit from the getrandom autoconfig while using a custom profile?

When I run:

bevy build --profile ci web

I get:

info: automatically configuring `getrandom` web backend
info: compiling to WebAssembly...
...
warning: You have to enable the `getrandom` web feature in your Cargo.toml:

The error doesn't happen when I omitted the --profile ci.

limber wedge
#

The issue is that we cannot enable this feature for you and i imagine without this profile another dependency already enables it?

#

We only set the required rustflags

karmic musk
limber wedge
#

but i imagine that your "ci" profile just does not enable the feautre and we do not enable features for you

#

(since this can not be done via cli flag)

karmic musk
karmic musk
#

I tried to make ci inherit it too, but no dice:

$ bevy build --config 'profile.ci.inherits="web"' --profile ci web -v
info: automatically configuring `getrandom` web backend
info: compiling to WebAssembly...
debug: running: `cargo build --config profile.web.inherits="dev" --config profile.ci.inherits="web" --profile ci --target wasm32-unknown-unknown`
debug: with env: RUSTFLAGS= --cfg getrandom_backend="wasm_js"

Also tried --config 'profile.ci.inherits="dev"' but no dice either.

limber wedge
#

most the time this happens if you dont use some crates in this profile. Most likely one of your dependencies enables this feature that is not used in ci

#

is the repo public?

karmic musk
karmic musk
limber wedge
#

let me check!

limber wedge
karmic musk
#

with the --profile ci?

limber wedge
#

are you using cranelift?

limber wedge
# karmic musk Yeah reproduced this with the `bevy_new_2d` template: ```bash $ bevy new -t 2d r...

i use this config.toml ```toml

Yoinked from: https://github.com/janhohenheim

[unstable]
codegen-backend = true

[profile.dev]

Compile using cranelift for massively faster compilation

codegen-backend = "cranelift"

If you want to attach a debugger, set this to true

debug = "line-tables-only"

Consider compiling deps with cranelift if you want cold-compilation to be faster

[profile.dev.package."*"]
codegen-backend = "llvm"

cranelift is panic = abort, so you need to compile with llvm to get #[should_panic] working

[profile.test.package."*"]
codegen-backend = "llvm"

Disable cranelift for release profile

[profile.release]
codegen-backend = "llvm"

cranelift cannot build wasm32-unknown-unknown out of the box

[profile.web]
codegen-backend = "llvm"
``` so this fails for too. but this is because i dont override the codegen-backend for the ci profile

#

so if i add [profile.ci] codegen-backend = "llvm" it compiles

karmic musk
#

what is especially dumb of me is that I know that cranelift doesn't support wasm and I still put profile.ci.codegen-backend = "llvm" in my config for some reason 🤦‍♂️🤦‍♂️ 🤦‍♂️

karmic musk
limber wedge
#

Hahaha happens. I think maybe a —v flag for extra verbosity could be useful for these cases where we also print the complete config so its easier to compare

#

But glad it works now!bavy

rocky oxide
#

cc @vast vine lol

#

We've discussed this before here

vast vine
#

Yeah, I'm not surprised lol. It was easier than I expected to get that prototype working. It's more general purpose than bevy though so I was planning on keeping this standalone

limber wedge
vast vine
#

ah TIL

karmic musk
karmic musk
halcyon saddle
#

Just wanted to drop a note -- thanks for this tooling! It makes webgpu testing a lot easier!

opaque anvil
#

Are there any plans to integrate subsecond into bevy_cli?

rocky oxide
foggy basin
# opaque anvil Are there any plans to integrate subsecond into `bevy_cli`?

We have an issue for it, but no progress so far. Back then it was put on hold.
https://github.com/TheBevyFlock/bevy_cli/issues/451#issuecomment-2932348363
I assume it's something for post-upstreaming

GitHub

See https://github.com/janhohenheim/bevy_simple_subsecond_system for context, as well as the new hotpatching workgroup A simple idea would be to allow bevy run --hot-patched. Considering that that ...

opaque anvil
foggy basin
twilit dew
#

Wizards, can you fact check this?

#

And this

#

I bet one of you has lurked deep enough in the compiler to know :p

limber wedge
#

well you can yea but im not sure if you will have fun doing this

earnest gate
#

don't think member order is a breaking change

quick kayak
#

most of it already exists, there's just a few small things about name res that need to change

civic dirge
#

multiline inline tables seem to break the bevy cli thonk they work fine with cargo now though

> bevy run web --verbose
debug: running: `cargo metadata --format-version 1`
debug: using defaults from bevy_cli config:
       features = ["dev"]
       default-features = false
       headers = []
       rustflags = [
           "-Zshare-generics=y",
           "-Zthreads=8",
       ]
error: failed to parse workspace manifest

Caused by:
    TOML parse error at line 2, column 9
      |
    2 | bevy = {
      |         ^
    newlines are unsupported in inline tables, expected nothing
foggy basin
civic dirge
#

yeah it is

foggy basin
#

Can you create an issue for it?

civic dirge
#

sure gimme a sec

rocky oxide
#

I think that this loosening of restrictions would be useful for assorted features of the bevy_cli in the future, and may allow us to operate purely on stable Rust toolchains?

#

I'm not 100% clued into the exact details of this subsystem though, so I would appreciate your expertise here

foggy basin
#

Hmm not sure yet if this also enables stuff like rebuilding std, which we need for the wasm stuff. Definitely worth an investigation though, sounds promising!

limber wedge
foggy basin
limber wedge
civic dirge
#

oh my bad then

pale viper
#

Thanks for reaching out, though!

#

(Also hi everybody, I'm so sorry for being absent for so long! I hope you all are having a good summer :)

foggy basin
#

https://blog.rust-lang.org/2026/05/28/Rust-1.96.0/

WebAssembly targets no longer pass --allow-undefined to the linker which means that undefined symbols when linking are now a linker error instead of being converted to WebAssembly imports from the "env" module. This change prevents modules from linking unless all linking-related symbols are defined to catch bugs earlier and prevent accidental issues with symbol naming or similar.

Wow I remember hitting this case, it was very annoying to debug. Good change

tardy cove
#

is there any way to specify the version of wasm-bindgen cli to use? Nix only has up to 0.2.114 but bevy cli is asking for 0.2.122

foggy basin
#

So your only option is probably to use an older version of Bevy that uses the wasm-bindgen version you need