packages: give rustup a default, and run steps under bash

Both failures on run 31383204572, all three distributions, in the same
step, before anything was compiled.

--default-toolchain none was copied from the two fork workflows, where it
is correct: their checkout root is the crate, so rust-toolchain.toml sits
in it and rustup reads the pin. This repository's root has no pin -- it is
in cosmic-comp/, one level down, and the other 27 components have none at
all -- so `none` left no default and the first cargo invocation at the
root failed with "could not choose a version of cargo to run".

stable does not weaken the pin. rustup applies a directory-local
rust-toolchain.toml on entering that directory and installs it on demand,
so cosmic-comp still gets the 1.93 it asks for.

The same logs showed `shell: sh -e {0}`, which is the container default
and is dash on Debian. Two later steps use brace expansion, which dash
lacks and bash-as-sh disables, so the RPM build would have created a
directory literally named rpmbuild/{BUILD,RPMS,...} and failed further
along. Declared bash for the job rather than rewriting around a constraint
none of the three images impose.

Worth recording why this was not caught before pushing: the run blocks
were syntax-checked with bash, which is not what was going to run them.
Checking with dash would not have caught it either -- brace expansion
failing is runtime behaviour, not a parse error. Declaring the shell is
the fix; there is no static check that substitutes for it.
This commit is contained in:
2026-08-10 18:25:36 +07:00
parent d2b091fa8b
commit e65a9722d9
+24 -5
View File
@@ -49,6 +49,15 @@ jobs:
name: ${{ matrix.distro }} name: ${{ matrix.distro }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: ${{ matrix.image }} container: ${{ matrix.image }}
# GitHub defaults `run:` to `sh -e {0}` inside a container, and on Debian
# that is dash. Several steps below use brace expansion and process
# substitution, which dash does not have and which bash-invoked-as-sh
# disables. Naming bash once here is better than writing POSIX around a
# constraint no target actually imposes -- all three images ship bash.
defaults:
run:
shell: bash
strategy: strategy:
# One distribution failing on a package name is worth seeing on its own, # One distribution failing on a package name is worth seeing on its own,
# and the other two artifacts are still worth having. # and the other two artifacts are still worth having.
@@ -133,14 +142,24 @@ jobs:
with: with:
submodules: recursive submodules: recursive
# --default-toolchain none, then let cosmic-comp's rust-toolchain.toml # stable as the default, not `none`.
# choose. Naming a version here would create a second place to update it #
# and a way for the packages to be compiled by something the project does # The two fork workflows use --default-toolchain none and let
# not otherwise use. # rust-toolchain.toml decide, which is right there because the checkout
# root is the crate and the pin sits in it. Here it does not: the pin is
# cosmic-comp/rust-toolchain.toml, one level down, and this job's other 27
# components have no pin at all. With `none` there is no default to fall
# back to and the first cargo invocation at the repository root fails
# before anything is built.
#
# Naming stable does not weaken the pin. rustup applies a directory-local
# rust-toolchain.toml whenever it enters that directory and installs it on
# demand, so cosmic-comp still compiles with the 1.93 it asks for while
# everything else uses stable.
- name: Install Rust - name: Install Rust
run: | run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain none --profile minimal | sh -s -- -y --default-toolchain stable --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Show toolchain - name: Show toolchain