Giter Club home page Giter Club logo

Comments (14)

thomasjm avatar thomasjm commented on August 25, 2024 1

Yeah, the error happened when using GHCi, but not when I ran stack build on hsass itself. Looks like it's the same as the issue you linked. Thanks!

from hsass.

jakubfijalkowski avatar jakubfijalkowski commented on August 25, 2024

Hi!

Does this error occur in GHCi only? GHCi seems to have problems with loading correct libstdc++ and this is "known bug" (see hLibsass readme ). Moreover, check the issue jakubfijalkowski/hlibsass#6 - it seems to be the same (and related to shared libraries).

I will probably be able to check and try to fix this once and for all on the weekend. I'll come back in a few days.

from hsass.

nrolland avatar nrolland commented on August 25, 2024

@thomasjm could you get it to work ? I just upgraded to Sierra and I have the same pb again....

from hsass.

thomasjm avatar thomasjm commented on August 25, 2024

Nope, still waiting on a fix.

from hsass.

nrolland avatar nrolland commented on August 25, 2024

can you compile hsass with the flags

flags:
  hlibsass:
    externalLibsass: true

in the stack.yaml ?

I get

Progress: 1/2
--  While building package hlibsass-0.1.5.0 using:
      /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack91128/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 configure --with-ghc=/Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc --with-ghc-pkg=/Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --with-ghcjs=/Users/nrolland/.local/bin/ghcjs --with-ghcjs-pkg=/Users/nrolland/.local/bin/ghcjs-pkg --user --package-db=clear --package-db=global --package-db=/Users/nrolland/.stack/snapshots/x86_64-osx/lts-8.5/8.0.2/pkgdb --package-db=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/pkgdb --libdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/lib --bindir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/bin --datadir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/share --libexecdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/libexec --sysconfdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/etc --docdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/doc/hlibsass-0.1.5.0 --htmldir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/doc/hlibsass-0.1.5.0 --haddockdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/doc/hlibsass-0.1.5.0 --dependency=base=base-4.9.1.0 -fexternalLibsass -f-sharedlibsass --exact-configuration
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/nrolland/Sync/clones/hsass/.stack-work/logs/hlibsass-0.1.5.0.log

    [1 of 2] Compiling Main             ( /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack91128/hlibsass-0.1.5.0/Setup.hs, /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack91128/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /Users/nrolland/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack91128/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack91128/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup ...
    Configuring hlibsass-0.1.5.0...
    setup: Missing dependency on a foreign library:
    * Missing C library: sass
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.

the program sass is on my path. not sure if it should be specified elsewhere for cabal (or some other voodoo) to know where it is.

Adding the location of which sass to stack.yaml does not change anything

extra-include-dirs:
- /Users/nrolland/.rvm/gems/ruby-2.3.3/bin/
extra-lib-dirs:
- /Users/nrolland/.rvm/gems/ruby-2.3.3/bin/

$ stack build                                                                                                                                                                                                                                                             not sandboxed
hlibsass-0.1.5.0: configure
Progress: 1/2
--  While building package hlibsass-0.1.5.0 using:
      /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack94353/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 configure --with-ghc=/Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc --with-ghc-pkg=/Users/nrolland/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --with-ghcjs=/Users/nrolland/.local/bin/ghcjs --with-ghcjs-pkg=/Users/nrolland/.local/bin/ghcjs-pkg --user --package-db=clear --package-db=global --package-db=/Users/nrolland/.stack/snapshots/x86_64-osx/lts-8.5/8.0.2/pkgdb --package-db=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/pkgdb --libdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/lib --bindir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/bin --datadir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/share --libexecdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/libexec --sysconfdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/etc --docdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/doc/hlibsass-0.1.5.0 --htmldir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/doc/hlibsass-0.1.5.0 --haddockdir=/Users/nrolland/Sync/clones/hsass/.stack-work/install/x86_64-osx/lts-8.5/8.0.2/doc/hlibsass-0.1.5.0 --dependency=base=base-4.9.1.0 -fexternalLibsass -f-sharedlibsass --extra-include-dirs=/Users/nrolland/.rvm/gems/ruby-2.3.3/bin --extra-lib-dirs=/Users/nrolland/.rvm/gems/ruby-2.3.3/bin --exact-configuration
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/nrolland/Sync/clones/hsass/.stack-work/logs/hlibsass-0.1.5.0.log

    [1 of 2] Compiling Main             ( /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack94353/hlibsass-0.1.5.0/Setup.hs, /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack94353/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /Users/nrolland/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack94353/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /private/var/folders/9d/vgq7v77x27xb7v93gg85bcmc0000gn/T/stack94353/hlibsass-0.1.5.0/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup ...
    Configuring hlibsass-0.1.5.0...
    setup: Missing dependency on a foreign library:
    * Missing C library: sass
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.

from hsass.

jakubfijalkowski avatar jakubfijalkowski commented on August 25, 2024

Okay, I have no idea what is going on. I think this problem is unrelated to the previous one (the GHCi not being able to load hlibsass) and occurs only on LTS-8. The fun thing is, Travis is able to build and test hsass under GHC 8.0.2 and stack 1.4. I have been unable to do so just a second ago (up-to-date Mint 18.1), but after some magic (nuking .stack-work, building under LTS-6, nuking, building under LTS-8 and some other steps that I don't remember), it just started to work. After stack clean it stopped, but I think it might be repeatable.

I need to dig deeper into the newest stack, GHC and Cabal. I don't know when I will be able to do so, but I hope it won't take me another year (I have finally started to have some time for things other than my studies and work, but I don't know if it stays like that for long). I made a promise to fix this a couple of times now, but I failed miserably (different priorities) - sorry for that.

from hsass.

nrolland avatar nrolland commented on August 25, 2024

That would be nice of course. Are other packages relying on external libraries relying on the same specific setup.hs ? If it really is necessary to have an ad-hoc setup, having a nix option flag might be a way that to normalize the behavior across platforms (and delegating normalization), as you can abstract the location business by shelling out some nix commands

from hsass.

jakubfijalkowski avatar jakubfijalkowski commented on August 25, 2024

If I understand your question correctly - yes, other libs do rely on a custom Setup.hs, if one of the dependencies do have one. Because libsass wasn't available as a distro package (at least not in Ubuntu, but that was 2 years ago), I have chosen to use custom setup and compile and link with libsass manually. There are many issues with this approach, but I had (or haven't knew about) no other choice.

Unfortunately, I know nothing about nix, but I'll check it out.

from hsass.

jakubfijalkowski avatar jakubfijalkowski commented on August 25, 2024

Okay, the problem with compilation should be fixed in hlibsass 0.1.5.2 and hsass 0.4.1. Could you check, please?

Also, with GHC 8.0.2, Cabal-1.24 and stack 1.4 (i.e LTS Haskell 8.5), GHCi seems to work, even with statically (and locally-built) linked libsass. Can you confirm?

from hsass.

nrolland avatar nrolland commented on August 25, 2024

I could compile on stack 1.4 with hlibsass 0.1.5.2 both hsass and my project, provided I do not specify

flags:
  hlibsass:
    externalLibsass: true

ps : what's the best reference for what's going on in Setup.hs in your opinion ?

from hsass.

jakubfijalkowski avatar jakubfijalkowski commented on August 25, 2024

What happens when you set the externalLibsass flag to true? Do you have libsass.a on the search path? It works for me (Linux Mint 18.1 with LibSass 3.3.4 from Ubuntu Xenial repo), but I am currently unable to check on macOS.

Moreover - do GHCi work now?

Ad. PS - do you mean Setup.hs from hlibsass or generally custom setup scripts? If generally - I ended up reading Cabal code, doing printf-style debugging and just experimenting. I couldn't find any comprehensive documentation for this.

from hsass.

nrolland avatar nrolland commented on August 25, 2024

External option works on this project hsass by adding to stack.yaml

extra-lib-dirs:   #this is passed to GHC
- /usr/local/lib  #where your libs are

flags:
  hlibsass:
    externalLibsass: true

I could compile once my other project but upon testing other ways to install libsass, I had the following error

$ stack build                                                                                                                                                                              
xquant2-0.1.0.0: build (exe)
Log files have been written to: /Users/nrolland/Sync/clones/xquant2/.stack-work/logs/

--  While building package xquant2-0.1.0.0 using:
      /Users/nrolland/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build exe:xquant2 --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/nrolland/Sync/clones/xquant2/.stack-work/logs/xquant2-0.1.0.0.log

    Preprocessing executable 'xquant2' for xquant2-0.1.0.0...
    Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/xquant2/xquant2 ...
    Undefined symbols for architecture x86_64:
      "_sass_option_get_plugin_path", referenced from:
          _chb9_info in libHShlibsass-0.1.5.2-1oW1V9GIDOwBgO0dG4ULhr.a(Context.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    `gcc' failed in phase `Linker'. (Exit code: 1)

Which I imagined comes from some mismatch between expected libsass version of 'hlibsass'.
Although I see plugin_path both in 'current' libsass and in 'current' hlibsass

It turned out it that installing via brew install --HEAD libsass caused the failure, while brew install libsass works fine. Using head and pray is plain wrong. Nix is really great for that. Cross platform, it really pins down which version gets used. I guess that's a prime exemple for the nix facility in stack.

Thanks for having a look at that Setup.hs, this is typically out of reach for casual users.
Even for me, although I am not so unfamiliar with Haskell, I am in a phase where I dont use everyday right now and just wanted to use it casually... So thanks ;)

from hsass.

jakubfijalkowski avatar jakubfijalkowski commented on August 25, 2024

Big thanks for the check. I consider this issue closed. :)

Next - nix. Will look at it sometime soon. The probable version mismatch was the thing that I've wanted to avoid (the other being libsass not available as a precompiled package, but that was long ago), hence the custom setup. :)

Yeah, Setup.hs is quite cryptic, but it's just scary and not that hard, really. I don't consider myself a "professional Haskeller" (I haven't used it for anything serious yet), but still been able to grasp it. Cabal people did a great job making the source code readable.

from hsass.

dantiel avatar dantiel commented on August 25, 2024

impossible to link on High Siierra. anyway its still easily possible to use sass with the shell wrapper and just read from stdin sass -s.

from hsass.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.