Skip to content

"no local sources enabled" randomly during parallel solves #152

@coryb

Description

@coryb

Using this HLB we will compile the hlb tool in parallel for Windows, Darwin and Linux:

import go from fs {
    image "openllb/go.hlb"
}

group default() {
	go.buildCommon fs {
		local "." with option {
			includePatterns "**/*.go" "go.mod" "go.sum"
		}
	} "github.com/openllb/hlb/cmd/hlb"
}

However I see the "no local sources enabled" error around 3/4 times:

$ ./hlb run ./test.hlb
[+] Building 2.1s (4/6)
 => CACHED [import go] docker-image://docker.io/openllb/go.hlb:latest                                   0.0s
 => => resolve docker.io/openllb/go.hlb:latest                                                          1.3s
 => compiling [default]                                                                                 2.0s
 => CANCELED docker-image://docker.elastic.co/beats-dev/golang-crossbuild:1.14.2-main                   0.0s
 => => resolve docker.elastic.co/beats-dev/golang-crossbuild:1.14.2-main                                0.0s
 => ERROR local://sha256:ecc4116a1fa41562e2426429f2e4b9d711f9ce72481830e244e9e0d66a32325b (**/*.go)     0.0s
 => => transferring sha256:ecc4116a1fa41562e2426429f2e4b9d711f9ce72481830e244e9e0d66a32325b:            0.0s
------
 > local://sha256:ecc4116a1fa41562e2426429f2e4b9d711f9ce72481830e244e9e0d66a32325b (**/*.go):
------
failed to solve: rpc error: code = Unknown desc = no local sources enabled

If I keep retrying it does eventually work. There is clearly a race condition and probably shared state between parallel solves, but I have not had any luck finding it yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions