From ea93e52a63913bc9503c7c7163b992ac04d484f9 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 22 Jan 2020 21:48:40 +0100 Subject: [PATCH] build: fix sass async worker patch causing successful builds to fail The sass async worker patch seems to cause successful builds to fail. This is because the `@bazel/worker` package expects the Promise to resolve with a boolean (`true` = good, `false` failing build). --- tools/bazel/sass_worker_async.patch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/bazel/sass_worker_async.patch b/tools/bazel/sass_worker_async.patch index 09562ba2ee63..b79d73b19987 100644 --- a/tools/bazel/sass_worker_async.patch +++ b/tools/bazel/sass_worker_async.patch @@ -1,14 +1,16 @@ diff --git sass/sass_wrapper.js sass/sass_wrapper.js -index 21abb8f..168ee49 100644 +index 21abb8f..9c750a3 100644 --- sass/sass_wrapper.js +++ sass/sass_wrapper.js -@@ -17,7 +17,9 @@ const fs = require('fs'); +@@ -17,7 +17,11 @@ const fs = require('fs'); const args = process.argv.slice(2); if (runAsWorker(args)) { debug('Starting Sass compiler persistent worker...'); - runWorkerLoop(args => sass.run_(args)); + runWorkerLoop(args => { -+ return new Promise((resolve, reject) => sass.run_(args)['then$1$2$onError'](resolve, reject)); ++ return new Promise(resolve => { ++ sass.run_(args)['then$1$2$onError'](() => resolve(true), () => resolve(false)); ++ }); + }); // Note: intentionally don't process.exit() here, because runWorkerLoop // is waiting for async callbacks from node.