Skip to content

fix(install_deps): resolve SCRIPT_DIR before dependency builds cd away - #298

Merged
drunkcoding merged 1 commit into
mainfrom
infra/install-deps-script-dir
Jul 4, 2026
Merged

fix(install_deps): resolve SCRIPT_DIR before dependency builds cd away#298
drunkcoding merged 1 commit into
mainfrom
infra/install-deps-script-dir

Conversation

@drunkcoding

Copy link
Copy Markdown
Collaborator

Description

Resolve SCRIPT_DIR/BATCHGEN_DIR once at the top of scripts/install_deps.sh (before anything can cd) and reuse them in install_batchgen_kernels() / install_batchgen().

Motivation

Invoked as ./scripts/install_deps.sh, BASH_SOURCE[0] is relative; the dependency installers cd into $INSTALL_DIR (/tmp/batchgen_deps/...), so every fresh run died right after building the deps:

==> Installing batchgen_kernels (AOT-compiled CUDA kernel extensions)...
./scripts/install_deps.sh: line 257: cd: ./scripts: No such file or directory

leaving batchgen_kernels and batchgen uninstalled — i.e. INSTALL.md Option B shipped a broken install on every fresh machine (reproduced in a fresh Ubuntu 22.04 + CUDA 12.8 container: torch/FA3/FlashMLA/DeepGEMM all built, then the crash).

close #285

Verification

Fresh Ubuntu 22.04 + CUDA 12.8.1 container (no GPU, no conda cache): ./scripts/install_deps.sh --all with this PR (+ #284 for the kernels arch fix) runs end-to-end — [OK] Installation complete!, 23 batchgen_kernels extensions installed, import batchgen OK from /root.

Type of Change

  • infra — build / CI / packaging / scripts / Docker

File changes

File Δ Note
scripts/install_deps.sh mod hoist SCRIPT_DIR/BATCHGEN_DIR resolution to script top

Checklist

  • I have read the CONTRIBUTING guide and the PR Merge Policy Contract.
  • I have updated the tests (n/a — shell script; verified by fresh-container run above).
  • I have updated the documentation (n/a).

PR Merge Policy Contract — pre-merge checklist

  • git diff --stat origin/main reviewed; every file traces to the task — no unrelated files (§3.1).
  • Exactly one Type of Change ticked; all changed files within that type's permitted set (§2.5).
  • File changes table lists every changed file and matches the diff.
  • No debug/scratch scripts added (§1.1).
  • No test_*.py inside the runtime package (§1.2).
  • No new BATCHGEN_* env-var debug guard (§1.3).

install_batchgen_kernels() and install_batchgen() resolved
SCRIPT_DIR from BASH_SOURCE[0] at call time. Invoked as
./scripts/install_deps.sh, that path is relative, and the earlier
installers cd into $INSTALL_DIR (/tmp/batchgen_deps/...), so on every
fresh machine the run died at the kernels step:

  ./scripts/install_deps.sh: line 257: cd: ./scripts: No such file or directory

leaving batchgen_kernels and batchgen uninstalled. Resolve
SCRIPT_DIR/BATCHGEN_DIR once at script start and reuse them.

close #285
@drunkcoding
drunkcoding merged commit 333f5dc into main Jul 4, 2026
1 check passed
@drunkcoding
drunkcoding deleted the infra/install-deps-script-dir branch July 14, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant