axodotdev / cargo-dist

📦 shippable application packaging
https://axodotdev.github.io/cargo-dist/
Apache License 2.0
1.52k stars 72 forks source link

create "ci" mode for ephemeral environments, with bare minimum env assumptions #1400

Closed Gankra closed 1 month ago

Gankra commented 2 months ago

The installer does several things that are useful/important for the full breadth of its supported usecases, but which are unnecessary or detrimental for folks who want to take control of the installation process. As such, we need a way to reliably tell the installer "don't do anything clever, and don't error out for things that don't really matter here".

The original proposal was to just make it non-fatal for certain operations like the install-receipt to be non-fatal to setup. The only consequence of a failed receipt is the updater gets bricked. In really minimal CI-like systems the updater doesn't matter, so we should not fall over if the receipt fails.

However as we discussed this more, we realized there's more kinds of usecases and something more comprehensive/intentional was desirable.

ashleygwilliams commented 2 months ago

after chatting a bit more with zanie, i think we should keep the install receipt being fatal and introduce a --ci flag (very open to a different name) that is designed for ephemeral environments. it does not require any env vars to be set and it doesn't try to create receipts of any kind. i think having a fork and clearly naming the behavior is a better choice than muddying a single behavior mode

ashleygwilliams commented 2 months ago

relevant issue from astral's tracker https://github.com/astral-sh/uv/issues/6965#issuecomment-2334455056

Gankra commented 1 month ago

Ok so here's Notable things the installer does by default, in probably too much granularity, for the sake of discussion. Some of these things are statically baked into the installer when we generate it, while others are dynamically computed.

I've bolded the steps which I expect someone wanting to "just install the bins, no funny business" may want disabled/changed.

Step 1: What Are We Installing?

Step 2: Getting The Goods

Step 3: Installing

Step 4: Updating PATH

Gankra commented 1 month ago

I expect every user still wants all of step 1 and 2. For steps 3 and 4 there are a few classes of user here that I'm familiar with:

In practice I expect the structuralists and conductors basically want access to the same "mode":