Skip to content

build: Split the Ubuntu dev-dependency install script into common, huntsman, and wolf variants. - #336

Merged
LinZhihao-723 merged 4 commits into
y-scope:mainfrom
LinZhihao-723:install-dev-refactor
Jun 7, 2026
Merged

build: Split the Ubuntu dev-dependency install script into common, huntsman, and wolf variants.#336
LinZhihao-723 merged 4 commits into
y-scope:mainfrom
LinZhihao-723:install-dev-refactor

Conversation

@LinZhihao-723

@LinZhihao-723 LinZhihao-723 commented Jun 5, 2026

Copy link
Copy Markdown
Member

Description

tools/scripts/lib_install/linux/install-dev.sh installed everything required to build Spider Wolf (C++), but Spider Huntsman (Rust) only needs a small subset of those dependencies. This PR splits the script so each consumer installs exactly what it needs, and renames the containing directory to reflect what the scripts actually target.

Changes

  • Split install-dev.sh into three scripts:
    • install-dev-common.sh — dependencies shared by all versions: ca-certificates, curl, git, python3, python3-pip, python3-venv, and the uv installer. Owns the apt-get update and privilege-elevation preamble.
    • install-dev-huntsman.sh — runs the common script, then installs gcc and libc6-dev, which rustc requires to link binaries (it invokes the system C compiler driver). Note: libc6-dev is listed explicitly because it previously arrived transitively through libssl-dev/libmariadb-dev, which the huntsman variant no longer installs.
    • install-dev-wolf.sh — runs the common script, then installs the C++ toolchain and native libraries (checkinstall, g++, gcc, jq, libcurl4, libcurl4-openssl-dev, libmariadb-dev, libssl-dev, make, openjdk-11-jdk, pkg-config) and performs the CMake install + version check, which are Wolf-only.
  • Renamed tools/scripts/lib_install/linux to tools/scripts/lib_install/ubuntu: the scripts use apt-get and Debian-family package names, which are not portable across Linux distributions, and all current consumers run Ubuntu (CI runners and the dev container). The new layout also telegraphs how support for another distribution would be added (a sibling directory with the same script names).
  • Updated all consumers:
    • .github/workflows/code-linting-checks.yaml: lint-common and lint-python now use the common script; lint-cpp uses the wolf script; lint-rust uses the huntsman script.
    • .github/workflows/tests.yaml: wolf-tests uses the wolf script; huntsman-tests uses the huntsman script.
    • .devcontainer/Dockerfile: runs both the wolf and huntsman scripts since the dev container is a full development environment for both versions.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Summary by CodeRabbit

Release Notes

  • Chores
    • Refactored development environment setup to use Ubuntu-specific installation scripts instead of generic Linux installers, improving system compatibility and reliability. The new modular approach separates common dependencies from component-specific requirements, streamlining both local development setup and continuous integration workflows. These changes enhance consistency and maintainability across all development environments.

@LinZhihao-723
LinZhihao-723 requested review from a team and sitaowang1998 as code owners June 5, 2026 21:08
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes.

Review Change Stack

Walkthrough

Development dependency installation is refactored from a single generic Linux script to Ubuntu-specific modular scripts. A new common installer handles shared setup (apt update, base packages, uv), while Wolf and Huntsman installers handle component-specific packages. All references in the devcontainer and CI workflows are updated to call the appropriate scripts.

Changes

Ubuntu-specific installation scripts

Layer / File(s) Summary
Shared and component-specific installer scripts
tools/scripts/lib_install/ubuntu/install-dev-common.sh, tools/scripts/lib_install/ubuntu/install-dev-wolf.sh, tools/scripts/lib_install/ubuntu/install-dev-huntsman.sh
New install-dev-common.sh provides shared Ubuntu setup (apt update, common packages, uv installation). Refactored install-dev-wolf.sh delegates common setup to the shared script and installs only Wolf-specific packages and CMake. New install-dev-huntsman.sh delegates to common and installs Huntsman-specific packages (gcc, libc6-dev).
Container and CI/CD integration
.devcontainer/Dockerfile, .github/workflows/code-linting-checks.yaml, .github/workflows/tests.yaml
Devcontainer and all CI workflow jobs (lint-common, lint-cpp, lint-python, lint-rust, wolf-tests, huntsman-tests) are updated to call the new Ubuntu-specific installer scripts instead of the generic Linux installer.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: splitting the Ubuntu dev-dependency install script into three variants (common, huntsman, wolf).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (4)
tools/scripts/lib_install/ubuntu/install-dev-common.sh (2)

18-18: 💤 Low value

Consider adding DEBIAN_FRONTEND=noninteractive to apt-get update for consistency.

While apt-get update typically doesn't prompt interactively, setting DEBIAN_FRONTEND=noninteractive here would match the pattern used on line 19 and ensure consistent non-interactive behaviour across all apt operations.

♻️ Proposed change
-${privileged_command_prefix} apt-get update
+DEBIAN_FRONTEND=noninteractive ${privileged_command_prefix} apt-get update
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/scripts/lib_install/ubuntu/install-dev-common.sh` at line 18, The
apt-get update invocation using ${privileged_command_prefix} should be run
non-interactively like the subsequent apt commands; update the command that
invokes "apt-get update" (the line using the variable
${privileged_command_prefix}) to prefix it with DEBIAN_FRONTEND=noninteractive
so it matches the non-interactive pattern used on the following line and ensures
consistent behavior across all apt operations.

29-29: ⚡ Quick win

Consider verifying the uv installer script integrity.

Piping a remote script directly to sh is convenient but introduces a supply-chain risk. While the URL uses HTTPS and points to the official Astral uv installer, consider adding checksum verification or pinning to a specific version if reproducibility and additional security assurance are priorities.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/scripts/lib_install/ubuntu/install-dev-common.sh` at line 29, The
installer is being piped directly into sh which is a supply-chain risk; change
the flow in install-dev-common.sh so you first download the script (referenced
by the existing curl invocation), verify integrity (either fetch a published
checksum/signature from the vendor and validate it or pin to a specific
versioned installer URL), and only then execute the verified script;
alternatively replace the piped URL with a stable, versioned release URL from
Astral (or verify a GPG signature) before invoking sh.
.github/workflows/code-linting-checks.yaml (1)

