Bazzite 45 is here!

Hey all, Smalls here! :waving_hand: Happy release day!

The biggest amount of time I have spent with this update revolved around splitting up how our images are built. They’re not the flashiest of user-facing changes, but they are huge changes for current and any future contributors/maintainers going forward.

I wanted to give a bit of a detailed overview of those changes, so let’s get down to it.

Splitting up the monolithic Containerfile

At the heart of building Bazzite is a Containerfile that defines how the image is built. Before Bazzite 45, just about every package installation and customization was done directly in the Containerfile. Due to the nature of how they work, they can get unruly with a bunch of chained shell commands that are easy to mess up and make it harder to maintain. The best way I can describe what it looks like is if you’ve ever seen someone post a big one-liner command.

With Bazzite 45, we’ve gone from a single 800+ line Containerfile to just 102 lines. Everything in there is now split into modular shell scripts under build_files/ in our repository. Not only that, but they’re documented with inline comments to help us and others understand what’s actually being done and why. It also gives us the ability to run tools like shellcheck locally, as well as when pull requests are made, to catch bugs and other bad practices before they get merged.

This change has already helped us catch some old things that aren’t needed anymore. In the end, I believe it’ll help everyone out going forward and should make things a lot more portable.

Separate build stages, no more

In addition to splitting up the monolithic Containerfile and other efforts by @tapoxi, @kylegospo, @renner, and others, we’re now able to do everything in one build stage and have reduced the amount of time it takes to build the images. Bazzite offers many different image variant combos to suit user-preference and hardware. There are the desktop and handheld/HTPC variants, which both have separate images for GNOME and KDE desktop environments and separate Nvidia-specific images for each.

One of the most time-consuming steps in the image builds was transitioning from one build stage to the next. Especially for the Nvidia-specific images. We originally had the base desktop stage, then the deck (handheld/HTPC) stage, and then, finally, the nvidia stage. Not all of these stages are ran for every image, but for the ones that needed them they would spend a good chunk of time copying the contents of one build stage to the next.

With Bazzite 45, it’s all just done in one stage and the deck/nvidia-specific additions are now built conditionally with build arguments. When you factor in this change with all of the other build optimizations done this release, all ten of our images are now built, usually, within 30 minutes. Before it would take almost an hour, with the worst being nearly an hour and a half. That is a massive improvement.

Wrapping up

Even with the changes we’ve made on our end, there’s always something to do to make it even better. What I’m hoping with the Containerfile not being monolithic anymore is making it less daunting for others to help make improvements.

All that being said, enjoy the new release! :grinning_face_with_smiling_eyes: