This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Description
I'm using (perhaps abusing / misusing in some way) the c-api. Here's a short example (excuse the mix of C / C++ and lack of freeing, a bit in a hurry :D
My downstream issue is sass/libsass-python#208
(My downstream-downstream issue is pre-commit/pre-commit.com#113)
reproduction
#include <sass/context.h>
#include <iostream>
int main() {
struct Sass_Context *ctx;
struct Sass_File_Context *context = sass_make_file_context(
"scss/main.scss"
);
struct Sass_Options* options = sass_file_context_get_options(context);
sass_compile_file_context(context);
ctx = sass_file_context_get_context(context);
if (sass_context_get_error_status(ctx)) {
std::cout << sass_context_get_error_text(ctx) << std::endl;
return sass_context_get_error_status(ctx);
} else {
std::cout << sass_context_get_output_string(ctx) << std::endl;
return 0;
}
}
I'm compiling with g++ -Ilibsass/include main.cpp libsass/lib/libsass.a -ldl
I have the following files set up:
scss/main.scss
@import 'scss/variables';
scss/_variables.scss
output under 3.4.3
output under 3.4.4
$ ./a.out
File to import not found or unreadable: scss/variables.
Parent style sheet: /tmp/foo/scss/main.scss
$ echo $?
1
investigation I've done so far
not much! I assume I'm doing something wrong? I'm going to dig into my trusty bisect tooling next :)