Forums Archived

The forums are being archived. See this topic for more information.

Packaging for remote testing

Get help and support with Rubygame

Packaging for remote testing

Postby cgmjr » Wed Jan 20, 2010 12:04 am

I have a small prototype ready to go. I used Ocra to compile to an EXE (rubyscript2exe is broken atm). Of course the exe runs fine on my two machines, but nothing on my testers.

I *suspect* it is the SDL dlls are not getting inlcuded by Ocra, but that's just a guess. I'll add some logging or open a console to find out.

In the meantime, how is everyone packing up their projects?
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Packaging for remote testing

Postby kiba » Thu Jan 21, 2010 2:55 am

Getting close to finishing the big massive rewrite, but not yet for packaging purpose.
I write libre games. My libre game programming service is also availiable for anybody that want to pay.

I ran the Libregamewiki, the free gaming encyclopedia.
kiba
 
Posts: 53
Joined: Sat Feb 07, 2009 2:13 am

Re: Packaging for remote testing

Postby kiba » Sun Jan 24, 2010 10:47 pm

The executable that was generated for my rubygame app went broke! :(
I write libre games. My libre game programming service is also availiable for anybody that want to pay.

I ran the Libregamewiki, the free gaming encyclopedia.
kiba
 
Posts: 53
Joined: Sat Feb 07, 2009 2:13 am

Re: Packaging for remote testing

Postby cgmjr » Mon Jan 25, 2010 4:08 am

My issue is indeed the SDL dlls, but it appears to be in "nice-ffi/library.rb:98"

The backtrace is below. I'm hoping jacius can give me a pointer. I *think* I need to tickle NiceFFI::PathSet::DEFAULT_PATHS, but I'm not sure how.

As you look below, remember that I'm using Ocra to package my little script, and the funky path below is part of it's function.

Thanks in advance.


Code: Select all
C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/gems/nice-ffi-
0.2/lib/nice-ffi/library.rb:98:in `load_library': Could not load SDL. (LoadError
)
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl.rb:47:in `<module:SDL>'
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl.rb:34:in `<top (required)>'
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/rubygame-2.6.2/lib/rubygame/main.rb:22:in `require'
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/rubygame-2.6.2/lib/rubygame/main.rb:22:in `<top (required)>'
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/rubygame-2.6.2/lib/rubygame.rb:44:in `require'
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/rubygame-2.6.2/lib/rubygame.rb:44:in `block in <top (required)>'
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/rubygame-2.6.2/lib/rubygame.rb:29:in `each'
        from C:/Users/Becky/AppData/Local/Temp/ocrF6C3.tmp/lib/ruby/gems/1.9.1/g
ems/rubygame-2.6.2/lib/rubygame.rb:29:in `<top (required)>'
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Packaging for remote testing

Postby cgmjr » Tue Jan 26, 2010 5:06 pm

Looking at the custom load paths post at jacius' github... hoping to find enlightenment there.
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am


Re: Packaging for remote testing

Postby cgmjr » Wed Jan 27, 2010 4:31 am

shawn42 wrote:How'd it turn out?


The doc from jacius on load paths got me one step closer, but it is still failing. OCRA unpacks your code and libs to a temp directory. It's putting the rubygame stuff in a ".../temp/lib..." and then putting my actual code and includes in a ".../temp/src..." directory. My SDL dlls too. So nice-ffi and the other rubygame code still can't find the SDL dlls on the test machine.

There are some instructions with OCRA concerning working directories and such. I have to plow through those next. But I'm close! Once I get this worked out I can move on to refactoring my awful prototype code, and get some real feedback from my colleagues.
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Packaging for remote testing

Postby cgmjr » Fri Jan 29, 2010 3:04 am

Update: it appears the setting a custom SDL_PATHS is not working, at least in combination with Ocra. After much trial and error, the only way my prototype will work is if all the dlls are in the same directory as the main script, and I force the working directory with
Code: Select all
Dir.chdir File.dirname(__FILE__)


I've printed the values set in SDL_PATHS at runtime, and the assignment seems fine. For example:
Code: Select all
main_dir = File.dirname(__FILE__)
SDL_PATHS = [ File.join( main_dir, "dlls" ) ]
p " SDL LOAD PATH = #{SDL_PATHS}"

returns "SDL LOAD PATH = [\"E:/NetBeansProjects/myprototype/lib/dlls\"]"

I wonder if the escaped quotes are causing an issue?

Anyhoot, it seems like I'm setting SDL_PATHS as jacius directs, but rubygame doesn't find the SDL libraries. For now I'll just live with a fugly directory o'stuff.
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am

Re: Packaging for remote testing

Postby jacius » Sat Jan 30, 2010 6:15 am

cgmjr wrote:I've printed the values set in SDL_PATHS at runtime, and the assignment seems fine. For example:
Code: Select all
main_dir = File.dirname(__FILE__)
SDL_PATHS = [ File.join( main_dir, "dlls" ) ]
p " SDL LOAD PATH = #{SDL_PATHS}"

returns "SDL LOAD PATH = [\"E:/NetBeansProjects/myprototype/lib/dlls\"]"

I wonder if the escaped quotes are causing an issue?

The quotes are not actually part of the path string, are they? It looks like they're just in the printed output.

Anyway, I would suggest adding a slash at the end of the path, as I stupidly forgot to program it to add a separator if necessary. :oops: You can make it add a slash by adding an empty string in the join args:

Code: Select all
SDL_PATHS = [ File.join( main_dir, "dlls", "" ) ]

If that doesn't help, I would try (to see if it helps, but probably not for production code) using backslashes instead, as is the custom on Windows. Perhaps like this:

Code: Select all
SDL_PATHS = [ File.join( main_dir, "dlls", "" ).gsub("/", File::SEPARATOR) ]
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: Packaging for remote testing

Postby cgmjr » Sun Jan 31, 2010 4:33 am

jacius wrote:The quotes are not actually part of the path string, are they? It looks like they're just in the printed output.

The outer quotes are just my confusing way of denoting the value SDL_LOAD_PATH. The inner, escaped quotes are added by Array.to_s I suspect, since SDL_LOAD_PATH is an array of strings. :shrug: Anyhoot, I did not manually add the quotes when I attempted to set SDL_LOAD_PATH.

Anyway, I would suggest adding a slash at the end of the path, as I stupidly forgot to program it to add a separator if necessary. :oops: You can make it add a slash by adding an empty string in the join args:

Code: Select all
SDL_PATHS = [ File.join( main_dir, "dlls", "" ) ]


If that doesn't help, I would try (to see if it helps, but probably not for production code) using backslashes instead, as is the custom on Windows. Perhaps like this:

Code: Select all
SDL_PATHS = [ File.join( main_dir, "dlls", "" ).gsub("/", File::SEPARATOR) ]

Thanks! I'm betting that extra "/" at the end will be the ticket. I'll give that a try and holler back. Atm, however, I'm engrossed in a different little struggle, which I have posted here.

Edit: well, the extra "/" at the end worked a little. It'll load SDL, but won't load SDL_ttf :( I'm starting to think that this is not worth the time. The Ocra extractor cleans up the files, so dumping everything into a single directory is worth the price of no installer and a single executable, I'm thinking. I can follow good directory layout on my dev boxes, and live with one big honkin' directory for distribution. I think...
User avatar
cgmjr
 
Posts: 39
Joined: Mon Jan 11, 2010 6:41 am


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron