On Fri, Jun 8, 2012 at 8:05 AM, Boško IvaniševićWe miss you!
<bosko.iv...@gmail.com> wrote:
>
> Hi guys,
>
> It's been a long time since I contributed to this project. My daily job took
> too much time but now I'm back (at least with this small contribution :)).
>
> I just pushed initial commit to new project atYou can:
> http://github.com/bosko/gem-exefy. This is RubyGems plugin which adds new
> command - exefy. Executing
>
> gem exefy <gem_name>
>
> will search for all executables in target Gem. For each executable it will
> try to find corresponding batch file which will, finally, be replaced with
> .exe file with the name of the Gem executable (batch file name).
>
> Gem is still not ready for publishing. It is still missing DevKit's
> detection. BTW what would be the best way to detect if DevKit is available,
> to automatically expand PATH variable to include it while .exe file is
> created? John, Luis?
>
begin
require "devkit"
rescue LoadError
# ...
end
A proper installation of DevKit will place a "devkit.rb" in the
$LOAD_PATH, you can use that to detect if is present or fail.
> Nevertheless Gem is completely functional if you manually executeThis is awesome! thank you for taking the time to work on this!
> devkitvars.bat before executing:
>
> gem exefy...
>
> Of course I would like to hear what you guys think about this.
>
I noticed that with every gem the compilation of the executable is
triggered, perhaps we would like to cache the executable inside the
Gem datadir and compile only once?
I'll investigate that a bit more and get back to you, in the
meantime... welcome back and thank you!
On Fri, Jun 8, 2012 at 10:40 AM, Boško Ivanišević
<bosko.iv...@gmail.com> wrote:
>
> On Fri, Jun 8, 2012 at 2:47 PM, Luis Lavena <luisl...@gmail.com> wrote:
>>
>> I noticed that with every gem the compilation of the executable isThat will not work between Ruby 1.8.x and 1.9.x.
>> triggered, perhaps we would like to cache the executable inside the
>> Gem datadir and compile only once?
>>
>
> Executable can be packed in the gem and just copied to target directory with
> different names so if DevKit is not found we can ask user whether batch file
> should be replaced with precompiled exe. In the case DevKit is loaded we can
> make executable in gem-exefy's install directory instead of temporary one
> and use it later whenever exefy command is issued.
>
I think that firing compilation and placing the result in the gem data
directory will be enough.
Since gems are installed/placed in a directory that follows Ruby API
versioning (e.g. 1.8, 1.9.1) linking to the right ruby dll will be no
problem.
>>Short term goal: make gem-exefy hook gem installation and replace
>> I'll investigate that a bit more and get back to you, in the
>> meantime... welcome back and thank you!
>>
> Thanks again. I'll wait till you get back with new ideas. In the mean time
> it would be good if others test this gem too, so we can release it once we
> clear up problem with multiple compilation.
>
windows scripts (.bat) with pre-generated .exe file.
Long term goal: Make this part of RubyInstaller and replace Ruby's
.bat with .exe files, also hooking RubyGems to replace batch files.
Really long term goal: conquer the world.
:o)
On Fri, Jun 8, 2012 at 4:06 PM, Boško Ivanišević
<bosko.iv...@gmail.com> wrote:
>
> On Fri, Jun 8, 2012 at 5:01 PM, Luis Lavena <luisl...@gmail.com> wrote:
>>
>> I think that firing compilation and placing the result in the gem dataI have an idea for this, can't code it right now (deploying some
>> directory will be enough.
>>
>> Since gems are installed/placed in a directory that follows Ruby API
>> versioning (e.g. 1.8, 1.9.1) linking to the right ruby dll will be no
>> problem.
>>
>
> I agree. I'll add this within next few days.
>
features to one of our applications) but will get on it later today.
>> >>You need to implement it as a Gem plugin, hooking part of the gem
>> >> I'll investigate that a bit more and get back to you, in the
>> >> meantime... welcome back and thank you!
>> >>
>> > Thanks again. I'll wait till you get back with new ideas. In the mean
>> > time
>> > it would be good if others test this gem too, so we can release it once
>> > we
>> > clear up problem with multiple compilation.
>> >
>>
>> Short term goal: make gem-exefy hook gem installation and replace
>> windows scripts (.bat) with pre-generated .exe file.
>>
> That was my initial idea but then I decided to let users to choose whether
> they want to keep batch files or replace them with exe counterparts. I'll
> have to find out a way to hook gem-exefy to gem installation. Probably do it
> in a similar way as DevKit, right?
>
installation process.
What DevKit does is provide the "operating_system" default override,
but both DevKit *and* gem-exefy wouldn't be able to co-exist in the
same file (without stepping into each other)
I (personally) find the batch files uber annoying :P
>> Long term goal: Make this part of RubyInstaller and replace Ruby'sWell, I'm thinking we use gem-exefy right now as proof of concept,
>> .bat with .exe files, also hooking RubyGems to replace batch files.
>>
> It can be also short term. I think we have almost everything implemented. It
> would be easy to create additional rake tasks which will replace Ruby's .bat
> with .exe files. Although I would like to find solution which would not
> force us to have duplicated code. One in gem-exefy and the other in
> RubyInstaller recipes. We should think about that.
>
even "bundle" it in the installer (as installed gem)
In the future we might want to make gem-exefy part of Ruby, who knows ;-)
> >> Short term goal: make gem-exefy hook gem installation and replaceHey Boško, good to hear from you again :)
> >> windows scripts (.bat) with pre-generated .exe file.
> >>
> > That was my initial idea but then I decided to let users to choose whether
> > they want to keep batch files or replace them with exe counterparts. I'll
> > have to find out a way to hook gem-exefy to gem installation. Probably do it
> > in a similar way as DevKit, right?
> >
>
> You need to implement it as a Gem plugin, hooking part of the gem
> installation process.
>
> What DevKit does is provide the "operating_system" default override,
> but both DevKit *and* gem-exefy wouldn't be able to co-exist in the
> same file (without stepping into each other)
I'm way late to the discussion and haven't looked at gem-exefy yet, but can you guard DevKit and gem-exefy from stepping on each other with something creative in https://github.com/oneclick/rubyinstaller/blob/master/resources/devkit/dk.rb.erb#L48-54
In particular check for presence of https://github.com/oneclick/rubyinstaller/blob/master/resources/devkit/dk.rb.erb#L72 or other ENV trickery.
I'll try to look at gem-exefy this weekend.
>> Long term goal: Make this part of RubyInstaller and replace Ruby'sWell, I'm thinking we use gem-exefy right now as proof of concept,
>> .bat with .exe files, also hooking RubyGems to replace batch files.
>>
> It can be also short term. I think we have almost everything implemented. It
> would be easy to create additional rake tasks which will replace Ruby's .bat
> with .exe files. Although I would like to find solution which would not
> force us to have duplicated code. One in gem-exefy and the other in
> RubyInstaller recipes. We should think about that.
>
even "bundle" it in the installer (as installed gem)
I agree.
That would be nice :)In the future we might want to make gem-exefy part of Ruby, who knows ;-)
Justin, take a look to pull request #2.
Sorry for top posting. Sent from mobile.
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.
I'll try to look at gem-exefy this weekend.Please do. I would like to hear what you think about this.
libdir is correct. We link against the import library.
Link against a dll is a MinGW feature that not always work.
Agree about the platform. Perhaps the gem can be forced to be mingw32.
Sorry for top posting. Sent from mobile.
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyinstaller/-/LFXrENJgLFgJ.
Have you tried it? My proposed way of linking follows the same rules ruby links itself.
I believe my issue with linking was function decorators and stdcall used in the msvcrt replacement functions provided by ruby. Again, that was long time ago and I believe wasted lot of time on that, so wanted to stay away and burn again.
Sorry for top posting. Sent from mobile.
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
I'll try to look at gem-exefy this weekend.Please do. I would like to hear what you think about this.
Looks nice. I scanned master@2fda77f and have the following feedback:
* `gem_exe.c:L60` - IIRC, `xmalloc` exits (doesn't return NULL) if mem alloc has problems, but if there's any chance that `xmalloc` ever returns NULL, `memset` on L61 will SEGV
* `exefy_command.rb:link` - is the `libruby_dir` and `libruby` combo correct since `CONFIG['libdir']` have only `*.dll.a` and `*-static.a`? Should `CONFIG['bindir']` be used instead so the link is against the DLL?
* `exefy_command.rb:execute` - safer to backup the .bat's by default than count on the user to remember `-b`. Naming the backups something like `*.bat.orig` might be clearer than `*.bcp`
* `exefy_command.rb:L25` - update the wording similar to "...executed only on a RubyInstaller Windows OS installation"? Similarly, update the `post_install_message` and `exefy_command.rb:initialize`?
* allow gem install only if `RbConfig::CONFIG['host_os'] =~ /mingw/`? Making it hard to accidentally install on `mswin` should save support emails.
I'll try to break away from the big time suck that is my new Snow Leopard VM and MacPorts and play with it a bit more ;)
Jon
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyinstaller/-/LFXrENJgLFgJ.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.
On Mon, Jun 11, 2012 at 4:40 AM, Boško Ivanišević
<bosko.iv...@gmail.com> wrote:
> On Mon, Jun 11, 2012 at 12:24 AM, Jon <jon.f...@gmail.com> wrote:
>
>> * allow gem install only if `RbConfig::CONFIG['host_os'] =~ /mingw/`?platform is not exposed through Hoe, you need to use `spec_extras` in
>> Making it hard to accidentally install on `mswin` should save support
>> emails.
>>
> Still trying to find a way to do this. I can't even set up
> Gem::Specification's platform through Hoe.spec so platform in built gem is
> always 'ruby'.
>
the Hoe.spec block:
spec_extras[:platform] = Gem::Platform::CURRENT
On Mon, Jun 11, 2012 at 10:57 AM, Boško Ivanišević
<bosko.iv...@gmail.com> wrote:
>
> On Mon, Jun 11, 2012 at 3:46 PM, Luis Lavena <luisl...@gmail.com> wrote:
>>
>> platform is not exposed through Hoe, you need to use `spec_extras` inYes please, want this be an exclusive feature ;-)
>> the Hoe.spec block:
>>
>> spec_extras[:platform] = Gem::Platform::CURRENT
>>
>
> Great! I didn't know about this. Should we add this so we only build mingw
> gem?
>
Here's some quick test results before the airport lounge cocktails kick in and everything goes south.
Bottom line
-----------
* need a bit more helpful info/error messages
* `data/gemstub.exe` needs to be stripped before using it as the .exe template
* backup .bat's by default; don't make a user remember `-b`
* consider adding `-a, --all` to exefy all gems at once
# Hey, this isn't very verbose...did anything happen?
C:\Users\Jon>gem exefy -v eventmachine
Temporarily enhancing PATH to include DevKit...
# Ok, now somthing happened...oh nooo, you deleted my .bat file by default :(
C:\Users\Jon>gem exefy thor
Temporarily enhancing PATH to include DevKit...
Generating executable 'C:/ruby-test/193/lib/ruby/gems/1.9.1/gems/gem-exefy-0.0.1-x86-mingw32/data/gemstub.exe'...
Creating executable as 'rake2thor.exe'
Removing batch file 'rake2thor.bat'
Creating executable as 'thor.exe'
Removing batch file 'thor.bat'
# remember to use `-b` to backup .bat
C:\Users\Jon>gem exefy erubis -b -v
Temporarily enhancing PATH to include DevKit...
Creating executable as 'erubis.exe'
Creating backup of 'erubis.bat' batch file
# manually delete `erubis.exe` and try again without `-v`
# did anything happen?...manually check...Ok, I see the new `erubis.exe`
C:\Users\Jon>gem exefy erubis -b
Temporarily enhancing PATH to include DevKit...
# Let's try it again with `thor`...>:->
# did anything happen?...i can't tell
C:\Users\Jon>gem exefy -v thor
Temporarily enhancing PATH to include DevKit...
# BOGUS: I see bin/testrb.bat...let's exefy it!
C:\Users\Jon>gem exefy testrb
Temporarily enhancing PATH to include DevKit...
Cannot exefy. Gem testrb not found
# quick smoke test .exe vs. bat cmd line option handling
C:\Users\Jon>gem exefy tilt
Temporarily enhancing PATH to include DevKit...
C:\Users\Jon>echo "Answer: <%= 2 + n %>" | tilt -t erb --vars="{n: 100}"
"Answer: 102"
# hey, those gemstub .exe's look too porky...strip 'em
C:\Users\Jon>dir \ruby-test\193\bin\thor.exe
06/12/2012 02:30 PM 142,487 thor.exe
C:\Users\Jon>strip -s \ruby-test\193\bin\thor.exe
C:\Users\Jon>dir \ruby-test\193\bin\thor.exe
06/12/2012 02:50 PM 29,198 thor.exe
One last comment: we need to test scripts located in different GEM_PATH than GEM_HOME.
The other test is installation in a non-ascii directory.
Sorry for top posting. Sent from mobile.
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
One last comment: we need to test scripts located in different GEM_PATH than GEM_HOME.
The other test is installation in a non-ascii directory.
Thanks for testing, meant either ruby or gems relocated to a directory with non-ascii directory.
I've seen this done by some users. Is not gem installation itself but later.
Sorry for top posting. Sent from mobile.
Thanks for testing, meant either ruby or gems relocated to a directory with non-ascii directory.
I've seen this done by some users. Is not gem installation itself but later.
Sorry, limited mobile device is no excuse for my limited description.
Meant: install ruby, exefy scripts, relocate then test.. :-D
Thank you.
Sorry for top posting. Sent from mobile.
Sorry, limited mobile device is no excuse for my limited description.
Meant: install ruby, exefy scripts, relocate then test.. :-D
Can you test against 1.9.3?
1. 9.2 is broken for unicode files and directories.
Sorry for top posting. Sent from mobile.
Can you test against 1.9.3?
1. 9.2 is broken for unicode files and directories.
> I must say you really have good points. Now I'm rethinking about it onceI'm with limited access to internet, but:
> again :-) Luis, what do you think about this (and the whole branch, of
> course)?
gem exefy should work like pristine:
gem pristine foo
For a single gem, or:
gem pristine --all
For all.
To revert:
gem exefy foo --revert
Or:
gem exefy --revert --all
That will make operation really simple.
Revert doesn't need to have the original .bat file, we can find the
executables and create the right one using RubyGems original windows
script method, so we don't need to keep them all along.
Just my thoughts, sorry for the lack of "timing" but I'm on limited
internet access as I'm traveling right now.
On Wed, Jun 13, 2012 at 2:36 PM, Boško IvaniševićI'm with limited access to internet, but:
<bosko.iv...@gmail.com> wrote:
>
> I must say you really have good points. Now I'm rethinking about it once
> again :-) Luis, what do you think about this (and the whole branch, of
> course)?
>
gem exefy should work like pristine:
gem pristine foo
For a single gem, or:
gem pristine --all
For all.
To revert:
gem exefy foo --revert
Or:
gem exefy --revert --all
That will make operation really simple.
Revert doesn't need to have the original .bat file, we can find the
executables and create the right one using RubyGems original windows
script method, so we don't need to keep them all along.
Just my thoughts, sorry for the lack of "timing" but I'm on limited
internet access as I'm traveling right now.