Clojure

RT.load doesn't work when called by code that is on the bootstrap classpath

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.3
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code
  • Approval:
    Screened

Description

RT.baseLoader assumes Compiler.getClass.getClassLoader will return a sane value. If Clojure is placed on the bootclasspath, it will return null.

Relying on baseLoader less may be possible; it looks like the ClassLoader/getSystemResource static method may get us the access we need to the bootstrap classloader, which would solve the problem I first noticed with using RT.load with the bootstrap classloader. However, there may be other issues beyond this.

More details at http://groups.google.com/group/clojure/browse_thread/thread/16c694573bd29552

I plan on investigating this further, but I've created this ticket to explain what I've discovered so far for posterity, etc.

Note that placing Clojure on the bootclasspath cuts its startup time in half; it's a measure that Charles Nutter of the JRuby project recommends.

Activity

Hide
Kevin Downey added a comment -

'lo as if from nowhere a patch!

Show
Kevin Downey added a comment - 'lo as if from nowhere a patch!
Kevin Downey made changes -
Field Original Value New Value
Attachment fix-clj-637.diff [ 10268 ]
Kevin Downey made changes -
Patch Code
Rich Hickey made changes -
Fix Version/s Release.Next [ 10038 ]
Approval Vetted
Hide
Aaron Bedra added a comment -

Patch looks reasonable, but I am waiting for a response from Phil to see if this resolves his issue.

Show
Aaron Bedra added a comment - Patch looks reasonable, but I am waiting for a response from Phil to see if this resolves his issue.
Aaron Bedra made changes -
Waiting On technomancy
Hide
Phil Hagelberg added a comment -

I just tested it again with the latest Clojure from git and it works fine. Here's an easy test that breaks without the fix: java -Xbootclasspath/a:clojure-1.3.0-master-SNAPSHOT.jar clojure.main -e "(require 'clojure.pprint)"

Show
Phil Hagelberg added a comment - I just tested it again with the latest Clojure from git and it works fine. Here's an easy test that breaks without the fix: java -Xbootclasspath/a:clojure-1.3.0-master-SNAPSHOT.jar clojure.main -e "(require 'clojure.pprint)"
Aaron Bedra made changes -
Approval Vetted Screened
Waiting On technomancy
Stuart Halloway made changes -
Status Open [ 1 ] Closed [ 6 ]
Resolution Completed [ 1 ]

People

Vote (1)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: