[MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Petr Kaleta
Hi everyone, I'd like to deploy my Macruby app using:

macruby_deploy --compile --embed --gem rest-client --gem sequel --bs Issues.app

but I'm getting this error:

*** Deployment started
*** Embedding MacRuby.framework
*** Embed RubyGems libdirs: 
/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
 
/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
 
/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
*** Embed BridgeSupport system files
*** Fix install path of binaries
*** Fix identification name of libmacruby
*** Compiling files
/usr/local/bin/macruby_deploy:127:in `block': undefined method `delete_if' for 
nil:NilClass (NoMethodError)
from /usr/local/bin/macruby_deploy:117:in `compile'
from /usr/local/bin/macruby_deploy:70:in `run'
from /usr/local/bin/macruby_deploy:283:in `'

Am I doing something wrong, or this is some bug in macruby_deploy tool? I am 
using the latest macruby version from origin/master.

- Petr
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Eloy Duran
No it's not your fault, it seems the code assumes a ENV variable
that's set by Xcode. This is the offending code:

compile_options = { bundle: true, output: obj, files: [source] }
# Use Xcode ARCHS env var to determine which archs to compile for
compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
# Check that the ARCHS env var contains valid values
supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
'').strip.split
compile_options[:archs].delete_if do |arch|
  unless supported_archs.include?(arch)
puts "Can't build for arch #{arch} because it is not supported"
true
  end
end

I think that if the ENV['ARCHS'] variable isn't set we should check
the app binary for the archs it's been built for. I'll create a path
in a bit.

For now you should be able to work around it by doing:

env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
rest-client --gem sequel --bs Issues.app

And adjust the actual archs for the ones your app is built for.

On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
> Hi everyone, I'd like to deploy my Macruby app using:
>
> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
> Issues.app
>
> but I'm getting this error:
>
> *** Deployment started
> *** Embedding MacRuby.framework
> *** Embed RubyGems libdirs: 
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>  
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>  
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
> *** Embed BridgeSupport system files
> *** Fix install path of binaries
> *** Fix identification name of libmacruby
> *** Compiling files
> /usr/local/bin/macruby_deploy:127:in `block': undefined method `delete_if' 
> for nil:NilClass (NoMethodError)
>        from /usr/local/bin/macruby_deploy:117:in `compile'
>        from /usr/local/bin/macruby_deploy:70:in `run'
>        from /usr/local/bin/macruby_deploy:283:in `'
>
> Am I doing something wrong, or this is some bug in macruby_deploy tool? I am 
> using the latest macruby version from origin/master.
>
> - Petr
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Petr Kaleta
Thanks for reply, that works. So after deploying, my whole application has 
about 45MB (zipped 12MB). My only question is, can I somehow speedup 
application start? Now it takes about 10 seconds (loading gems & project files).

- Petr

On May 5, 2011, at 12:13 PM, Eloy Duran wrote:

> No it's not your fault, it seems the code assumes a ENV variable
> that's set by Xcode. This is the offending code:
> 
>compile_options = { bundle: true, output: obj, files: [source] }
># Use Xcode ARCHS env var to determine which archs to compile for
>compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
># Check that the ARCHS env var contains valid values
>supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
> '').strip.split
>compile_options[:archs].delete_if do |arch|
>  unless supported_archs.include?(arch)
>puts "Can't build for arch #{arch} because it is not supported"
>true
>  end
>end
> 
> I think that if the ENV['ARCHS'] variable isn't set we should check
> the app binary for the archs it's been built for. I'll create a path
> in a bit.
> 
> For now you should be able to work around it by doing:
> 
> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
> rest-client --gem sequel --bs Issues.app
> 
> And adjust the actual archs for the ones your app is built for.
> 
> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
>> Hi everyone, I'd like to deploy my Macruby app using:
>> 
>> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
>> Issues.app
>> 
>> but I'm getting this error:
>> 
>> *** Deployment started
>> *** Embedding MacRuby.framework
>> *** Embed RubyGems libdirs: 
>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>>  
>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>>  
>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
>> *** Embed BridgeSupport system files
>> *** Fix install path of binaries
>> *** Fix identification name of libmacruby
>> *** Compiling files
>> /usr/local/bin/macruby_deploy:127:in `block': undefined method `delete_if' 
>> for nil:NilClass (NoMethodError)
>>from /usr/local/bin/macruby_deploy:117:in `compile'
>>from /usr/local/bin/macruby_deploy:70:in `run'
>>from /usr/local/bin/macruby_deploy:283:in `'
>> 
>> Am I doing something wrong, or this is some bug in macruby_deploy tool? I am 
>> using the latest macruby version from origin/master.
>> 
>> - Petr
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Petr Kaleta
Now I am looking in the application package and embeded gems are not compiled. 
And as you can see here http://cl.ly/240t0v3q2O221X3U113u some ruby files 
compiled are, but there are source files as well. Embeded STDlib is not 
compiled at all http://cl.ly/2d2D2R2L451m2C2x472J

Is this right?

On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:

> Thanks for reply, that works. So after deploying, my whole application has 
> about 45MB (zipped 12MB). My only question is, can I somehow speedup 
> application start? Now it takes about 10 seconds (loading gems & project 
> files).
> 
> - Petr
> 
> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
> 
>> No it's not your fault, it seems the code assumes a ENV variable
>> that's set by Xcode. This is the offending code:
>> 
>>   compile_options = { bundle: true, output: obj, files: [source] }
>>   # Use Xcode ARCHS env var to determine which archs to compile for
>>   compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
>>   # Check that the ARCHS env var contains valid values
>>   supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
>> '').strip.split
>>   compile_options[:archs].delete_if do |arch|
>> unless supported_archs.include?(arch)
>>   puts "Can't build for arch #{arch} because it is not supported"
>>   true
>> end
>>   end
>> 
>> I think that if the ENV['ARCHS'] variable isn't set we should check
>> the app binary for the archs it's been built for. I'll create a path
>> in a bit.
>> 
>> For now you should be able to work around it by doing:
>> 
>> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
>> rest-client --gem sequel --bs Issues.app
>> 
>> And adjust the actual archs for the ones your app is built for.
>> 
>> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
>>> Hi everyone, I'd like to deploy my Macruby app using:
>>> 
>>> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
>>> Issues.app
>>> 
>>> but I'm getting this error:
>>> 
>>> *** Deployment started
>>> *** Embedding MacRuby.framework
>>> *** Embed RubyGems libdirs: 
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
>>> *** Embed BridgeSupport system files
>>> *** Fix install path of binaries
>>> *** Fix identification name of libmacruby
>>> *** Compiling files
>>> /usr/local/bin/macruby_deploy:127:in `block': undefined method `delete_if' 
>>> for nil:NilClass (NoMethodError)
>>>   from /usr/local/bin/macruby_deploy:117:in `compile'
>>>   from /usr/local/bin/macruby_deploy:70:in `run'
>>>   from /usr/local/bin/macruby_deploy:283:in `'
>>> 
>>> Am I doing something wrong, or this is some bug in macruby_deploy tool? I 
>>> am using the latest macruby version from origin/master.
>>> 
>>> - Petr
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Eloy Duran
I have just pushed a fix for this:
https://github.com/MacRuby/MacRuby/commit/82ab10ee484a14e4939b8b13c3f4f14fd1298955
Please try it out!

Hmm, I’ll have to dig deeper to see how the embedded gems are actually
loaded. My assumption was that rubygems would not be loaded at all,
which is usually the culprit of long startup times. However, I have to
leave now, so will look at this later.

On Thu, May 5, 2011 at 1:27 PM, Petr Kaleta  wrote:
> Thanks for reply, that works. So after deploying, my whole application has 
> about 45MB (zipped 12MB). My only question is, can I somehow speedup 
> application start? Now it takes about 10 seconds (loading gems & project 
> files).
>
> - Petr
>
> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
>
>> No it's not your fault, it seems the code assumes a ENV variable
>> that's set by Xcode. This is the offending code:
>>
>>        compile_options = { bundle: true, output: obj, files: [source] }
>>        # Use Xcode ARCHS env var to determine which archs to compile for
>>        compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
>>        # Check that the ARCHS env var contains valid values
>>        supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
>> '').strip.split
>>        compile_options[:archs].delete_if do |arch|
>>          unless supported_archs.include?(arch)
>>            puts "Can't build for arch #{arch} because it is not supported"
>>            true
>>          end
>>        end
>>
>> I think that if the ENV['ARCHS'] variable isn't set we should check
>> the app binary for the archs it's been built for. I'll create a path
>> in a bit.
>>
>> For now you should be able to work around it by doing:
>>
>> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
>> rest-client --gem sequel --bs Issues.app
>>
>> And adjust the actual archs for the ones your app is built for.
>>
>> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
>>> Hi everyone, I'd like to deploy my Macruby app using:
>>>
>>> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
>>> Issues.app
>>>
>>> but I'm getting this error:
>>>
>>> *** Deployment started
>>> *** Embedding MacRuby.framework
>>> *** Embed RubyGems libdirs: 
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
>>> *** Embed BridgeSupport system files
>>> *** Fix install path of binaries
>>> *** Fix identification name of libmacruby
>>> *** Compiling files
>>> /usr/local/bin/macruby_deploy:127:in `block': undefined method `delete_if' 
>>> for nil:NilClass (NoMethodError)
>>>        from /usr/local/bin/macruby_deploy:117:in `compile'
>>>        from /usr/local/bin/macruby_deploy:70:in `run'
>>>        from /usr/local/bin/macruby_deploy:283:in `'
>>>
>>> Am I doing something wrong, or this is some bug in macruby_deploy tool? I 
>>> am using the latest macruby version from origin/master.
>>>
>>> - Petr
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>>
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Eloy Duran
No, that's not right. The embed code is run before the compile code
and the compile code uses the following to select all ruby files in
the Resources directory of the app bundle:

  def compile_files
Dir.glob(File.join(app_resources, '**', '*.rb'))
  end

It would be great if you can upload a sample that shows this.

On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
> Now I am looking in the application package and embeded gems are not 
> compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some ruby 
> files compiled are, but there are source files as well. Embeded STDlib is not 
> compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
>
> Is this right?
>
> On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
>
>> Thanks for reply, that works. So after deploying, my whole application has 
>> about 45MB (zipped 12MB). My only question is, can I somehow speedup 
>> application start? Now it takes about 10 seconds (loading gems & project 
>> files).
>>
>> - Petr
>>
>> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
>>
>>> No it's not your fault, it seems the code assumes a ENV variable
>>> that's set by Xcode. This is the offending code:
>>>
>>>       compile_options = { bundle: true, output: obj, files: [source] }
>>>       # Use Xcode ARCHS env var to determine which archs to compile for
>>>       compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
>>>       # Check that the ARCHS env var contains valid values
>>>       supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
>>> '').strip.split
>>>       compile_options[:archs].delete_if do |arch|
>>>         unless supported_archs.include?(arch)
>>>           puts "Can't build for arch #{arch} because it is not supported"
>>>           true
>>>         end
>>>       end
>>>
>>> I think that if the ENV['ARCHS'] variable isn't set we should check
>>> the app binary for the archs it's been built for. I'll create a path
>>> in a bit.
>>>
>>> For now you should be able to work around it by doing:
>>>
>>> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
>>> rest-client --gem sequel --bs Issues.app
>>>
>>> And adjust the actual archs for the ones your app is built for.
>>>
>>> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
 Hi everyone, I'd like to deploy my Macruby app using:

 macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
 Issues.app

 but I'm getting this error:

 *** Deployment started
 *** Embedding MacRuby.framework
 *** Embed RubyGems libdirs: 
 /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
  
 /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
  
 /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
 *** Embed BridgeSupport system files
 *** Fix install path of binaries
 *** Fix identification name of libmacruby
 *** Compiling files
 /usr/local/bin/macruby_deploy:127:in `block': undefined method `delete_if' 
 for nil:NilClass (NoMethodError)
       from /usr/local/bin/macruby_deploy:117:in `compile'
       from /usr/local/bin/macruby_deploy:70:in `run'
       from /usr/local/bin/macruby_deploy:283:in `'

 Am I doing something wrong, or this is some bug in macruby_deploy tool? I 
 am using the latest macruby version from origin/master.

 - Petr
 ___
 MacRuby-devel mailing list
 [email protected]
 http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Petr Kaleta
Here is sample application source code + archive 
http://cl.ly/2m060z0t1C1B18442m33

Than I run:

env ARCHS='x86_64' macruby_deploy --compile --embed --gem rest-client --bs 
MemoryTesting.app

Which produced this package http://cl.ly/3Y03050r3q1E0p1q453D In the package 
contents there you can see, that files in Framework are not compiled (include 
rest-client gem)

My another question is, is it normal, that this simple "blank window" app takes 
45MB RAM?

- Petr

On May 5, 2011, at 2:34 PM, Eloy Duran wrote:

> No, that's not right. The embed code is run before the compile code
> and the compile code uses the following to select all ruby files in
> the Resources directory of the app bundle:
> 
>  def compile_files
>Dir.glob(File.join(app_resources, '**', '*.rb'))
>  end
> 
> It would be great if you can upload a sample that shows this.
> 
> On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
>> Now I am looking in the application package and embeded gems are not 
>> compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some 
>> ruby files compiled are, but there are source files as well. Embeded STDlib 
>> is not compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
>> 
>> Is this right?
>> 
>> On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
>> 
>>> Thanks for reply, that works. So after deploying, my whole application has 
>>> about 45MB (zipped 12MB). My only question is, can I somehow speedup 
>>> application start? Now it takes about 10 seconds (loading gems & project 
>>> files).
>>> 
>>> - Petr
>>> 
>>> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
>>> 
 No it's not your fault, it seems the code assumes a ENV variable
 that's set by Xcode. This is the offending code:
 
   compile_options = { bundle: true, output: obj, files: [source] }
   # Use Xcode ARCHS env var to determine which archs to compile for
   compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
   # Check that the ARCHS env var contains valid values
   supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
 '').strip.split
   compile_options[:archs].delete_if do |arch|
 unless supported_archs.include?(arch)
   puts "Can't build for arch #{arch} because it is not supported"
   true
 end
   end
 
 I think that if the ENV['ARCHS'] variable isn't set we should check
 the app binary for the archs it's been built for. I'll create a path
 in a bit.
 
 For now you should be able to work around it by doing:
 
 env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
 rest-client --gem sequel --bs Issues.app
 
 And adjust the actual archs for the ones your app is built for.
 
 On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
> Hi everyone, I'd like to deploy my Macruby app using:
> 
> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
> Issues.app
> 
> but I'm getting this error:
> 
> *** Deployment started
> *** Embedding MacRuby.framework
> *** Embed RubyGems libdirs: 
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>  
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>  
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
> *** Embed BridgeSupport system files
> *** Fix install path of binaries
> *** Fix identification name of libmacruby
> *** Compiling files
> /usr/local/bin/macruby_deploy:127:in `block': undefined method 
> `delete_if' for nil:NilClass (NoMethodError)
>   from /usr/local/bin/macruby_deploy:117:in `compile'
>   from /usr/local/bin/macruby_deploy:70:in `run'
>   from /usr/local/bin/macruby_deploy:283:in `'
> 
> Am I doing something wrong, or this is some bug in macruby_deploy tool? I 
> am using the latest macruby version from origin/master.
> 
> - Petr
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
 ___
 MacRuby-devel mailing list
 [email protected]
 http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>> 
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
> ___
> MacRuby-devel mailing list
> MacRuby-d

Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Petr Kaleta
Yes, you said, that it compile all files from Resources directory, but gems are 
embeded in Framework directory. So thats why, they are not compiled. Can be 
STDLIB compiled as well?

- Petr

On May 5, 2011, at 2:34 PM, Eloy Duran wrote:

> No, that's not right. The embed code is run before the compile code
> and the compile code uses the following to select all ruby files in
> the Resources directory of the app bundle:
> 
>  def compile_files
>Dir.glob(File.join(app_resources, '**', '*.rb'))
>  end
> 
> It would be great if you can upload a sample that shows this.
> 
> On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
>> Now I am looking in the application package and embeded gems are not 
>> compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some 
>> ruby files compiled are, but there are source files as well. Embeded STDlib 
>> is not compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
>> 
>> Is this right?
>> 
>> On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
>> 
>>> Thanks for reply, that works. So after deploying, my whole application has 
>>> about 45MB (zipped 12MB). My only question is, can I somehow speedup 
>>> application start? Now it takes about 10 seconds (loading gems & project 
>>> files).
>>> 
>>> - Petr
>>> 
>>> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
>>> 
 No it's not your fault, it seems the code assumes a ENV variable
 that's set by Xcode. This is the offending code:
 
   compile_options = { bundle: true, output: obj, files: [source] }
   # Use Xcode ARCHS env var to determine which archs to compile for
   compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
   # Check that the ARCHS env var contains valid values
   supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
 '').strip.split
   compile_options[:archs].delete_if do |arch|
 unless supported_archs.include?(arch)
   puts "Can't build for arch #{arch} because it is not supported"
   true
 end
   end
 
 I think that if the ENV['ARCHS'] variable isn't set we should check
 the app binary for the archs it's been built for. I'll create a path
 in a bit.
 
 For now you should be able to work around it by doing:
 
 env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
 rest-client --gem sequel --bs Issues.app
 
 And adjust the actual archs for the ones your app is built for.
 
 On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
