librelist archives

« back to archive

1.9.1: binject.c . Almost might not suck too much

1.9.1: binject.c . Almost might not suck too much

From:
Cecil Coupe
Date:
2010-04-11 @ 07:25
Using ruby 1.9.1, I managed to build an exe *AND* a dmg! Woo-hoo!

binject.c/pack.rb still has many issues with threads and C callbacks and
variable scope between 1.8.7 and 1.9.1. The commit
http://github.com/ccoupe/shoes/commit/9b266ae28bca715e9bdfba22768dae3b91679410
is just a hint of what needs to be done. It's freaking hack that
shouldn't be put in the mainstream. It also works for me. 

I wonder if the 1.9.1 scoping changes finally pushed _why over the edge
of not-caring. I'm starting to feel that too. 

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Satoshi Asakawa
Date:
2010-04-11 @ 12:50
Hi Cecil,

> Using ruby 1.9.1, I managed to build an exe *AND* a dmg!
Wow, awesome!

I downloaded binject.c from your github repo and re-built Shoes on my
laptop.

I executed `shoes -p` with the build and ... Yay! I got .exe file!

Then I clicked the .exe file, but,....

It opened a pop-up window and displayed: 'This is an empty Shoes stub.'
Umm... I have to add something one more step for my Windows MinGW
environment. ;-)

ashbb

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Devyn Cairns
Date:
2010-04-11 @ 17:50
That seems like it's not actually injecting at all, and just copying over
the stub.exe...

On Sun, Apr 11, 2010 at 5:50 AM, Satoshi Asakawa <ashbbb@gmail.com> wrote:

> Hi Cecil,
>
>
> > Using ruby 1.9.1, I managed to build an exe *AND* a dmg!
> Wow, awesome!
>
> I downloaded binject.c from your github repo and re-built Shoes on my
> laptop.
>
> I executed `shoes -p` with the build and ... Yay! I got .exe file!
>
> Then I clicked the .exe file, but,....
>
> It opened a pop-up window and displayed: 'This is an empty Shoes stub.'
> Umm... I have to add something one more step for my Windows MinGW
> environment. ;-)
>
> ashbb
>
>


-- 
   ~devyn

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Cecil Coupe
Date:
2010-04-11 @ 19:26
I have the benefit of some old packaged scripts (by raisins for
raisins). These were packaged to download shoes. Packaging the source
script in 1.9.1 and targeting raisins produces and identical exe. 

Are you using the changes I made to pack.rb to pick the target? If not
there's a catch-22. You can't package for policeman since there is no
policeman at the website to download.

When you made your exe, did you include shoes with it? Is the size
reasonable? 

FWIW, that stub.exe needs to be edited and rebuilt (in Windows) one of
these days. It references things that don't exist - hackety.org.
There is still a lot of work to do. 


On Sun, 2010-04-11 at 10:50 -0700, Devyn Cairns wrote:
> That seems like it's not actually injecting at all, and just copying
> over the stub.exe...
> 
> On Sun, Apr 11, 2010 at 5:50 AM, Satoshi Asakawa <ashbbb@gmail.com>
> wrote:
>         Hi Cecil,
>         
>         
>         > Using ruby 1.9.1, I managed to build an exe *AND* a dmg!
>         
>         Wow, awesome!
>         
>         I downloaded binject.c from your github repo and re-built
>         Shoes on my laptop.
>         
>         I executed `shoes -p` with the build and ... Yay! I got .exe
>         file!
>         
>         Then I clicked the .exe file, but,....
>         
>         It opened a pop-up window and displayed: 'This is an empty
>         Shoes stub.' 
>         Umm... I have to add something one more step for my Windows
>         MinGW environment. ;-)
>         
>         ashbb
>         
> 
> 
> 
> -- 
>    ~devyn

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Satoshi Asakawa
Date:
2010-04-11 @ 22:16
Sorry, Cecil.
I didn't understand anything.
I didn't replace pack.rb, blank.exe and didn't select including Policeman.

I need to take more time. :)

ashbb

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Devyn Cairns
Date:
2010-04-12 @ 04:22
In recent times, this kind of thing has happened twice, no? Get more sleep,
if you can :D

On Sun, Apr 11, 2010 at 3:16 PM, Satoshi Asakawa <ashbbb@gmail.com> wrote:

> Sorry, Cecil.
> I didn't understand anything.
> I didn't replace pack.rb, blank.exe and didn't select including Policeman.
>
> I need to take more time. :)
>
> ashbb
>



-- 
   ~devyn

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Satoshi Asakawa
Date:
2010-04-12 @ 13:52
hahaha. Okay, zzz... zzz... :-P

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Cecil Coupe
Date:
2010-04-12 @ 06:04
ashbb,

  What version is your gcc? MinGW? XP? How many CPUs/cores? Ruby
version?

Perhaps I can set up a VM in VirtualBox that matches your system.
Doubles my confusion which quadruples the possibility of dumb mistakes
but somebody has to do it. 

The threading (and scoping issues) in Shoes with 1.9.1 can be very
difficult at the C level. Details matter. 

Mine is:
ccoupe@twb:~/Projects/shoes$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
4.4.1-4ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr 
--enable-shared --enable-multiarch --enable-linker-build-id 
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-objc-gc --disable-werror 
--with-arch-32=i486 --with-tune=generic --enable-checking=release 
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) 

ccoupe@twb:~/Projects/shoes$ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]



On Sun, 2010-04-11 at 21:22 -0700, Devyn Cairns wrote:
> In recent times, this kind of thing has happened twice, no? Get more
> sleep, if you can :D
> 
> On Sun, Apr 11, 2010 at 3:16 PM, Satoshi Asakawa <ashbbb@gmail.com>
> wrote:
>         Sorry, Cecil.
>         I didn't understand anything.
>         I didn't replace pack.rb, blank.exe and didn't select
>         including Policeman.
>         
>         I need to take more time. :)
>         
>         ashbb
> 
> 
> 
> -- 
>    ~devyn

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Satoshi Asakawa
Date:
2010-04-12 @ 13:57
Hi Cecil,

I'm using ThinkPad X40, Pentium M and
MS Windows XP Professinal Version 2002 SP3.

C:\shoes_dev>gcc -v
Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld
--with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw
--enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java
--disable-win32-registry --disable-shared --enable-sjlj-exceptions
--enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm
--disable-libgcj-debug --enable-interpreter --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)

C:\shoes_dev>ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

And I'm building Shoes by these steps:
http://github.com/ashbb/shoes_hack_note/blob/master/md/hack019.md

ashbb

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Cecil Coupe
Date:
2010-04-13 @ 04:33
ashbb,

  Thanks for the build info. I've looked a little deeper at the Windows
requirements mentioned in your build note. Then I looked at the
plaform/msw files that do the download from hacketyhack.net - it's
hardcoded. 

The project needs a Windows C knowledgeable contributer and it won't be
me - I can't take that much pain. 

The Rakefile currently requires ruby 1.9.1 (for Windows) so we have
another catch-22 for releasing Policeman. We can't go backwards to 1.8.7
for Windows (easily) and we can't go forward to 1.9.1 until the scoping
related issues in Shoes are found and fixed and a Windows C developer
emerges. 

On Mon, 2010-04-12 at 22:57 +0900, Satoshi Asakawa wrote:
> Hi Cecil,
> 
> I'm using ThinkPad X40, Pentium M and
> MS Windows XP Professinal Version 2002 SP3.
> 
> C:\shoes_dev>gcc -v
> Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs
> Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc
> --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32
> --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c
> ++,f77,ada,objc,java --disable-win32-registry --disable-shared
> --enable-sjlj-exceptions --enable-libgcj --disable-java-awt
> --without-x --enable-java-gc=boehm --disable-libgcj-debug
> --enable-interpreter --enable-hash-synchronization
> --enable-libstdcxx-debug
> Thread model: win32
> gcc version 3.4.5 (mingw-vista special r3)
> 
> C:\shoes_dev>ruby -v
> ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]
> 
> And I'm building Shoes by these steps:
> http://github.com/ashbb/shoes_hack_note/blob/master/md/hack019.md
> 
> ashbb

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Satoshi Asakawa
Date:
2010-04-13 @ 13:59
Hi Cecil and forks,

Updated a little bit my github repo. Now can build Shoes-0.r1409 for Windows
both with Ruby 1.9.1 or 1.8.7.

http://vgoff.blogspot.com/2010/04/shoes-policeman-with-ruby-191-or-187.html

They don't execute binject well so far, though. :(

BTW. One question. I know I've not edited the plaform/msw files yet. But I
think there is no need to include Shoes, if I select "No, download Shoes if
it's absent." option on the pack.rb window.

Right?

ashbb

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Cecil Coupe
Date:
2010-04-14 @ 01:29
On Tue, 2010-04-13 at 22:59 +0900, Satoshi Asakawa wrote:
> Hi Cecil and forks,
> 
> Updated a little bit my github repo. Now can build Shoes-0.r1409 for
> Windows both with Ruby 1.9.1 or 1.8.7.

Brilliant.
> 
> http://vgoff.blogspot.com/2010/04/shoes-policeman-with-ruby-191-or-187.html

After looking at the commit mentioned on your blog, where did you find
the definition/documentation of rb_io_stdio_file?  
> 
> They don't execute binject well so far, though. :(

What script are you using to test packaging? I'll use it too and we
compare file sizes and such to see what's missing or wrong. 
> 
> BTW. One question. I know I've not edited the plaform/msw files yet.
> But I think there is no need to include Shoes, if I select "No,
> download Shoes if it's absent." option on the pack.rb window.
> 
> Right?
Correct. That my preferred option for packaging. Figuring out the URL to
use is the hard part. 

Re: [shoes] 1.9.1: binject.c . Almost might not suck too much

From:
Satoshi Asakawa
Date:
2010-04-14 @ 13:17
Hi Cecil,

> where did you find the definition/documentation of rb_io_stdio_file?
I just did googling and found the following:

http://redmine.ruby-lang.org/issues/show/1807

This is written in Japanese, but you can see this line:

   f = rb_io_stdio_file(fptr);  /* 1.8 GetReadFile */


> What script are you using to test packaging?
I'm doing:
- `shoes -p` on the console window
- select a little Shoes app file and `Windows` check box
- select `No, download Shoes if it's absent.` option
- then click `ok` button

Regards,
Satoshi