diff --git a/joj3_config_generator/models/task.py b/joj3_config_generator/models/task.py index c58d57e..50107f9 100644 --- a/joj3_config_generator/models/task.py +++ b/joj3_config_generator/models/task.py @@ -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): diff --git a/joj3_config_generator/transformers/task.py b/joj3_config_generator/transformers/task.py index d30cda3..26adb53 100644 --- a/joj3_config_generator/transformers/task.py +++ b/joj3_config_generator/transformers/task.py @@ -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, diff --git a/tests/convert/full/task.toml b/tests/convert/full/task.toml index 2a33dd5..553be99 100644 --- a/tests/convert/full/task.toml +++ b/tests/convert/full/task.toml @@ -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