Skip to content

Commit

Permalink
build: fix sass async worker patch causing successful builds to fail (#…
Browse files Browse the repository at this point in the history
…18260)

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).
  • Loading branch information
devversion authored and jelbourn committed Jan 22, 2020
1 parent a949db3 commit 3cbc94a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/bazel/sass_worker_async.patch
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 3cbc94a

Please sign in to comment.