-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Support hotpatching systems #19296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The maintainers are keen on supporting hot reloading in Bevy itself, and at least personally, I would prefer to colalborate with the rest of the ecosystem. Before adopting this fully, I'd like more investigation / docs into exactly how this would be used by Bevy devs, and the constraints and risks imposed. We don't have a ton of bandwidth to investigate this fully (nor do I personally have the requisite expertise on the technical / implementation side), so I would really value a cohesive design doc or other write-up. |
Here's a little something I threw together to use in the meantime :) |
We're exploring this as a working group: https://discord.com/channels/691052431525675048/1374187654425481266/1374187654425481266 Design doc can be found at: https://hackmd.io/@bevy/SkdMQIYWle/edit Joint prototype: https://github.com/TheBevyFlock/bevy_simple_subsecond_system/ |
I am interested in integrating I feel that the part of the puzzle that is missing is a standalone version of This way, the whole ecosytem can benefit without specifically depending on the Dioxus build process. I'm not sure if there are any efforts in this direction, but I will look into isolating the relevant parts of |
This is something that Bevy is interested in too :) |
Cool! I am working on it over here: https://github.com/hecrj/cargo-hot I've got the |
I get that dioxus is open source, but we've been working on this for the better part of the last year and seeing our work immediately ripped out like this is upsetting. The least you could do is help us spin There are bugs and dragons abound and big work ahead like proper workspace support. Lots of sweat and long nights went into this, hand-rolled assembly, and head banging to figure out esoteric hacks to get it working. I would love it if the community came together to help maintain a "cargo plus plus", not just extricate our work to put their own name on it. It's understandable if some random fly-by contributor did this, but the head of another large rust project doing it without even reaching out is disappointing. |
That's how you kill an ecosystem. It should be a |
wasm-bindgen, wasm-pack, and trunk are not cargo subcommands. cargo cannot |
@jkelleyrtp what is it that you actually want? I understand Dioxus/you put a lot of work into creating subsecond and hot patching and should be referenced etc. (did an amazing job :) ) to solve some of these issues it makes sense to me to have a separate source control etc for the pure functionally of hot reloading. i think it would be useful to answer what you were wanting/expecting.
i dont think anyone wanted to take your work and put their name on it. |
@jkelleyrtp I'd argue it still makes sense as a subcommand, even though others aren't. Cargo subcommands are basically the same as git subcommands - they just attach a prefix, and your binary works the same as standalone. The only difference (from a rudimentary check of making one) is that they automatically set some environment variables in addition, specifically:
as well as adding the actual cargo subcommand name as the first argument. In the case of the standard dx CLI, it makes sense to be standalone - dioxus is not just a rust tool, and can be initialized via npm too. So requiring it be a cargo subcommand may be a little constraining. Many cargo-installed binaries I use don't work as a cargo subcommand, but generally the differentiator between ones that do and ones that don't are if they are specifically about rust code and operating on your actual codebase (with the exception of cargo-install-update, which is a cargo subcommand but doesn't operate on a codebase level - still makes sense to me). |
@jkelleyrtp I am very grateful for all your amazing work; but I don't think you get what open source means. Even then, I don't think an exploration that is ~8 hours old warrants this reaction. I enjoy exploring on my own and I had no ill intent. In fact, I thought Dioxus could eventually switch to it and join efforts. I am sorry to disappoint, but I don't need to "reach out" when I am already working right here in the open. In any case, I am happy to cooperate and join efforts with anyone that would find this tool useful. I am definitely not the right person to maintain it! |
Re: cargo subcommand vs own command The frustrations with cargo's limitations and its glacial development cycle has led this very project to design the Bevy CLI alpha as a cargo replacement / wrapper and not a subcommand. I think it's worth not immediately dismissing the validity of a cargo v2. As Jon points out, quite a few projects have come to the conclusion that cargo is often simply not enough. The discussion of whether we want to collectively encourage the ecosystem to migrate to a cargo replacement or not is certainly out of scope for this wee issue. For prolonged discussion of this, I suggest moving to a dedicated issue on the Dioxus repo instead. For Bevy's use-case, the relevant PR is not even merged yet, the feature is experimental, and the Dioxus version it depends on is in alpha. Really, we should be fine with some hoops right now IMO. |
@janhohenheim I am kinda curious - what were the limitations found? Do you have a link to a discussion on the discord or here on github about this? I'm unaware of such limitations as I don't tend to work on CLI tools much, so I'm very interested where the limitations have been found. |
Uh oh!
There was an error while loading. Please reload this page.
What problem does this solve or what need does it fill?
A common complaint from Bevy users is the relatively high iteration time. Hotpatching is a nice solution for this, as it allows code changes to affect the running binary.
What solution would you like?
While many things can be hotpatched, I think implementing it for systems is a nice start. This way, users could already start live-editing their UIs by changing a system that re-inserts a UI node hierarchy in
Update
, for example.What alternative(s) have you considered?
Additional context
Recently, Dioxus has released an alpha of subsecond, which implements exactly this. One of their explicit goals is to make this technology available for other frameworks such as Bevy.
If we go this route, there is already a Bevy integration demo. Per @jkelleyrtp, this is not meant as a long-term end-user API, but to give Bevy maintainers and early adopters today an example of how to wire stuff up. We need to spend some time working on the integration between the two, in order to ensure it is safe.
The text was updated successfully, but these errors were encountered: