jakubfijalkowski / hlibsass Goto Github PK
View Code? Open in Web Editor NEWLow-level bindings to libsass for Haskell
License: MIT License
Low-level bindings to libsass for Haskell
License: MIT License
Build fails with Cabal-3.0 with this error:
/private/var/folders/3b/9plp3gb959gcv_nyqg9j_k740000gn/T/stack45489/hlibsass-0.1.8.0/Setup.hs:41:13: error:
Not in scope: ‘preSDist’
|
41 | , preSDist = updateLibsassVersion
| ^^^^^^^^
This seems to be because of using the now removed preSDist
hook.
... but this assumption doesn't work on operating systems where that's not the case.
Setup.hs hard-wires "make"
; a better heuristic might be:
if gmake
is available, use it by preference, otherwise make
.
(Stack does this, but uses RIO's doesExecutableExist
.)
(I'll try to come up with a patch, but I'm not hopeful.)
Hi there, just wondering if you or anyone else out there has tried using this on Windows10. I read the installation instructions, but here's what happens:
env: make: No such file or directory -- While building custom Setup.hs for package hlibsass-0.1.6.1 using: C:\Users\Kilian\hlibsass\.stack-work\dist\ca59d0ab\setup\setup --builddir=.stack-work\dist\ca59d0ab configure --with-ghc=C:\Users\Kilian\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\Kilian\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\62cfb14b\pkgdb --package-db=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\pkgdb --libdir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\lib --bindir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\bin --datadir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\share --libexecdir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\libexec --sysconfdir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\etc --docdir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\doc\hlibsass-0.1.6.1 --htmldir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\doc\hlibsass-0.1.6.1 --haddockdir=C:\Users\Kilian\hlibsass\.stack-work\install\6c953ab2\doc\hlibsass-0.1.6.1 --dependency=Cabal=Cabal-1.24.2.0 --dependency=base=base-4.9.1.0 --dependency=directory=directory-1.3.0.0 --extra-include-dirs=C:\Users\Kilian\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\Kilian\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\Kilian\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --enable-benchmarks Process exited with code: ExitFailure 127
Please correct me if i did domething wrong here.
It seems this library defines bindings to sass_option_get_plugin_path
and sass_option_get_include_path
in https://github.com/jakubfijalkowski/hlibsass/blob/9b60d51b2195b6930df7b98b7243c18f79a11a05/Bindings/Libsass/Context.hs which were removed from from libsass headers int commit sass/libsass@3753948.
This causes compilation failure
error: undefined reference to 'sass_option_get_plugin_path_size'
The default configuration has intero
say
GHC runtime linker: fatal error: I found a duplicate definition for symbol
__ZN4Sass7EmitterD0Ev
whilst processing object file
/Users/nrolland/.stack/snapshots/x86_64-osx/nightly-2017-01-14/8.0.1/lib/x86_64-osx-ghc-8.0.1/hlibsass-0.1.5.0-DAuvZ5FMWJ2GN3MaQufO80/libsass.a
The symbol was previously defined in
/Users/nrolland/.stack/snapshots/x86_64-osx/nightly-2017-01-14/8.0.1/lib/x86_64-osx-ghc-8.0.1/hlibsass-0.1.5.0-DAuvZ5FMWJ2GN3MaQufO80/libsass.a(emitter.o)
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
intero: Could not on-demand load symbol '__ZN4Sass14Operation_CRTPIvNS_7InspectEEclEPNS_12Custom_ErrorE'
intero:
lookupSymbol failed in relocateSection (RELOC_GOT)
/Users/nrolland/.stack/snapshots/x86_64-osx/nightly-2017-01-14/8.0.1/lib/x86_64-osx-ghc-8.0.1/hlibsass-0.1.5.0-DAuvZ5FMWJ2GN3MaQufO80/libsass.a: unknown symbol `___dso_handle'
intero: Could not on-demand load symbol '__ZN4Sass14Memory_Manager3addEPNS_13Memory_ObjectE'
intero:
lookupSymbol failed in relocateSection (relocate external)
/Users/nrolland/.stack/snapshots/x86_64-osx/nightly-2017-01-14/8.0.1/lib/x86_64-osx-ghc-8.0.1/hlibsass-0.1.5.0-DAuvZ5FMWJ2GN3MaQufO80/libsass.a: unknown symbol `__ZN4Sass14Memory_Manager3addEPNS_13Memory_ObjectE'
intero: Could not on-demand load symbol '__ZN4Sass6Parser3lexIXadL_ZNS_8Prelexer10identifierEPKcEEEES4_bb'
Using an external libsass involves installing it globally brew install libsass
and adding to the stack.yaml
:
extra-deps:
- hlibsass-0.1.5.0
# Override default flag values for local packages and extra-deps
flags:
hlibsass:
externalLibsass: true
Now intero should work.
It might be useful to add it to the readme.
libsass releases 3.6 onward have a lot of new features which will be great to have in hlibsass as well.
Build failure with GHC 8.2.1 as seen on the Stackage build server:
[1 of 1] Compiling Main ( Setup.hs, Setup.o )
Setup.hs:31:38: error:
• Data constructor not in scope:
Version :: [Integer] -> [a0] -> Version
• Perhaps you meant one of these:
variable ‘mkVersion’ (imported from Distribution.Simple),
variable ‘noVersion’ (imported from Distribution.Simple)
|
31 | hooksFix = if cabalVersion < Version [1, 20, 0] []
| ^^^^^^^
Setup.hs:123:52: error:
• Data constructor not in scope: FlagName :: [Char] -> FlagName
• Perhaps you meant one of these:
variable ‘flagName’ (imported from Distribution.PackageDescription),
variable ‘mkFlagName’ (imported from Distribution.PackageDescription),
variable ‘unFlagName’ (imported from Distribution.PackageDescription)
|
123 | getCabalFlag name flags = fromMaybe False (lookup (FlagName name') allFlags)
|
Would you be opening to making this library also work on Windows? When I try to build it on Windows I get the following error:
env: rawSystem: does not exist (No such file or directory)
It looks like this is caused by these two lines in Setup.hs
.
https://github.com/jakubfijalkowski/hlibsass/blob/master/Setup.hs#L65
https://github.com/jakubfijalkowski/hlibsass/blob/master/Setup.hs#L72
This is the lowest level Haskell sass library (all the others ultimately depend on this one), so it seems like it would be useful for it to also support Windows. Is this something you would consider?
Hi, just wondering if you or anyone else out there has tried using this on OS X. I read the installation instructions and tried all the flags in order. Here's what happens:
No flag:
ghc:
lookupSymbol failed in relocateSection (RELOC_GOT)
/Users/mohanzhang/code/hq/.stack-work/install/x86_64-osx/lts-2.17/7.8.4/lib/x86_64-osx-ghc-7.8.4/hlibsass-0.1.4.0/libsass.a: unknown symbol `___dso_handle'
ghc: unable to load package `hlibsass-0.1.4.0'
with sharedLibsass
:
<command line>: can't load .so/.DLL for: /Users/mohanzhang/code/hq/.stack-work/install/x86_64-osx/lts-2.17/7.8.4/lib/x86_64-osx-ghc-7.8.4/hlibsass-0.1.4.0/libHShlibsass-0.1.4.0-ghc7.8.4.dylib (dlopen(/Users/mohanzhang/code/hq/.stack-work/install/x86_64-osx/lts-2.17/7.8.4/lib/x86_64-osx-ghc-7.8.4/hlibsass-0.1.4.0/libHShlibsass-0.1.4.0-ghc7.8.4.dylib, 9): Library not loaded: lib/libsass.so
Referenced from: /Users/mohanzhang/code/hq/.stack-work/install/x86_64-osx/lts-2.17/7.8.4/lib/x86_64-osx-ghc-7.8.4/hlibsass-0.1.4.0/libHShlibsass-0.1.4.0-ghc7.8.4.dylib
Reason: image not found)
with externalLibsass
(it builds much quicker since it's not building its own libsass, but still fails in the same way as building with no flags. I used homebrew to install libsass. Is it expecting to find it in a specific place?):
ghc:
lookupSymbol failed in relocateSection (RELOC_GOT)
/Users/mohanzhang/code/hq/.stack-work/install/x86_64-osx/lts-2.17/7.8.4/lib/x86_64-osx-ghc-7.8.4/hlibsass-0.1.4.0/libsass.a: unknown symbol `___dso_handle'
ghc: unable to load package `hlibsass-0.1.4.0'
Any ideas? Thanks!
Hi, would it be possible to get an update of this package that supports the most recent version of libsass, which is version 3.3.2, I believe?
This request is related to commercialhaskell/stackage#1040, FYI.
[paul@imaskar:~/projects/programming/alldice] (master) :) $ stack build 12:49AM
alldice-0.1.0.0: configure
Configuring alldice-0.1.0.0...
alldice-0.1.0.0: build
Preprocessing executable 'alldice' for alldice-0.1.0.0...
[8 of 8] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/alldice/alldice-tmp/Main.o )
src/Main.hs:4:1: Warning:
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/alldice/alldice ...
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsass
collect2: error: ld returned 1 exit status
-- While building package alldice-0.1.0.0 using:
/home/paul/.stack/setup-exe-cache/setup-Simple-Cabal-1.22.4.0-x86_64-linux-ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/ build exe:alldice --ghc-options -ddump-hi -ddump-to-file
Process exited with code: ExitFailure 1
Basically this is what happens when I try to use this project with stack, it falls apart. I am not for certain the exact reasoning and I'll be linking this ticket to the stack project in case it has to do with the submodule here (libsass). But if I alter my stack config to include:
# Local packages, usually specified by relative directory name
packages:
- '.'
- location: libs/hlibsass
extra-dep: true
Then make this repo a submodule of my regular repo, and force the libsass submodule to load, stack is able to build and relink against the project over and over just fine.
Something similar to #3 seems to be happening again, where the latest version of libsass isn't supported.
Can someone else confirm though? I'm not super confident this is what's going wrong. I'm coming from NixOS/nixpkgs#38253.
2016-05-20 00:29:40.226610: [warn] The following GHC options are incompatible with GHCi and have not been passed to it: -O2 -threaded @(stack_4Jm00qpelFc1pPl4KgrPav:Stack.Ghci src/Stack/Ghci.hs:134:9)
2016-05-20 00:29:40.226871: [info] Using main module: 1. Package `alldice' component exe:alldice with main-is file: /home/paul/projects/programming/alldice/src/Main.hs @(stack_4Jm00qpelFc1pPl4KgrPav:Stack.Ghci src/Stack/Ghci.hs:199:28)
2016-05-20 00:29:40.227007: [info] Configuring GHCi with the following packages: alldice @(stack_4Jm00qpelFc1pPl4KgrPav:Stack.Ghci src/Stack/Ghci.hs:159:5)
2016-05-20 00:29:40.227271: [debug] Run process: ghc --interactive -i -odir=/home/paul/projects/programming/alldice/.stack-work/odir -hidir=/home/paul/projects/programming/alldice/.stack-work/odir -hide-all-packages -i/home/paul/projects/programming/alldice/src -i/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen -i/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build -i/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/alldice/alldice-tmp -stubdir=/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build -lpthread -package-id=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d -package-id=hsass-0.4.0-c75fc33916942b59209c6f8aaadda002 -package-id=hlibsass-0.1.5.0-55d6cccedbcf8a713482379106202249 -Wall -fno-warn-missing-signatures -rtsopts -optP-include -optP/tmp/ghci20900/cabal_macros.h -ghci-script=/tmp/ghci20900/ghci-script @(stack_4Jm00qpelFc1pPl4KgrPav:Stack.Exec src/Stack/Exec.hs:76:5)
2016-05-20 00:29:40.227620: [debug] Creating process: /home/paul/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc --interactive -i -odir=/home/paul/projects/programming/alldice/.stack-work/odir -hidir=/home/paul/projects/programming/alldice/.stack-work/odir -hide-all-packages -i/home/paul/projects/programming/alldice/src -i/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen -i/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build -i/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/alldice/alldice-tmp -stubdir=/home/paul/projects/programming/alldice/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build -lpthread -package-id=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d -package-id=hsass-0.4.0-c75fc33916942b59209c6f8aaadda002 -package-id=hlibsass-0.1.5.0-55d6cccedbcf8a713482379106202249 -Wall -fno-warn-missing-signatures -rtsopts -optP-include -optP/tmp/ghci20900/cabal_macros.h -ghci-script=/tmp/ghci20900/ghci-script @(stack_4Jm00qpelFc1pPl4KgrPav:System.Process.Run src/System/Process/Run.hs:102:5)
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
zsh: segmentation fault stack ghci --verbose
It seems like if I only import base + hsass + hlibsass it will crash ghci with segmentation faults.
As found in meoblast001/hakyll-sass#3, Mac OS users appear to be receiving the following link-time warning:
ld: warning: directory not found for option '-L/private/var/folders/77/zxlvnwsj3dv3nc6kt_szls2w0000gn/T/cabal-tmp-5380/hlibsass-0.1.5.0/libsass/lib'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.