Closed michaelhofer closed 2 years ago
Hi @michaelhofer,
I'm sadly not the best person to ask, as this concerns a dependency of webcompiler. Can you please file this in the libsasshost repo?
Thanks Stefan
Hi @stefanloerwald
Sure, I will do so. I was not entirely sure if I should start there, but thanks for your reply.
Thanks Michael
I can confirm that Webcompiler runs well now on Apple Silicon with .NET 6 and WebCompiler Version 3.0.1-preview.1.
Thank you @stefanloerwald !
Hi @michaelhofer,
I have a Webcompiler configuration for my project which is compiling on my Intel iMac without any problem, but not on my Apple Silicon.
I got the following error: [MSB3073] The command "dotnet webcompiler ./Styles/Sf3.scss -c excubowebcompiler.json" exited with code 137. There is no any other error message. If I run the above command in the command line, nothing happens. I just simply get my cursor back. I have installed .NET core SDK 6.0.100.
Do you have any idea what can be wrong with my setup? Do I have to install anything else other than .NET SDK?
csproj configuration
<Target Name="ToolRestore">
<Exec Command="dotnet tool restore" StandardOutputImportance="high" />
</Target>
<Target Name="WebCompiler" DependsOnTargets="ToolRestore">
<!--compile and minify scss-->
<Exec Command="dotnet webcompiler ./Styles/Sf3.scss -c excubowebcompiler.json" StandardOutputImportance="high" StandardErrorImportance="high" />
</Target>
excubowebcompiler.json
{
"Minifiers": {
"GZip": false,
"Enabled": true,
"Css": {
"CommentMode": "Important",
"ColorNames": "Hex",
"TermSemicolons": true,
"OutputMode": "SingleLine",
"IndentSize": 2
},
"Javascript": {
"RenameLocals": false,
"PreserveImportantComments": true,
"EvalTreatment": "Ignore",
"TermSemicolons": true,
"OutputMode": "SingleLine",
"IndentSize": 2
}
},
"Autoprefix": {
"Enabled": false,
"ProcessingOptions": {
"Browsers": [
"last 4 versions"
],
"Cascade": true,
"Add": true,
"Remove": true,
"Supports": true,
"Flexbox": "All",
"Grid": "None",
"IgnoreUnknownVersions": false,
"Stats": "",
"SourceMap": true,
"InlineSourceMap": false,
"SourceMapIncludeContents": false,
"OmitSourceMapUrl": false
}
},
"CompilerSettings": {
"Sass": {
"IndentType": "Space",
"IndentWidth": 2,
"OutputStyle": "Compressed",
"RelativeUrls": true,
"LineFeed": "Lf",
"SourceMap": false
}
},
"Output": {
"Preserve": false,
"Directory": "./wwwroot/css"
}
}
dotnet-tools.json
{
"version": 1,
"isRoot": true,
"tools": {
"excubo.webcompiler": {
"version": "3.1.0-preview.1",
"commands": [
"webcompiler"
]
}
}
}
I have investigated the problem yesterday and I think the problem is not in this library.
I cloned the repository and built my own nuget from it. I think the problem is DarkSassHost itself or perhaps another dependency.
WebCompiler/Compile/SassCompiler.cs Line: 70-73
using (var compiler = new DartSassHost.SassCompiler(JsEngineFactory.Instance))
{
compile_result = compiler.CompileFile(file, tmp_output_file, file, options);
}
When you try to access any of the properties or methods on the compiler instance, the program shuts down unexpectedly. There is no any kind of exception or error message.
Strangely if I just run the WebCompiler from my IDE(Rider), then everything works fine and the css file has been created.
Now that .NET6 supports the
arm64
architecture for Apple Silicon, I am trying to get thewebcompiler
tool up and running on a Mac with an M1 processor.Unfortunately, I run in this exception (thrown by
LibSassHost
):I followed the mentioned steps and have the
libsass.dylib
in/usr/local/lib
, but that does not help.I can see that the latest version of WebCompiler targets
net6.0
as well, but are there any other adaptions required?