Skip to content

AARCH64 whl cannot resolve ARM64 exe path #39

@Crozzers

Description

@Crozzers

I installed this lib on a raspberry pi, but when I go to trigger it like so:

from sass_embedded import compile_directory
compile_directory(STYLES_DIR, OUT_DIR, no_sourcemap=True)

I get the following error:

Traceback (most recent call last):
  File "/tmp/website/src/make_styles.py", line 18, in <module>
    compile_directory(STYLES_DIR, OUT_DIR, no_sourcemap=True)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/server/.venvs/website/lib/python3.13/site-packages/sass_embedded/simple.py", line 248, in compile_directory
    proc = subprocess.run(
        cli.command_with_path(source, dest), capture_output=True, text=True
    )
  File "/usr/lib/python3.13/subprocess.py", line 554, in run
[... lots of traceback ...]
    self.pid = os.posix_spawn(executable, args, env, **kwargs)
               ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/server/.venvs/website/lib/python3.13/site-packages/sass_embedded/dart_sass/_ext/1.93.2-linux-aarch64/dart-sass/src/dart'

Upon investigation, it seems like the aarch64 wheel being distributed through PyPI installs the ARM64 version:

Image

This isn't necessarily a problem, since it seems to still run, at least on my machine:

$ /home/server/.venvs/website/lib/python3.13/site-packages/sass_embedded/dart_sass/_ext/1.93.2-linux-arm64/dart-sass/src/dart --version
Dart SDK version: 3.9.3 (stable) (Tue Sep 9 12:02:51 2025 -0700) on "linux_arm64"

I suspect this issue comes down to how the library resolves the dart exe, and how it decides which arch to use, perhaps here? No mention of aarch64?

def resolve_arch() -> ArchName:
"""Retrieve cpu architecture string as dart-sass specified."""
# NOTE: This logic is not all covered.
arch_name = platform.machine()
if arch_name in ("x86_64", "AMD64"):
arch_name = "x64"
if arch_name.startswith("arm") and arch_name != "arm64":
arch_name = "arm"
return arch_name # type: ignore[return-value]


Don't have time right this second, but happy to investigate further and submit a fix later this week
Scratch that, fix seems to be easier than I thought

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions