-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add information on releasing Bevy games #1885
Comments
This Bevy game template is another great source of inspiration for tricks to draw from. |
This is about privacy-sensitive paths in the compiled executable, right? Reading through the relevant rust issues (e.g. rust-lang/rust#40552) it does not sound like there is an actual fix or an easy workaround for now. Several people wrote that the mentioned solutions do not work (and I did not see anything about "relative rather than absolute paths"). The way to avoid leaking paths at the moment seems to be not distributing executables compiled on your private machine. I would propose recommending to only publish builds from CI/CD e.g. GitHub workflows in the new "Releasing Bevy games" section. |
Correct. I think your proposal is sensible then; it's a shame there's no local machine workaround. |
Probably building in docker or similar would work... but I would recommend setting up CI anyway |
I think CI makes the most sense for most people, but if someone's project isn't open-source, then CI could cost money. Maybe we should focus on CI on the website, but also link to some documentation on local alternatives like Docker, chroot jails, etc.? |
Just noticed some of our dependencies have licenses that needs to be mentioned when releasing a game made with Bevy. For example wgpu with MPL-2.0 |
I just left some thoughts on that here: #2101 (comment) |
The file produced by https://crates.io/crates/cargo-bom for Bevy is 568KB |
Maybe we can compress it by removing redundant license boilerplate? no clue if that is valid. |
Another option would be to gzip (or any common method) compress it and add a header that describes in plain text that the following bytes are the gzipped license text. A function to get the license text at runtime could transparently decompress it. |
I dig that. We could have a bevy_license_compliance plugin that |
And then (depending on the size) we could include it by default. |
I've been starting to do a bit of poking around on this topic and could use some advice. I'm fairly new to Bevy (and machine languages more generally) and been struggling to make a Debian package file for my example application. When I build the application, I'm unable to directly run the binary due to missing shared libraries. Is the entire |
If you aren't using |
Egg on my face; thank you @bjorn3. I forget that all of my child crates had been using the dynamic linking feature. |
Using
|
@follower How big is the license text after compression? I would assume that it compresses very well. |
@bjorn3 Yeah, it's a bit under 20KB with random right-click compression action applied. So it'd be interesting to see what sort of trade-offs make sense in terms of size+compression+ease of use. (And, for a GUI app at least, it feels like its probably primarily an amusing situation rather than a major issue. :) ) |
One thing I've not seen mentioned yet is around building portable executables when distributing for Linux. My understanding is that building with the A solution to this is to build using MUSL instead e.g. This produces a static binary which should just work on any Linux machine. I've tried the above but I'm getting pkg_config errors whilst compiling the Regardless, using MUSL then has its own issue in that its memory allocator performs relatively poorly in multi-threaded workloads. To resolve this, a different memory allocator would need to be used. This recent blog post covers 2 ways of using the MiMalloc allocator - the easiest approach seems to be just using this crate: https://github.com/purpleprotocol/mimalloc_rust This post gives a bit more context to the above, and also found that using a MUSL + MiMalloc combination can outperform GLIBC. It might be worth running the stress tests whilst using MiMalloc (on Windows or Linux) and see if that grants an easy performance boost? |
You can't statically link a program that needs to use the GPU. The userspace part of the graphics driver has to be dynamically linked. If you were to statically link it, you wouldn't be able to use any future gpu's with the game, nor be able to use nvidia's graphics driver (which doesn't have a stable syscall abi). If you are dynamically linking, using glibc instead of musl is a much better option. Most distros use glibc and thus compile the graphics driver against it. And the main musl based distro that I know of (Alpine linux) has a glibc compatibility shim.
There are three options:
|
Ah okay, thanks for your reply @bjorn3 - I've learnt something new today! Will have a look into Steam's runtime/Flatpak and see what I can get working |
Probably good to mention one should include the following in one's log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] } See #14116 |
For relative newcomers to Rust, we should start a section on Releasing Bevy games, to go along with our advice on fast compilations.
This should include:
This information likely deserves its own page, but should be linked on the Bevy website, perhaps near the section on fast compilation.
The text was updated successfully, but these errors were encountered: