Skip to content

fix(install): show detected distro in sudo apt Accept prompt - #7324

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
Souravrajvi0:fix/6207-installer-distro-prompt
Jul 24, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
Souravrajvi0:fix/6207-installer-distro-prompt

Conversation

@Souravrajvi0

Copy link
Copy Markdown
Contributor

Fixes #6207

Problem

When install.sh needs missing build deps (e.g. libcurl4-openssl-dev), the sudo Accept prompt only says elevated permissions are required. Users cannot tell whether Unsloth recognized their distro, or whether it might install a tarball outside the system package manager instead of using the distro's official repos.

Fix

  • install.sh: Add _apt_distro_description() (reads /etc/os-release) and update the _smart_apt_install Accept prompt to name the detected distro (e.g. Ubuntu 24.04 (debian-like)) and state that sudo apt-get installs from the distro's official repositories, not a third-party tarball.
  • tests/sh/test_apt_distro_prompt.sh: Hermetic coverage for the helper plus a prompt-text contract check.

Verification

bash -n install.sh
bash tests/sh/test_apt_distro_prompt.sh

10/10 assertions pass. Live check on Ubuntu 24.04: Ubuntu 24.04 (debian-like).

Compatibility

  • Prompt-only change; package install path is still sudo apt-get update/install.
  • Non-apt hosts are unchanged (they never enter _smart_apt_install).
  • Tauri NEED_SUDO exit path is unchanged.

Make the package-install elevation prompt name the detected distro and
state that packages come from official apt repos, so users know we are
not installing a tarball outside their package manager (unslothai#6207).
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

macOS CI uses bash 3.2, which misparses case arms inside command
substitution and fails install.sh at the apt distro helper. Use a
plain subshell so the Accept? prompt still works everywhere.
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 762de70639

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

Reviewed and verified. The installer package prompt did not show which distro was detected, so users could accept an action for the wrong platform. This surfaces the detected distro in the Accept prompt. Confirmed the detected value is displayed and the prompt still gates on user consent. Codex review has no open items. The remaining red CI is pre-existing upstream breakage (Core HF/TRL) unrelated to this change. Good to merge.

@danielhanchen
danielhanchen merged commit 0807d03 into unslothai:main Jul 24, 2026
36 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Clearly show that the distro is recognised and norms will be followed when asking for permission to install packages

2 participants