rake-compiler-dev-box icon indicating copy to clipboard operation
rake-compiler-dev-box copied to clipboard

Seems to find no gem

Open philippneugebauer opened this issue 10 years ago • 11 comments
trafficstars

First, I want to thank you for the implementation of that great idea!

After changing the folder to /vagrant (and before) it does not find the gem while I try to package it with package_all rugged. Neither the rugged gem nor the sample_gem are found, I always get No such file or directory although I followed directly the instructions in the README. On the other hand, it lists the folders when I use ls.

Is there anything I forgot or can you reproduce my problem? I'm using version 4.3.24 of VirtualBox on a Windows 7 64bit machine.

philippneugebauer avatar Mar 10 '15 23:03 philippneugebauer

On linux it finds the path of the directory and does some stuff, but it still does not compile the gems for windows :/ The compilation of the linux gem works fine, but at the windows gems I get the following error message:

rake aborted!
Don't know how to build task 'cross'
/home/vagrant/.rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in `eval'
/home/vagrant/.rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in `<main>'

philippneugebauer avatar Mar 11 '15 13:03 philippneugebauer

@philippneugebauer the gem you're trying to cross-compile with rake-compiler-dev-box needs to implement cross-compilation setting all the related options for it.

See bundled example gem or others like this: https://github.com/luislavena/test-ruby-c-extension

luislavena avatar Mar 17 '15 13:03 luislavena

@philippneugebauer Just to clarify, in your first comment, you said you had issues even with the included sample_gem, but your second comment might revert that? Are you now only having issues with your gem, or the provided sample_gem as well?

tjschuck avatar Mar 17 '15 16:03 tjschuck

@tjschuck on windows it didn't work at all, on linux I need to test @luislavena's suggestions because I think I misunderstood the README text a bit

philippneugebauer avatar Mar 17 '15 17:03 philippneugebauer

@philippneugebauer Thanks for confirming -- in that case, there's a problem with the sample_gem too, then! If you figure out something that also applies to that, please let me know so I can fix it (or submit a PR if you can).

Thanks!

tjschuck avatar Mar 17 '15 18:03 tjschuck

@philippneugebauer in order for cross-compile gems to windows, you need to prepare cross compilers. This could explain why cross was not defined or similar

Only repositories placed relative to this project Vagrantfile (like sample_gem) are going to be found, so you need to place your code relative to it.

So:

  • In order to find the gem directory, it needs to be placed under the same parent directory as Vagrantfile so it can be found in /vagrant.
  • In order to cross compile to Windows, you first need to prepare cross-compiled versions of Ruby. Also the gem needs to define cross compilation, please look at examples indicated before.

If even following those guidelines still fail, please include precise steps done and exact out so we can reproduce.

Both sample_gem and test-ruby-c-extension compile perfectly in cross-compilation and natively on Windows.

Please note that any particular problem with rake-compiler itself needs to be addressed to new rake-compiler maintainers, as I'm no involved with the development anymore.

luislavena avatar Mar 17 '15 19:03 luislavena

@luislavena the problem on windows was that it couldn't even find the folder of the gem I wanted to compile and the folder of the sample gem although they were listed by ls -l

The other part then was a misunderstanding when I followed the readme instructions of the rake-compiler gem through that I thought the explained steps by you weren't required when I use this gem.

philippneugebauer avatar Mar 20 '15 16:03 philippneugebauer

the problem on windows was that it couldn't even find the folder of the gem I wanted to compile

Not sure to follow the scenario you're describing, were you trying to compile natively on Windows? or where you trying yo using rake-compiler-dev-box on Windows?

For the former scenario, I think is unrelated to this project. The later scenario might be caused by how Vagrant works with mounted folders and sync between them.

But again, I'm not fully understanding what happened and I don't have enough information to properly indicate what to look at, sorry.

luislavena avatar Mar 20 '15 17:03 luislavena

@luislavena I was trying to use rake-compiler-dev-box on Windows to compile the gem. Although the generell setup worked, I wasn't able to use the vagrant vm to do anything because the system didn't recognize the subfolders after I used cd \vagrant but the folders were correctly listed by ls -l. I wanted to try it again after your hints, but somehow the vm crashed and must be set up again. That's why I couldn't make it to now to test it again.

I will let you know, when I was able to try it again.

philippneugebauer avatar Mar 27 '15 11:03 philippneugebauer

I received the output ": No such file or directory" when running any of the package_* commands. Running it with "bash -x ..." showed, that the scripts contained carriage returns which were interpreted as part of the file names and I assume that because of that the files could not be found.

Could the CRs be added by the git checkout command trying to please the Windows platform?

RainerSchwarze avatar Apr 14 '15 14:04 RainerSchwarze

@RainerSchwarze most likely, I always set core.autocrlf=false to avoid these issues and let me decide what CRLF configuration will use in my source code.

luislavena avatar Apr 14 '15 14:04 luislavena