top | item 22914389

(no title)

citruspi | 5 years ago

TL;DR Just publish it on crates.io and call it a day.

> What I'm most familiar with when it comes to publishing CLI tools is NPM. However, since Rust requires a build step I don't really feel like crates.io is set up for that on its own.

FWIW, I'd second hazebooth's nod towards simply publishing on crates.io.

I think you may be overthinking this, but that said I personally go the route of having CI cross-compile binaries for each OS and arch type that I host in order to minimize dependencies on the systems that run them (e.g. avoid installing the Go or Rust compiler).

I don't personally maintain package manager options (e.g. apt and brew) for projects because, as you mentioned, it'd be a lot of work. Plus, to be quite frank, when and if a project is popular enough that a large enough audience uses it, one day you'll find that someone else has added a package for it to e.g. apt or brew.

But given your familiarity w/ NPM - if you are interested in precompiling binaries for each system - you might want to take a look at Cloudflare's wrangler[0], their tooling for interacting with Cloudflare Workers. wrangler is published to both crates.io and NPM (the latter using a script to pull down pre-compiled binaries they host).

Edit: Another option, if you want really want to make your project available via a "package manager" that isn't crates.io, would be to release a Docker image. This is an option for CLI tooling - e.g. Hashicorp publishes Packer[1] and Terraform[2] Docker images. That way you don't need to worry about compiling binaries for macOS, linux w/ glibc, linux w/ musl, etc. Just publish a single Docker image, ideally as small as possible.

[0] https://github.com/cloudflare/wrangler [1] http://hub.docker.com/r/hashicorp/packer [2] http://hub.docker.com/r/hashicorp/terraform

discuss

order

No comments yet.