[Jruby-devel] PATCH: Fix runtime parsing from within a block

2006-02-19 Thread Charles O Nutter
This is a somewhat less naive patch than my previous attempt, and this
one appears to work well enough for Rails to continue. It basically
just looks through the iter stack (which specifies whether blocks are
about to be or currently are being executed) and if it finds an
ITER_CUR, meaning a block is being run, it adds the topmost dynamic
variables to the RubyParserConfiguration. This in turn is used by
ParserSupport to appropriately create nodes for variables, either
DVar/DAsgn if within a block or LocalVar/LocalAsgn if not.

The patch is naive because it does not accurately set the "current
block count" in ParserSupport, and it may be over-inclusive by doing a
linear search of the iter stack. I'm not sure if it's perfect, but it
works and hasn't broken anything...

With this, Rails gets quite a bit further. I'll send another email
updating that.

--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com


runtime_parse_block_scoping.patch
Description: Binary data


Re: [Jruby-devel] Rails 'generate' progress

2006-02-19 Thread Thomas E Enebo
On Sun, 19 Feb 2006, Charles O Nutter defenestrated me:
>
> With the runtime parse patch, we're getting much closer to running the
> Rails 'generate' script. At this point it manages to require all the
> frameworks in; that in itself is pretty big. It continues on in the
> Rails initializer, executing Initializer#process.
> 
> Initialize#process sets up the load path, requires in all the
> frameworks, loads your environment, and then starts initializing
> subsystems.
> 
> The first subsystem initialized is the database. This, unfortunately
> does not run right, for reasons unknown. It appears to get stuck in a
> loop, and eventually runs out of memory. It appears to be during YAML
> parsing the default database.yml file, but I haven't investigated
> further.
> 
> However, if this is commented out... The next failure is further down,
> in the routing subsystem. This actually blows up with an error I've
> seen in a few other places, but haven't investigated yet:
> 
> config/../vendor/rails/actionpack/lib/action_controller/routing.rb:63:in
> `new': super: no superclass method 'new' (NameError)
> from 
> config/../vendor/rails/actionpack/lib/action_controller/routing.rb:63:in
> `new'
> from 
> config/../vendor/rails/actionpack/lib/action_controller/routing.rb:352:in
> `initialize_components'
> from 
> config/../vendor/rails/actionpack/lib/action_controller/routing.rb:286:in
> `collect'
> ...
> 
> So there we are.

  I have been working on two seperate things:
1. webrick running (e.g. make socket.rb better)
2. Trying to run script/server on the equivalent hello world RoR project.

On item 1, I am currently trying to hack around having a reasonable
Kernel#select implementation.  The real solution is to change IO to use
nio.  For now, I have been trying to make a read-only select that should
give us what webrick requires.  I am currently stuck on TCPServer needing
to be an IO object.

For item 2, I explode with the following error.  Until very recently, I
thought this was the same problem Charlie was having.  Now I realize it
must be something else (I am not using any serialized files):

org.jruby.runtime.Scope.setValue(Scope.java:129): 
java.lang.NullPointerException: null (NativeException)
from 
org.jruby.evaluator.EvaluateVisitor$LocalAsgnNodeVisitor1.execute(EvaluateVisitor.java:1306)
...

I am spending the rest of the day comparing 0.8.2 against head in extra
tests in preparation of 0.8.3 for the coming week.

-Tom

-- 
+ http://www.tc.umn.edu/~enebo + mailto:[EMAIL PROTECTED] +
| Thomas E Enebo, Protagonist  | "Luck favors the prepared|
|  |  mind." -Louis Pasteur   |


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel


Re: [Jruby-devel] Rails 'generate' progress

2006-02-19 Thread Thomas E Enebo
On Sun, 19 Feb 2006, Thomas E Enebo defenestrated me:
> 
>   I have been working on two seperate things:
> 1. webrick running (e.g. make socket.rb better)
> 2. Trying to run script/server on the equivalent hello world RoR project.
> 
> On item 1, I am currently trying to hack around having a reasonable
> Kernel#select implementation.  The real solution is to change IO to use
> nio.  For now, I have been trying to make a read-only select that should
> give us what webrick requires.  I am currently stuck on TCPServer needing
> to be an IO object.
> 
> For item 2, I explode with the following error.  Until very recently, I
> thought this was the same problem Charlie was having.  Now I realize it
> must be something else (I am not using any serialized files):
> 
> org.jruby.runtime.Scope.setValue(Scope.java:129): 
> java.lang.NullPointerException: null (NativeException)
>   from 
> org.jruby.evaluator.EvaluateVisitor$LocalAsgnNodeVisitor1.execute(EvaluateVisitor.java:1306)
> ...

  Scratch that...I was still including a serialized version causing
this problem.

  Now in this area, I get one problem trying to load a non-existent
.rb (rails_env.rb), which I am guessing we do not handle a rescue correct.
I add an empty one and then the thing runs to completion with no error
and no server started :)  Hmmm, something is not working.  Unless
my stubbing did this we have a problem somewhere.

-Tom

-- 
+ http://www.tc.umn.edu/~enebo + mailto:[EMAIL PROTECTED] +
| Thomas E Enebo, Protagonist  | "Luck favors the prepared|
|  |  mind." -Louis Pasteur   |


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel