Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions cli-tools/nddev_junie_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"--agent-location",
"--agent-default-location",
"--command-location",
"--command-default-locations",
"--command-default-location",
"--extensions-default-location",
"--guidelines-filename",
"--model-location",
Expand Down Expand Up @@ -4317,7 +4317,12 @@ def resolve_junie_binary(version_dir: Path, target: Path) -> Path:
for candidate in candidates:
try:
info = candidate.lstat()
except FileNotFoundError:
except (FileNotFoundError, NotADirectoryError):
# FileNotFoundError: candidate does not exist.
# NotADirectoryError: an earlier path component is a regular file
# (e.g. versions/<v>/junie is the launcher script, so
# versions/<v>/junie/bin/junie cannot be traversed). Either way
# this candidate is not the binary; try the next one.
continue
try:
require_current_owner(info, "Junie binary")
Expand Down Expand Up @@ -4695,7 +4700,7 @@ def run_stage_version_probe(stage_home: Path, version: str, timeout: int) -> Non
"false",
"--command-location",
str(commands),
"--command-default-locations",
"--command-default-location",
"false",
"--model-default-locations",
"false",
Expand All @@ -4711,6 +4716,12 @@ def run_stage_version_probe(stage_home: Path, version: str, timeout: int) -> Non
capture_output=True,
check=False,
timeout=timeout,
# Junie is a JVM app that writes runtime state (~/.junie) under the
# isolated probe HOME. Force an owner-only umask so anything it
# creates is already private and survives the
# require_private_directory check that follows, regardless of the
# caller's ambient umask.
preexec_fn=lambda: os.umask(0o077),
)
except FileNotFoundError as exc:
fail(f"stage Junie version probe command is missing: {exc}")
Expand Down Expand Up @@ -6800,7 +6811,7 @@ def build_launch_plan_locked(target: Path, child_args: list[str]) -> LaunchPlan:
"false",
"--command-location",
str((canonical / "commands").resolve()),
"--command-default-locations",
"--command-default-location",
"false",
"--model-default-locations",
"false",
Expand Down