feat: files.no-auto-import
All checks were successful
build / build (push) Successful in 2m2s
build / trigger-build-image (push) Successful in 9s

This commit is contained in:
张泊明518370910136 2025-10-08 05:59:47 -07:00
parent 701541c032
commit dd5f1123b4
GPG Key ID: D47306D7062CDA9D
3 changed files with 10 additions and 1 deletions

View File

@ -132,6 +132,9 @@ class StageFiles(StrictBaseModel):
import_map: Dict[str, str] = Field(
{}, validation_alias=AliasChoices("import-map", "import_map")
)
no_auto_import: List[str] = Field(
[], validation_alias=AliasChoices("no-auto-import", "no_auto_import")
)
class Limit(StrictBaseModel):

View File

@ -105,7 +105,11 @@ def get_executor_with(
copy_in=copy_in,
copy_in_dir="." if task_stage.copy_in_cwd else "",
copy_out=copy_out_files,
copy_in_cached={file: file for file in cached},
copy_in_cached={
file: file
for file in cached
if file not in task_stage.files.no_auto_import
},
copy_out_cached=file_export,
cpu_limit=task_stage.limit.cpu,
clock_limit=task_stage.limit.time,

View File

@ -66,6 +66,8 @@ files.import-map = { "tools/Makefile" = "h7/Makefile" }
# files to export from the sandbox, relative to `/w`, will be imported to later
# stages automatically
files.export = [ "yes.txt" ]
# files that should not be imported from the `export` field in previous stages
files.no-auto-import = [ "yes.txt" ]
# whether to copy all files from the current working directory from host (i.e. the whole repo)
# you can set it as false if you are in the run stage of a compiled language, as the binary is all you need
copy-in-cwd = true # default: true