Repository navigation
scripts: install the Linux prerequisites in one command (BUILD-LINUX-DEPS-INSTALLER) - #1140
Conversation
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Reviewed and verified. Adds scripts/install_deps_linux.sh supporting apt, dnf, and pacman with --dry-run, --minimal, and post-install tool verification for Python, LLVM/AMDGPU, SPIRV-Tools, and CMake. Clean-room compliant.
|
Recommendation: [WAIT] Reasoning: Adds Impact level: 3/10 |
xel1uz
left a comment
There was a problem hiding this comment.
With empty apt lists, the installer runs apt-get update before the first prompt. I reproduced this on Ubuntu 26.04.1 (apt 3.2.1) using a temporary apt index and a local file: package source. Answering n on this revision still changed the index.
These four suggestions go together. They ask before refreshing an empty index, then show the resolved packages and ask before installing. With the fix, n, Enter, and EOF each produced zero apt-get calls and left the index contents and modification times unchanged. Answering yes then no refreshed once and skipped installation. I also checked --dry-run and --yes. The refresh used real apt; installs were simulated.
| ID_LIKE=${ID_LIKE:-} | ||
| is_like() { case " $ID $ID_LIKE " in *" $1 "*) return 0 ;; esac; return 1; } | ||
|
|
||
| apt_has() { apt-cache show "$1" >/dev/null 2>&1; } |
There was a problem hiding this comment.
| apt_has() { apt-cache show "$1" >/dev/null 2>&1; } | |
| confirm() { | |
| local answer | |
| [ "$assume_yes" -eq 1 ] && return 0 | |
| read -r -p "$1 [y/N] " answer || return 1 | |
| case "$answer" in y|Y|yes|o|O|oui) return 0 ;; *) return 1 ;; esac | |
| } | |
| apt_has() { apt-cache show "$1" >/dev/null 2>&1; } |
| say "+ ${SU}apt-get update" | ||
| "${SUDO[@]}" apt-get update | ||
| fi |
There was a problem hiding this comment.
| say "+ ${SU}apt-get update" | |
| "${SUDO[@]}" apt-get update | |
| fi | |
| say "Package lists are needed to choose an LLVM version: ${SU}apt-get update" | |
| confirm "Refresh the package lists now?" || { say "Nothing installed."; exit 1; } | |
| say "+ ${SU}apt-get update" | |
| "${SUDO[@]}" apt-get update | |
| else | |
| plan "${SU}apt-get update" | |
| fi |
| plan "${SU}apt-get update" | ||
| plan "${SU}apt-get install -y ${pkgs[*]} ${optional[*]}" |
There was a problem hiding this comment.
| plan "${SU}apt-get update" | |
| plan "${SU}apt-get install -y ${pkgs[*]} ${optional[*]}" | |
| plan "${SU}apt-get install -y ${pkgs[*]} ${optional[*]}" |
| if [ "$assume_yes" -eq 0 ]; then | ||
| read -r -p "Run them? [y/N] " answer | ||
| case "$answer" in y|Y|yes|o|O|oui) ;; *) say "Nothing installed."; exit 1 ;; esac | ||
| fi |
There was a problem hiding this comment.
| if [ "$assume_yes" -eq 0 ]; then | |
| read -r -p "Run them? [y/N] " answer | |
| case "$answer" in y|Y|yes|o|O|oui) ;; *) say "Nothing installed."; exit 1 ;; esac | |
| fi | |
| confirm "Run them?" || { say "Nothing installed."; exit 1; } |
With empty apt lists the installer ran apt-get update before its first
prompt, so answering no still changed the index. It now asks first
("Refresh the package lists now?"), puts apt-get update in the shown
plan otherwise, and one confirm() handles n, Enter and EOF as no.
Suggested by xel1uz in the review of ProjectLeonida#1140.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@xel1uz thanks, you're right: the empty-index refresh ran before any prompt. Applied your four suggestions in 7eb78cf. Checked in a @Deedlyy the AI-assisted. |
…DEPS-INSTALLER) scripts/install_deps_linux.sh installs what docs/linux.md lists with apt (Debian, Ubuntu and derivatives), dnf or pacman. It takes the newest llvm-21 or later the distribution packages, leaves out optional packages it lacks, shows the commands and asks before running them (--dry-run, --yes, --minimal), then checks Python 3.12+, llvm-mc with AMDGPU, SPIRV-Tools, CMake 3.24+, Ninja, a C++ compiler and the Vulkan headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With empty apt lists the installer ran apt-get update before its first
prompt, so answering no still changed the index. It now asks first
("Refresh the package lists now?"), puts apt-get update in the shown
plan otherwise, and one confirm() handles n, Enter and EOF as no.
Suggested by xel1uz in the review of ProjectLeonida#1140.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7eb78cf to
b72251b
Compare
|
#1140 | head b72251b (merged cleanly with main adfb382) | Audited |
|
Checked
AI-assisted (Claude Code). |
|
Read at b72251b against main bd643e4 (diff reading only). This answers the "no test" question.
AI-assisted (Claude Code). |
|
Read-only check by OreoFR on macOS 27.2.1 (26B131), Apple M5, main 7c330c7, PR head b72251b — not executed (apt installer, not runnable on macOS)
Verdict: read-only OK (needs a run on a Linux box for a real red/green). AI-assisted: Claude Code |
aslan2142
left a comment
There was a problem hiding this comment.
Reviewed scripts/install_deps_linux.sh and docs/linux.md: clean-room compliant, supports apt/dnf/pacman with --dry-run, --yes, --minimal, prompts before both empty-index refresh (addressing @xel1uz's review) and package installation, and validates the installed toolchain afterward. Merges cleanly onto main.
Not merging immediately because the Nov 24 CI run is stale/red (windows, linux-gpu-tools, translator-tests, check cancelled). Ready to merge once CI is re-run green on current main (note: LLVM_TRY=(23 22 21) already prefers llvm-23 when available; you may optionally update the LLVM 21+ note for the shaders stage to align with #1923).
(AI-assisted review.)
Claimed in the coordination issue as: BUILD-LINUX-DEPS-INSTALLER (#14)
scripts/install_deps_linux.shinstalls whatdocs/linux.mdlists, in one command:llvm-21or later the system's own sources have (llvm-22on Debian 12 and 13,llvm-21on Ubuntu 22.04 and 24.04,llvm-22on 26.04), so no extra repository is needed;--dry-runonly shows them,--yesdoesn't ask,--minimalleaves the optional ones out;spirv-as/spirv-val, CMake 3.24+, Ninja, a C++ compiler, the Vulkan headers.It touches nothing of the game and downloads only distribution packages.
docs/linux.mdgets one paragraph pointing at it, above the manual list (left as it was).Tested (containers, as root):
debian:trixie, full install with--yes --minimal: every check ok (llvm-mc-22).debian:bookworm, full install: everything installs; the check reports Python 3.11 as too old, as it should.ubuntu:22.04,ubuntu:24.04,ubuntu:26.04,fedora:latest(45),archlinux:latest:--dry-runpicks the expected packages.--dry-runwith sudo.AI-assisted (Claude Code).
🤖 Generated with Claude Code