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

Bug fix for windows: closesocket (Issue #447) #497

Merged
merged 6 commits into from May 11, 2014

Conversation

@u338steven
Copy link

commented Feb 21, 2014

fixed close error (Issue #447)
and build error (Issue #422, Issue #451)
(include a patch by @ccoenen)

@ccoenen

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2014

I can confirm that this builds fine on

  • Windows 7 (64bit) with Ruby 2.0.0p247 (x64-mingw32) and RubyDevKit 4.7.2-64
  • Windows 7 (64bit) with Ruby 2.0.0p353 (x64-mingw32) and RubyDevKit 4.7.2-64
  • Windows 8.1 (64bit) with Ruby 1.9.3p448 (i386-mingw32) with RubyDevKit 4.5.2
  • Windows 8.1 (64bit) with Ruby 1.9.3p484 (i386-mingw32) with RubyDevKit 4.5.2
    • rubygems 1.8.28 failed with undefined method 'build' for Gem::Package::Module
    • rubygems 2.2.2 Worked just fine right there.
@ccoenen

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2014

Also builds fine on

  • Windows 8.1 (64bit) with Ruby 2.0.0p353 (x64-mingw32) and RubyDevKit 4.7.2-64

Now i ran out of systems. :D

@ccoenen

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2014

Ah, i just updated to latest RailsInstaller. Still builds fine.

  • Windows 8.1 (64bit) with Ruby 2.0.0p451 (x64-mingw32) and RubyDevKit 4.7.2-64

Can we pretty please get this merged into master?

task = "native:#{GEMSPEC.name}:#{platform}"
if Rake::Task.task_defined?(task)
Rake::Task[task].prerequisites.unshift "lib/#{ext.name}.rb"
if ext.cross_platform.is_a?(Array) then

This comment has been minimized.

Copy link
@tmm1

tmm1 Mar 3, 2014

Contributor

The then here is non-idiomatic. Why is this guard needed anyway?

This comment has been minimized.

Copy link
@u338steven

u338steven Mar 4, 2014

Author

Thank you, @ccoenen and @tmm1.
You are right. I removed then.

Why is this guard needed anyway?

Because Rake::ExtensionTask#cross_platform returns String or Array.
Please refer to the link below for details.
https://github.com/luislavena/rake-compiler/blob/master/lib/rake/extensiontask.rb#L32
https://github.com/luislavena/rake-compiler/blob/master/lib/rake/extensiontask.rb#L69

@danielricecodes

This comment has been minimized.

Copy link

commented Apr 24, 2014

@ccoenen, I'm trying to get this to work on my Windows 7 machine. What commands to you run to build the gem locally? I'm trying but keep getting errors, or keep building eventmachine1.0.1.gem and not 1.0.3.

Also, would be great if the eventmachine team could release a windows x64 version of this gem, even if its a .beta or .rc1 build!

@ccoenen

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2014

There's two ways, both should work fine. choose the one that seems simpler for you or your project. For both, you'll need to have the correct RubyDevKit loaded in your terminal. Please let us know if it works for you.

The first method uses bundlers :git attribute:
If you have a bundler project anyway you just need to change your Gemfile to include this:

gem 'eventmachine', :git => 'https://github.com/u338steven/eventmachine', :branch => 'patch-1'

Credits go to this stack overflow answer

The second method uses the install_specific gem:
If you don't use bundler, you can use a gem called "specific_install". Run this in your terminal/console/shell

gem install specific_install
gem specific_install -l https://github.com/u338steven/eventmachine -b patch-1

Credits go to that stack overflow answer / more usage of specific_install in their git project

I would also like to take this opportunity to ask @tmm1 to take a second look at this changeset if time permits. His earlier question/comment has since been answered and fixed, and it would really be quite nice to get back on a regular build of event machine.

tmm1 added a commit that referenced this pull request May 11, 2014

Merge pull request #497 from u338steven/patch-1
Bug fix for windows: closesocket (Issue #447)

@tmm1 tmm1 merged commit 93ac34d into eventmachine:master May 11, 2014

@ccoenen

This comment has been minimized.

Copy link
Contributor

commented May 11, 2014

Thank you and all other people involved in evemachine, this really means a lot to me!

@sodabrew

This comment has been minimized.

Copy link
Contributor

commented May 11, 2014

🎉

@pgibler

This comment has been minimized.

Copy link

commented May 16, 2014

Thank you so much ccoenen. This was driving me crazy all day trying to get off of using WEBrick... now I'm on thin =)

@sinayion

This comment has been minimized.

Copy link

commented Jun 20, 2014

Hi all,

Since this has been merged to master, I'm assuming the errors associated with this should be fixed if I do gem install eventmachine from my local Ruby installation (Windows 7)? Because I'm still getting the error associated with 411, and inspecting the eventmachine-1.0.3 folder in my local Ruby install, the project.h files are different between local and the master git repo.

@ccoenen

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2014

If you're using bundler, you can specify to use a git branch in your Gemfile. You could put this line into your Gemfile:

gem 'eventmachine', :git => 'https://github.com/eventmachine/eventmachine.git', :branch => 'master'

The downside is, that "master" will change eventually and that you won't know the exact version you have. Another approach would be to pin it to the merge of this ticket, which was in 93ac34d. This would look like this in your Gemfile:

gem 'eventmachine', :git => 'https://github.com/eventmachine/eventmachine.git', :ref => '93ac34d0de1baf218f5c2ca61d39f4230737be7e'
@sinayion

This comment has been minimized.

Copy link

commented Jun 21, 2014

Thanks, I'll give that a shot once I log into my work pc. :)

But just wondering about my original question. In theory, shouldn't this fix be in the released master version now, since master contains all fixes?

Edit: Or is the version that is included with Ruby for Windows not automatically updated?

@rjattrill

This comment has been minimized.

Copy link

commented Jun 30, 2014

@sinayion - although it is fixed in master (11 May 2014) the last gem release was March 2013. Hence you must use the techniques described by @ccoenen until there is a new gem package released.

@sodabrew

This comment has been minimized.

Copy link
Contributor

commented Sep 24, 2014

Ping for a release please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.