Incremental compilation

Damien Mattei damien.mattei@oca.eu
Thu Jun 6 06:02:32 GMT 2024


i had sort of bug in Scheme where you can redefine language procedure 
and you do not think at first time can take a long time debugging and 
tracing to understand what happens :-)

Le 05/06/2024 à 21:06, Panicz Maciej Godek via Kawa a écrit :
> Ce message provient d’un expéditeur externe à l’université (adresse : kawa-bounces+damien.mattei=unice.fr@sourceware.org). Ne cliquez pas sur les liens et n’ouvrez pas les pièces jointes si vous ne connaissez pas l’expéditeur ou que vous n’êtes pas sûr du contenu. En cas de doute, merci de transférer le mail à abuse@univ-cotedazur.fr
>
> I found that the "unbound-location" error was caused by the fact that I
> defined a function named  "module-name", which apparently overrode the Kawa
> built-in special form that has the same name, and so Kawa tried to evaluate
> the module name.
>
> pon., 3 cze 2024, 15:00 użytkownik Panicz Maciej Godek <
> godek.maciek@gmail.com> napisał:
>
>> After I had to recompile GRASP for a number of times in a row, I decided
>> to try to implement a build system that would only recompile the modules
>> that either changed, or depend on modules that changed.
>>
>> Until now, I had three build scripts, for each version of GRASP (one for
>> Android, one for desktop and one for terminal). They all relied on a
>> dependency analyzer that I wrote in order to spot circular dependencies
>> between modules (in my experience, Kawa didn't provide valuable information
>> when facing circular dependencies; it was just failing in some weird ways).
>> But since I already had the list of required modules, I could simply pass
>> it to Kawa via command line, and apparently Kawa figured everything out by
>> itself.
>>
>> But for the script, I'm trying to use the "compile-module" procedure
>> (essentially because the new build script is written entirely in Kawa). It
>> produces zip/jar archives instead of .class files, but I can just unzip
>> them after build.
>>
>> The source files are all located in the "src" directory. I would like the
>> .class files to be located in the "build/cache" directory, with the
>> directory structure mimicking the one from the "src" directory. And for
>> some modules this is indeed the case. But other modules are built in the
>> "build/cache/src" directory (i.e. after the build, the files contained in
>> the resulting .zip file are all placed in the "src" directory). I suspect
>> that the ones without the "src" prefix also happen to be the dependencies
>> of the shell script.
>>
>> In either case, I am able to build the dependencies in the proper order.
>>
>> I run the script with the following shell preamble:
>>
>> #!/bin/sh
>> #|
>> mkdir -p build/cache
>>
>> JARS=`ls libs/*.jar | tr '\n' ':' | sed 's/:$//'`
>>
>> exec java -cp "$JARS:build/cache" kawa.repl \
>>    -Dkawa.import.path="|:src:.:build/cache" \
>>    -f "$0"
>> |#
>>
>> where the libs folder contains kawa.jar and a few other dependencies.
>>
>> However, when I build the modules, at some point I get the following
>> exception:
>>
>> gnu.text.SyntaxException: src/editor/interfaces/elements.scm:17:9: unknown
>> library (utils print)
>> src/editor/interfaces/elements.scm:18:9: unknown library (utils
>> string-building)
>> src/editor/interfaces/elements.scm:22:9: unknown library (editor
>> interfaces painting)
>>
>>          at kawa.lib.system.compileFile(system.scm:92)
>>          at atInteractiveLevel$Mn51.run(build.scm:313)
>>          at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
>>          at kawa.Shell.run(Shell.java:300)
>>          at kawa.Shell.runFile(Shell.java:562)
>>          at kawa.Shell.runFileOrClass(Shell.java:485)
>>          at kawa.repl.processArgs(repl.java:298)
>>          at kawa.repl.main(repl.java:830)
>>
>> I know that, at this point, the files utils/print.class,
>> utils/string$Mnbuilding.class and editor/interfaces/painting.class are
>> already present in the build system, and build/cache should be in both
>> jvm's class path and kawa.import.path. How do I convince Kawa to look in
>> there for the modules?
>>
>> I also have another problem: when these few classes already exist, and I
>> try to re-run the script, it fails to start with the following message:
>>
>> src/language/define-syntax-rule.scm:1:15: unbound location: language
>>          at gnu.mapping.DynamicLocation.get(DynamicLocation.java:36)
>>             at language.define$Mnsyntax$Mnrule.run(define-syntax-rule.scm:1)
>>          at gnu.expr.ModuleBody.run(ModuleBody.java:51)
>>          at gnu.expr.ModuleBody.run(ModuleBody.java:35)
>>          at atInteractiveLevel$Mn3.run(build.scm:14)
>>             at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
>>               at kawa.Shell.run(Shell.java:300)
>>          at kawa.Shell.runFile(Shell.java:562)
>>          at kawa.Shell.runFileOrClass(Shell.java:485)
>>          at kawa.repl.processArgs(repl.java:298)
>>          at kawa.repl.main(repl.java:830)
>>
>>


More information about the Kawa mailing list