Skip to content
Permalink
Browse files
fix: throw error message in case of target rule that depends on a pip…
…e. (#1532)

* fix: throw error message in case of target rule that depends on a pipe.

* skip on win
  • Loading branch information
johanneskoester committed Mar 30, 2022
1 parent 99b22d3 commit b9e9a7eff4b6e3349dde6b90eec9f5a37ef69ce7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
@@ -1308,6 +1308,12 @@ def handle_pipes_and_services(self):
"a dead lock.".format(f),
rule=job.rule,
)
elif is_pipe and depending[0].is_norun:
raise WorkflowError(
f"Output file {f} is marked as pipe but is requested by a rule that "
"does not execute anything. This is not allowed because it would lead "
"to a dead lock."
)

for dep in depending:
if dep.is_run:
@@ -0,0 +1,11 @@
rule all:
input:
"test.txt"


rule a:
output:
pipe("test.txt")
shell:
"echo test > {output}"

Empty file.
@@ -1565,3 +1565,13 @@ def test_service_jobs():

def test_incomplete_params():
run(dpath("test_incomplete_params"), dryrun=True, printshellcmds=True)


@skip_on_windows # no pipe support on windows
def test_pipe_depend():
run(dpath("test_pipe_depend"), shouldfail=True)


@skip_on_windows # no pipe support on windows
def test_pipe_depend_target_file():
run(dpath("test_pipe_depend"), targets=["test.txt"], shouldfail=True)

0 comments on commit b9e9a7e

Please sign in to comment.