johan-v-r / LibSassBuilder

Sass builder for .NET projects
MIT License
99 stars 14 forks source link

Plans for supporting arm64 architecture on macOS (i.e. Apple M1 CPUs)? #48

Open ChristianWeyer opened 2 years ago

ChristianWeyer commented 2 years ago

Hi @johan-v-r - thanks a lot for this great lib. It has helped us many times. Before some of us moved to the M1 😅

When trying to use the tool e.g. as a global dotnet tool, we get this error:

➜  Client git:(net60) lsb directory .
Sass compile directory: .
Unhandled exception. LibSassHost.SassCompilerLoadException: During loading of Sass compiler error has occurred. Most likely it happened, because the 'libsass.dylib' assembly or one of its dependencies was not found. There is no LibSassHost.Native.osx-* package for the arm64 processor architecture. You can build the 'libsass.dylib' assembly for the current processor architecture by using following instructions - https://github.com/Taritsyn/LibSassHost#os-x-1. ---> System.DllNotFoundException: Unable to load shared library 'libsass' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibsass, 0x0001): tried: 'liblibsass' (no such file), '/usr/local/lib/liblibsass' (no such file), '/usr/lib/liblibsass' (no such file), '/Users/christianweyer/Sources/blazor-wasm-things-to-know/IsolatedCssSass/Client/liblibsass' (no such file), '/usr/local/lib/liblibsass' (no such file), '/usr/lib/liblibsass' (no such file)
   at LibSassHost.Internal.Native.Sass_Api.libsass_version()
   at LibSassHost.Internal.SassCompilerProxy.GetVersion()
   at LibSassHost.SassCompiler.Initialize()
   at LibSassHost.SassCompiler.Initialize()
   at LibSassHost.SassCompiler.CompileFile(String inputPath, String outputPath, String sourceMapPath, CompilationOptions options)
   at LibSassBuilder.Program.CompileFilesAsync(IEnumerable`1 sassFiles) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 93
   at LibSassBuilder.Program.CompileDirectoriesAsync(String directory, IEnumerable`1 excludedDirectories) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 67
   at LibSassBuilder.Program.CompileDirectoriesAsync(String directory, IEnumerable`1 excludedDirectories) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 76
   at LibSassBuilder.Program.<>c.<<Main>b__0_2>d.MoveNext() in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 34
--- End of stack trace from previous location ---
   at CommandLine.ParserResultExtensions.WithParsedAsync[T](ParserResult`1 result, Func`2 action)
   at LibSassBuilder.Program.Main(String[] args) in D:\a\LibSassBuilder\LibSassBuilder\src\LibSassBuilder\Program.cs:line 22
   at LibSassBuilder.Program.<Main>(String[] args)

[1]    41974 abort      lsb directory .

Are you planning to include arm64 support anytime soon? Thanks!

johan-v-r commented 2 years ago

Hi Christian - thanks for the feedback!

The supported platforms are dependent on LibSassHost - and unfortunately I don't see any package for it yet. We can defo add it If/when it's available, but I think focus will be shifted towards DartSassHost & our DartSassBuilder going forward.

ChristianWeyer commented 2 years ago

Great. Thanks for your answer. This is actually why I also added an issue over there ;-) https://github.com/deanwiseman/DartSassBuilder/issues/17

CookieBox commented 2 years ago

I appreciate this is a slightly older topic, and the project is moving over to DartSassBuilder, however I was able to get this project working on an M1 Pro MacBook Pro - if anyone is interested?

I'm still figuring out how this would be packaged into the NuGet package, but my solution was the following:

Apologies I haven't been able to find any further information, or provide a PR fix - I'll see if I can submit the generated file as a PR on the LibSassHost project later, which may allow this project to be updated and support arm64.