Giter Site home page Giter Site logo

hruby's People

Contributors

bartavelle avatar cstrahan avatar matil019 avatar nwtgck avatar phadej avatar pierrer avatar wolfgangwalther avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hruby's Issues

Add support for Ruby 2.1

Hi,

I have given it a try by adding a flag for Ruby21.

cabal install -f ruby21 hruby will install without error.

But when I try to install puppet-language, I get the following errors:

Loading package hruby-0.1.3 ... linking ... ghc: /home/vagrant/projects/language-puppet/.cabal-sandbox/lib/x86_64-linux-ghc-7.6.3/hruby-0.1.3/libHShruby-0.1.3.a: unknown symbol `rb_str_new2'

0.2.8 release

Could you release 0.2.8 with the latest commit ?

Thanks

Support for ruby-2.4.0?

Does this library support ruby 2.4.x correctly?

I'm wondering because I managed to compile it, but none of the builds that depend on hruby, like language-puppet, link successfully with that resulting package, i.e. I get errors like these ones:

[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Bindings.o):(.text+0x253d): more undefined references to `rb_str_new2' follow
[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Bindings.o):(.text+0x27bd): undefined reference to `rb_ary_new2'
[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Bindings.o):(.text+0x29ab): undefined reference to `rb_ary_new4'
[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Helpers.o):(.text+0x478f): undefined reference to `rb_ary_new4'
[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Helpers.o):(.text+0x4d5a): undefined reference to `rb_str_new2'
[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Helpers.o):(.text+0x5872): undefined reference to `rb_str_new2'
[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Helpers.o):(.text+0x621a): undefined reference to `rb_str_new2'
[  395s] /usr/lib64/ghc-8.0.2/hruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS/libHShruby-0.3.4.3-8m7CsJorZf257hqkjk3RnS.a(Helpers.o):(.text+0x656e): undefined reference to `rb_str_new2'
[  395s] collect2: error: ld returned 1 exit status

Support for Ruby 1.9.3 (Ubuntu 14.04) ?

This is the error message I have got:

$ puppetresources -p . --hiera ./tests/hiera.yaml -o puppetmaster --facts-override ./tests/facts-testing.yaml --pdbfile ./tests/facts.yaml 
not an array! RBuiltin RSTRING
<main>: [BUG] Segmentation fault
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

hruby-0.3.1 tests fail because of missing file

We're getting the following error in NixOS:

Running 1 test suites...
Test suite test-roundtrip: RUNNING...
test-roundtrip: Stack "Could not load ./test/test.rb" "cannot load such file -- ./test/test.rb\n"
Test suite test-roundtrip: FAIL

Is it possible that this file is missing from the release archive on Hackage?

fails to build with aeson-2.0

hruby                          > Building library for hruby-0.3.8.1..
hruby                          > [1 of 4] Compiling Foreign.Ruby.Bindings
hruby                          > [2 of 4] Compiling Foreign.Ruby.Helpers
hruby                          > 
hruby                          > /tmp/stack-b1b9478f83173021/hruby-0.3.8.1/Foreign/Ruby/Helpers.hs:123:39: error:
hruby                          >     • Couldn't match type: HM.HashMap k v
hruby                          >                      with: Data.Aeson.KeyMap.KeyMap Value
hruby                          >       Expected: [(k, v)] -> Object
hruby                          >         Actual: [(k, v)] -> HM.HashMap k v
hruby                          >     • In the second argument of ‘(.)’, namely ‘HM.fromList’
hruby                          >       In the expression: Object . HM.fromList
hruby                          >       In an equation for ‘toHash’: toHash = Object . HM.fromList
hruby                          >     • Relevant bindings include
hruby                          >         toHash :: [(k, v)] -> Value
hruby                          >           (bound at Foreign/Ruby/Helpers.hs:123:21)
hruby                          >     |
hruby                          > 123 |                     toHash = Object . HM.fromList
hruby                          >     |                                       ^^^^^^^^^^^
hruby                          > 
hruby                          > /tmp/stack-b1b9478f83173021/hruby-0.3.8.1/Foreign/Ruby/Helpers.hs:144:26: error:
hruby                          >     • Couldn't match type: Data.Aeson.KeyMap.KeyMap Value
hruby                          >                      with: HM.HashMap a0 a1
hruby                          >       Expected: HM.HashMap a0 a1
hruby                          >         Actual: Object
hruby                          >     • In the first argument of ‘HM.toList’, namely ‘m’
hruby                          >       In the first argument of ‘forM_’, namely ‘(HM.toList m)’
hruby                          >       In the first argument of ‘($)’, namely ‘forM_ (HM.toList m)’
hruby                          >     |
hruby                          > 144 |         forM_ (HM.toList m) $ \(k, v) -> do
hruby                          >     |                          ^

Releasing 0.3.1.4

I would like to make language-puppet pin that version so I can use aeson- 0.8 which is now the default on archlinux.

Thanks

Setup.hs chokes on Windows

hruby would work fine on Windows if not for its Setup script. Currently, if you try to configure this project, it fails with:

$ cabal configure --enable-tests
Resolving dependencies...
[1 of 1] Compiling Main             ( dist\setup\setup.hs, dist\setup\Main.o )
Linking .\dist\setup\setup.exe ...
Configuring hruby-0.3.4.2...
Detected ruby: RubyInfo {rbVersion = (2,4,0), rbInstallName = "ruby", rbIncludes = ["C:/msys64/mingw64/include/ruby-2.4.0","C:/msys64/mingw64/include/ruby-2.4.0/ruby","C:/msys64/mingw64/include/ruby-2.4.0/x64-mingw32","C:/msys64/mingw64/lib/ruby/2.4.0/x64-mingw32"], rbLib = "C:/msys64/mingw64/lib", rbLibName = "x64-msvcrt-ruby240"} cc:["-DRUBY2","-DRUBY21"]
setup.exe: Bad header file: ruby.h
The header file contains a compile error. You can re-run configure with the
verbosity flag -v3 to see the error messages from the C compiler.

If you run cabal configure -v3, you'll see that ruby.h is failing with lots of errors to the effect of:

In file included from C:/msys64/mingw64/include/ruby-2.4.0/ruby/io.h:24:0,
from
C:/Users/RyanGlScott/Software/ghc-8.0.2/mingw/x86_64-w64-mingw32/include/sys/stat.h:14,
from C:/msys64/mingw64/include/ruby-2.4.0/ruby/defines.h:106,
from C:/msys64/mingw64/include/ruby-2.4.0/ruby/ruby.h:36,
from C:/msys64/mingw64/include/ruby-2.4.0/ruby.h:33,
from C:\Users\RYANGL~1\AppData\Local\Temp\2696224464.c:1:
C:/msys64/mingw64/include/ruby-2.4.0/ruby/encoding.h:137:1: error: unknown
type name 'VALUE'
VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
^

What's happening here is that MinGW-w64 uses a header file called io.h, and there's also an io.h file in C:/msys64/mingw64/include/ruby-2.4.0/ruby. Normally, this wouldn't be an issue, since all of the Ruby headers refer to its io.h as ruby/io.h. But the Setup script is putting C:/msys64/mingw64/include/ruby-2.4.0/ruby on the include path, which causes gcc to pick up the wrong io.h!

A patch which fixes this issue is:

diff --git a/Setup.hs b/Setup.hs
index e226bae..fcbb77b 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -55,14 +55,13 @@ getRubyInfo = do
         Just v -> do
             installName <- evalRuby "print RbConfig::CONFIG['RUBY_INSTALL_NAME']"
             headerDir   <- evalRuby "print RbConfig::CONFIG['rubyhdrdir']"
-            headerDir'  <- evalRuby "print RbConfig::CONFIG['rubyhdrdir'] + File::Separator + 'ruby'"
             archDir     <- evalRuby "print RbConfig::CONFIG['rubyarchhdrdir']"
             libDir      <- evalRuby "print RbConfig::CONFIG['libdir']"
             td          <- evalRuby "print RbConfig::CONFIG['topdir']"
             libName     <- evalRuby "print RbConfig::CONFIG['LIBRUBY_SO'].sub(/^lib/,'').sub(/\\.(so|dll|dylib)([.0-9]+)?$/,'')"
             return $ RubyInfo <$> pure v
                               <*> installName
-                              <*> sequence [headerDir, headerDir', archDir, td]
+                              <*> sequence [headerDir, archDir, td]
                               <*> libDir
                               <*> libName

I would go ahead and make a pull request with this change, but I first wanted to make sure that this C:/msys64/mingw64/include/ruby-2.4.0/ruby isn't important. It doesn't seem like it is, since I can still build hruby on Linux without it, and pkg-config doesn't think it's needed either:

# Windows
$ pkg-config --cflags ruby-2.4
-IC:/msys64/mingw64/include/ruby-2.4.0/x64-mingw32 -IC:/msys64/mingw64/include/ruby-2.4.0

# Linux
$ pkg-config --cflags ruby-2.3
-I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0

Failure with Ruby 3.1.4

I have this failure using ruby 3.1.4
Not sure if it is the way I am building hruby or the fact that I am now using ruby 3.x.y.

undefined method `current' for Ractor:Class
/nix/store/v001jk4sximy2fn9c704dj64a2vwfxsm-ruby-3.1.4/lib/ruby/3.1.0/psych.rb:727:in `config'
/nix/store/v001jk4sximy2fn9c704dj64a2vwfxsm-ruby-3.1.4/lib/ruby/3.1.0/forwardable.rb:232:in `load_tags='
/nix/store/v001jk4sximy2fn9c704dj64a2vwfxsm-ruby-3.1.4/lib/ruby/3.1.0/psych.rb:737:in `<module:Psych>'
/nix/store/v001jk4sximy2fn9c704dj64a2vwfxsm-ruby-3.1.4/lib/ruby/3.1.0/psych.rb:234:in `<top (required)>'
/nix/store/v001jk4sximy2fn9c704dj64a2vwfxsm-ruby-3.1.4/lib/ruby/3.1.0/yaml.rb:4:in `require'
/nix/store/v001jk4sximy2fn9c704dj64a2vwfxsm-ruby-3.1.4/lib/ruby/3.1.0/yaml.rb:4:in `<top (required)>'
/nix/store/05m5z8ir6akpcz87cv8i8l43pqja7d35-language-puppet-1.5.0-data/share/ghc-9.2.8/x86_64-linux-ghc-9.2.8/language-puppet-1.5.0/ruby/hrubyerb.rb:3:in `require'

Any idea ?

Releasing 0.3.1.5

Would you mind releasing the latest version on hackage ?

The reason I am asking is because ghc-mod is quite buggy with ghc-7.10 particularly when you link cabal sandbox (and I need 0b4b767 on arch linux) ...

Add hruby to stackage

Now that stackage built with Ubuntu 16.04, it would be nice try to have it available there.

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.