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

Fix Gem.ruby singleton method on Windows #1448

Merged
merged 1 commit into from Jan 27, 2014

Conversation

Projects
None yet
2 participants
@GregMefford
Copy link
Contributor

GregMefford commented Jan 27, 2014

This issue was identified when trying to install the murmurhash3 gem, which includes native extensions, on the Windows platform using the jruby-complete JAR file as the executable. This generated an error message as follows:

C:\temp\JRuby_Test>set GEM_HOME=C:\temp\JRuby_Test\vendor\
C:\temp\JRuby_Test>set GEM_PATH=C:\temp\JRuby_Test\vendor\
C:\temp\JRuby_Test>java -jar C:\temp\JRuby_Test\jruby-complete-1.7.10.jar -S gem install murmurhash3
Building native extensions.  This could take a while...
ERROR:  Error installing murmurhash3:
        ERROR: Failed to build gem native extension.

    java -jar /C:/temp/JRuby_Test/jruby-complete-1.7.10.jar extconf.rb
Error: Unable to access jarfile /C:/temp/JRuby_Test/jruby-complete-1.7.10.jar


Gem files will remain installed in C:/temp/JRuby_Test/vendor/gems/murmurhash3-0.1.4 for inspection.
Results logged to C:/temp/JRuby_Test/vendor/gems/murmurhash3-0.1.4/ext/murmurhash3/gem_make.out

After digging in a bit, it looked like the problem was that there was an extraneous slash at the beginning of the result of the Gem.ruby singleton method call, causing the command to come out as /C:/... instead of just C:/...

I figured while I was in there, I'd extract the Gem.jar_path method and document what it's doing since it wasn't obvious to me at first glance what the "jarred_path" input string was going to look like.

Full Disclosure: I didn't run all the unit tests myself to make sure things don't break because I don't have the whole JRuby development environment set up on my machine. I did, however, manually test the specific behavior related to this change on Windows 7 using both the system-installed jruby.exe and the jruby-complete.jar file, and also on CentOS 6.5.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Jan 27, 2014

I am going to follow this up with a change to only use your logic when on Windows.

enebo added a commit that referenced this pull request Jan 27, 2014

Merge pull request #1448 from GregMefford/patch-2
Fix Gem.ruby singleton method on Windows

@enebo enebo merged commit beb7cfe into jruby:master Jan 27, 2014

1 check failed

default The Travis CI build failed
Details

enebo added a commit that referenced this pull request Jan 27, 2014

enebo added a commit that referenced this pull request Jan 27, 2014

@GregMefford

This comment has been minimized.

Copy link
Contributor Author

GregMefford commented Jan 27, 2014

That's fine. I was going to use the Gem.win_platform? method, but I don't
think it's required on Cygwin, so keep that in mind.

On Monday, January 27, 2014, Thomas E Enebo notifications@github.com
wrote:

I am going to follow this up with a change to only use your logic when on
Windows.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1448#issuecomment-33400795
.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Jan 27, 2014

Ah yeah that might be. In the case of cygwin I think you will see unix style paths right? c:/ will not show up unless it is mount'd but I think that would need to be a user-provided path perhaps? Well I guess we will see...

@GregMefford GregMefford deleted the GregMefford:patch-2 branch Jan 28, 2014

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