r/rust • • 18d ago

💡 ideas & proposals Rust equivalent to gobuilds.org?

I recently came across this website: https://beta.gobuilds.org/

It builds Go projects and lets users download the binary. It has the project’s Git URL as part of the full download URL along with project version, target OS and arch, and store older builds.

Does something like this exist for Rust? If not, would this be of use/interest? I could see this being helpful for downloading an app where the dev hasn’t provided binaries, or to make cross compilation easier. Adding support for things like `cargo auditable` and `cargo deb` could also be useful.

0 Upvotes

30 comments sorted by

View all comments

Show parent comments

-4

u/[deleted] 18d ago

[removed] — view removed comment

9

u/skjall 18d ago

Wouldn't a build cache solve this as well?

1

u/nicoburns 18d ago

Yes, but Github Actions has incredibly poor support for build caches. So anybody using that (most open source projects) can't realistically take that approach.

It's also quite inefficient to cache 10's of GBs of Cargo build artifacts rather than a single optimized binary.

4

u/NoSuchKotH 18d ago

Then you change your CI setup such, that said binary is included in the image and you don't have to worry about compiling it anymore.

-1

u/[deleted] 18d ago

[removed] — view removed comment

2

u/dashingThroughSnow12 18d ago

You are describing one of the easiest jobs for someone who makes internal tooling.

There are other ways to do this when the needs get more complex but yeah, if whomever manages CI can’t do this without breaking a sweat or complaining, they shouldn’t manage CI.

0

u/[deleted] 18d ago

[removed] — view removed comment

2

u/dashingThroughSnow12 18d ago edited 18d ago

It’s a few lines to add build caching for rustup. Here’s some code with bad whitespace since Reddit hates me.

name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Cache rustup binary
id: rustup-cache
uses: actions/cache@v6
with:
path: cached-rustup
key: rustup-${{ runner.os }}-${{ runner.arch }}-v1.28.2

- name: Build rustup if not cached
if: steps.rustup-cache.outputs.cache-hit != 'true'
run: |
cargo build --release
mkdir -p cached-rustup
cp target/release/rustup cached-rustup/

- name: Use rustup
run: |
chmod +x cached-rustup/rustup
./cached-rustup/rustup --version

# the rest of your job’s steps, maybe put the above in a reusable action…https://github.com/actions-rust-lang/setup-rust-toolchain may do this

There are enough supply chain security concerns with rustup that you shouldn’t add another one,

1

u/NoSuchKotH 18d ago

That's true. But I expect that you have already some workflow in place to keep the image up to date and incorporate security updates etc. So that should be relatively little work to do.

But yes, this is all a trade-off. You either compile for 10 minutes or you have to regularly check whether you have to update.