ChildIOException inconsistency

Create issue
Issue #1299 new
Elsa created an issue

I have found some inconsistencies related to the ChildIoException error. As I understand, ChildIoException occurs when a rule has multiple outputs, one of which is a directory, and the others are files inside the directory (Correct me if I’m wrong)

So, the following example gives ChildIoException:

rule All: input: "C"

rule A:
    output: "outputA/A1", "outputA/A2", directory("outputA")
    shell: "mkdir -p outputA; touch outputA/A1; touch outputA/A2"

rule C:
    input: test="outputA/A1", testb="B"
    output: "C"
    shell: "cp {input.test} C"

ChildIOException:
File/directory is a child to another output:
/home/elsa/test/outputA
/home/elsa/test/outputA/A1

However, I have found that it is possible to work around that error by adding another rule which has the directory (“outputA”) as an input. The following code gives no error and executes correctly:

rule All: input: "C"

rule A:
    output: "outputA/A1", "outputA/A2", directory("outputA")
    shell: "mkdir -p outputA; touch outputA/A1; touch outputA/A2"

rule B:
    input: "outputA"
    output: "B"
    shell: "touch B"

rule C:
    input: test="outputA/A1", testb="B"
    output: "C"
    shell: "cp {input.test} C"

I could reproduce this in versions 5.6.0, 5.4.4 and 5.4.2

So, which behavior is correct?

Comments (1)

  1. Log in to comment