trifork / erjang

A JVM-based Erlang VM
http://www.erjang.org
Apache License 2.0
725 stars 62 forks source link

Dummy modules (for io, unicode, ...) necessary for Erj but get in the way for OTP boot process #7

Closed eriksoe closed 14 years ago

eriksoe commented 14 years ago

One way to solve this is to have EModuleManager make these dummies on demand, but only if configured to do so (i.e. it should know of a set of module names for which such dummies might be created).

krestenkrab commented 14 years ago

Those dummy modules need to go away ASAP, and then have Erj be a variation over otp boot, as is the case in BEAM. For now, I renamed them in my master repo, so that they are not in the way of OTP boot.

eriksoe commented 14 years ago

OK. But we still need some solution for this, without full OTP. Point in case: We've got a test case (iolist_tests) which uses the unicode BIFs; however, these are not presently usable from the test harness. One simple solution is to have each test file state which modules it's going to use. However, I'd like to keep a general way of running small test programs like with Erj.

krestenkrab commented 14 years ago

For non-OTP I think we simply need a variation of EModuleManager which knows how to load modules without using error_handler. I had that originally [using erjpath system property] but then took it out when working on OTP.

krestenkrab commented 14 years ago

The function that needs a variation is EModuleManager.FunctionInfo.makeErrorhandler(). It needs to know if we're not using OTP, in which case it should use erjpath to find the offending module,. ... in fact I already did this

krestenkrab commented 14 years ago

Perhaps this fix http://github.com/krestenkrab/erjang/commit/f9d932da81b96d5d217f0692a03157e0664da15c is enough to make it work for you? I'll try to make your unit tests work again tonight.

eriksoe commented 14 years ago

Yes, both test cases and OTP booting works fine now. Thank you. What's missing now is for the comparison test suite to compile the stub modules it needs, but that's another matter.