koenvzeijl / AspNetCore.SassCompiler

Sass Compiler Library for .NET Core 3.1/5.x/6.x/7.x without node, using dart-sass as a compiler
https://www.nuget.org/packages/AspNetCore.SassCompiler/
MIT License
215 stars 26 forks source link

Problems with .NET 8 on build server (alpine amd64) with nuget path set #159

Closed inf9144 closed 10 months ago

inf9144 commented 11 months ago

Describe the bug After upgrading to .NET 8 the build server is not able to compile our solution anymore.

/builds/X/X/.nuget/aspnetcore.sasscompiler/1.69.5/build/AspNetCore.SassCompiler.targets(11,5): error : Error running sass compiler: /builds/X/X/.nuget/aspnetcore.sasscompiler/1.69.5/build/../runtimes/linux-x64/sass: exec: line 20: /builds/X/X/.nuget/aspnetcore.sasscompiler/1.69.5/runtimes/linux-x64/src/dart: not found [/builds/X/X/XYZ/ABC/ABC/ABC.csproj]

To Reproduce Use dotnet restore/run/build/test with --packages referencing a directory (relative path) like .nuget like:

dotnet restore --packages .nuget
dotnet build --no-restore
dotnet test --no-restore --no-build

Expected behavior Would expect that dart is found and SassCompiler works as normal.

System Container: mcr.microsoft.com/dotnet/sdk:8.0.100-1-alpine3.18-amd64

Additional context In the local folder on my windows (with .nuget sitting in C:\user\XXX\.nuget) i can see the 'dart' file in the folder where the build script under linux says it's missing.

czkawka commented 10 months ago

Hey, Try add RUN apk add gcompat before dotnet build

Source: https://github.com/sass/dart-sass-embedded/issues/85

sleeuwen commented 10 months ago

Thanks @czkawka for providing the solution, I've tested it myself and that works indeed.

I'll add this to the readme as well so it can easily be found in the future.