pikelang / Pike

Pike is a dynamic programming language with a syntax similar to Java and C. It is simple to learn, does not require long compilation passes and has powerful built-in data types allowing simple and really fast data manipulation.
http://pike.lysator.liu.se/
Other
194 stars 34 forks source link

What versions of libsass and sass2scss does pike use? #41

Open abdellahi-brahim opened 1 year ago

abdellahi-brahim commented 1 year ago

I'm trying to use the Web.Sass.sass2scss method in Pike to compile SASS. However, I'm encountering errors, which I suspect are due to incorrect dependencies. Could you specify which versions of libsass and sass2scss Pike relies on? Also, what are the necessary packages I should install to ensure the Web.Sass methods function properly?

grubba commented 1 year ago

I am not certain of the full set of supported versions, but libsass-3.6.5 seems to work.

What OS are you using? For many OSes you need to install the libsass-devel (or similar) package.

abdellahi-brahim commented 1 year ago

I'm running Ubuntu 18.04. The libsass seemed to solve the issues (I downloaded and compiled the package). The sass2scss library seemed to not work with that instalation, so I tried to install the sass2scss package from this GitHub repository, and the problem persists :C

grubba commented 1 year ago

Hmm... Ubuntu 18.04 seems to have libsass 3.4.8. Have you installed libsass-dev?

grubba commented 1 year ago

The Web.Sass module seems to build without issue in both Pike 8.0 and master on Ubuntu 18.04 with libsass-dev installed.

abdellahi-brahim commented 1 year ago

The problem is when I try to use the Web.Sass.sass2scss(data) method, it does not seem to work, I am using the version 8.0 release 604

abdellahi-brahim commented 1 year ago

Just to provide more context. I am trying to run the following code:

 write("libsass version:   %s\n", Web.Sass.libsass_version());
 write("sass2scss version: %s\n", Web.Sass.sass2scss_version());

 string sass_code = #"
    div
        font-size: 12px
    p
        color: red
 ";

string scss_code = Web.Sass.sass2scss(sass_code);
write("Converted SCSS:\n" + scss_code);

But all I get is the following output:

main.pike:17:Index 'sass2scss' not present in module Sass.
main.pike:17:Indexed module was: Web.Sass.
main.pike:17:Too many arguments to `() (function call) (expected 0 arguments).
main.pike:17:Got     : string.
Pike: Failed to compile script.

Source: https://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Web/Sass/sass2scss.html

abdellahi-brahim commented 1 year ago

After some research I saw that the sass2scss method was only introduced in this release:

https://git.lysator.liu.se/pikelang/pike/-/releases/v8.0.702

But when trying this and the latest the method is not recognized. Is it a compilation issue?


main.pike:5:Indexed module was: Web.
main.pike:6:Index 'Sass' not present in module Web.
main.pike:6:Indexed module was: Web.
main.pike:10:Index 'Sass' not present in module Web.
main.pike:10:Indexed module was: Web.```