> Hi everyone, I'd like to deploy my Macruby app using:
> 
> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
> Issues.app
> 
> but I'm getting this error:
> 
> *** Deployment started
> *** Embedding MacRuby.framework
> *** Embed RubyGems libdirs: 
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>  
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>  
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
> *** Embed BridgeSupport system files
> *** Fix install path of binaries
> *** Fix identification name of libmacruby
> *** Compiling files
> /usr/local/bin/macruby_deploy:127:in `block': undefined method 
> `delete_if' for nil:NilClass (NoMethodError)
>   from /usr/local/bin/macruby_deploy:117:in `compile'
>   from /usr/local/bin/macruby_deploy:70:in `run'
>   from /usr/local/bin/macruby_deploy:283:in `'
> 
> Am I doing something wrong, or this is some bug in macruby_deploy tool? I 
> am using the latest macruby version from origin/master.
> 
> - Petr
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
 ___
 MacRuby-devel mailing list
 [email protected]
 http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>> 
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Eloy Duran
Aha indeed! Yes we should definitely compile them imo. But I’m not
sure if there’s a good reason for excluding stdlib and gems from
compilation. The last time I tried there was no problem with compiling
it all. Can you change this in source/bin/ruby_deploy and see if your
app works good afterwards? If so I’ll apply that, right now I’m going
to start on a test suite for the tool as it is.

On Thu, May 5, 2011 at 2:58 PM, Petr Kaleta  wrote:
> Yes, you said, that it compile all files from Resources directory, but gems 
> are embeded in Framework directory. So thats why, they are not compiled. Can 
> be STDLIB compiled as well?
>
> - Petr
>
> On May 5, 2011, at 2:34 PM, Eloy Duran wrote:
>
>> No, that's not right. The embed code is run before the compile code
>> and the compile code uses the following to select all ruby files in
>> the Resources directory of the app bundle:
>>
>>  def compile_files
>>    Dir.glob(File.join(app_resources, '**', '*.rb'))
>>  end
>>
>> It would be great if you can upload a sample that shows this.
>>
>> On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
>>> Now I am looking in the application package and embeded gems are not 
>>> compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some 
>>> ruby files compiled are, but there are source files as well. Embeded STDlib 
>>> is not compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
>>>
>>> Is this right?
>>>
>>> On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
>>>
 Thanks for reply, that works. So after deploying, my whole application has 
 about 45MB (zipped 12MB). My only question is, can I somehow speedup 
 application start? Now it takes about 10 seconds (loading gems & project 
 files).

 - Petr

 On May 5, 2011, at 12:13 PM, Eloy Duran wrote:

> No it's not your fault, it seems the code assumes a ENV variable
> that's set by Xcode. This is the offending code:
>
>       compile_options = { bundle: true, output: obj, files: [source] }
>       # Use Xcode ARCHS env var to determine which archs to compile for
>       compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
>       # Check that the ARCHS env var contains valid values
>       supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
> '').strip.split
>       compile_options[:archs].delete_if do |arch|
>         unless supported_archs.include?(arch)
>           puts "Can't build for arch #{arch} because it is not supported"
>           true
>         end
>       end
>
> I think that if the ENV['ARCHS'] variable isn't set we should check
> the app binary for the archs it's been built for. I'll create a path
> in a bit.
>
> For now you should be able to work around it by doing:
>
> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
> rest-client --gem sequel --bs Issues.app
>
> And adjust the actual archs for the ones your app is built for.
>
> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
>> Hi everyone, I'd like to deploy my Macruby app using:
>>
>> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
>> Issues.app
>>
>> but I'm getting this error:
>>
>> *** Deployment started
>> *** Embedding MacRuby.framework
>> *** Embed RubyGems libdirs: 
>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>>  
>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>>  
>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
>> *** Embed BridgeSupport system files
>> *** Fix install path of binaries
>> *** Fix identification name of libmacruby
>> *** Compiling files
>> /usr/local/bin/macruby_deploy:127:in `block': undefined method 
>> `delete_if' for nil:NilClass (NoMethodError)
>>       from /usr/local/bin/macruby_deploy:117:in `compile'
>>       from /usr/local/bin/macruby_deploy:70:in `run'
>>       from /usr/local/bin/macruby_deploy:283:in `'
>>
>> Am I doing something wrong, or this is some bug in macruby_deploy tool? 
>> I am using the latest macruby version from origin/master.
>>
>> - Petr
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

 ___
 MacRuby-devel mailing list
 [email protected]
 http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>>
>>> 

Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Nick Ludlam
I think Laurent and I were discussing some issues with the AOT compiling of 
certain stdlib files causing problems. My specific case was from the RSS module.

https://www.macruby.org/trac/ticket/1020

On 5 May 2011, at 14:39, Eloy Duran wrote:

> Aha indeed! Yes we should definitely compile them imo. But I’m not
> sure if there’s a good reason for excluding stdlib and gems from
> compilation. The last time I tried there was no problem with compiling
> it all. Can you change this in source/bin/ruby_deploy and see if your
> app works good afterwards? If so I’ll apply that, right now I’m going
> to start on a test suite for the tool as it is.
> 
> On Thu, May 5, 2011 at 2:58 PM, Petr Kaleta  wrote:
>> Yes, you said, that it compile all files from Resources directory, but gems 
>> are embeded in Framework directory. So thats why, they are not compiled. Can 
>> be STDLIB compiled as well?
>> 
>> - Petr
>> 
>> On May 5, 2011, at 2:34 PM, Eloy Duran wrote:
>> 
>>> No, that's not right. The embed code is run before the compile code
>>> and the compile code uses the following to select all ruby files in
>>> the Resources directory of the app bundle:
>>> 
>>>  def compile_files
>>>Dir.glob(File.join(app_resources, '**', '*.rb'))
>>>  end
>>> 
>>> It would be great if you can upload a sample that shows this.
>>> 
>>> On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
 Now I am looking in the application package and embeded gems are not 
 compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some 
 ruby files compiled are, but there are source files as well. Embeded 
 STDlib is not compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
 
 Is this right?
 
 On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
 