47-50: Informational: uv is installed twice in jobs using install-dev-common.sh.

The workflow installs uv via the GitHub action (line 47), then install-dev-common.sh installs it again (line 50). The uv installer is idempotent, so this works correctly but performs redundant work. The same pattern applies to lint-python (lines 151-154). This redundancy likely existed before this refactor and is not a new issue.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/code-linting-checks.yaml around lines 47 - 50, Remove the
duplicate uv installation by choosing one source of truth: either keep the
GitHub action step "./tools/yscope-dev-utils/exports/github/actions/install-uv"
or keep the script step named "Install dev dependencies" that runs
"./tools/scripts/lib_install/ubuntu/install-dev-common.sh"; update the workflow
to remove the other step, or alternatively modify install-dev-common.sh to
detect an existing uv install and skip reinstalling (add an idempotent check
before install). Also apply the same de-duplication for the lint-python
installation (the corresponding install action and the install-dev-common.sh
invocation).
.devcontainer/Dockerfile (1)

8-9: Note: install-dev-common.sh runs twice (once per component script).

Since both wolf and huntsman internally call install-dev-common.sh, the common setup (including apt-get update and base package checks) executes twice. This is slightly inefficient but maintains script independence, allowing each component script to run standalone. The duplicate installations are harmless (apt and uv are idempotent), so this trade-off is acceptable for maintainability.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.devcontainer/Dockerfile around lines 8 - 9, Both component installers
(install-dev-wolf.sh and install-dev-huntsman.sh) call install-dev-common.sh,
causing the common setup to run twice; change the Dockerfile so
install-dev-common.sh runs only once before invoking the two component scripts,
or modify the component scripts to respect an environment flag (e.g.,
SKIP_COMMON) and set that flag when calling the second script. Locate
install-dev-wolf.sh, install-dev-huntsman.sh and install-dev-common.sh
references in the diff and either (A) add a separate RUN invocation for
install-dev-common.sh once and then run both component scripts, or (B) update
the component scripts to check SKIP_COMMON and set SKIP_COMMON=1 in the
Dockerfile for subsequent calls to avoid re-running the common installer.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.devcontainer/Dockerfile:
- Around line 8-9: Both component installers (install-dev-wolf.sh and
install-dev-huntsman.sh) call install-dev-common.sh, causing the common setup to
run twice; change the Dockerfile so install-dev-common.sh runs only once before
invoking the two component scripts, or modify the component scripts to respect
an environment flag (e.g., SKIP_COMMON) and set that flag when calling the
second script. Locate install-dev-wolf.sh, install-dev-huntsman.sh and
install-dev-common.sh references in the diff and either (A) add a separate RUN
invocation for install-dev-common.sh once and then run both component scripts,
or (B) update the component scripts to check SKIP_COMMON and set SKIP_COMMON=1
in the Dockerfile for subsequent calls to avoid re-running the common installer.

In @.github/workflows/code-linting-checks.yaml:
- Around line 47-50: Remove the duplicate uv installation by choosing one source
of truth: either keep the GitHub action step
"./tools/yscope-dev-utils/exports/github/actions/install-uv" or keep the script
step named "Install dev dependencies" that runs
"./tools/scripts/lib_install/ubuntu/install-dev-common.sh"; update the workflow
to remove the other step, or alternatively modify install-dev-common.sh to
detect an existing uv install and skip reinstalling (add an idempotent check
before install). Also apply the same de-duplication for the lint-python
installation (the corresponding install action and the install-dev-common.sh
invocation).

In `@tools/scripts/lib_install/ubuntu/install-dev-common.sh`:
- Line 18: The apt-get update invocation using ${privileged_command_prefix}
should be run non-interactively like the subsequent apt commands; update the
command that invokes "apt-get update" (the line using the variable
${privileged_command_prefix}) to prefix it with DEBIAN_FRONTEND=noninteractive
so it matches the non-interactive pattern used on the following line and ensures
consistent behavior across all apt operations.
- Line 29: The installer is being piped directly into sh which is a supply-chain
risk; change the flow in install-dev-common.sh so you first download the script
(referenced by the existing curl invocation), verify integrity (either fetch a
published checksum/signature from the vendor and validate it or pin to a
specific versioned installer URL), and only then execute the verified script;
alternatively replace the piped URL with a stable, versioned release URL from
Astral (or verify a GPG signature) before invoking sh.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e5ac8d1f-e8c4-4c38-9461-64de296655bd

📥 Commits

Reviewing files that changed from the base of the PR and between 100129e and f845d20.

📒 Files selected for processing (6)
  • .devcontainer/Dockerfile
  • .github/workflows/code-linting-checks.yaml
  • .github/workflows/tests.yaml
  • tools/scripts/lib_install/ubuntu/install-dev-common.sh
  • tools/scripts/lib_install/ubuntu/install-dev-huntsman.sh
  • tools/scripts/lib_install/ubuntu/install-dev-wolf.sh

@LinZhihao-723
LinZhihao-723 merged commit 0683275 into y-scope:main Jun 7, 2026
12 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.

2 participants