Skip to content

ForceNoOutput causing graph duplication #350

Description

@coryb

When we run the second target from this HLB:

fs _first() {
	image "busybox"
	run "echo first" with option {
		mount scratch localCwd as first
	}
}

fs _second() {
	_first
	run "echo second" with option {
		mount first localCwd as second
	}
}

we will see something like:

#1 resolve image config for docker.io/library/busybox:latest
#1 DONE 0.4s

#2 docker-image://docker.io/library/busybox:latest
#2 resolve docker.io/library/busybox:latest
#2 resolve docker.io/library/busybox:latest 0.3s done
#2 CACHED

#3 /bin/sh -c 'echo first'
#3 CACHED

#4 /bin/sh -c 'echo first'
#4 0.270 first
#4 DONE 0.3s

#5 /bin/sh -c 'echo second'
#5 0.499 second
#5 DONE 0.5s

Note the echo first is evaluated twice, if we add noCache it will run echo first twice in two different containers. The duplication goes away when we remove this line

I am at a loss for how to fix this. It seems the first mount is getting evaluated twice once has ForceNoOutput applied and one has the Bind logic applied. I am not sure why the Bind logic would not be applied in both locations.

We should probably revert #347 and #348 unless anyone has ideas on how to work around this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions