Skip to content

fix: guard tools build-context on directory existence and fix SLURM env var escaping#134

Merged
coketaste merged 1 commit into
developfrom
coketaste/fix-tests
May 29, 2026
Merged

fix: guard tools build-context on directory existence and fix SLURM env var escaping#134
coketaste merged 1 commit into
developfrom
coketaste/fix-tests

Conversation

@coketaste
Copy link
Copy Markdown
Collaborator

Summary

  • docker_builder.py: The --build-context tools= flag was unconditionally passed to every docker build command, causing builds to fail when scripts/common/tools doesn't exist. It is now
    only included when the directory is present.
  • slurm.py: shlex.quote() wraps values in single quotes, which prevents variable expansion but also breaks values containing spaces or paths when interpreted in SLURM batch scripts.
    Replaced with double-quote escaping (, ", $, `) to safely handle special characters while remaining compatible with SLURM's bash environment.

Test plan

  • Run a Docker build in an environment without scripts/common/tools — confirm build proceeds without the --build-context flag and does not error
  • Run a Docker build in an environment with scripts/common/tools — confirm --build-context tools= is included as before
  • Submit a SLURM job with env vars containing spaces, $VAR references, or file paths — confirm they are exported correctly in the batch script

…n SLURM

- docker_builder: only pass --build-context tools= when scripts/common/tools exists
- slurm: use double-quote escaping for env var values instead of shlex.quote to preserve special characters like spaces and paths correctly

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
@coketaste coketaste self-assigned this May 29, 2026
Copilot AI review requested due to automatic review settings May 29, 2026 14:45
@coketaste coketaste merged commit 2b4018b into develop May 29, 2026
1 check failed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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