> Thanks for reply, that works. So after deploying, my whole application 
> has about 45MB (zipped 12MB). My only question is, can I somehow speedup 
> application start? Now it takes about 10 seconds (loading gems & project 
> files).
> 
> - Petr
> 
> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
> 
>> No it's not your fault, it seems the code assumes a ENV variable
>> that's set by Xcode. This is the offending code:
>> 
>>   compile_options = { bundle: true, output: obj, files: [source] }
>>   # Use Xcode ARCHS env var to determine which archs to compile for
>>   compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
>>   # Check that the ARCHS env var contains valid values
>>   supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
>> '').strip.split
>>   compile_options[:archs].delete_if do |arch|
>> unless supported_archs.include?(arch)
>>   puts "Can't build for arch #{arch} because it is not supported"
>>   true
>> end
>>   end
>> 
>> I think that if the ENV['ARCHS'] variable isn't set we should check
>> the app binary for the archs it's been built for. I'll create a path
>> in a bit.
>> 
>> For now you should be able to work around it by doing:
>> 
>> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
>> rest-client --gem sequel --bs Issues.app
>> 
>> And adjust the actual archs for the ones your app is built for.
>> 
>> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
>>> Hi everyone, I'd like to deploy my Macruby app using:
>>> 
>>> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
>>> Issues.app
>>> 
>>> but I'm getting this error:
>>> 
>>> *** Deployment started
>>> *** Embedding MacRuby.framework
>>> *** Embed RubyGems libdirs: 
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
>>> *** Embed BridgeSupport system files
>>> *** Fix install path of binaries
>>> *** Fix identification name of libmacruby
>>> *** Compiling files
>>> /usr/local/bin/macruby_deploy:127:in `block': undefined method 
>>> `delete_if' for nil:NilClass (NoMethodError)
>>>   from /usr/local/bin/macruby_deploy:117:in `compile'
>>>   from /usr/local/bin/macruby_deploy:70:in `run'
>>>   from /usr/local/bin/macruby_deploy:283:in `'
>>> 
>>> Am I doing something wrong, or this is some bug in macruby_deploy tool? 
>>> I am using the latest macruby version from origin/master.
>>> 
>>> - Petr
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>> 
>> 

Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Eloy Duran
Hmm, yes this is a problem. Maybe we should add separate options for compiling 
stdlib and gems and start keeping a list of libs known to not work well with 
AOT compilation which can then be excluded? I don't like adding another option 
so we could also compile everything with --compile, but this might introduce 
problems for users with libs of which we don't yet know if they work well.

I personally prefer the latter, because it keeps the interface of ruby_deploy 
simple and forcing people to run into potential bugs is the only good way to 
find these problem libs. However, from a user friendly pov opt-in might be 
better, but it's much less likely that people will report about broken libs in 
that case.

On 5 mei 2011, at 15:49, Nick Ludlam wrote:

> I think Laurent and I were discussing some issues with the AOT compiling of 
> certain stdlib files causing problems. My specific case was from the RSS 
> module.
> 
> https://www.macruby.org/trac/ticket/1020
> 
> On 5 May 2011, at 14:39, Eloy Duran wrote:
> 
>> Aha indeed! Yes we should definitely compile them imo. But I’m not
>> sure if there’s a good reason for excluding stdlib and gems from
>> compilation. The last time I tried there was no problem with compiling
>> it all. Can you change this in source/bin/ruby_deploy and see if your
>> app works good afterwards? If so I’ll apply that, right now I’m going
>> to start on a test suite for the tool as it is.
>> 
>> On Thu, May 5, 2011 at 2:58 PM, Petr Kaleta  wrote:
>>> Yes, you said, that it compile all files from Resources directory, but gems 
>>> are embeded in Framework directory. So thats why, they are not compiled. 
>>> Can be STDLIB compiled as well?
>>> 
>>> - Petr
>>> 
>>> On May 5, 2011, at 2:34 PM, Eloy Duran wrote:
>>> 
 No, that's not right. The embed code is run before the compile code
 and the compile code uses the following to select all ruby files in
 the Resources directory of the app bundle:
 
 def compile_files
   Dir.glob(File.join(app_resources, '**', '*.rb'))
 end
 
 It would be great if you can upload a sample that shows this.
 
 On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
> Now I am looking in the application package and embeded gems are not 
> compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some 
> ruby files compiled are, but there are source files as well. Embeded 
> STDlib is not compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
> 
> Is this right?
> 
> On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
> 
>> Thanks for reply, that works. So after deploying, my whole application 
>> has about 45MB (zipped 12MB). My only question is, can I somehow speedup 
>> application start? Now it takes about 10 seconds (loading gems & project 
>> files).
>> 
>> - Petr
>> 
>> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
>> 
>>> No it's not your fault, it seems the code assumes a ENV variable
>>> that's set by Xcode. This is the offending code:
>>> 
>>>  compile_options = { bundle: true, output: obj, files: [source] }
>>>  # Use Xcode ARCHS env var to determine which archs to compile for
>>>  compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
>>>  # Check that the ARCHS env var contains valid values
>>>  supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
>>> '').strip.split
>>>  compile_options[:archs].delete_if do |arch|
>>>unless supported_archs.include?(arch)
>>>  puts "Can't build for arch #{arch} because it is not supported"
>>>  true
>>>end
>>>  end
>>> 
>>> I think that if the ENV['ARCHS'] variable isn't set we should check
>>> the app binary for the archs it's been built for. I'll create a path
>>> in a bit.
>>> 
>>> For now you should be able to work around it by doing:
>>> 
>>> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
>>> rest-client --gem sequel --bs Issues.app
>>> 
>>> And adjust the actual archs for the ones your app is built for.
>>> 
>>> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
 Hi everyone, I'd like to deploy my Macruby app using:
 
 macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
 Issues.app
 
 but I'm getting this error:
 
 *** Deployment started
 *** Embedding MacRuby.framework
 *** Embed RubyGems libdirs: 
 /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
  
 /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
  
 /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
 *** Embed BridgeSupport system files
>

Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Petr Kaleta
Sounds good for me.

On May 5, 2011, at 4:25 PM, Eloy Duran wrote:

> Hmm, yes this is a problem. Maybe we should add separate options for 
> compiling stdlib and gems and start keeping a list of libs known to not work 
> well with AOT compilation which can then be excluded? I don't like adding 
> another option so we could also compile everything with --compile, but this 
> might introduce problems for users with libs of which we don't yet know if 
> they work well.
> 
> I personally prefer the latter, because it keeps the interface of ruby_deploy 
> simple and forcing people to run into potential bugs is the only good way to 
> find these problem libs. However, from a user friendly pov opt-in might be 
> better, but it's much less likely that people will report about broken libs 
> in that case.
> 
> On 5 mei 2011, at 15:49, Nick Ludlam wrote:
> 
>> I think Laurent and I were discussing some issues with the AOT compiling of 
>> certain stdlib files causing problems. My specific case was from the RSS 
>> module.
>> 
>> https://www.macruby.org/trac/ticket/1020
>> 
>> On 5 May 2011, at 14:39, Eloy Duran wrote:
>> 
>>> Aha indeed! Yes we should definitely compile them imo. But I’m not
>>> sure if there’s a good reason for excluding stdlib and gems from
>>> compilation. The last time I tried there was no problem with compiling
>>> it all. Can you change this in source/bin/ruby_deploy and see if your
>>> app works good afterwards? If so I’ll apply that, right now I’m going
>>> to start on a test suite for the tool as it is.
>>> 
>>> On Thu, May 5, 2011 at 2:58 PM, Petr Kaleta  wrote:
 Yes, you said, that it compile all files from Resources directory, but 
 gems are embeded in Framework directory. So thats why, they are not 
 compiled. Can be STDLIB compiled as well?
 
 - Petr
 
 On May 5, 2011, at 2:34 PM, Eloy Duran wrote:
 
> No, that's not right. The embed code is run before the compile code
> and the compile code uses the following to select all ruby files in
> the Resources directory of the app bundle:
> 
> def compile_files
>  Dir.glob(File.join(app_resources, '**', '*.rb'))
> end
> 
> It would be great if you can upload a sample that shows this.
> 
> On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
>> Now I am looking in the application package and embeded gems are not 
>> compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some 
>> ruby files compiled are, but there are source files as well. Embeded 
>> STDlib is not compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
>> 
>> Is this right?
>> 
>> On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
>> 
>>> Thanks for reply, that works. So after deploying, my whole application 
>>> has about 45MB (zipped 12MB). My only question is, can I somehow 
>>> speedup application start? Now it takes about 10 seconds (loading gems 
>>> & project files).
>>> 
>>> - Petr
>>> 
>>> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
>>> 
 No it's not your fault, it seems the code assumes a ENV variable
 that's set by Xcode. This is the offending code:
 
 compile_options = { bundle: true, output: obj, files: [source] }
 # Use Xcode ARCHS env var to determine which archs to compile for
 compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
 # Check that the ARCHS env var contains valid values
 supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
 '').strip.split
 compile_options[:archs].delete_if do |arch|
   unless supported_archs.include?(arch)
 puts "Can't build for arch #{arch} because it is not supported"
 true
   end
 end
 
 I think that if the ENV['ARCHS'] variable isn't set we should check
 the app binary for the archs it's been built for. I'll create a path
 in a bit.
 
 For now you should be able to work around it by doing:
 
 env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
 rest-client --gem sequel --bs Issues.app
 
 And adjust the actual archs for the ones your app is built for.
 
 On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  
 wrote:
> Hi everyone, I'd like to deploy my Macruby app using:
> 
> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
> Issues.app
> 
> but I'm getting this error:
> 
> *** Deployment started
> *** Embedding MacRuby.framework
> *** Embed RubyGems libdirs: 
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>  
> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/re

Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Eloy Duran
Btw, do you really need the complete stdlib? If not, you can use the --stdlib 
option to only keep those you really need. (see macruby_deploy --help)

On 5 mei 2011, at 13:27, Petr Kaleta wrote:

> Thanks for reply, that works. So after deploying, my whole application has 
> about 45MB (zipped 12MB). My only question is, can I somehow speedup 
> application start? Now it takes about 10 seconds (loading gems & project 
> files).
> 
> - Petr
> 
> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
> 
>> No it's not your fault, it seems the code assumes a ENV variable
>> that's set by Xcode. This is the offending code:
>> 
>>   compile_options = { bundle: true, output: obj, files: [source] }
>>   # Use Xcode ARCHS env var to determine which archs to compile for
>>   compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
>>   # Check that the ARCHS env var contains valid values
>>   supported_archs = RbConfig::CONFIG['ARCH_FLAG'].gsub('-arch',
>> '').strip.split
>>   compile_options[:archs].delete_if do |arch|
>> unless supported_archs.include?(arch)
>>   puts "Can't build for arch #{arch} because it is not supported"
>>   true
>> end
>>   end
>> 
>> I think that if the ENV['ARCHS'] variable isn't set we should check
>> the app binary for the archs it's been built for. I'll create a path
>> in a bit.
>> 
>> For now you should be able to work around it by doing:
>> 
>> env ARCHS='i386 x86_64' macruby_deploy --compile --embed --gem
>> rest-client --gem sequel --bs Issues.app
>> 
>> And adjust the actual archs for the ones your app is built for.
>> 
>> On Thu, May 5, 2011 at 11:57 AM, Petr Kaleta  wrote:
>>> Hi everyone, I'd like to deploy my Macruby app using:
>>> 
>>> macruby_deploy --compile --embed --gem rest-client --gem sequel --bs 
>>> Issues.app
>>> 
>>> but I'm getting this error:
>>> 
>>> *** Deployment started
>>> *** Embedding MacRuby.framework
>>> *** Embed RubyGems libdirs: 
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/mime-types-1.16/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/rest-client-1.6.1/lib,
>>>  
>>> /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/sequel-3.22.0/lib
>>> *** Embed BridgeSupport system files
>>> *** Fix install path of binaries
>>> *** Fix identification name of libmacruby
>>> *** Compiling files
>>> /usr/local/bin/macruby_deploy:127:in `block': undefined method `delete_if' 
>>> for nil:NilClass (NoMethodError)
>>>   from /usr/local/bin/macruby_deploy:117:in `compile'
>>>   from /usr/local/bin/macruby_deploy:70:in `run'
>>>   from /usr/local/bin/macruby_deploy:283:in `'
>>> 
>>> Am I doing something wrong, or this is some bug in macruby_deploy tool? I 
>>> am using the latest macruby version from origin/master.
>>> 
>>> - Petr
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Mark Rada
The parts of stdlib that are compiled are being included in the app bundle. The 
list of which libs are compiled is in rakelib/builder.rake in the AOT_STDLIB 
constant.

There is a bug though, because .rb files should be removed from the stdlib if a 
.rbo equivalent is present.

I don't think that gem compilation should happen in ruby_deploy, you really 
should be testing with compiled gems before deploy time, probably at gem 
install time, and then just let ruby_deploy copy the already compiled files 
when it embeds the gems. There are still some gems that misbehave when compiled 
or don't compile at all; I say this as someone who compiles almost every gem 
that I install.

Long load time is probably caused by the gems; a 10 second load time would only 
be caused by rubygems if rubygems were still being loaded and it had to find a 
gem (meaning the gem embedding didn't get all the dependencies), AND you have a 
lot of gems installed. For example, I know that loading DataMapper can take 
upwards of 10 seconds by itself to load (and bloats the MacRuby process to over 
200MB of RAM), I guess because it hits some edge cases. You also have to 
remember that loading Cocoa takes more than 1 second by itself.

Also, I am very interested in helping with a test suite for ruby_deploy as 
there are other changes I'd like to make to it; I was having a bit of 
difficulty getting started due to how ruby_deploy wants to load the compiler. 
Please let me know how I can help!


Mark Rada
[email protected]



On 2011-05-05, at 10:25 AM, Eloy Duran wrote:

> Hmm, yes this is a problem. Maybe we should add separate options for 
> compiling stdlib and gems and start keeping a list of libs known to not work 
> well with AOT compilation which can then be excluded? I don't like adding 
> another option so we could also compile everything with --compile, but this 
> might introduce problems for users with libs of which we don't yet know if 
> they work well.
> 
> I personally prefer the latter, because it keeps the interface of ruby_deploy 
> simple and forcing people to run into potential bugs is the only good way to 
> find these problem libs. However, from a user friendly pov opt-in might be 
> better, but it's much less likely that people will report about broken libs 
> in that case.
> 
> On 5 mei 2011, at 15:49, Nick Ludlam wrote:
> 
>> I think Laurent and I were discussing some issues with the AOT compiling of 
>> certain stdlib files causing problems. My specific case was from the RSS 
>> module.
>> 
>> https://www.macruby.org/trac/ticket/1020
>> 
>> On 5 May 2011, at 14:39, Eloy Duran wrote:
>> 
>>> Aha indeed! Yes we should definitely compile them imo. But I’m not
>>> sure if there’s a good reason for excluding stdlib and gems from
>>> compilation. The last time I tried there was no problem with compiling
>>> it all. Can you change this in source/bin/ruby_deploy and see if your
>>> app works good afterwards? If so I’ll apply that, right now I’m going
>>> to start on a test suite for the tool as it is.
>>> 
>>> On Thu, May 5, 2011 at 2:58 PM, Petr Kaleta  wrote:
 Yes, you said, that it compile all files from Resources directory, but 
 gems are embeded in Framework directory. So thats why, they are not 
 compiled. Can be STDLIB compiled as well?
 
 - Petr
 
 On May 5, 2011, at 2:34 PM, Eloy Duran wrote:
 
> No, that's not right. The embed code is run before the compile code
> and the compile code uses the following to select all ruby files in
> the Resources directory of the app bundle:
> 
> def compile_files
>  Dir.glob(File.join(app_resources, '**', '*.rb'))
> end
> 
> It would be great if you can upload a sample that shows this.
> 
> On Thu, May 5, 2011 at 2:11 PM, Petr Kaleta  wrote:
>> Now I am looking in the application package and embeded gems are not 
>> compiled. And as you can see here http://cl.ly/240t0v3q2O221X3U113u some 
>> ruby files compiled are, but there are source files as well. Embeded 
>> STDlib is not compiled at all http://cl.ly/2d2D2R2L451m2C2x472J
>> 
>> Is this right?
>> 
>> On May 5, 2011, at 1:27 PM, Petr Kaleta wrote:
>> 
>>> Thanks for reply, that works. So after deploying, my whole application 
>>> has about 45MB (zipped 12MB). My only question is, can I somehow 
>>> speedup application start? Now it takes about 10 seconds (loading gems 
>>> & project files).
>>> 
>>> - Petr
>>> 
>>> On May 5, 2011, at 12:13 PM, Eloy Duran wrote:
>>> 
 No it's not your fault, it seems the code assumes a ENV variable
 that's set by Xcode. This is the offending code:
 
 compile_options = { bundle: true, output: obj, files: [source] }
 # Use Xcode ARCHS env var to determine which archs to compile for
 compile_options[:archs] = ENV['ARCHS'].strip.split if ENV['ARCHS']
 # Check that the ARCHS 

Re: [MacRuby-devel] macruby_deploy error while compiling files

2011-05-05 Thread Eloy Duran
> Also, I am very interested in helping with a test suite for ruby_deploy as 
> there are other changes I'd like to make to it; I was having a bit of 
> difficulty getting started due to how ruby_deploy wants to load the compiler. 
> Please let me know how I can help!

I’ve just pushed a spec for `ruby_deploy --compile`. Please feel free to add 
more if I've missed some or start on --embed or rubyc.

https://github.com/MacRuby/MacRuby/blob/master/spec/macruby/command_line/ruby_deploy_spec.rb
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel