@@ -953,7 +953,6 @@ prompt_rtk_selection() {
953953 # it for token-compact output (runtime opt-out: ATELIER_BASH_EXTERNAL_COMPACTORS=0).
954954 [[ " ${ATELIER_INSTALL_RTK:- } " == " 0" ]] && return 0
955955 command -v rtk > /dev/null 2>&1 && { INSTALL_RTK=1; return 0; }
956- command -v cargo > /dev/null 2>&1 || return 0
957956 if [[ " ${ATELIER_INSTALL_RTK:- } " == " 1" ]]; then
958957 INSTALL_RTK=1
959958 return 0
@@ -1764,21 +1763,21 @@ install_jj_if_needed() {
17641763 case " $OS_NAME " in
17651764 darwin)
17661765 if command -v brew > /dev/null 2>&1 ; then
1767- spin " Installing jj (Jujutsu)" brew install jj \
1766+ spin_tail " Installing jj (Jujutsu)" brew install jj \
17681767 || warn " jj install failed — continuing without it"
17691768 elif command -v cargo > /dev/null 2>&1 ; then
1770- spin " Installing jj (Jujutsu)" cargo install --locked jj-cli \
1769+ spin_tail " Installing jj (Jujutsu)" cargo install --locked jj-cli \
17711770 || warn " jj install failed — continuing without it"
17721771 else
17731772 warn " Neither Homebrew nor cargo found. Install jj manually: https://martinvonz.github.io/jj/latest/install-and-setup"
17741773 fi
17751774 ;;
17761775 linux)
17771776 if command -v cargo > /dev/null 2>&1 ; then
1778- spin " Installing jj (Jujutsu)" cargo install --locked jj-cli \
1777+ spin_tail " Installing jj (Jujutsu)" cargo install --locked jj-cli \
17791778 || warn " jj install failed — continuing without it"
17801779 elif command -v brew > /dev/null 2>&1 ; then
1781- spin " Installing jj (Jujutsu)" brew install jj \
1780+ spin_tail " Installing jj (Jujutsu)" brew install jj \
17821781 || warn " jj install failed — continuing without it"
17831782 else
17841783 warn " cargo not found. Install jj manually: https://martinvonz.github.io/jj/latest/install-and-setup"
@@ -1790,6 +1789,17 @@ install_jj_if_needed() {
17901789# Install rtk when prompt_rtk_selection opted in. Soft integration: a failed
17911790# install only warns — it must never fail the Atelier install. Pinned to
17921791# ATELIER_RTK_TAG so release-time installs are reproducible.
1792+ # Bootstrap a minimal Rust toolchain via rustup when cargo is missing, so the
1793+ # optional rtk install (`cargo install --git ...`) below has something to run.
1794+ # Runs rustup's own installer, which persists PATH into the shell profile
1795+ # itself. Failure here is soft: rtk stays skipped, nothing else in the
1796+ # installer depends on cargo.
1797+ _install_rustup () {
1798+ command -v curl > /dev/null 2>&1 || return 1
1799+ curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs \
1800+ | sh -s -- -y -q --default-toolchain stable --profile minimal
1801+ }
1802+
17931803install_rtk_if_selected () {
17941804 [[ " $INSTALL_RTK " != " 1" ]] && return 0
17951805 local rtk_ref=()
@@ -1805,7 +1815,20 @@ install_rtk_if_selected() {
18051815 echo " [dry-run] cargo install --git https://github.com/rtk-ai/rtk${ATELIER_RTK_TAG: + --tag ${ATELIER_RTK_TAG} } "
18061816 return 0
18071817 fi
1808- spin " Installing rtk ${ATELIER_RTK_TAG:- HEAD} (command compactor)" \
1818+ if ! command -v cargo > /dev/null 2>&1 ; then
1819+ # spin_tail (not spin): rustup's download+extract takes a while with
1820+ # no output otherwise, which reads as a hung spinner.
1821+ spin_tail " Installing Rust toolchain (cargo, for rtk)" _install_rustup \
1822+ || warn " rustup install failed — install cargo manually from https://rustup.rs to enable rtk."
1823+ [[ -x " ${HOME} /.cargo/bin/cargo" ]] && export PATH=" ${HOME} /.cargo/bin:${PATH} "
1824+ fi
1825+ if ! command -v cargo > /dev/null 2>&1 ; then
1826+ warn " cargo unavailable — skipping rtk (Atelier works without it)."
1827+ return 0
1828+ fi
1829+ # spin_tail: a from-source cargo build can take minutes; stream the
1830+ # "Compiling ..." lines so it doesn't look stuck.
1831+ spin_tail " Installing rtk ${ATELIER_RTK_TAG:- HEAD} (command compactor)" \
18091832 cargo install --git https://github.com/rtk-ai/rtk ${rtk_ref[@]+" ${rtk_ref[@]} " } \
18101833 || warn " rtk install failed — Atelier works without it (soft integration)."
18111834}
@@ -1889,7 +1912,7 @@ install_code_tools() {
18891912 _SPINNER_MSG=" JS/TS tooling already installed"
18901913 _spinner_stop ok
18911914 else
1892- spin " Installing JS/TS tooling" npm install -g --prefix " $ATELIER_NODE_DIR " --no-fund eslint ts-morph typescript
1915+ spin_tail " Installing JS/TS tooling" npm install -g --prefix " $ATELIER_NODE_DIR " --no-fund eslint ts-morph typescript
18931916 fi
18941917 else
18951918 warn " npm not found - skipping JS/TS tools. Install Node.js 20+ to enable."
0 commit comments