Skip to content

Wire cdxgen/govulncheck/scancode/toolchain-cache env vars into compose - #306

Merged
haksungjang merged 1 commit into
mainfrom
compose-env-wiring/cdxgen-toolchain-cache
Sep 3, 2026
Merged

Wire cdxgen/govulncheck/scancode/toolchain-cache env vars into compose#306
haksungjang merged 1 commit into
mainfrom
compose-env-wiring/cdxgen-toolchain-cache

Conversation

@haksungjang

Copy link
Copy Markdown
Contributor

Summary

  • 10 vars documented in .env.example (cdxgen image/spec selection, govulncheck subprocess limits, scancode enable flag, shared per-language toolchain cache size/idle/roots) were never referenced in x-backend-env, so setting them in .env had no effect on the running container.
  • Adds them to both compose files with defaults matching core/config.py exactly.

Two vars deliberately excluded

The audit also flagged EXTRACTCODE_LIBARCHIVE_PATH / TYPECODE_LIBMAGIC_PATH, but they are NOT wired here: Dockerfile.worker bakes them as image ENV pointing scancode's ctypes loader at the arm64 system libarchive/libmagic (integrations/_subprocess_env.py's comment: "MUST be forwarded or scancode crashes at import on arm64 with undefined symbol: archive_read_new"). Adding an ${VAR:-} compose line would shadow that image default with an empty string and break scancode, which is worse than the gap it would "fix". Left unreferenced on purpose.

Context

Part of the same compose env-var wiring audit as #300/#301/#303/#304.

Test plan

  • Both compose files parse as valid YAML
  • Reviewer: this touches the same anchor lines as other PRs in the batch — rebase on merge if needed

10 vars documented in .env.example (cdxgen image/spec selection,
govulncheck subprocess limits, scancode enable flag, shared
per-language toolchain cache size/idle/roots) were never referenced in
x-backend-env, so setting them in .env had no effect on the running
container. Adds them with defaults matching core/config.py exactly.

EXTRACTCODE_LIBARCHIVE_PATH / TYPECODE_LIBMAGIC_PATH were also flagged
by the audit but are deliberately excluded: Dockerfile.worker bakes
them as image ENV pointing scancode's ctypes loader at the arm64
system libarchive/libmagic, and an ${VAR:-} compose line would shadow
that with an empty string and crash scancode on import.

Part of the compose env-var wiring audit.
@haksungjang
haksungjang force-pushed the compose-env-wiring/cdxgen-toolchain-cache branch from a1ef5ec to 5b561e4 Compare September 3, 2026 06:59
@haksungjang
haksungjang merged commit 359e51b into main Sep 3, 2026
24 checks passed
@haksungjang
haksungjang deleted the compose-env-wiring/cdxgen-toolchain-cache branch September 3, 2026 07:18
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.

1 participant