Closed 8399Saalsat closed 1 year ago
I was able to get all of the tests passing by switching the ClearScript.V8 engine switcher packages out with the ChakraCore equivalent packages. The ChakraCore libaries work on both Linux and Windows (I am unable to test on Mac).
I'm not sure if there was a specific reason V8 was chosen over ChakraCore. I did notice the example projects in the DartSassHost library also use ChakraCore.
I can submit my changes for PR if there's interest.
Restored /home/buildagent/webcompilertest/WebCompiler/WebCompiler/WebCompiler.csproj (in 348 ms).
Restored /home/buildagent/webcompilertest/WebCompiler/Tests_WebCompiler/Tests_WebCompiler.csproj (in 348 ms).
/home/buildagent/webcompilertest/WebCompiler/WebCompiler/Program.cs(63,17): warning SYSLIB0020: 'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' [/home/buildagent/webcompilertest/WebCompiler/WebCompiler/WebCompiler.csproj]
/home/buildagent/webcompilertest/WebCompiler/WebCompiler/Program.cs(266,38): warning CS8604: Possible null reference argument for parameter 'value' in 'bool string.StartsWith(string value)'. [/home/buildagent/webcompilertest/WebCompiler/WebCompiler/WebCompiler.csproj]
/home/buildagent/webcompilertest/WebCompiler/WebCompiler/Program.cs(255,20): warning CS8603: Possible null reference return. [/home/buildagent/webcompilertest/WebCompiler/WebCompiler/WebCompiler.csproj]
/home/buildagent/webcompilertest/WebCompiler/WebCompiler/Compile/SassCompiler.cs(167,50): warning CS8604: Possible null reference argument for parameter 'path1' in 'string Path.Combine(string path1, string path2)'. [/home/buildagent/webcompilertest/WebCompiler/WebCompiler/WebCompiler.csproj]
/home/buildagent/webcompilertest/WebCompiler/WebCompiler/Compile/SassCompiler.cs(178,50): warning CS8604: Possible null reference argument for parameter 'path1' in 'string Path.Combine(string path1, string path2)'. [/home/buildagent/webcompilertest/WebCompiler/WebCompiler/WebCompiler.csproj]
/home/buildagent/webcompilertest/WebCompiler/WebCompiler/Compile/Place.cs(48,47): warning CS8604: Possible null reference argument for parameter 'path' in 'DirectoryInfo Directory.CreateDirectory(string path)'. [/home/buildagent/webcompilertest/WebCompiler/WebCompiler/WebCompiler.csproj]
WebCompiler -> /home/buildagent/webcompilertest/WebCompiler/WebCompiler/bin/Debug/net6.0/Excubo.WebCompiler.dll
Tests_WebCompiler -> /home/buildagent/webcompilertest/WebCompiler/Tests_WebCompiler/bin/Debug/net6.0/Tests_WebCompiler.dll
Test run for /home/buildagent/webcompilertest/WebCompiler/Tests_WebCompiler/bin/Debug/net6.0/Tests_WebCompiler.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Passed! - Failed: 0, Passed: 50, Skipped: 0, Total: 50, Duration: 26 s -```
I went ahead and opened the PR https://github.com/excubo-ag/WebCompiler/pull/61
Hi @8399Saalsat,
Thanks for raising this. The JS engine is certainly the weakest link... I had to replace it a few times already and it seems to continue to be a source of issues.
I think we had ChakraCore in the past and I remember that there were issues as well. I'll take a look at the history and try to remember what that was. I'll get back to you on this once I've found the pieces of information.
Stefan
Actually, let me do it right now. Easier to find than I thought...
Using ChakraCore, these were the issues: https://github.com/Taritsyn/AutoprefixerHost/issues/1 https://github.com/Taritsyn/DartSassHost/issues/2
I'm not quite comfortable at this point to switch back, because I want to avoid a back-and-forth thing... What do you think? Does it work for you to work with a locally built version until the issues with the dependencies are resolved?
Yeah we've got a local build of my fork that will work for now. In the mean time I'll try to get an issue opened in the ClearScript repository.
Thanks for the quick response!
Reproduction steps
dotnet test
in the solution directory)Expected results: All tests pass
Actual results: 20 of 30 tests fail with a Sass compiler error
Environment
The error states that the V8JsEngine instances couldn't be created due to a missing dependency. The dependency appears to be correctly referenced as a package in WebCompiler.csproj, so this seems like an issue in the V8 library with detecting the operating system at runtime
I have attached a screenshot of the test failure and the corresponding stack trace.