Skip to content

image: Add image.ops.source() for tracked run arguments - #448

Merged
martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:run-source-args
Nov 30, 2026
Merged

martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:run-source-args

Conversation

@daandemeyer

Copy link
Copy Markdown
Member

A run() or python() argument only becomes an input through $(location), so
a project wraps every script it runs in an export_file(). A plain path to the
script runs too, because the project is mounted in the sandbox. Buck doesn't
track that file, though, and keeps the cached layer after the script changes.

Let's add image.ops.source(), which names a file of the package as a tracked
argument. The layer driver now fails on a plain argument that names a file of
the project, so a script that isn't tracked breaks the build instead of
leaving a stale image.

A run() or python() argument only becomes an input through $(location), so
a project wraps every script it runs in an export_file(). A plain path to the
script runs too, because the project is mounted in the sandbox. Buck doesn't
track that file, though, and keeps the cached layer after the script changes.

Let's add image.ops.source(), which names a file of the package as a tracked
argument. The layer driver now fails on a plain argument that names a file of
the project, so a script that isn't tracked breaks the build instead of
leaving a stale image.

Signed-off-by: Daan De Meyer <daan@amutable.com>
@martinpitt
martinpitt merged commit c644aa7 into amutable:main Nov 30, 2026
6 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