Skip to content

libsass: add build-libsass.yml for riscv64 wheels - #1011

Merged
luhenry merged 3 commits into
mainfrom
libsass
Sep 6, 2026
Merged

libsass: add build-libsass.yml for riscv64 wheels#1011
luhenry merged 3 commits into
mainfrom
libsass

Conversation

@luhenry

@luhenry luhenry commented Sep 6, 2026

Copy link
Copy Markdown
Member

Binds the vendored libsass C++ Sass compiler for compiling Sass/SCSS from Python. Upstream publishes no riscv64 wheel; both libsass-python and the vendored libsass library are archived upstream (deprecated in favor of Dart Sass) but still build and test cleanly on riscv64.

Differs from upstream

  • Upstream's own Linux CI only runs tests via tox, with no wheel-build job to mirror - this workflow adds one.
  • Stages the vendored libsass submodule's own MIT licence at build time - setup.cfg's license_files list only names the wrapper's licence.
  • Pins setuptools<82 for the test environment only - sassutils/wsgi.py imports pkg_resources, which setuptools 82 removed.

Matrix: cp312/cp313/cp314 only - the abi3 wheel's floor tracks whichever interpreter builds it, and cp314t is dropped since the build forces abi3 unconditionally with no free-threaded case.

Testing

  • same as upstream (sasstests.py), aside from the setuptools pin above.

License: Wheel bundles the compiled libsass C++ library (MIT); upstream ships only libsass-python's own licence text, so the build adds the vendored one.

Built on cp312; 107 passed, 0 skipped.

Fully vendored C++ sources (libsass submodule) compile cleanly with no
external deps; abi3 wheel floors at cp312 since setup.py's own
bdist_wheel override picks the building interpreter's version.
PySass_make_enum_dict and PySass_init_module are defined in _sass.c with
default (extern) visibility but are only called from within that same
file. Since the extension is built against Py_LIMITED_API, abi3audit
--strict flags both as non-abi3 symbols leaking from the .abi3.so.
Patch upstream to mark them static, apply it before the cibuildwheel
step, and add patches/libsass/** to the pull_request trigger paths.
sasstests.py opens fixtures like test/a.scss relative to the process
cwd, but cibuildwheel runs the test command from an empty temp dir, so
{package}/sasstests.py -v failed to collect with
FileNotFoundError: 'test/a.scss'. Stage sasstests.py plus its test/
and testpkg/ fixture dirs via CIBW_TEST_SOURCES and run against the
staged copy so the relative opens resolve, while leaving sass.py and
sassutils unstaged so imports still resolve to the installed wheel.
@luhenry
luhenry merged commit 9c71b15 into main Sep 6, 2026
6 checks passed
@luhenry
luhenry deleted the libsass branch September 6, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant