Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chipmunk extension is outdated #321

Closed
IanTrudel opened this issue Feb 16, 2017 · 11 comments
Closed

Chipmunk extension is outdated #321

IanTrudel opened this issue Feb 16, 2017 · 11 comments
Labels
Milestone

Comments

@IanTrudel
Copy link
Collaborator

The current version of Chipmunk integrated to Shoes is 4.1.0 . The latest Ruby bindings available is 6.1.3. Good news! It's available in a RubyGems. May hopefully work out of the box.

@IanTrudel IanTrudel added the Low label Feb 16, 2017
@ccoupe
Copy link

ccoupe commented Feb 16, 2017

You've tagged this issue low - correctly. Although I'm fond of the sample I'm not aware of anybody using chipmunk in Shoes (how would I know?) If the gem was working with Ruby 2.3, I'd feel better about using the gem instead. I could easily be convinced to not ship the ext & sample and not include the gem either. They appear to provide a mingw binary gem so thats 80% of the audience w/o and the 20% can install xcode or use the linux package manager to install gcc.

@IanTrudel
Copy link
Collaborator Author

The latest bindings did successfully build on my machine when installing it as a RubyGems. Chipmunk is lightweight and stable. It should build right out of the box on your build environment for all Shoes targets. How about doing that, copy the gem in Shoes, like Nokogiri, Picky, etc?

@ccoupe
Copy link

ccoupe commented Feb 17, 2017

did the samples/simple-chipmunk work with the gem?

@IanTrudel
Copy link
Collaborator Author

Latest version requires a DevKit. No DevKit to build Shoes here, no DevKit to build gems for Shoes. I did try chipmunk-5.3.4.5-x86-mingw32 without success. It complains about not valid UTF-8 string. There a similar issue on shoes/shoes-deprecated#265. Most likely compiling parameters are not right for Shoes. Really need to build on a Shoes DevKit to test.

The following happened when I clicked copy in the Shoes Console: (cshoes.exe:15524): Gdk-WARNING **: Failed to convert utf8: Invalid byte sequence in conversion input

image

@IanTrudel
Copy link
Collaborator Author

Copied chipmunk.so from 6.1.3.4 compiled with Ruby 2.1.5 DevKit but got the following error. Obviously, Shoes has a newer version of Ruby.

Error in <unknown> line 0 | 2017-02-17 09:40:09 -0500
incompatible library version - C:/Program Files (x86)/Shoes/lib/ruby/2.2.0/i386-mingw32/chipmunk.so
C:/Program Files (x86)/Shoes/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
C:/Program Files (x86)/Shoes/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
C:/Program Files (x86)/Shoes/lib/shoes/chipmunk.rb:1:in `<top (required)>'
C:/Program Files (x86)/Shoes/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
C:/Program Files (x86)/Shoes/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
simple-chipmunk.rb:2:in `<main>'
C:/Program Files (x86)/Shoes/lib/shoes.rb:349:in `eval'
C:/Program Files (x86)/Shoes/lib/shoes.rb:349:in `visit'
eval:1:in `<main>'

@IanTrudel
Copy link
Collaborator Author

Very good news! I installed Ruby 2.2.4 to match Shoes, compiled Chipmunk with the DevKit, moved chipmunk.so in Shoes\lib\ruby\2.2.0\i386-mingw32 and voilà! It's working right of the box, just as I said it would.

@IanTrudel
Copy link
Collaborator Author

Chipmunk integrates well with the new MSYS2 target. It actually seems faster than the older version. Replacement with the newest version highly advisable.

@ccoupe
Copy link

ccoupe commented Mar 17, 2017

Fails the linux loose shoes test - gem is installed - not copied into Shoes because it shouldn't need to be - samples/simpile/simple-chipmunk fails to load the gem with require 'chipmunk'. Irb (same ruby will)

@IanTrudel
Copy link
Collaborator Author

Well, I had success with copying chipmunk.so. Notice the samples/simple/simple-chipmunk.rb is loading the wrapper shoes/chipmunk.rb which is requiring chipmunk**.so**.

It may work as a gem but shoes/chipmunk.rb may need some help.

@ccoupe
Copy link

ccoupe commented Mar 18, 2017

Yes. In lib/shoes/chipmunk.rb

#require 'chipmunk.so'  #ext
require 'chipmunk/chipmunk.so' #gem

@ccoupe
Copy link

ccoupe commented Mar 18, 2017

Just in case any one cares, I want to use the gem so it's no longer an ext (can delete ftsearch and chipmunk as exts) If you think this is simple here's the private task list.

2017-03-17
done: loose: can load chipmunk.so from the gem instead of an ext. 
====> Chipmunk gem tasks
      install gem, copy gem, uninstall gem, fix task.rb?, fix custom.yaml, build Shoes, test, delete ext's, wiki? 
   x86_64:  x         x          x             x                 x              x        x
   i686  :  x         x          x             x                 x              x        x
   pi3   :  x         x          x             x                 x              x        x
   win7  :  x         x          x             x                 x              x        x
   xwin7 :  -         x          -             x                 x              x        x
   msys2 :
   osx   :
   repackage windows gem archives and upload. Test again- groan.

You don't want to know about the effort on OSX and potential pilot errors with and OSX virtual machine just to install and copy.

@IanTrudel IanTrudel added this to the 3.3.3 milestone Mar 20, 2017
IanTrudel referenced this issue Mar 20, 2017
* chipmunk is a gem. - we include it but it's not an ext.
* sqlite3 is also a real gem instead of an odd duck. We
  still have to provide the dll for some platforms (windows) but
  that's dep lib, not a gem.
* YUGE win if you cross compile windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants