From 95c47aba55d4646daca1757df7fdafc382335c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 29 Oct 2019 14:31:18 +0000 Subject: [PATCH] cmd/gogio: clarify the need for --use-gl=egl in the e2e tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After some investigation, it turns out that both Alpine and Arch suffer from the same bug - their packages completely lack SwiftShader. The current workaround is still the best that we have right now. But at least we can actually provide a good explanation why, and a TODO to improve this once the issues filed with the distros are fixed. Signed-off-by: Daniel Martí --- cmd/gogio/js_test.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cmd/gogio/js_test.go b/cmd/gogio/js_test.go index 771ca357..c348d19e 100644 --- a/cmd/gogio/js_test.go +++ b/cmd/gogio/js_test.go @@ -43,11 +43,20 @@ func TestJSOnChrome(t *testing.T) { opts := append(chromedp.DefaultExecAllocatorOptions[:], chromedp.Flag("headless", *headless), - // We need use-gl=egl instead of the default of use-gl=desktop; - // "desktop" doesn't seem to work when we're in headless mode. - // TODO(mvdan): Does egl require a GPU? If so, consider - // use-gl=swiftshader, which will use CPU-based rendering. That - // might be necessary for some CI or headless environments. + // The default would be use-gl=desktop when there's a GPU we can + // use, falling back to use-gl=swiftshader otherwise or when we + // are running in headless mode. Swiftshader allows full WebGL + // support with just a CPU. + // + // Unfortunately, many Linux distros like Arch and Alpine + // package Chromium without Swiftshader, so we can't rely on the + // defaults above. use-gl=egl works on any machine with a GPU, + // even if we run Chrome in headless mode, which is OK for now. + // + // TODO(mvdan): remove all of this once these issues are fixed: + // + // https://bugs.archlinux.org/task/64307 + // https://gitlab.alpinelinux.org/alpine/aports/issues/10920 chromedp.Flag("use-gl", "egl"), )