Skip to content

Commit

Permalink
If rule did not create logfile, create it in its shadow directory
Browse files Browse the repository at this point in the history
This addresses gh snakemake#1257. If the rule did not create a logfile, an empty
one would be created in its final destination. If the shadow directive
was used, however, Snakemake would try to move the nonexistent logfile
from the shadow directory to its final location. This caused the
observed failures. This commit has Snakemake create the empty file where
Snakemake would have expected the program to create it (i.e. in the
shadow directory). This enables the unshadow operation that takes place
later to succeed.
  • Loading branch information
jaicher committed Nov 12, 2021
1 parent c2ef679 commit b1af154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snakemake/dag.py
Expand Up @@ -640,7 +640,7 @@ def handle_log(self, job, upload_remote=True):
for f in job.log:
if not f.exists_local:
# If log file was not created during job, create an empty one.
f.touch_or_create()
job.shadowed_path(f).touch_or_create()
if upload_remote and f.is_remote and not f.should_stay_on_remote:
f.upload_to_remote()
if not f.exists_remote:
Expand Down

0 comments on commit b1af154

Please sign in to comment.