statistics2
statistics2 copied to clipboard
Separate packages
On unix, is nice to have ruby and C extension together, but for Windows users installing is not trivial.
So, it would be good create a separate gem for extension or provide compiled version for Windows users.
Thanks for bringing this up. I see three possible solutions:
- Since this gem doesn't need the C extension, we could disable the extension portion of the gem install process on the Windows platform. This is an easy fix, and I think I'll do this first regardless of whether we later choose one of the other options.
- Someone could rewrite the extension and the gemspec to make this gem work cross-platform. I don't have a Windows machine to develop or test on, but patches are welcome.
- Someone could fork this gem and make a Windows-only version. Again, I don't use Windows, so I can't help with this effort.
I prefer (1), because it's easy and the speed factor shouldn't be that much of an issue. I also strongly prefer (2) over (3), because I think it'd really confusing to have a separate gem for each platform. I'm not really sure how one would go about writing a gem that compiles an extension on every platform.
I'll try to check in (1) soon; are you able to test that it works on Windows?
I could test on Windows without problem. If I found how to create a cross-platform gem which doesn't bug you when no compilation framework is available, I will fork and test.
Great, thanks. Could you pull changes from the 'windows' branch and test them?
http://github.com/abscondment/statistics2/commits/windows
Tested on Windows, using mingw version. Works fine. I try to compile a mingw version using Ubuntu. I will create a branch called "cross compilation" for this.
Testing on another gem, the ideal will be create pre-compiled version of library for some platforms. If someone wants to compile the gem, only gave to do gem install --platform ruby statistics2
I created a branch called "using_rake-compiler". With rake-compiler, we can create precompiled binaries for linux and windows, without losing the possibility of compiling the extension manualy.
Can you pull and test it?
By the way: require 'statistics2' shouldn't call the extension, but a ruby script. This should decide if we load the extension or use the pure ruby version. This allow alternative implementations of ruby uses the library without worrying about existence of the extension
Thanks for the suggestions. I'll get a chance to test & think about this over the weekend.
Right. I got a windows machine to test all my ruby code.
Not sure what became of this, but wanted to mention that the same issue affects JRuby users--the C version can't be used with JRuby (at least not easily).
Is there a way to prevent compilation of the native extension and default to the /no_ext version, or some other way to get the gem to play nice with JRuby? If not, making a pure ruby version available would be a great help to a growing audience.
I absolutely want to do this. What's happened is, well, I've let it languish while scurrying around to do more pressing work things. I'll tackle it if/when I find spare time, or I'd love to see a pull request.
I haven't really figured out how to do it properly yet, but I planned on copying the methods employed by other gems (e.g. Nokogiri, which I believe handles all the various Rubies well).
On Sat, Dec 8, 2012 at 9:34 AM, John McGrath [email protected]:
Not sure what became of this, but wanted to mention that the same issue affects JRuby users--the C version can't be used with JRuby (at least not easily).
Is there a way to prevent compilation of the native extension and default to the /no_ext version, or some other way to get the gem to play nice with JRuby? If not, making a pure ruby version available would be a great help to a growing audience.
— Reply to this email directly or view it on GitHubhttps://github.com/abscondment/statistics2/issues/1#issuecomment-11161099.