This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Mutual require bug when compiling?
- From: alex mitchell <alexm at nus dot edu dot sg>
- To: Per Bothner <per at bothner dot com>
- Cc: "kawa at sources dot redhat dot com" <kawa at sources dot redhat dot com>
- Date: Thu, 20 Aug 2009 16:53:38 +0800
- Subject: Re: Mutual require bug when compiling?
Hi Per,
I've tested under MacOS X and Windows XP, and this seems to have fixed the
problem, thanks!
However, under Ubuntu 9.04, I can't seem to build kawa. I get the following
when I do a make:
(compiling syntax.scm to kawa.lib.syntax)
internal error while compiling syntax.scm
java.lang.NoSuchMethodError:
kawa.lib.std_syntax.addProcedureProperties(Lgnu/expr/GenericProc;[Ljava/lang
/Object;)V
at kawa.lib.lists.run(lists.scm:29)
at gnu.expr.ModuleBody.run(ModuleBody.java:44)
at gnu.expr.ModuleBody.run(ModuleBody.java:32)
at kawa.lib.lists.<clinit>(lists.scm:11)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at
sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorF
actory.java:25)
at
sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
at java.lang.reflect.Field.get(Field.java:358)
at gnu.expr.ModuleInfo.setupModuleExp(ModuleInfo.java:167)
at kawa.standard.require.importDefinitions(require.java:294)
at kawa.standard.require.scanForDefinitions(require.java:203)
at kawa.lang.Syntax.scanForm(Syntax.java:65)
at kawa.lang.Translator.scanForm(Translator.java:1051)
at gnu.kawa.lispexpr.LispLanguage.parse(LispLanguage.java:73)
at gnu.expr.Compilation.process(Compilation.java:1858)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:308)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:293)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:293)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:293)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:293)
at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:293)
at kawa.repl.compileFiles(repl.java:803)
at kawa.repl.processArgs(repl.java:457)
at kawa.repl.main(repl.java:866)
make[2]: *** [scm-classes.stamp] Error 255
Just to be safe, I deleted my kawa directory and grabbed a fresh copy from
svn, and got the same result. I also just did an update in ubuntu using the
update manager, so I should have the latest version of java, 1.6.0_14. Any
idea what could be wrong?
Alex
On 8/20/09 2:25 PM, "Per Bothner" <per@bothner.com> wrote:
> On 08/10/2009 09:29 AM, alex mitchell wrote:
>> Unfortunately, the duplicate definition warnings are still showing up in our
>> main project. I've tried putting in some print statements in ModuleManager
>> and ModuleInfo, and it seems that the modules are NOT being instantiated
>> more than once - the second time a require is encountered for the same
>> module, it successfully retrieves the ModuleInfo. It also seems that it is
>> always using findWithSourcePath, so I don't think its mistakenly
>> mis-identifying modules. Despite this, ImportDefinitions in require.java is
>> still calling ScopeExp.duplicateDefinitionError when the second require is
>> encountered. Perhaps the code in ImportDefinitions is mistakenly thinking
>> that the definitions are from a different module, even though they are from
>> the same module required in a different file?
>
> I just checked in a potential fix. Please try it.
>
> The problem was the checkCurrent method of ModuleInfo. It has a
> heuristic to not check if the module is current if we've done so
> recently. Where "recently" is 1000 ms. But if compilation is
> taking more than 1000 ms then we go down the "slow" path were
> we actually try to load the class file, which fails, so we
> decide the (non-existing) class is current, so we re-parse it.
> And so we get a fresh set of declarations and thus duplicates.
>
> Instead we should realize we're already compiling this module,
> so don't bother checking timestamps.