#bevy_cli
1 messages · Page 3 of 1
adding similar functionality than cargo bless would be nice too
what is #![deny(bevy::zst_query)] doing in the lint tests ? tests/ui/zst_query/query.rs
I'm trying to test the linter I wrote, but it's not producing anything. I registered the linter and added it to the slice lints in LINTS. I've debugged it and verified that it does indeed call span_lint_and_help, but still nothing. FAILED TEST ... test got exit code status: 0, but expected 1
The only thing I can see that might be different is that I haven't added #![deny(bevy::sus_resource)] (just a temporary name for now), because it says :
3 | #![deny(bevy::sus_resource)]
| ^^^^^^^^^^^^^^^^^^ Warn: unknown lint: `bevy::sus_resource`
Eh the deny is so it produces errors and not warnings
So it checks the .stderr file
Yes
This is the problem
Yea seems like something is not working with registering the lint correctly. Im on phone but maybe i could take a quick if you have a link
Do you have both the declare lint / declare lint pass and registered them both?
cargo dev new_lint --name=foo_functions --pass=early --category=pedantic (category will default to nursery if not provided)
Does this command work for bevy_lint ?
No i dont think it does maybe BD103 can confirm but we haven’t implemented/ migrated any of the dev tools that clippy has
Like this^
src/lints/sus_resource.rs :
declare_bevy_lint! {
pub EVENTS_RESOURCE_SYSTEM_PARAM,
RESTRICTION,
// FIXME: Better note.
"use of bad system parameter",
}
declare_bevy_lint_pass! {
pub EventsResourceSystemParam => [EVENTS_RESOURCE_SYSTEM_PARAM.lint],
}
src/lints/mod.rs :
pub(crate) static LINTS: &[&BevyLint] = &[
sus_resource::EVENTS_RESOURCE_SYSTEM_PARAM,
...
]
...
store.register_late_pass(|_| Box::new(sus_resource::EventsResourceSystemParam::default()));
Ok I fixed it
it uses the name provided in the macro as the linter name thing
So what do I do when I think the lint is finished ? I'm considering just leaving my bad names and error messages and just letting whoever reviews the PR to tell me what would be the most apporiate messages / lint level
If your lint fixes an open issue you could reference that in the PR otherwise just create a PR with a short description what the lint does / should prevent. I would still try to name it properly, the reviewers can still rename it but chance is that it fits. And it helps the reviewers aswell understand the purpose better.
I feel like I may have no understood the issue, but not sure how else I could have interpreted it
No worries! Congrats on your first PR to the linter and thanks so much for the effort 
Can I try porting some clippy dev tools ?
A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/ - rust-lang/rust-clippy
my environment has rustup and cargo, but i've never been able to cargo +[toolchain], so whatever hardcoded cargo +toolchain command is in bevy_lint doesn't work; i'm going to try figuring out if there's a specific way of configuring cargo that allows this, but surely there should be some easier workaround
i'm pretty sure i got it working with env RUSTC_WORKSPACE_WRAPPER=/home/gigamicro/.cache/cargo/bin/bevy_lint_driver rustup run nightly-2025-01-09-x86_64-unknown-linux-gnu cargo check, but i can't actually verify since it didn't detect anything...
are there any test cases i can check if it's working with?
Not sure I understand the issue 100% but the bevy linter at the moment requires you to have cargo installed via rustup: https://github.com/TheBevyFlock/bevy_cli/issues/194
If you want to test if the bevy linter works you could take a look at the tests, for example: https://github.com/TheBevyFlock/bevy_cli/blob/main/bevy_lint/tests/ui/main_return_without_appexit/main.rs
Hi! Thanks for the interest, but for now I want to avoid adding any dev tools like that
I feel like it starts to add unnecessary complexity that could easily break, which makes it a lot harder to maintain in the future
I have no objection to adding Cargo aliases, though, so I wouldn't mind a cargo bless shortcut for cargo test --test ui -- --bless.
As @limber wedge said, it looks like Rustup's cargo proxy isn't on your path. If you're on Linux / MacOS, could you run which -a cargo to find where your Cargo is installed?
It should return ~/.cargo/bin/cargo, but maybe yours is different
it's ~/.rustup/..toolchain../bin/
Are you planning to release a changelog for bevy_cli?
i always just used rustup toolchain install but maybe what you want to do is ```sh
$ rustup toolchain link my-toolchain <path_to_toolchain>
$ rustup override set my-toolchain
Started packaging the tool for NixOS ❄️ c:
I think it makes sense to keep track of it after the 0.1 release, perhaps in a simple CHANGELOG.md
Hm, that's really weird. I opened https://github.com/TheBevyFlock/bevy_cli/pull/264, which switches the linter to use rustup run directly instead of cargo +TOOLCHAIN. Would you mind checking out the changes and letting me know if it works for you?
If you need help with building the linter locally, just let me know :)
Feel free to steal the changelog format bevy_lint uses if you do!
compiles, runs, but doesn't seem to lint anything special
for reference, i'm on a bare arch linux install with rustup via pacman and symlinks /usr/local/bin -> /home/gigamicro/.bin/ (unsafe ik) and /home/gigamicro/.bin/cargo -> /home/gigamicro/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo
Many lints are disabled by default, so I’m not surprised. Either way, glad that fixed it!
it acts the same as my solution here
Is it planned to ship bevy_lint directly with bevy_cli in the future?
Not sure if this is a desired feature. Feel free to close this if it's not the case
For me personally yes(in some sorts). Many lints are aimed to help beginners so it should be made as easy as possible to get the linter up and running. Its just not something that is currently planned for 0.2 or 0.3. (of the linter). I think we first need to figure out how we want to support different versions of bevy before tackling that issue.
Do we wanna add the Web doc here: https://hackmd.io/cCHAfbtaSviU_MDnbNHKxg ? (sorry just wanted to check if i can edit ^^). If so should i rewrite https://hackmd.io/cCHAfbtaSviU_MDnbNHKxg#So-what-might-it-do to what it does instead?
Yes I suppose we can reuse that document!
Or add a new section about the prototype
sure will do!
Sorry I have been quite busy the last week
no worries!! Just trying to help you out with the last (often not as fun) things ^^
wrote / mostly copied some of the section from the readme so we have a basic overview in the hackmd
sorry for the delay, busy irl. did a first pass now :)
Very good feedback, thanks!
I will adjust the PR as soon as I have time
having thought about it a bit more, i'd ideally want this PR to limit behavioral changes, and any small behavioral changes that remain should be configurable by a user somehow
for example, overriding the default index.html provided by bevy CLI (e.g. user can pass --html path/to/index.html to bevy CLI, or else it'll look for a web/index.html or wasm/index.html, and if none of those are found, it'll use its own default index.html)
also i'd want there to be an easy way for a user to find out exactly what bevy run and bevy run web etc. do, so they can switch off bevy CLI for more control / flexibility
i haven't been keeping up much with bevy CLI development and a lot has happened, so these things might already exist
this isn't a hard blocker though, if we prefer to merge first and iterate later. there's time before the next bevy jam, which is when bevy_new_2d sees the most use
Yes, you can provide a web/index.html file yourself :)
Agreed. For example, we could log the commands we execute when using a --verbose flag, that's what trunk does right now
No worries, I can also work a bit more before we merge it.
This integration also highlights some weak points with the prototype right now, so its good to have that feedback
Yea that makes sense.
Part of it is limitations of the prototype, but part of it is on me. For example, the profile configuration can already be adapted to work as we had it previously. I'll implement it as soon as I have the time
While I’d love for this to be the case, the linter has some extra requirements that makes it more challenging to install than the CLI
Right now the CLI provides the bevy lint command, which is a shortcut for calling the bevy_lint executable if it is installed
In the future I think it would be great if the CLI supported installing the linter for you, but I think it might be really difficult to install them both at the same time
Who knows, though! I’d be happy if it turns out to be possible :)
So, I tried installing the linter, but when I invoke it, it complains of a missing dll
I think setting up the CLI to work with cargo binstall will be nice, the web stuff also takes quite long to install so having pre compiled binaries will be a nice boost
Did you install the rustc-dev and llvm-tools-preview components for the Rust toolchain? (Installation instructions)
bevy_lint is a custom linter for the Bevy game engine, similar to Clippy.
I did
But i think it will definitely worth it. I would already be happy if the CLI helps you install it. (As most „support“ requests are about the installation)
Could you share what error message you're receiving? I'm assuming you're on Windows
Will do when I get home
If it's easier, please consider opening an issue on Github. Those are more discoverable and allow for long-term conversations
error: process didn't exit successfully: `\\?\C:\Users\joaqu\.cargo\bin\bevy_lint_driver.exe C:\Users\joaqu\.rustup\toolchains\nightly-2025-01-09-x86_64-pc-windows-msvc\bin\rustc.exe -vV` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)
Check failed: exit code: 101.
Plus a popup window complaining about a rustc-driver-<jibberish>.dll being missing
I managed to reproduce the error locally, though I'm still trying to figure out why it happens
I opened this issue to track what I find!
I followed the installation guide on Windows, but running the linter throws an error: $ bevy_lint error: process didn't exit successfully: `\?\C:\Users\USER.cargo\bin\bevy_lint_driver.exe C:...
Thanks 😄
@pale viper if you have time and feel like it feel free to add / fix the missing lints: https://github.com/TheBevyFlock/bevy_cli/pull/263 since its one of the last few open issues for 0.2.0. i just started once and will try to finish it this weekend.
Yup! I saw it, but probably won't be able to help until the beginning of next week
I'm just about finished with reviewing the Cargo lint infrastructure in #185, so I'm hoping to wrap that up by the end of today
I may remove #263 (the macro one) from the v0.2.0 release milestone, since Cargo lints and the Windows issue are higher priority for me, but I'll let you know
For now, I'm still hopeful I can get it reviewed before the end of February, since that's my hard-deadline for v0.2.0 :)
O yea sure no worries! Should probably be done until the beginning of next week but yea its a lot of review work for you
Hah, I try my best! Thankfully we don't have too many (if any) users at this point, so any pressure I put on myself is purely artificial
Reviewing is not my strong suit, but it's the least I can do considering the time you take to help :)
Yea always important to remind yourself that other things have priority!
Yea mine neither i value your input/ ideas a lot so dont feel bad for criticizing stuff ^^ always a good opportunity to learn!
Is there a list of the available bevy_lints somewhere?
All lints offered by bevy_lint.
There’s a few other things on the website as well that you may find useful :)
ah nice, this should get linked prominently in the README I think 🙂
ah ok, it seems like panicking_methods can not be specified in a Cargo.toml (but the sub-rule panicking_query_methods can)
[package.metadata.bevy_lint]
missing_reflect = "warn"
panicking_methods = "deny"
warning[E0602]: unknown lint: `bevy::panicking_methods`
|
= help: did you mean: `bevy::panicking_query_methods`
= note: requested on the command line with `-D bevy::panicking_methods`
= note: `#[warn(unknown_lints)]` on by default
I opened issues for both of those points, thank you!
Can we adjust the first step of bevy build to be opt-in (via --autoinstall flag or something) and make the default behaviour throwing useful error messages?
Auto installing on behalf of the user is not an acceptable default imo.
e.g. I don't even have rustup installed and the command wouldn't work for me at all
You are totally right! Installing should be opt in. if you mean the build web command this should be the case. It should prompt you unless you passed —yes. Could you share the output?
While we don't install anything without asking the user, it's true that the command currently won't work without rustup.
For the first prototype, it was an easy way to detect if the wasm target is installed.
Can you share more info about your setup to check what we can work with instead?
I assume we will later change the command to be optimistic and not perform the check beforehand, instead parsing the error output for the related error messages and only then asking the user if we should install the target via rustup
As a first step, we can add a simple check whether rustup is installed and then just skip the wasm target check.
You will still need to ensure that the target is installed, but then at least you're not completely blocked from using the prototype
I created https://github.com/TheBevyFlock/bevy_cli/issues/272 to track this
@pale viper https://github.com/TheBevyFlock/bevy_cli/pull/263 would be ready but more or less every file had some changes
so feel free to just exclude it from the 0.2.0 milestone as its not that important imo.
Our „own“ NeedlessPassByValue lint would be pretty cool. I really like that lint usually but in a bevy project it has so many false positives that we could hardcode skip the lint for.
Ok! Maybe we hold off for v0.2.1, then :)
I updated the CLI 0.1.0 milestone with a few more tasks to avoid regressions on bevy_new_2d.
Work is currently more stressful so I have less time/motivation to work on this, but I'll keep chipping them away over time.
It might delay the release a bit, but I'd rather have all stakeholders 100% on board with the CLI than rush it through for a release
Hi everyone! It's been a hectic (for me, anyways!) past few days, so I figured I'd recount what I've been working on and what the current plan is for the linter.
First up, I finally finished reviewing #185, @limber wedge's duplicate_bevy_dependencies Cargo lint. (And he's already addressed the changes! 😆) The current plan is to merge it with a few rough corners under the nursery lint group, so people can experiment with it
Second, I opened #276, which is a specification for lint module docs. This should hopefully make it clearer what I look for in documentation, and help keep things consistent
Unfortunately zst_query cannot be moved back to restriction (or another lint group) because I found a fundamental flaw with it while testing, as documented in #279. It still has a bit more work to be done, since it turns out the data yielded by Query<T>s doesn't have to be T, but can be anything depending on T's QueryData implementation
Looking back at the v0.2.0 milestone, we're largely on pace. While technically behind the soft deadline, we still have 1 full week before March, which is the hard deadline where the linter will be released no matter what
I'm confident duplicate_bevy_dependencies in #185 will be merged by then. #167 is lower priority, so if it doesn't make the release than that's fine, though we do have an open PR for it.
#267 is a problem, though, because I'm pretty sure it breaks the linter entirely for Windows. I need to do more testing, but I believe something about rustup run isn't setting up the PATH correctly for bevy_lint_driver, causing it to fail to discover rustc_driver.dll
This is something that probably will block the release, since it likely needs to be fixed before the linter can be incorporated into Bevy's CI (which is the overall goal of this release). If I continue making no progress, I'll try pulling in one of my friends who is more familiar with MSVC and the distilled chaos that is Windows
So that's all! I hope this sheds some light on what I've been working on, and where the linter stands currently :)
Why exactly are we relying on rustup within the bevy_lint crate, btw? I just want to understand /gen
As far as I can tell the reasoning goes:
- you need rust nightly to hook into the compiler features
- rust nightly is too unstable so you pin specific versions of it
- you need to ensure users have that specific version, so you put it in the rust-toolchain.toml and install it in build.rs
- in bevy lint you explicitly call that toolchain via rustup
Is that correct?
I hope you get some time to rest and recharge! Appreciate all your hard work!
Yea this to me is also highest priority. I imagined most users of bevy use windows? My windows machine is sadly so bad that its pretty painful to debug. I found this blow post: https://jyn.dev/rustc-driver/ that looked interesting but didn’t get around to take time and read it carefully
what happens when you run <code>cargo clippy</code>?
we also take heavy use of the clippy utils crate so we need to make sure the nightly version we use matches clippy utils one exactly.
I see, thanks! I'll give that some more thought. Maybe we can just tear that all out and replace it by instructive error messages instead of doing so many things on behalf of the user? Not sure
Yup, really close! The one thing to note is that bevy_lint does not install the toolchain for you, it just errors if that toolchain doesn't exist
It’s a cool blog post! I read it over this morning, and it’s quite useful in explaining how the linter is setup. It is targeted towards Linux, but may still be useful
Is the „allow maintainers to push directly“ or however this option is called on a pr more annoying than helpful?
Hah, yeah.......
Im sorry ^^ will take it out from now
It's not your fault! I tried using git push -f, which looking back was not the right decision
I may have broken your main branch, so you may need to regenerate it on your fork
No worried im gonna throw away that anyway. Working on main on a forked repo seems not a good choice
Rather keep my main in sync and branch off. Makes merging into my pr‘s easier
Yeah. In the future, I'll stick to Github's review suggestion UI for making changes instead of trying to push changes from my computer
Seems a lot safer at the moment 
But its so terrible for how good they could make it 
I've never used anything other than Github, so I wouldn't know
This must be how people who've only used Java Gradle feel
You can probably also request write access to the main repo, given that you're one of its most active contributors :)
Good idea!
@limber wedge invite sent :)
Now instead of working on a fork, you can create branches on the repo itself. You can also merge PRs, but please make sure they have 1 approval first
ohh thanks!!
At some point we should probably add mandatory appprvals again as we near the initial release. With 3 active maintainers I think we should never be blocked for too long on urgent fixes
we should also revisit the CLI e2e tests so we can lower ci time a bit 
How long is it right now? I thought the caching helped already but maybe it's still too high (or I didn't configure it correctly)
I'm also thinking about using the CLi version of wasm-opt instead of bundling it directly. It would be a bit less reliable/configurable, but the compile times are quite harsh
i think the e2e tests take around 45min on windows. But not sure if it also depends on what kind of windows runner you get not too familiar with how Github CI is setup
Hmm yea that doesn't seem right. I think when I added the caching it went back down to 5 min in my test.
Or maybe the PR touched dependencies? Then the cache might be invalidated
But 45 min sounds suspiciously like wasm-opt.
I think using the CLI version will be the way to go, then we can use cargo binstall to install a pre-compiled version and save a lot of time
I think trunk also uses wasm-opt, we can also check how they handle it
a perhaps this was the issue
I fixed bevy_lint for Windows! Turns out rustup run doesn't modify the PATH on Windows by default: https://github.com/TheBevyFlock/bevy_cli/pull/281
I finally had time to finish up my PR for default title for bevy run web:
https://github.com/TheBevyFlock/bevy_cli/pull/273
Awesome, I'll check it out! :)
You are a hero!!
@pale viper Didn't you create a PR to read linter settings from Cargo.toml?
I want to use it as reference to do the same for the main CLI, but I can't find it anymore
Ah nevermind, it's https://github.com/TheBevyFlock/bevy_cli/pull/251!
Should we create a third crate that we can use in both bevy_cli and bevy_lint?
I feel like we're slowly duplicating more and more small pieces of code
Yup, there you go! You'll likely be most interested in config.rs, the rest of the changes in that PR just hook config loading into the rest of the linter
Maybe? But I'm not sure just yet, as introducing a new crate adds a some issues itself (mainly publishing it to crates.io). Also, I think the most code we could share is Cargo.toml discovery and parsing, which isn't that much...
As you work on CLI config, for now just copy-and-paste what you need. If it ends up being a large chunk, then I'd be willing to consider it further!
any strong opinions on logging crates? https://github.com/TheBevyFlock/bevy_cli/pull/282 @foggy basin
Tracing please
I don't think anyone is going to be using the CLI on no_std hardware TBH
The A Maintainer Has Spoken
A maintainer has spoken :p
Hah, good correction, though none of the others peak into this channel :)
As a side note to @limber wedge and @foggy basin, I've switched back on the requirement for a maintainer approval before merging
https://github.com/TheBevyFlock/bevy_cli/issues/283 was the false positive i mentioned earlier today
Question: does anyone object to me deleting the X-Uncontroversial label? It seems pretty pointless, since uncontroversial issues don't need a label in the first place
I've been going through the lint list and our issue backlog, labeling things, which is why I'm bringing this up
The reason it exists in Bevy itself is to explicitly communicate to new contributors who might be missing context that they shouldn't expect resistance
Might be less important here
||also proof that I peak into this channel||
||just, not usefully||
Hey, that was a useful contribution! I don't know what you're talking about >:D
Right, I think you can disable publishing for crates, which is what I would do for a utility crate such as this.
But I'll start with copy-pasting and we can re-evaluate later :)
True, 90% of the CLI is about running external commands, which requires std anyway :D
Small PR to add a warning if JavaScript or canvas isn't supported:
https://github.com/TheBevyFlock/bevy_cli/pull/286
I made rustup optional in the main CLI:
https://github.com/TheBevyFlock/bevy_cli/pull/287
@worn jetty if you have time to test this, it would be highly appreciated. Instructions are in the PR description
You are on fire!
Thanks, I'll give it a look AS soon as I find the time
any idea why this fails https://github.com/TheBevyFlock/bevy_cli/actions/runs/13552104867/job/37878398353
o "System.IO.IOException: No space left on device : '/home/runner/runners/2.322.0/_diag/Worker_20250226-195434-utc.log'"
well a quick guess would be that there's no space left on the runner drive 😄
you only have 14GB available
yea didn't see the big "Annotations" banner at the top ^^
seems cache is messed up on the repo. probably not the only issue, but the caching story is bad
I'm not very familiar with Github Actions, thanks for the hint! will check it out tomorrow.
It should be cleared with cargo sweep, but who knows...
Us using two caches in the tests might also be problematic
I've been looking at this: caches are 2 GB in size, and we restore it twice (one of workspace, one for E2E tests)
So that's 4 GB out of the bat that are taken up per run
They also cache the same things twice (in the ~/.cargo folder), so that may be causing issues
I'm going to delete our entire cache and see if that does anything
Thanks!
I only moved the E2E tests into the tests directory because it looks kind of weird otherwise but if it makes caching that much more complicated we can just move it back again?
right my issue with the cache setup was more that it generates way too many different saves, so probably never share it, so not very useful
and with the volume of cache generated github deletes everything older than 1 day
Yup, but realistically we only need enough space for the most recent job
Sharing a cache between jobs could help with caches not being shared across branches, however
I opened #291 to decrease CI times (and hopefully cache sizes as well). Once the checks finish running, it should be ready to review
Heck yeah, check out these improvements!
HECK YEA! You are a wizard!
CI was one of the first things that I contributed to in Bevy, so it's great to roll back my sleeves and hack it again
Just ignore the diff size 😅
(Though, honestly, cutting out ~16,000 lines of code is probably a good thing)
100%
Out of curiosity, what got you interested in Bevy / this working group?
the community does not seem to like this change
Eh my best friend is learning how to code in university and he wants to make a game. I enjoy rust so i told him i would be in if we use bevy ^^
And the fact that bevy does not yet have an editor was a big plus. As someone who has no idea about game dev they are often kinda overwhelming and i just wanna hack
How about you?
And for the linter i just really enjoy these kind of problems
I first heard about Bevy back when 0.12 was released (back when I was still learning Rust). As I dug a little deeper, I got a strong impression that Bevy was the forefront of game dev in the Rust ecosystem
The other engines at that time, like Piston and Amethyst, were unmaintained, but Bevy was growing and crazy enough that it even found a few bugs in the Rust compiler
I started seriously contributing a year ago, and I've been here ever since! :)
I think that is or used to be a big part of bevy. That devs want to work with rust and make games!
Do you also work with rust at your job or only for fun on the side?
I knew you had some exam stuff
I assumed "senior at university"!
Hah, no! I'm still __
My European brain never understands what high school is
Thats Crazy!
Yeah, it's been a wild ride honestly
But you have a whiteboard that counts for at least 3 extra years
lol totally! (Speaking of which, I should go update that...)
Once v0.2.0 of the linter is released, I plan to switch gears back to working on benchmarking Bevy
Me too! While im not old either (23) its always shocking how talented and smart others are AND then they are even younger 
Yeah, I'm seriously impressed by how quickly you learned. Hacking on the Rust compiler is hard stuff
Thanks still a long way to go but helps a lot that you take documentation very seriously
Can you explain a bit what you did to get those results?
huh I actually noticed the other day while installing bevy_cli that some dependencies of actix seemed super dubious. I wanted to look into that but it completely fell out of my brain.
Sort of curious about the decision to use actix over axum or straight up hyper. But I haven't really paid attention to rust web backend stuff in a few years.
I looked over the results of cargo tree for the CLI, but nothing seems particularly out-of-place
I did notice that we're pulling in hyper anyways due to reqwest, so it may be worth dropping actix_web anyways in favor of that (axum)
The largest one was setting default-features = false for our dependencies on Bevy
Bevy as a lot of extra features that we don't really need in testing
The other thing I did was go through our direct dependencies and disable features that I thought we wouldn't need
So that PR wasn't any special trick like more caching, just pruning some extra things that we don't actually need
I can say that the current axum version is nicer than the version of actix_web I last tried ... 6 years ago. maybe it's an unfair comparison though 😄
ohh, nm. my brain made a weird connection seeing the change to the actix dep.
I think what happened was I saw rhai taking a while, and tracked it down to cargo generate, which probably makes sense.
Ohhh, yeah. rhai does have significant compilation times, but its genuinely used by cargo-generate
cargo, make me a project
Thanks for mentioning it anyways, though, since we can probably switch to axum to decrease build times further
It wasn't a super thought out decision on my part, I didn't have any experience with Rust web frameworks so I just picked one that didn't seem very bloated (apparently I was wrong about that) and where I could quickly find out how to serve folders.
It's definitely something we can (and should) revisit as the CLI matures
Unfortunately Bevy is often at the other end of the spectrum where the caches are updated so rarely that they are often out of date and cargo has to recompile a lot of stuff anyway (at least the last time I checked on it)
Also, even though the cache keys are often different, we can still often use fallbacks to not have to start from scratch
I still haven't made a functional game with Bevy, but it's definitely super interesting to follow the development. Things are moving fast!
idk if we are linting for this but ran into a tiny error i was confused by.
Do you spot the REAL mistake?
Awnser: ||When I cloned the transform to pass it as a component clippy told me it was a "needless clone", but i technically was needed or rather a deref was needed. In short, that transform is a &Transform this had the unintended consequence of making it a invalid tuple bundle.||
dont think its something bevy can fix, only could lint against it
Interesting, do you think an impl<T: Component + Copy> &Component for T would be useful in this situation, or have unintended consequences?
idk how you define lints but if that means "Warn about &Component in a spawn"
then sure
Wait, no! I meant adding that impl block to bevy_ecs, not the linter! 😅
Like what if instead of Bevy failing to compile, it just copied transform for you
idk def an ecs question lol
Fair enough
I do think it would be troublesome to make that a lint, however, because its already an existing compile error
Afaik, lints are run after type checking, trait checking, and other bits of analysis. If one of those raises an error, I don't know if the lints would even run
It may be possible to override the compiler query that does type checking, but that sounds....... scary
fwiw I do a fair bit of web work and in general I've see more companies choosing axum over the last couple years than actix. One notable thing is that you can take advantage of tower's Service trait for middleware, which means there's a decent ecosystem that exists on crates.io for that middleware.
a PR for comparison to current: https://github.com/TheBevyFlock/bevy_cli/pull/295
Thanks, I will take a look later!
https://github.com/bevyengine/bevy/pull/18082 @pale viper will open an issue to track panicking method lint. Big chance that we dont need it anymore in 0.16
What else is this checking?
I'd love a hit list.
I think that we're probably going to leave in World::resource and friends for now, so it'll probably stick around, just as a less important lint
panicking methods of Query, QueryState, or World
Mhmm, but other than the single family and the resource family are there other methods to be careful with?
Eh iirc on world there are probably easiest to check the tests: https://github.com/TheBevyFlock/bevy_cli/tree/main/bevy_lint/tests/ui/panicking_methods
Aha, many!
Okay, that's an easy PR
definitely cutting that
Alongside the UI tests, you can also check the official list
Sounds good! We can either deprecate or straight-up remove that lint, depending on how the change is
(I'm a little sad, because I did like that lint code, but yay for better ergonomics!)
Yea i would not remove it yet perhaps if we get bevy 0.14 working again in the 0.3.0 milestone it can still be helpful
A PR to put all the web-functionality behind a new web feature flag:
https://github.com/TheBevyFlock/bevy_cli/pull/297
Really shows how almost all of the CLI's complexity (except for the linter) is currently the web stuff lol
Just another day as Bevy contributor:
> cargo clean-recursive
Total space saved: 152.3 GB
now you have enough space to install monster hunter! 
If you all have time, would you mind looking over this draft blog post announcing v0.2.0 of bevy_lint?
cc @rocky oxide, since I appreciate your writing ability, but no pressure if you don't have the time :)
My PR has been sitting open for a while. I think it's relatively simple, could you review again some time ? https://github.com/TheBevyFlock/bevy_cli/pull/262
I can try to have a look tonight or tomorrow (sorry it took so long!). I recommend checking the issue again, iirc bd103 added some more information that could be helpful .
TIL the require attribute must be below the derive component attribute or else it wont work, nor will any errors be thrown till you make assumptions about it working...
#[require(B)]
#[derive(Component)]
struct A;
Is this valid rust code? Does it compile?
If it compiles, we could definitely write a lint for it
I had zero warning when my code was like this but the require doesn't actually get applied.
It behaved as if the require wasn't there.
Weird! Would you mind opening an issue for this? It sounds like a useful lint!
@limber wedge this might be our first early lint pass! :D
Sure
would be cool!
This came up again: https://github.com/TheBevyFlock/bevy_cli/issues/300 for me personally snippets are more than enough how do you all feel about this?
I dont really see the benefit of a Component or Resource (and similar) command since i don’t create a file per component. For the plugin one i could see this more as a potential future feature that could integrate with a bevy editor.
Plugin is only one that would be useful imo
Component/resource/state/event all fall under "let the user do it" imho
lint idea: reading/writing files in normal systems, not in an async task
Currently thinking about how to best implement the feature configuration in Bevy CLI. The main motivation is that you often need to enable different sets of features in dev vs. release or native vs. web and it's a hassle to do it manually.
Option 1: Custom CLI config in Cargo.toml, e.g.
[package.metadata.bevy_cli.dev]
features = ["bevy/dynamic_linking", "bevy/bevy_dev_tools"]
[package.metadata.bevy_cli.native.dev]
features = ["bevy/file_watcher", "bevy/embedded_watcher"]
[package.metadata.bevy_cli.web]
default-features = false
Option 2: "Magic" feature flags that are enabled automatically, e.g.
[features]
default_dev = ["bevy/dynamic_linking", "bevy/bevy_dev_tools"]
default_native_dev = ["bevy/file_watcher", "bevy/embedded_watcher"]
# No `default-features = false` for the specific profiles possible
I wrote down some advantages/disadvantages in the GitHub issue.
Currently leaning towards option 2.
Any opinions?
a bit sad cargo does not support defining features in custom profiles. I don't have a strong opinion but im often not a fan of "magic" and while Option 1 is some CLI specific configuration migrating away or to a custom solution is very very simple. And to me i think if we would in the future then have some configuration fields under [package.metadata.bevy_cli it would be weird that the features are not there.
@foggy basin https://github.com/TheBevyFlock/bevy_cli/issues/289 I had some thoughts:
- Does the
wasm-optversion need to match another version we install (like wasm-bindgen) is there a "minimal required version"? - I found this rust
wasm-optcli wrapper https://github.com/brson/wasm-opt-rs but it seems unmaintained. So I would rather not depend on that, so do we want to install directly from https://github.com/WebAssembly/binaryen/releases viawget? Or what would be the best method so we don't need to also check if our "installing" method is installed (Not familiar with Windows but iirc it was only available in Powershell by default)^^. Not sure if this is worth it
i wonder if there's a cargo issue for setting default features per profile
- I don't think there is a version requirement, at least we can ignore it for now.
- We currently already depend on this wrapper for the lib version IIRC, so that should be fine. Installing directly from the release page sounds difficult to maintain. In the future I'd like yo optionally support installing via
cargo binstallto speed up installs, but that can be a follow up
Oh okay yea then its super easy
possible lint, Query<Children>.find(|ch|ch.contains(e))
What's the lint?
should use a parent instead of finding the entity containing a child
either Query<&Parent>.get(e) or editing the source of e to get a Parent
D:\Rust Projects
❯ bevy new proj
Error: error sending request for url (https://api.github.com/orgs/TheBevyFlock/repos)
Caused by:
0: client error (Connect)
1: invalid URL, scheme is not http
I have a sneaking suspicion I've done something wrong 
no i have broken it
https://github.com/TheBevyFlock/bevy_cli/pull/305 should fix it but i wanna add some unit tests so this does not happen again in the future
Opened 8 minutes ago
That explains why I didn't find it
installed the version on the PR and it worked perfectly 🎉
Ha! CI passes on windows but not macos while i use macos, usually its always the other way around 
One fun part of this is that, at the present, Github Actions' MacOS runners are faster than Linux and Windows
It's why in the engine's main CI we use MacOS in a larger amount of places, even though Linux is considered the "default"
👍
Yea i saw that too but i think they are having some connectivity issue. Only on mac runners sometimes the job fails
<@&1064695155975803020> bevy_lint v0.2.0 is ready to be released. As per the release process, we need the approval of at least one maintainer before it can be published! If any have the time, I would appreciate them stopping by #308 to leave their review. Thank you!
Just saw that cargo metadata output also contains the workspace and package metadata, so parsing the Cargo.toml manually shouldn't be necessary
Is anyone already working on https://github.com/TheBevyFlock/bevy_cli/issues/64 ?
If not, I think I’ll try to work on it
https://github.com/rust-lang/rust/pull/138586 @pale viper et al; toss your reviews here? The author asked me for permission before mentioning Bevy, and this PR was inspired by this working group
This is very cool imo, bd103 already documented it very nicely in the bevy lint repository but this makes it so much more accessible (and we can just link to that instead?)
Woah, that's awesome! I'm really happy to hear that the author is (somewhat) planning on writing an RFC too
Once #![register_tool(...)] stabilizes, that should make the linter much easier to use :)
yay!
my favorite part of working on stuff like this is hearing how people plan to use it
Hi! I didn't realize you were on this server :)
ooo
I'm not quite familiar with the process, and need to research path resolution a bit more, but willing to learn!
let me type up what i know so far. the main remaining steps are
- wait for the crate-attr rfc to land
- read through ~150 comments on the register_tool tracking issue, and the original rfc that only addressed official tools
- write it all up
additionally i’ve been getting feedback in dms on how people are using it and i need to make a brain dump of that
maybe i could write up what i already know, run it by petrochenkov and #rustc-dev for feedback, and then delegate to you for writing the actual doc?
also though i don't want to spend too much time on this because cough i was going to use it to reward myself for making progress on apartment hunting lmao
let me just make a list of interested parties to start
- bevy_cli
- cargo semver-checks (i think lints only)
- c2rust
- cargo tarpaulin
- "anyone writing a rustc_driver" which according to sourcegraph search includes rust-gpu, ooo
- dylint
i don't actually think these are hard problems. lang is being conservative because they're afraid and don't have backgroud. there are already lots of ways that the type namespace are conflicts, and separating lints and attributes is just a policy decision but doesn't actually affect the feature much
lccc is vaporware
marker looks dead, last commit is 2 years ago
dylint is a modern version of that
Right! I remember reading one of their blog posts when I first got started
(the rust-lang org tends to be where projects go to die unless they are a submodule of rust-lang/rust 🙃)
I think they work around #![register_tool(...)] being unstable by just not using lint namespaces at all
i am very interested in what they think about namespacing, whether there should be a dylint namespace or a namespace for each tool using the library, and if the latter whether they think it should be valid to have a crate name and tool name overlap
Yeah totally! I think it would be nice for Dylint to expose that option to lint authors too
oh right yeah this is very similar to what you're working on, isn't it? are you using dylint as a library or was it not flexible enough?
I started with Dylint, but moved away after trying it for a while
I don't think I was a fan of the installation process required when using Dylint
yeahhh being a rustc_driver is so hard
i want to make it easier but i'm not sure where to start
I think it was because I wanted bevy_lint to be usable as its own standalone tool (like Clippy), while Dylint is more targeted towards composing multiple linters together
(well i guess i do, i'm starting with register_tool lol)
Honestly? The biggest helper for me at this point would be some sort of generated list of breaking changes
It's been smooth so far upgrading which nightly version bevy_lint uses, since usually I just have to fix compile failures
I always worry that I'm missing some behavioral change, though, that the compiler wouldn't catch
I looked into it, but it doesn't like working with nightly Rust at the minute
i have to figure out how to get it to run on rustc, but rustdoc already generates docs for all the crates so it shouldn't be too hard to get it to generate json, i just have to convince CSC that it shouldn't go through cargo
that's just the driver
the driver is the simplest part, trustfall doesn't care about your compiler version
why don't i invite you to the CSC discord?
Ah, cool! I get that rustc_driver has no guarantees about stability, but still I'd like to know if things break
Honestly, a link to a PR is enough at this point ^^
Sure!
Thanks, I'm in!
I used to (painfully) use https://github.com/xfbs/diff.rs to compare clippy_utils releases, but it was more of a bandaid than an actual solution to this
oh jeez
And unfortunately it doesn't work anymore due to a CORS issue that I wasn't able to fix 🤷♂️
this tool is fascinating because it's simultaneously too much and too little info lol
it shows you every modified line but it doesn't know which ones are important
Maybe it's a dumb idea but would integrating profiling into the cli make sense ? Like an easy command to run and profile the game without the hassle of setting stuff up ?
IMO the latter would be better
I would like to bringe some attention to this again, i know you all are busy just so it will not be forgotten💚 not sure how close bevy 0.16 is but it would be pretty cool it we can release before that since 0.2.0 is only compatible with bevy 0.15
Wouldn't make sense to release with 0.16 (and compatible to it) at same time as 0.16?
Please make sure I get this done today
Thank you! I'm taking a look at your feedback now!
The lint list over at https://thebevyflock.github.io/bevy_cli/bevy_lint/lints/index.html is a bit weird, because of the cargo module. This is inconsistent with the other lints: I don't think that this division should be user visible.
I totally agree with this. I think one solution to this that will benefit the long term is transforming the module structure into this:
All lints offered by bevy_lint.
I'm going to wait to do that until after v0.2.0 releases, however, since we're so late in the process
I’m working on publishing v0.2.0 now! If you all could avoid merging any PRs for the next few hours, I would really appreciate it!
A few hours late, but v0.2.0 is published! The announcement post is also up, with some fun little features I enjoyed putting together :)
Stick that in #devlogs!
Congrats!🎉
@limber wedge I'm trying to diagnose why MacOS seems to be occasionally failing on the should_scaffold_new_default_project and related tests in CI. I cleared the cache and am re-running https://github.com/TheBevyFlock/bevy_cli/actions/runs/13972212765/job/39179285771?pr=312, so we'll see how it goes!
A Bevy CLI tool and linter. Contribute to TheBevyFlock/bevy_cli development by creating an account on GitHub.
I saw you were working on the macos-runner-ci branch, did you figure out what was going wrong?
not yet, im just trying out different things on that branch. I added (and removed alread) some rerty logic but it seems that either it works first try or never.
Looks like the first known failure of this was this run, on 8dc695db9367ded69bd6a8aafc1b3e4e1b7ea732
Wait, nevermind. That commit simply merges the bevy new tests 🤦♂️
yea ^^
I think i will add some logs next to see where the timeout happens but im sadly sick so not sure when i get to it sorry
Its a pretty annoying issue 
Aww, hope you feel better! No worries for now, worst case we'll temporarily disable the test
Weirdly enough, I haven't been able to reproduce the issue locally on MacOS. I fear it's some runner-specific issue
Yea its a weird issue with the runner
planning to work on this today
oh god there were multiple tool attribute rfcs
hold on i am collecting a list of relevant links
lol one of the backlinks is from you https://github.com/TheBevyFlock/bevy_cli/issues/88
oh no
oh god
so it turns out that you don't actually need a feature gate if instead of doing #[bevy_cli::foo] you do #[clippy::bevy_cli::foo] instead
i don't like this
uh. please do not use this information for evil
clippy doesn't even warn jeez
ok i have read through the implementation PR and through the tracking issue up to https://github.com/rust-lang/rust/issues/66079#issuecomment-1170326144
i need to read the rest of the backlinks on the tracking issue, the original tool attribute RFC that was meant only for rustfmt, and the tracking issue for "tool attributes" (which makes no sense for me; it should surely be part of the tracking issue for register_tool)
a lot of people want to use this, more than i expected
@pale viper out of curiosity: why did you choose bevy_cli:: as the prefix for lints instead of bevy::?
(i suspect the answer is "the latter is disallowed right now" but i just want to confirm)
ok backlinks done. reading through https://github.com/rust-lang/rust/issues/44690
I didn't, actually, it's just bevy:: :)
https://thebevyflock.github.io/bevy_cli/bevy_lint/index.html#registering-bevy-as-a-tool
bevy_lint is a custom linter for the Bevy game engine, similar to Clippy.
oh cute
wait doesn't that error if you already have the bevy crate in scope?
wait no that's only attributes, not lints
i confused myself again
oh jesus this is legal
#[rustfmt::arbitrary::number::of::segments(then * arbitrary !!! token ~~~ tree ^_^)]
and stable
ugh
oh ok it's caught by rustfmt
yeah ok that's the right semantics
fascinating, extern crate rustfmt seems to be legal
even extern crate log as rustfmt
i think tool attributes need a bunch more documentation honestly
let me finish reading through these issues and i'll send what i have written up so far
lol let me fix discord's highlighting
oh it's just broken cool
anyway
@pale viper the next steps are:
- document how tool attributes work today
- document how register_tool works
- collect a list of how people want to use this (not projects, use cases. so for example "i want my proc macro to have custom lints" would be a use case)
- write up a thread on IRLO making sure that step 3 is complete
- write an RFC
let me know which if any of those steps you are interested in
oh no wonder i couldn't find the tool attribute docs lol they got deleted https://github.com/rust-lang/rust/pull/53459/files#diff-b9e398bba6448e39723645d78b68546c316601b83805ce479e18c7c47d790069
ah someone added them back at some point cool https://doc.rust-lang.org/nightly/reference/attributes.html#tool-attributes
bevy_cli has project creation correct?
Yes there is some basic scaffolding
i want to just use it for project managment rather than the editor reimplment it
aka editor launcher just acts as a ui for the cli a little
Yea
would be my vision too but not sure what the official plan is
This is my intent too
great, ill keep working on my rewrite of the launcher/editor/game logic to use cfg features instead of manually reading args
@pale viper Im actually fine with just disabling the bevy new tests for now, it makes me go a little insane^^ CI breaks on this call: https://github.com/TheBevyFlock/bevy_cli/blob/main/src/template.rs#L79
Hah, fair enough! I'll open a PR nuking those tests for now :D
do you know the error it gives? github has a low~ish rate limit when calling github apis from github actions if you don't give a token
Iirc it just times out but maybe before closing we can try to clone with a token
Often I find it silently fails without any error message, and fails to create the folder
https://github.com/TheBevyFlock/bevy_cli/actions/runs/14038213319/job/39301482430 is an example of the error, though I've seen a few other kinds of failures
hum "silently fails" is a bug on the side of the CLI, it should raise the proper error
you're ? all the way to main, that's not proper error handling 😄
Fair enough, we definitely should add .context() in places to annotate the errors
It may be worth setting RUST_BACKTRACE=1 in CI too
i think the tests just dont capture stdout or stderr of the child process
oh yea it is the rate limit stdout: Ok(Response { url: "https://api.github.com/orgs/TheBevyFlock/repos", status: 403, headers: {"date": "Mon, 24 Mar 2025 15:59:08 GMT", "server": "Varnish", "strict-transport-security": "max-age=31536000; includeSubdomains; preload", "x-content-type-options": "nosniff", "x-frame-options": "deny", "x-xss-protection": "1; mode=block", "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'", "access-control-allow-origin": "*", "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset", "content-type": "application/json; charset=utf-8", "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "x-github-media-type": "github.v3; format=json", "x-ratelimit-limit": "60", "x-ratelimit-remaining": "0", "x-ratelimit-reset": "1742832588", "x-ratelimit-re
Thanks for the hint!!
Oh, awesome! Do you want to work on a fix for this, then? I think you need to pass set a header in the request to be the Github Token
https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
Ah, looks like you can get the Github token from the GITHUB_TOKEN environmental variable: https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication
If you need any help, let me know :)
will open a pr yea thanks!
Hey, sorry for taking a second to get back to you! I'm mostly interested in step 5, writing the actual RFC, but I can help out with earlier steps if you need me to. I'd also be happy to write about how bevy_lint wants to use #![register_tool(...)], but I can't really speak for other projects
I also took a look at the HackMD you sent out: how do you think registered tool namespaces should cooperate with imported modules when it comes to attributes?
#![register_tool(foo)]
extern crate foo;
#[foo::bar]
fn main() {
// ...
}
Which foo takes precedence in this scenario? Should a warning / error be emitted?
funny you ask, I just talked with petrochenkov about this.
i think that should resolve to the tool, actually. my reasoning is that there’s a way to disambiguate a crate: write ::foo::bar. there’s nothing equivalent for tools and I don’t really want to add new syntax
i think this actually matches people’s expectations tbh. you don’t expect extern crate rustfmt to break rustfmt::skip
(it does today! i think that’s bad.)
cool. i am going to finish up https://github.com/rust-lang/reference/pull/1765 and the corresponding test pr. then i want to write up 4-5 edge cases and how i think they should behave. then i'll turn it over to you to write the actual rfc. sound good?
ugh let me make a list of all the open source things i'm working on it's getting hard for me to keep track lol
i think i have a problem lol
Sounds awesome, thank you!
EDIT: Fixed, the issue was the 2d template code using canvas: Some("#bevy".to_string()), removing this line and deleting the whole web folder seemed to make it work. Not sure why it didnt work without these changes though...
(apologies if this is the wrong place to ask this)
Im trying out bevy_cli and attempting to use the web feature, but am getting a few errors in chrome console:
Cannot find element: #bevy.
Unable to find a GPU! Make sure you have installed required drivers! (im on an M1 mac)
I have a fresh bevy project that i created using bevy new my-project -t 2d and i ran bevy run web --open
I see the loading spinner going indefinitely
Hi! this is absolutely the right place to ask and thanks for testing the bevy cli!. There is still some open work to port the https://github.com/TheBevyFlock/bevy_new_2d template to the cli. Mainly see: https://github.com/TheBevyFlock/bevy_new_2d/pull/312.
oh, glad you got it to work! yea thats what this PR would change ^^
thank you! Having a great time with it so far, thank you all for the work on it. Just getting back into Bevy after a long break, so this was super helpful to get started on a new project without any hassle/recalling how things work. 🙂
thanks for the links, ill take a look!
should probably try to get the integration working before the upcoming bevy jam
the PR is mergeable as is iirc, there were just some things on the bevy CLI side that could be improved to not regress some minor things on the bevy_new_2d side
some (all?) of which have been fixed
Right yeah: I hope we can get folks to dogfood this for the upcoming jam
What are your thoughts of putting the linter in CI for the template? Is that desirable, any things you might change?
i haven't used the linter myself yet, but in theory that sounds like a good idea
my potential concerns would be wrt false positives and CI time / space (especially for private repos)
i expect the latter to not be a big deal though, it's more of a thing for the release workflow
@foggy basin, is the PR to switch from trunk to bevy run web unblocked now?
if nothing else i think the value of dogfooding bevy_lint is definitely worth it
@pale viper Before we can add it to the template we need to support bevy 0.16.0 since the jam will be using that version i assume? If so i went quickly through our paths: https://github.com/TheBevyFlock/bevy_cli/blob/298-bevy-v16/bevy_lint/src/paths.rs
EntityCommandschanged, we need to check what this means for usResourcechanged only the path i think.- Remove the variants that no longer panic from the
panicking_methodslint
And then we should be good to go! I have lots of time tomorrow and on the weekend so i will get a PR going, but i think i would like some help with the EntityCommands change.
I'm still working on the configuration of features in Cargo.toml. Progress has been slow unfortunately due to limited time.
But if that's not a blocker for you we could move forward with the PR!
Awesome, that's a good call! For EntityCommands, we only use it in the borrowed_reborrowable. Since the new version still has reborrow(), I don't think anything further needs to be changed.
A list of commands that will be run to modify an Entity.
Also, I like the change you made where you added comments linking to the source definitions! In the future, we may be able to even make a test that verifies those paths exist :)
Oh, yes! I was more preparing for the next version so it will be more convenient but that would be an interesting idea!
Clippy and rustc have the concept of internal lints, lints behind a #[cfg(feature = "internal")] flag, that are used to check themselves. We could use that to verify all paths in paths.rs exist
Anyways, with the upgrade to 0.16, do you think we should make a new release as bevy_lintv0.3.0, or simply install the specific commit in CI?
That's fine, if you need any help let us know :D
Hm we could make a new release.
Maybe v0.3.0-rc.1? An unstable release candidate specifically for the game jam?
We could change the milestone to only include the v16, macro and panicking issue and then release it end of this week?
Or even exclude the macro pr though we could take it in since its „ready“
Im also fine with that. The benefit of releasing 0.3.0 with minimal changes would be that we could prepare 0.4.0 to land with bevy 0.17 giving us more time
i see. i'll move forward with the PR and make some followup issues
Thanks for your patience with all of this!
@pale viper while the docs.rs page looks way nicer for the lints in regards of their LintGroup its kinda awkward that we need to move a file if we want to change the Group Maybe in the distant future it would in the end still be easier if we just have a separate page like clippy: https://rust-lang.github.io/rust-clippy/master/index.html
A collection of lints to catch common mistakes and improve your Rust code.
Maybe, but I'm unsure how often a lint's group will change once it exits nursery. Maybe pedantic lints will be upgraded to suspicious, and maybe suspicious to correctness, but I don't know how much of an issue that may be
On the other hand, making a custom page like Clippy gives us a lot more flexibility and room to improve the experience, so I'm not against it
I originally used rustdoc for the lint documentation because it makes life a lot easier. All we have to do is put the docs next to the code, and rustdoc automatically handles parsing the Markdown, generating the website, and making it look pretty!
So while I'm not against making a custom website in the future, I'm not sure we should work on it right now, just because there are other things I think are more important :)
100% its not something that we need now at all ^^
this pr makes me sad https://github.com/rust-lang/rust/pull/138840
hey who wants to see a wild bug https://github.com/rust-lang/rust/issues/139095
ok i think those two are mostly done
umm
let me write up the corner cases with register_tool
i think this is going to be my last rust project for a while
there are probably some i'm missing, i'll think about it later when i'm less tired
the module resolution one really worries me
i don't know what to do about that
i was looking into https://github.com/TheBevyFlock/bevy_new_2d/issues/329
setting type: shell with bevy run seems to work fine
however, bevy run itself has some extraneous output that cargo run does not, and i think it's undesirable
if there are errors, cargo run outputs the error messages to stderr and then exits with status code 101
bevy run then sees that its Command "failed" so it prints the error and exits
a user of bevy run doesn't need to know that the Command failed within bevy_cli's code, it's useless information unless you're trying to debug bevy_cli itself
also with RUST_BACKTRACE=1 enabled it includes a stack backtrace from within bevy_cli
Yea thats true, i think it makes sense to log that in --verbose mode but otherwise its just noise. Will create an issue for it!
ok @pale viper i think this is ready for a draft of an RFC :) https://hackmd.io/2hRNnZ0vR7yw_M71KbRdqA?both
let me know what your plans are around that. https://github.com/rust-lang/rfcs#what-the-process-is has instructions for the actual act of writing.
please do read through the hackmd - happy to answer questions about anything in there, i know i was kinda writing in shorthand for most of it
@near mist could you check https://github.com/TheBevyFlock/bevy_new_2d/pull/342 💚
In #312 and #339, some changes were made to lib.rs but were forgotten to be copied over the lib.rs.template, resulting in broken projects.
Thank you! I'll take a look later today, then begin drafting the RFC on HackMD
Today I'm dedicating a couple of hours working on bevy_lint stuff! I have a fun checklist and everything 🦆
i love the drawing!
kwak
Hah, that's the limit of my drawing ability :D
You're the best ❤️
Be warned: I'm opening a PR renaming get_many() to many() >:)
We'll see how that goes :)
I'm currently working on the CLI features configuration and hope to get a PR ready some time today :)
That's awesome! Congrats 🎉
Does someone not use rustup who could test https://github.com/TheBevyFlock/bevy_cli/pull/287 ?
@worn jetty, I believe you're on NixOS. Would you be willing to test this?
Will the CLI only be published when its moved under bevy?
I believe the v0.1.0 of the CLI will be only available through GitHub, since we cannot publish to crates.io as an unofficial project
But the CLI is on 0.2.0?
The linter is. The cli did not yet release 0.1.0 but we are close!
Ok, unfortunately I had less time than anticipated and couldn't finish it, but I already put up a draft PR:
https://github.com/TheBevyFlock/bevy_cli/pull/331
On the bright side, a lot of this is foundational work and adding more features in the future should be a lot easier
its the 1h that got stolen from us ^^
@pale viper quickly hacked something together so we have a basis to discuss: https://github.com/TheBevyFlock/bevy_cli/pull/333 what do you think of the direction? did you have something completely different in mind?
Interesting! There's some things I like about it, but also some things I think won't be flexible enough for the future
One of the things I really want is to make a semver::Version globally available so that we can easily check what version is being used anywhere within the linter (it's part of why the linter configuration is being stored in the static LINTER_CONFIG, even if it's never accessed)
For example, I want this:
if linter_config().version() > Version::new(0, 16, 1) {
// ...
}
Another note: I have one more grand refactor in the works that converts LintGroup from a struct to a trait:
pub trait LintGroup {
const NAME: &str;
const LEVEL: Level;
const LINTS: &[&Lint];
fn register_lints(store: &mut LintStore);
fn register_passes(store: &mut LintStore);
fn register_group(store: &mut LintStore);
}
This would remove the need for BevyLint and the "Click me for more information" statics on each lint's page
My most recent thought was to handle version-conditional lint registration within each LintGroup's register_lints() method
Then again, I'm not sure which method is best in the long-run. This may require a design document to think through the constraints and requirements
I think this would be a good idea so we can write down the goals and then we need to experiment a bit to see what works. I can start something tomorrow
That would be great and would allow more flexibility.
I like the base idea of having the versions be some sort of structs so its easy to see what are the paths etc for this version as a maintainer but as a user we would like to easily see what lints are available (so like our current page as sub page based on each version)
i created an issue on bevy_new_2d to track adding bevy_lint to the CI workflow: https://github.com/TheBevyFlock/bevy_new_2d/issues/349
it would be really nice to have cargo-binstall available for both bevy_lint and bevy_cli before the jam
so we don't have to have CI compile bevy_lint and release compile bevy_cli every time (especially for those using private repos with limited resources)
but i wouldn't call this a blocker
Hey folks! I have an issue and maybe some of you might know how to deal with it. I decided to give bevy-cli a go and I'm having this exact same issue when trying to build on CI: https://github.com/rustwasm/wasm-bindgen/issues/4422
Locally I don't have this issue, but in GitHub Actions I do. A snippet of what I'm doing here.
- name: Install tools for WASM build
run: cargo install --git https://github.com/TheBevyFlock/bevy_cli --locked bevy_cli
- name: Build release
run: RUSTFLAGS='--cfg getrandom_backend="wasm_js"' bevy build --yes $BUILD_PROFILE web --bundle
The error in the script is:
error: The "wasm_js" backend requires the wasm_jsfeature forgetrandom. For more information see: https://docs.rs/getrandom/#webassembly-support
Which is not the same error you get when you are missing the env var.
And on my Cargo.toml file I do:
[target.wasm32-unknown-unknown.dependencies]
getrandom = { version = "*", default-features = false, features = ["wasm_js"] }
I'll really appreciate your help!
I'm not sure if this is the real issue, but I don't know if Github Actions supports the Bash-style RUSTFLAGS='--cfg getrandom_backend="wasm_js"'. Usually I'd do:
- name: Build release
run: 'bevy build --yes $BUILD_PROFILE web --bundle'
env:
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
Also, make sure $BUILD_PROFILE is set elsewhere in the action! Usually you need env or environmental files
I would also test what happens if you move the getrandom dependency to be under normal dependencies:
[dependencies]
getrandom = { version = "*", default-features = false, features = ["wasm_js"] }
And maybe also set the version to >0.3.0! You never know :)
Already tried different ways to set the env var to no avail. The other var is working properly afaics.
I'll try setting the version like that just in case but I feel like it might be something else. I don't really understand what they meant in the solution proposed in issue I linked.
Thanks a lot! Any other ideas will be welcomed.
Hm im at work but can check when im home. I would perhaps test setting the rustflags in the .cargo/config.toml under the desired target. Not sure if it creates issues while installing wasm-bindgen-cli as hinted in the linked issue.
I try that too in a few, thanks for the idea
Some results:
move the getrandom dependency to be under normal dependencies
This is not possible, as the feature is wasm exclusive. This breaks desktop builds.
And maybe also set the version to >0.3.0!
No change with this sadly.
setting the rustflags in the Cargo.toml under the desired target
This didn't work for me even locally but now I'm not sure if I set it properly:
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
I'll keep trying later and if I find a solution I'll make sure I post it somewhere relevant.
oh, i couldn't read on phone. ment .cargo/config.toml this seems to work for me: https://github.com/DaAlbrecht/bevy_new_2d/blob/main/.cargo/config.toml.
Otherwise i assume you could also not use the cli to install the wasm-bindengen-cli and then set the rustflags as env variable
Interesting problem. I'm currently working on setting up CLI configuration in Cargo.toml for feature flags, I wonder if we should also support setting env variables that way. Then you could define web-specific env variables that are not used during cargo install.
Speaking of CLI configuration, I think I got it working now for web builds.
Supporting native however might be trickier than I thought: To load the correct config, we need to know the package of the target we're building/running. To know that package (for certain), we need to execute cargo build/cargo run, but we need to pass the feature flags from the config to these commands!
On the web, we manually determine the target and have hence access to the package, but it doesn't have 100% the same behaviour as the target selection from cargo yet.
And ideally I'd like to keep full cargo compatibility at least for native builds.
Not sure yet how to proceed, maybe we ignore native for the first iteration, as supporting web-specific configuration would already solve a bulk of the issues
What ended up working was using . cargo/config file as suggested later. I was setting rustflags in my Cargo.toml file and that was incorrect. Thanks for your help!
glad it works!
If you don't mind sharing, what has your experience with the CLI been so far? Any pain points or features you're missing?
I only wanted the bundling feature for web so it was quite useful but also simple to use for that purpose. But for what it's worth, it comes with pre-existing profiles that you can override, you don't really need an index file unless you do, has the "audio patch" built in... Pretty satisfactory if you ask me. I have yet to publish this bundle on itch.io so I might have other bits to share later.
hi! just wanted to check in, have you had a chance to work on this?
Hi, I’ve gotten pulled aside to help with the Bevy 0.16 release. That should finish in a week or 2, so that’s when I plan to work on the RFC (which is slightly less time-critical)
The feature configuration PR is ready for review: https://github.com/TheBevyFlock/bevy_cli/pull/331
will have a look tomorrow!
That’s awesome! I’m busy with 0.16 right now, so Im not able to give a thorough review, but let me know if you need anything :)
Opened a PR to allow setting custom headers for the web server: https://github.com/TheBevyFlock/bevy_cli/pull/343
This is for example required if you want to test out multi-threading on Wasm.
There are still several things to do before we can properly support that, but this is the first important step
You are on fire!
started reviewing the first pr but have to study a bit :( will for sure be done in the evening
No rush :)
I think on my mac i had problems with cargo install —path . on the branch but didnt get to check could just be that i have set a different version
Does it work if you install from the remote branch instead?
yea works with --locked https://github.com/TheBevyFlock/bevy_cli/pull/342 will fix it ^^
Hello fine people of bevy_cli, I used to be able to use it without issue but recently it started doing that, any ideas ?
$ cargo install cargo-generate
Updating crates.io index
Ignored package `cargo-generate v0.23.2` is already installed, use --force to override
$ bevy new my_project -t 2d
Error: Required cargo-generate version not met. Required: ^0.23 was: 0.22.1
what's your cargo generate --version?
i think if you update the bevy_cli to the newest version on the main branch this should be fixed
ah right bevy_cli depends on the library version of cargo-generate
$ cargo generate --version
cargo generate-generate 0.23.2
yes and we just updated to 0.23 yesterday
how would I do that ?
i think just re running cargo install --git https://github.com/TheBevyFlock/bevy_cli --locked bevy_cli should do the job
https://github.com/TheBevyFlock/bevy_new_minimal/pull/18 will fix the minimal template
tested with:
❯ cargo-generate generate -g https://github.com/DaAlbrecht/bevy_new_minimal --branch bump-cargo-generate
❯ head -n 3 Cargo.toml
[package]
name = "foo"
version = &...
thanks, works
I never really bothered with wasm but the web command makes it so nice i think you did such a good job! @foggy basin 
maybe the only downside is now i actually wanna support wasm lol
Hello, does the cli support/plans to support easy exporting ? Like one command to export for windows that packs the zip with .exe and assets ?
That's pretty much my goal, so great news :D
Not yet, but I was thinking about that as well. Not sure if we have an issue for that yet
https://github.com/TheBevyFlock/bevy_cli/issues/350 I didn't find one so I made it
I think it would be pretty simple
as an end-user, versioning the template doesn't really make a whole lot of sense unless its going to get overridden when constructing a new template. My little test project or new game isn't 0.2.0, the template is. (this was generated via the minimal template)
[package]
name = "ecs-tilemap-16-test"
version = "0.2.0"
edition = "2021"
yes, i totally agree, it should be 0.1.0 since it's a template not a library
i have a draft pr waiting on bevy 0.16 that also changes the version back to 0.1.0, but that could be split out to merge it sooner
Not urgent by any means, just thought it was something worth mentioning
Tiny PR to support the -Z flag: https://github.com/TheBevyFlock/bevy_cli/pull/353
Approved and merged!
I extended the design doc for the web functionality a bit. In particular, I added multi-threading and no_std/wasm32v1-none to the future work items.
I also want to mention that the bevy_cli v0.1.0 milestone is complete @pale viper @limber wedge.
I think the next step would be for the maintainers to review the current state and then for us to advertise the CLI more to invite broader testing?
and a binary release of v0.1.0 to github for cargo-binstall to pick up 🥺
🎉 i would love if we could add the rustflags pr also to the 0.1.0 release. Think its pretty useful for the rand crates
Does cargo-binstall just need a GitHub release with binaries attached? Or is there any other configuration needed?
It depends on the released binary name
I hope that it doesn't get confused because we have releases for both the linter and the CLI in the same repo
If tries to match the desired binary name with some patterns if it doesn’t match you can add annotations in the cargo.toml
Can we also use cargo-binstall to make it easier to use the linter?
IIRC it requires nightly and other configuration to be installed, is that still the case?
If yes, maybe we can configure all of that in CI and then allow the user to install the compiled binary
I guess that's something we can still prepare: Taking into account the maintainer's limited time and making it as easy as possible for them to test out the CLI :D
Yes still requires a specific nightly toolchain. I think we should be able to prepackage everything.
according to their readme, technically it doesn't require anything and it'll fall back on compiling from source if necessary
and apparently they try a few things before falling back on that
so it's probably "smart"
as for different binaries in the same github repo idk, but i'm sure there are other cases like that
it seems you can make the cargo-binstall support explicit, if necessary: https://github.com/cargo-bins/cargo-binstall/blob/main/SUPPORT.md
I created https://github.com/TheBevyFlock/bevy_cli/issues/354 to keep track of this
I created a new PR which allows you to overwrite the web target and also set the default target in the config:
https://github.com/TheBevyFlock/bevy_cli/pull/355
This is especially important to target wasm32v1-none.
@old rover if you happen to have some time and a no_std project on hand, your testing would be highly appreciated!
Works exactly as I'd expect it to, compiling out using the web profile on the provided target
Thanks for checking!
Tested against this little dummy application:
#!/usr/bin/env cargo
//! \`\`\`cargo
//! [dependencies]
//! bevy = { version = "0.16.0-rc.3", default-features = false, features = ["web"] }
//! wasm-bindgen = { version = "0.2.100", default-features = false, features = ["msrv"] }
//! wee_alloc = "0.4.5"
//! \`\`\`
#![no_std]
#![no_main]
use bevy::prelude::*;
use wasm_bindgen::prelude::*;
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[panic_handler]
fn suppress_panics(_: &core::panic::PanicInfo<'_>) -> ! {
alert("Oh No!");
loop {}
}
#[wasm_bindgen]
extern "C" {
fn alert(s: &str);
}
#[wasm_bindgen]
pub extern "C" fn start() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, || {
alert("Starting Up...");
})
.run();
}
(the tripple-backticks in the cargo block wont format in discord lol)
It was fun seeing the message evolve as you tried out new things lol
frantically tries to fix formatting
That's very useful, thanks!
I'll add that to my test repo setup
If its possible to bundle a folder that can be installed, then theoretically yes
That’s fantastic! Congratulations :)
I think it would already help if both the linter and cli would have their own binary releases and not just the sources. Then you can just cargo-binstall both separately I guess
i don't even use the cli, just the linter, and it was originally somewhat confusing to figure out where to get the installation instructions
@quick kayak I've started working on the RFC at https://hackmd.io/@BD103/Hk8lGGj6R. I'm going to see if I can get a first draft finished in the next few days, but I'll let you know how things are going
I've invited you as an editor in case you have any comments / quick fixes you want to make, but no pressure :)
maybe i will take a bit longer with my pr's had some issues at work that needed to be fixed asap so i was busy working until 1am yesterday and the day before :(
I created a bigger PR which completely reworks our automatic installation process.
Instead of checking that the correct packages and targets are installed before every bevy invocation, the PR uses an optimistic approach and just tries to run the commands.
Only on failure, the checks are performed and the user is prompted to install missing dependencies if needed.
Afterwards, the CLI will retry the command and continue if possible.
This should (a) slightly reduce latency as less commands are executed on the happy path and (b) clean up the verbose logs to only contain commands that are really needed
No pressure at all! Bevy is volunteerism, so there aren’t any expectations. Take as much time as you need 💙
One-line PR to remove an unnecessary log:
https://github.com/TheBevyFlock/bevy_cli/pull/359
I guess I'll also start setting up a blog to be able to write a bit about the CLI development
Ohh that sounds really fun! Github Pages is great if you're hosting a website, although I hear Bear is really easy if you don't want to bother making you're own website
When the default level of a lint is specified by a constant, the UI tests fail, but when the level is behind a reference, the tests pass normally >:)
This was the bug that caused me to stop working on #341, since I had no idea what was going on. It was only until yesterday where I manually read through the HIR and MIR to see what was going on
What thats crazy how so?
I would have gone insane trying to find that out ^^
Thanks! I already have a webserver from some previous projects so I'll probably use that.
I'll build it with SvelteKit (which I believe you did as well?)
I'm not quite sure, honestly! I spent a long plane ride debugging the thing, trying as much as I could to isolate the issue. That's why that branch so has many commits; I was saving my changes each time I could verify nothing broke
I'm 80% sure it's a compiler bug, but I'm going to make a reproducible example before opening a bug report / trying to fix it
Yup, I also used SvelteKit! I think it was a little bit overkill for my needs, but it was generally pleasant
Beware that if you use mdsvex for Markdown formatting, it uses a really old version of remark, so some plugins may not work. (I had to use a an old version of remark-footnotes, for example, for it to work correctly)
will take a look today or tomorrow!
No rush :)
Hey, I just ran into a weird issue with bevy run web where the uuid crate didn't know which randomness backend to use
Dunno if this is a user error or not
Context:
Update: the described example now just loads forever in the browser :/
Chrome:
Firefox:
(the tab below are the dev tools that themselves seem to not load)
On another note: I'm using bevy run web for the Foxtrot rework, and it's working really really well there!
hm i think this part uuid = {version = "1", features = ["js"]} is expected. The example loads for me with bevy run -p map_loading web in chrome or safari.
weird 🤷♂️
Another thing: how do I run bevy run web with WebGPU?
I tried bevy run web -- --api webgpu but the CLI thinks that's an option for the web command
hmm actually even bevy run -- --api webgpu doesn't run
error: unrecognized subcommand '--api'
Usage: bevy run [OPTIONS] [COMMAND]
For more information, try '--help'.
Another another thing: found a bug!
use bevy new -t 2d foo, and then add the following into the main.rs:
#[cfg(feature="dev_native")]
compile_error!("dev_native active");
cargo build will show the error, while bevy build will not. Somehow the default features got lost, even though that should only happen on release builds
That is a new feature 🎉 you can override the features the bevy cli should use now in the Cargo.toml and the 2d template has: ```toml
package.metadata.bevy_cli.web.dev]
Disable native-only debug functionality in web builds
default_features = false
features = ["dev"]
But that should not trigger on bevy build, right?
Since that is not for web
(I know the feature though, it’s a really cool idea!)
O yea my dyslexic brain just thought you used the web command
Oh you are swiss too 
Grüezi wohl 😄
(assuming you're from the German speaking region)
Yes im from bern!
Ah, in that case, let me use the propper greeting: Auää!
Now it feels like home!
@foggy basin should we revert your bevy_new_2d until this is fixed?
Ah right, we didn't implement the double dash forwarding thing yet. I assume its some clap option you need to activate? Feel free to create an issue!
Yes feel free to do that!
I might have some time this weekend to look into it.
Admittedly, the package detection is a bit hacky on native builds
Added a bug report for this as well: https://github.com/TheBevyFlock/bevy_cli/issues/370
Repro: Clone bevy_new_2d at TheBevyFlock/bevy_new_2d@dfbdbcb Add the following to main.rs #[cfg(feature="dev_native")] compile_error!("dev_native active"); run cargo build ->...
i think: https://github.com/TheBevyFlock/bevy_cli/pull/371/commits/ee6f04b9b48c59ee076ae6534126567547ecac03 should fix it. will do some more testing (and branch of main) when im home
i have a friend who's learning bevy and trying out the bevy_new_2d template. however, the main branch of bevy_new_2d depends on bevy 0.16.0-rc.1, which is incompatible with most 3rd-party crates for now, so we wanted to use an older version of the template that depended on bevy 0.15
the bevy new command supports specifying a git branch, but not a tag or revision
i ended up creating a bevy-0.15 tag in bevy_new_2d and my friend had to use cargo generate to be able to specify the tag
so basically, feature request: support specifying git revision / tag in bevy new command :)
(also for some reason cargo generate with revision specified was not working, it couldn't find the revision from the SHA)
created an issue: https://github.com/TheBevyFlock/bevy_cli/issues/372
Good point! Thanks!
Thanks for looking into this!
@limber wedge would you like me to adopt the unconventional_naming PR? I've come down with a cold, so I have a bit of free time on my hands to work on it :)
I think i would like to finish it but if there is nothing else sure!
Oh and get well soon!
Thanks! If that's the case, I'll work on something else
I think it's close to time to release v0.3.0-rc.0 of the linter, since Bevy 0.16 is super close to release
Additionally, I'm going to try to give the CLI the ability to install the linter (maybe bevy lint install or something)
I think if you enable cargo binstall the cli could use that?
And i think the lintgroup trait pr if unblocked would be pretty big too so we can start a design doc for how we want to support multiple versions
I wish that were possible, but I'm pretty confident that the linter cannot be installed as a single standalone binary (which is a requirement for binstall)
Because of the driver?
Yeah, unfortunately. I've looked it up, but I don't think it's possible to combine a dynamic library into an executable
I see yea then i guess having the cli setup the required rust toolchain would be nice
I do have good news on this, however! I did finish working on this, and should be able to open a PR for it today :D
Thats fantastic!
@limber wedge The Rustflag PR looks good and works for me now, can you take a look at the merge conflicts when you have the time? :)
Once that's merged, I'll add the experimental multi-threading support. I think then we have all the necessary pieces in place
Another polishing PR to improve logging of the config:
https://github.com/TheBevyFlock/bevy_cli/pull/375
nice thanks for testing!
This should be fixed by https://github.com/TheBevyFlock/bevy_cli/pull/376.
If you have time to test, it would be highly appreciated!
what is your guys opinion on this: https://github.com/TheBevyFlock/bevy_cli/issues/368 im not familiar with NixOS at all i personally just don't like having too many niche files in the root directory but if its the only way to support the nix folks then im okay with it.
I've seen quite many projects with nix files, so I think adding those is fairly normal and fine 🙂
Ye same i like the idea of Nix just seems kinda „invasive“
I like the idea of supporting Nix users, I just worry it won't be tested all that often
As far as I can tell, none of the frequent contributors drive Nix. If things break, they may stay broken for a while
I think I'm more interested in the Nix flake that lets users install the CLI easily, more so than the dev shell
But I will admit I'm quite uneducated on Nix as a whole
im all for supporting Nix on a "best effort" basis don't get me wrong we would just depend a lot on nix folks to test / find / fix bugs
I wrote up a few questions to the issue author in https://github.com/TheBevyFlock/bevy_cli/issues/368#issuecomment-2818516507, but I think I'm ok with moving forward with adding better Nix support
I definitely agree on the "best effort" part though. We should document it, though, so people understand they may run into issues :)
Although whatever support we add will certainly be better than our current state of affairs 😆
^^ that is true. But i have so little contact with nix i dont even know what the issue are. Maybe when im back in the office i need to go annoy one of our nix users
Another polishing PR, improving the error message when a command (especially cargo metadata) fails:
https://github.com/TheBevyFlock/bevy_cli/pull/378
Bugfix PR for bevy run web --bundle:
https://github.com/TheBevyFlock/bevy_cli/pull/379
setup CI to use it, at least in one job 👍
@limber wedge @pale viper are there any more blockers before we can get the prototype reviewed by the maintainers?
If not we can start drafting a quick start introduction for them
We probably won't make it in time for the 0.16 release, but maybe it could make sense to do the announcement together with the Bevy jam announcement (given that there are no major objections).
That would also be a perfect opportunity to try out the CLI and it should provide a lot of benefit given how important a web build is for jams
I don’t think so (at least for the cli). I would like this too to get some feedback!
I would definitely take a look at the documentation. The README.md could probably benefit from a restructuring to make it easier for new users to learn how to use all of the CLI's features
The installation portion should also be updated to suggest installing the tagged v0.1.0, instead of directly installing from main
While it's a bit above-and-beyond, it may be useful to write down the intended release process as well. The linter has this so that other maintainers can take the reins in case I ever stop working on the project
Feature-wise, I'm super happy with what we have so far. There's been lots of praise over in #1271949921708146770, and a few good bug reports too! Ignoring the docs bits, I think the CLI is ready for release
Which is actually awesome!

I've been looking over the v0.3.0 milestone for the linter, and we're also really close, so we may not need to make a release candidate in order to be in time for Bevy 0.16!
A Bevy CLI tool and linter. Contribute to TheBevyFlock/bevy_cli development by creating an account on GitHub.
haha little trickster (;
Looking at the open issues and PRs:
- https://github.com/TheBevyFlock/bevy_cli/pull/345 will be merged today or tomorrow
- https://github.com/TheBevyFlock/bevy_cli/pull/377 is an optional refactor that can be held back for v0.4.0
- https://github.com/TheBevyFlock/bevy_cli/pull/380 is needed to add the linter to the
bevy_new_2dtemplate - I'll see if I can tackle https://github.com/TheBevyFlock/bevy_cli/issues/141, or may end up pushing it back
i will fix up #345 then merge it into main then merge main into #377
If everything goes well, we may end up release Bevy 0.16, bevy_cli v0.1.0, and bevy_lint v0.3.0 at the same time!
There's bound to be merge conflicts, so let me know if you need help
The PR description for https://github.com/TheBevyFlock/bevy_cli/pull/377 is pretty extensive, though, so it shouldn't be too difficult :)
yea finished looking at it just earlier but thought i rather merge https://github.com/TheBevyFlock/bevy_cli/pull/345 first
Adds a new lint called unconventional_naming that checks whether a bevy trait is implemented for a structure that does not follow the commonly used naming pattern.
So far, this only includes:
Syst...
and fix the conflicts then
Totally!
As mentioned here
#editor-dev message
Any info on CLI having templates added by user?
do you mean that the template gets added to the "shortcut" list like 2d ? I guess this would be open to the Bevy maintainers otherwise the cli just accepts a GitHub URL
Yea I guess? I suppose the launcher could hide the github link use under the hood but maybe CLI should have it?
Didn't realize it just used github templates.
Not GitHub templates in general, but cargo-generate templates in particular
When providing a GitHub URL, it will check that repo for a valid cargo-generate template
Ok I'll note this down in the launcher's docs
the -t foo shortcut just evaluates to https://github.com/TheBevyFlock/bevy_new_foo
With a special case for bevy_new_minimal, which is used when no -t param is passed
Something simple one could do is add a github user to the evaluation
Pseudo syntax:
bevy template add source janhohenheim could add my GitHub to the places to look for templates
Then bevy new -t networking could first check https://github.com/janhohenheim/bevy_new_networking and then https://github.com/TheBevyFlock/bevy_new_networking
Or one could also add a local directory containing subdirectories named bevy_new_something
But yeah bottom line is that the CLI already today accepts arbitrary user-provided URLs for the templates 🙂
@finite crag
BTW @sturdy tapir I really appreciate that you're trying to not duplicate feature implementations across the launcher and the CLI 
Makes the work much easier for everyone involved 🙂
Ofc
The launcher is just a ui abstraction of cli's with some QoL features imo
Its most complex feature is probably installing rust for the user lol
Or maybe the search bar...
Right, so I see it all boils down to cargo-generate templates
Installing rust is pretty easy compared to search bar lol
Which fit exactly what I imagined they would anyway.
yes!
The UI just somehow needs to parse the required placeholders and display the appropriate fields.
cargo, make me a project
But that seems easy? I imagine cargo-generate has an appropriate API to access that.
which btw supports local templates given a path instead of a URL
bevy new does not support that yet afaik, but it's a thin wrapper over cargo generate so it should be possible
Which brings me to my next question
How many args are there for bevy new?
Need to know what can be set when the launcher is making a project.
$ bevy new -h
Create a new Bevy project from a specified template
Usage: bevy new [OPTIONS] <NAME>
Arguments:
<NAME> The desired name for the new project
Options:
-t, --template <TEMPLATE> The name of the template to use for generating the project [default: minimal]
-b, --branch <BRANCH> The git branch to use [default: main]
-v, --verbose
-h, --help Print help (see more with '--help')
Can we have more options to fill out the cargo.toml?
Description/Authors/Rust Edition etc
cargo generate supports setting up interactive user prompts for this type of thing, which ofc is only useful for CLI usage specifically
Yea interactive doesn't really help the launcher lol
Hm, does it not expose a more programmatic API for bevy CLI to use?
That's annoying
huh i think it does actually
--values-file <FILE> Pass template values through a file. Values should be in the format `key=value`, one per line
if this does what it sounds like
oh you can pass it directly in the command actually
with --define <key>=<value>
you would have to know the names of the keys that the template supports, but that can be standardized for bevy templates for common things like author etc
(source: cargo generate -h)
cargo-generate has some interesting doc comments lol
There's also --define which you can pass the API
not sure if that's the same thing though
Does bevy_cli use cargo generate as a binary or as a library?
created issue: https://github.com/TheBevyFlock/bevy_cli/issues/383
I saw that the lint for unconventional naming was merged, and it enforces a FooSet naming convention. When this was originally discussed though (starting here), this was somewhat contentious; at the start, people were maybe generally more in favor of FooSet, but at the end it seemed like consensus was largely on FooSystems instead, with Cart being biased towards that and Alice (and me) also preferring that over FooSet in the end
as a library
Just throwing this out there, I was kinda surprised to see FooSet being enforced. These days I'm heavily in favor of FooSystems, have been using that for new system set types, and have been intending to rename system sets in both Avian and Bevy to match that :P
Oh boy, I completely missed that poll. Hilarious how close that race was 😄
Thanks for pointing that out! i missed that, im fine with just switching to FooSystems. And if Card and Alice are leaning towards FooSystems then its set ^^. @pale viper
I suppose it should then be reasonably easy to extract the info on which parameters need to be defined from cargo-generate (though I can't say I've found the relevant methods in the docs)
Not sure that API exists, but one can manually look them up in the cargo-generate.toml
Well, not manually manually, but parsing the TOML
you know what I mean 😄
Yeah, I was just hoping we'd re-use the mechanism that already has to exist in cargo-generate anyway, but you're right.
As a heads-up @sturdy tapir, the 2d template has a post-generate hook that generates a prompt in the terminal, asking whether the user wants to execute the cargo update line at the bottom.
Dunno if there's a way to auto-confirm that prompt 🤷♂️
actually... lemme see if I can make a PR for Bevy to rename them to be consistent for 0.17, that way we can also get more first-party consensus on a naming convention if it gets approved
as you can see, Bevy's system set naming is rather inconsistent 😂
I'll just leave this here
there is! -a aka --allow-commands, which is used in bevy_new_minimal's ci-generate.yaml workflow
that's for cargo generate again, not bevy new
Oh, lovely!
This is needed to support bevy new in GUIs without opening up an interactive terminal. E.g. the 2d template has a post-generation hook that asks the user for confirmation for the last line in that ...
https://github.com/TheBevyFlock/bevy_cli/pull/384 @slim pine prepared this regardless ^^
Branch with consistent system set naming for Bevy is here if someone wants to see the diff. Some doc links probably need to be updated still, I'll make a PR soon
https://github.com/bevyengine/bevy/compare/main...Jondolf:bevy:system-set-naming
the PR description might take a while 😂
could have been the best vim macro that has ever existed
I've approved this! I originally went with Set because that's what I thought was the winner, but I'm happy with changing it to Systems :)
btw is it possible to use the machine applicable fixes already? cargo check does not provide that (since its done using cargo fix iirc) so i assume bevy_lint does neither? @pale viper
After looking at it, I guess it isn't! Clippy provides cargo clippy --fix, so it may be good to copy them
I bet it's possible to call RUSTC_WORKSPACE_WRAPPER=bevy_lint_driver cargo fix to get the same result
Ik its already been discussed but the crux of it all is that Set doesn't tell you what it is, it tells you is a grouping of something but not what that something is.
Systems while being similar to System is linguistically more clear than Set
@sturdy tapir when you say the editor uses the CLI, does it use it as a library or does it install and run the program?
makes sense!
We originally designed bevy_cli to be friendly as a library, although I don't know if that still applies
Yes to both.
Under the hood the launcher will use the CLI to do things like create project etc
But it'll also offer to install it on the users system, if they refuse then we still need the CLI as a library.
Good to know! Hopefully the upcoming release will provide a bit of API stability for you folks
I need to figure out text input first but once I do imma work on the create project stuff.
Where is the editor being worked on? https://github.com/bevyengine/bevy_editor_prototypes seems a bit emptier than I expected
i think thats good to keep in mind for us when we write doc comments.
That's the editor yes
Launcher is being done in isolation on my PC rn.
#editor-dev message
Ooooo, there's a lot of work being done in different branches and forks. I see!
There's also just been a general slow down as we wait for pieces to be easier to do
Launcher is the only fully unblocked item imo
That's super exciting! Let us know if you need any help integrating the CLI, it seems like a good idea to join the CLI and linter efforts under the editor wing :)
Especially since we can't be a working group forever
Eh CLI should probably stay as a separate tool from the editor since one could only need one or the other.
Launcher will just offer to install it for the user.
Fair enough, but the CLI cannot remain a working group forever, as those need a specific end goal. The goal of the CLI and linter are to become official tools, and once that happens, this working group will likely be closed
My thoughts were to migrate communication over to #editor-dev, since the work is similar. It may need to be renamed, though (maybe tooling-dev?)
But that's far enough in the future that we don't have to worry about it yet :)
Tooling might need a whole ass forum lol
Lol
got discord integration
I might make this a 3rd party crate cause discord integration seems really useful
btw there's an archived bevy discord rich presence plugin listed in the bevy assets page: https://github.com/jewlexx/bevy-discord-rpc
From the looks of #engine-dev, Bevy 0.16 might be releasing today! Could I please get a review for https://github.com/TheBevyFlock/bevy_cli/pull/380, as it's the last thing required for v0.3.0 of the linter to release?
@foggy basin I know Github Actions are usually your cup of tea, but if anyone wants to try their hand at it feel free!
Slightly off topic, but would anyone like to review a small PR that aims to make buttons more ergonomic to spawn in bevy_new_2d? The main question is whether the SpawnObserver boilerplate in widget.rs is a reasonable price to pay, keeping in mind users of all levels of experience with bevy may use the template
it feels like using the spawn APIs directly would remove the need for the abstraction entirely
What do you mean by that, passing Commands around instead of returning bundles?
I left a comment on the PR. Seems like SpawnWith would solve the issue without any trickery?
and since you already have to understand the Spawn apis to understand what button/SpawnObserver, etc is doing, its reasonable to "just use the existing APIs" rather than build a new observer spawning abstraction
(lmk if I misunderstood something about the example or whatnot)
Ah I'll have to try that, I wasn't aware of SpawnWith
It looks like what I would've wanted if I knew about it
I can test it / look at it in the evening
I left a few comments
My app needs to be plopped into an existing html canvas, so hiding the loading screen when a canvas is added isn't working for me -- how are folks detecting that bevy has been initialized?
I ended up moving the mutation observer to my canvas and removing the loading screen when bevy modifies its height, which seems to work well enough.
Making it easier to customize the web assets to fit into other contexts is high on the list of things I want to improve
CLI friends, is there a reason why this workflow produces something that says "release" in the profile?
This template is a great way to get started on a new 2D Bevy game! - TheBevyFlock/bevy_new_2d
Yup! If you scroll up, you'll see that's installing wasm-bindgen with the release profile
bevy_new_2d is still being built with the web profile, the CLI just noticed that wasm-bindgen wasn't installed so it did so for you :)
oooh okay 🙂
thanks for clarifying!
BTW, I submitted a new feature request: https://github.com/TheBevyFlock/bevy_cli/issues/397
The main reason is that it would be nice to have bevy test web build with the right settings so that I can run my unit tests for Wasm builds in a neat way :) See TheBevyFlock/bevy_new_2d#379 where ...
Doing bevy test web in a CI run would be really cool
Ooohh, good idea!
<@&1064695155975803020> bevy_lint is ready for its v0.3.0 release! Just like the last two releases, we need at least one maintainer approval on https://github.com/TheBevyFlock/bevy_cli/pull/392 before it becomes official. Now's your chance to try it out, browse the documentation and changelog, and request any changes that you may want!
The PR description has more information on how to test bevy_lint, and it links to the release process document as well in case you need a refresh
Let me know if you have any questions! :)
Reviewed 🙂
Thank you! I and @limber wedge have some follow-up questions, but take your time :)
Did you manage to fix this? I'm running into the exact same issue now
This can be solved by specifying the RUSTFLAFS in the cli metadata
Like this?
[package.metadata.bevy_cli.web.dev]
# Disable native-only debug functionality in web builds
default_features = false
features = ["dev"]
rust_flags = ["--cfg", "getrandom_backend=\"wasm_js\""]
hmm, that didn't work
did I mistype something?
oh wait it's rustflags not rust_flags 😄
I think it's building happily along now 🙂
Hahaha
Any idea why this came up now and not before in my project?
Might be worth adding to bevy_new_2d @near mist
Edit: PR
For me it was always the case when you used rand
I used rand in 0.15 already, this now just came up after upgrading to 0.16 
Eh, as long as it builds, I'm happy
Yea not sure maybe its because we use the wasm-unknown-unknown target and that does not have built in seeding or something like this
And perhaps trunk or w.e used a different target or had something else configured
Oh yeah I did! Thanks for checking @twilit dew
BTW moving away from trunk to bevy cli made things incredibly simpler for my use case 😅
Same 😄
I didn't pay attention to this one, sorry 😅 so this change removes the need to set the flag on a project level?
yep, beny run web will just work ™️ again 🙂
P.S.A. I'm merging https://github.com/TheBevyFlock/bevy_cli/pull/392 now, so no merging other PRs until the post-release PR is out please :)
This PR prepares bevy_lint for v0.3.0, following the release guide. Once this is marked ready for review, this will need at least one approval from a Bevy maintainer and no outstanding concerns. On...
And with that, we are released! Thank you all for your help :D
https://github.com/TheBevyFlock/bevy_cli/releases/tag/lint-v0.3.0
Well done! 
whoop whoop!
little question: if I write this:
[package.metadata.bevy_cli.web.release]
default_features = false
are the cargo defaults for release still used on top of that?
What do you mean with cargo defaults?
the default settings of the release profile
I believe they're merged, but let me check
Actually, I believe you can use bevy web build --verbose to log the final configuration
DEBUG Using defaults from bevy_cli config:
features = []
default_features = false
rustflags = ["--cfg", 'getrandom_backend="wasm_js"']
INFO Compiling to WebAssembly...
DEBUG Running: `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" --bin foxtrot --no-default-features --profile web-release --target wasm32-unknown-unknown`
That points to yes 🙂
thx!
Yes
FYI I'm going to want a dedicated blurb for the Jam description about how to get started with the CLI, and what features might be most useful
Yea we need to update the readme and then we could also release 0.1.0 of the cli
related to this, i'm trying to set up dev to use features native and dev, and web.dev to use features web and dev (but not native)
[package.metadata.bevy_cli.dev]
features = ["native_dev"]
[package.metadata.bevy_cli.web.dev]
features = ["web_dev"]
this doesn't work because then web.dev has both web_dev and native_dev features enabled
is there a way to do this?
ah i see there's a native.dev, nice
another question.. currently i'm setting [profile.dev] opt-level = 1 and [profile.dev.package."*"] opt-level = 3
i noticed bevy run web uses --profile web, which is distinct from --profile dev, where i've set those options
i assume that means those options won't get picked up for web dev builds?
and i assume there isn't a particular reason i wouldn't want those options enabled for web builds too?
or does profile web inherit from profile dev
ok major
, the answer is yes, it does, as mentioned right above in this thread :p
Just shows that we need to clean up the readme to include the new features. Will start if i have time today
well this was me noticing it in the README 😄
could bevy CLI get like a man page for this type of info that doesn't fit in --help?
idk if windows has something similar
Hahaha ^^ yea we could do this i think there is a man-gen crate
actually i think an mdbook style documentation might be even better (easier to read / navigate)
not that it's mutually exclusive
Yea i like mdbook more but maybe if you could create an issue for this so we dont forget it. Otherwise i can create one in the evening.
sure will do (EDIT: https://github.com/TheBevyFlock/bevy_cli/issues/403)
And then maybe alice has a preference
found a bug?
# These bevy commands:
bevy build --release
bevy build --profile release
# Become these cargo commands:
cargo build --features native --profile release
cargo build --features native,native_dev --profile release
i would have expected them to be treated the same
in release workflow i use --profile=${{ matrix.profile }} to be generic instead of the --release shorthand
although i guess i can switch to --release in practice
Not a bug but maybe not the intended behavior? You would like that the cli checks if the release profile is used and if so merge the release configs and not the dev once?
bevy build --profile release seems to be picking up my [package.metadata.bevy_cli.native.dev] settings despite using the release profile, not the dev profile
so yeah i think it should special-case when the profile is named release
and same thing for --profile web-release, that should be treated as web.release, not native.dev
it seems like any custom profile uses the native.dev settings atm
Yea i think it only merges the other configs if the release argument or the web arguments are present. I think this makes sense
To assume if you pass the specific profiles to also use the same merging method as if the cli argument for web/ release was passed what do you think @foggy basin
Currently its determined by whether you use the web command and whether you use the --release flag
We could also do something like checking for the strings "web" and "release" in the profile. A bit weird, but could aid the case where you need multiple profiles for different use cases
In any case, I'm open to change this logic :)
Yea i guess i would check if the profile passed matches one that the cli would read out of the cargo.toml. If so just act as these arguments where passed?
It was mentioned that we need to improve the documentation for the v0.1.0 of the CLI, so here's a first pass on improving the README:
https://github.com/TheBevyFlock/bevy_cli/pull/405
Feedback is highly appreciated :)
@pale viper @limber wedge I will attend RustWeek and the Bevy unconf in 2 weeks and plan to talk about and gather feedback for the Bevy CLI there.
Is there anything specific you'd like me to find out or should present?
Exciting! I think giving a demo using the CLI with bevy_new_2d would be a great way to show people why they should use it and how to get started :)
I would also appreciate if you could get a grasp of how large our user-base is. I don't have a clue how many people are using the CLI and linter, but would like to know that!
If we get enough popularity, that should help us become official
That would be good to know!
But there will only be 20-30 people attending the Bevy unconf, so probably not the best sample size :D
No, but it's better than nothing at all :D
Or the graph of how many clones we get a day:
Actually, this whole page is interesting: https://github.com/TheBevyFlock/bevy_cli/graphs/traffic
Interesting, what's bevyskein.dev?
That's @molten merlin's Blender integration for Bevy
He can probably talk better on it than I can, but the docs look great :)
Ahhh I saw some social media posts about that, looked very useful :)
Github, Google, and DuckDuckGo make sense, but it's interesting that we're linked to from the Rust forums
I belive taintedcoders.com is a Bevy tutorial / cookbook