dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

sass --embedded doesn't reliably exit when closing stdin on Windows

Open bep opened this issue 1 year ago • 4 comments

This is the same as #2278

This looks like a regression as the tests

  • Pass in 1.63.2
  • Fails in >= 1.77.5 (last tested 1.80.5)

This works fine on other platforms tested: MacOS and Linux.

I see no error output (stderr, log events) while testing this.

https://github.com/bep/godartsass/pull/29

bep avatar Nov 01 '24 10:11 bep

I wasn't able to reproduce this using the ruby host implementing the exactly same logic as your failing test running on GitHub Actions, and I don't have access to a local windows dev environment.

@bep Is it possible for you to build dart-sass with the following patch and see if it makes any difference:

diff --git a/lib/src/embedded/isolate_dispatcher.dart b/lib/src/embedded/isolate_dispatcher.dart
index fe79f034..085035fe 100644
--- a/lib/src/embedded/isolate_dispatcher.dart
+++ b/lib/src/embedded/isolate_dispatcher.dart
@@ -97,7 +97,7 @@ class IsolateDispatcher {
       _handleError(error, stackTrace);
     }, onDone: () {
       _closed = true;
-      _allIsolates.stream.listen((isolate) => isolate.kill());
+      exit(exitCode);
     });
   }
 

ntkme avatar Nov 01 '24 17:11 ntkme

@bep Is it possible for you to build dart-sass with the following patch and see if it makes any difference:

Reading the building from source I see nothing about cross-compiling to Windows, so I would say no. If you could point me to a Windows executable, I can find a way to test it.

bep avatar Nov 01 '24 18:11 bep

@bep Can you please try the build artifact from here: https://github.com/ntkme/dart-sass-test/actions/runs/11634405067/artifacts/2134365866

ntkme avatar Nov 01 '24 18:11 ntkme

Dart doesn't support cross-compilation, but you can build from source on Windows itself.

nex3 avatar Nov 01 '24 23:11 nex3