Error: no such module '_SwiftDispatchOverlayShims'

During swift build on linux, a compilation error occurs periodically:

<unknown>:0: warning: missing submodule '_SwiftDispatchOverlayShims'
..../swift-5.1.5/swift-corelibs-libdispatch/src/swift/Block.swift:14:8: error: no such module '_SwiftDispatchOverlayShims'
import _SwiftDispatchOverlayShims

like here: Re: [Swift CI] Build Failure: OSS - Swift Package - Ubuntu 16.04 (master) #3537

How i can fix it?

I see this occasionally, simply deleting that build directory and starting over fixes it. There's something flaky going on there, but it happens sporadically enough that nobody has probably bothered investigating.

yes, just restarting the build solves the problem. but this approach is not applicable for distribution in a package manager.