Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

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

Open
ChristianWeyer opened this issue Feb 14, 2022 · 3 comments

Comments

@ChristianWeyer
Copy link

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
Copy link
Owner

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
Copy link
Author

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

@CookieBox
Copy link

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:

  • I cloned the LibSassHost repo and followed the compilation instructions detailed here: https://github.com/Taritsyn/LibSassHost#os-x-1
  • By running the build-libsass.sh script, it produced a libsass.dylib within LibSassHost/src/libsass/bin/Release/OSX
  • I then copied the generated libsass.dylib file into the USER/.nuget/packages/libsassbuilder/2.0.1/tool folder. This allowed my build process to find the relevant .dylib file and compile the sass files correctly.

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants