Skip to content

fix sporadic failures to load DLLs by lazy loading them#74

Open
tgummerer wants to merge 1 commit into
atotto:masterfrom
tgummerer:tg/lazy-load-dll
Open

fix sporadic failures to load DLLs by lazy loading them#74
tgummerer wants to merge 1 commit into
atotto:masterfrom
tgummerer:tg/lazy-load-dll

Conversation

@tgummerer

Copy link
Copy Markdown

On Windows DLL loading sometimes fails for spurious reasons. The panic is always in the following form:

syscall.MustLoadDLL(...)
	/opt/hostedtoolcache/go/1.21.1/x64/src/syscall/dll_windows.go:94
github.com/atotto/clipboard.init()
	/home/runner/go/pkg/mod/github.com/atotto/clipboard@v0.1.4/clipboard_windows.go:22 +0x347

This appears to be happening while loading the application, and was a frequent issue in CI tests in github.com/pulumi/pulumi. We can fix this by lazy loading the DLLs instead. We've been using this fix in our go.mod, using a replace statement (see pulumi/pulumi#17410), but would love to get this upstreamed, so we can remove that replace, and hopefully it helps others as well.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant