Brioche Project Update - August 2024
Published on
By Kyle Lacy
So, it’s been about two months since the initial public release of Brioche, so I thought it was about time to share what’s been going on with the project! I quite like the newsletter-style updates that Rust and Dolphin put out regularly, so I think I’ll start doing something similar for Brioche (expect ~monthly updates)
Brioche releases
Brioche v0.1.1 was released in early June, which helped smooth out some of the kinks from v0.1.0. The changelog includes all the details, but to give a few highlights:
- Speed up registry syncing drastically and tweak registry timeouts
- Update the JS runtime to report the current version of Brioche. This will allow
std
to detect the version before using a new recipe type (either returning an error or using a fallback implementation) - Add a new
collect_references
recipe type for use in thestd
package
I even included a subcommand to update Brioche itself, but uhhh… it’s broken, so for now, you’ll need to follow the installation instructions again to upgrade. Also unfortunately, I didn’t catch this issue before v0.1.1 was released, so it’s still broken and the next release will also require a manual upgrade… oops
Package updates
During the initial release, there were only 10 packages available: ca_certificates
, curl
, jq
, miniserve
, nodejs
, rust
, plus the std
package and a few miscellaneous ones (hello_world
, typer
, smol_toml
)
Now, there are 38, almost 4x as many as during the original launch! Here’s what’s available now:
alsa_lib
bat
broot
carapace
dust
eza
git
gitui
go
joshuto
jujutsu
jwt_cli
k9s
lurk
oha
oniguruma
openssl
(split out fromstd
)opentofu
pcre2
pv
ripgrep
ruff
tcsh
tokei
xplr
xsv
zoxide
Massive kudos for these packages go to @jaudiger and @asheliahut, who opened 31 and 7 Pull Requests, respectively!
There were also several breaking changes made to Rust, NodeJS, and Go, to make building packages more consistent. See the PRs brioche-packages#65 and brioche-packages#67 for an overview of the changes.
std updates
The std
package has also seen quite a few changes. Note that it’s still pretty volatile, so keep an eye on the changelog to see how it evolves.
Since the initial release, there have been quite a few changes! Here’s the full list of changes since the initial release, but here are the highlights:
- Remove Python and OpenSSL from
std.toolchain()
. OpenSSL was added as its own package (openssl
), and Python will join it soon! - Overhaul recipe casting. See brioche-packages#25 for more context
- Replace the
std.auotwrap()
function withstd.autopack()
. Migrating to the new function should be fairly straightforward, and the new function provides a lot more options - Add
std.BRIOCHE_VERSION
to check which version of Brioche is being used. This will mainly be used bystd
itself for feature detection - Optimize container sizes made with
std.ociContainerImage()
. When using Brioche >=0.1.1, container images can now be much smaller!
Brioche core updates
I was hoping to have a v0.1.2 release ready to go before publishing the first project update, but alas, it’s not ready to go quite yet…
…but that also means there are a few goodies in the main
branch that you can look forward to for the next release!
Updates to several subcommands (fmt
, check
, publish
, install
) so they can take more than one package at a time. When working with multiple Brioche projects (say, if you’re contributing a new package), you can now save time by passing the -p
or -r
flag more than once! Once again, huge thanks to @jaudiger for contributing these changes!
Add support for “locked downloads” with Brioche.download
expressions. Normally when downloading something with Brioche, you need to provide the download hash explicitly in code. This has long led to an awkward dance where you need to get the URL, download it yourself first, get the hash, then paste it in the code. Well, as long as the URL is static in your source code, you’ll no longer need to do this! Just change from this:
…to this:
…and the URL will automatically be downloaded and recorded in the lockfile! Note that this will require an update to the std
package too, which is still in draft.
Registry updates
Right after release, @matklad opened a Zulip discussion to ask why installing hello_world
took so long (and then also contributed brioche#54 to help stop the bleeding).
After a lot of back-and-forth with testing, I got some general fixes in place that went out with Brioche v0.1.1, but it still wasn’t a great experience. After a lot of investigation, @asheliahut and I ended up doing a major change to the registry.
To cut a long story short, the registry runs on ephemeral Fly.io machines, and I originally used LiteFS for the database (basically, SQLite with replication). LiteFS ended up causing a lot of latency and reliability issues, so we ended up migrating to a Postgres database hosted by Neon (which, so far, has been an amazing database host!)
Now, the registry should respond much faster, even when a Fly.io machine has to do a cold start!
Coming soon
To close this out, I wanted to share a shortlist of things currently in progress and things I’d like to make progress on in the near future! But… consider this more of a “wishlist” than a “roadmap”
- @jaudiger opened brioche#105 to upgrade Deno Core to the latest version. There’s still quite a bit of work left to get this working and mergeable, but I’m hoping this will make it in soon!
- Add a new
std.glob()
function, which will take a recipe and keep only the files matching a glob pattern - More cleanup to
std.toolchain()
, especially around autotools (you need to do some hacky stuff to use autotools currently) - @asheliahut made some progress on CMake (permalink) and Python (permalink). Both open up lots of new packages that can be added!
- Cross-platform support and cross-compilation are going to be fairly massive tasks, but I’d like to start making some progress towards these. ARM64 Linux will probably be the second supported target, and macOS will be further down the line.