Trying to debug a silent BUILD FAILED
brian
24 May 2012
Hi csterritt,
Its probably some Java FFI problem, but you can't tell because there is another bug where the compiler throws a CompilerErr improperly without logging it. I have since fixed that problem, but don't think it has made it into build yet. It is sort of hard to fix yourself unless you are setup for bootstrap. If you'd like me to email a patched compiler.pod, just send me an email to brian@skyfoundry.com. Or if you are setup for bootstrap you can change your Compiler.fan file to this around line 70:
try
{
frontend
backend
}
catch (CompilerErr e)
{
if (errs.isEmpty) CompilerSupport(this).errReport(e)
throw e
}
finally cleanup
csterritt
25 May 2012
Thanks -- with your fixed compiler.pod I now get the following error:
Unknown: Java package 'javax.net' not found
Running the fan compilerJava::ClassPath command, I see that javax.net is not named as one of the packages found. The ClassPath files lists:
ClassPath Files: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar file:/Users/chris/fantom-1.0.62/lib/java/ext/macosx-x86_64/swt.jar /Users/chris/fantom-1.0.62/lib/java/sys.jar
I don't see the file
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar
mentioned, which does have the javax.net package in it. Adding that to my CLASSPATH makes everything work.
So I'm curious: is there a way to add the other /System/Library/... jars "properly"?
Thanks for the help!
brian
25 May 2012
Glad to hear you got it working.
So I'm curious: is there a way to add the other /System/Library/... jars "properly"?
The big problem is the deplorable and inexcusable lack of modularity in Java. So it is hard to figure out what you should be including as part of the system core. So what you see in the compiler's ClassPath code is a bunch of hacks to try and figure out what is available. Hopefully if they ever get jigsaw done, we can do things more elegantly.
Outside of core code, my best practice is now to package up Java jars as Fantom pods and make them first class Fantom modules with clean names, versions, and dependencies.
csterritt
2 Jun 2012
Hi Brian,
Outside of core code, my best practice is now to package up Java jars as Fantom pods and make them first class Fantom modules with clean names, versions, and dependencies.
I've looked around a little, and I can't find a description of how to do this. Thanks.
brian
2 Jun 2012
Not too much to it other than how to turn a jar into a pod which you can do by creating an empty build script and making a jar one of your resDirs. See 1780.
csterritt
24 May 2012
Hello,
Trying to compile some code on my mac, which compiles fine on Linux. On the mac, the compilation output looks like:
compile [fan_rmq] Compile [fan_rmq] FindSourceFiles [2 files] BUILD FAILED [1002ms]!With no other clues. I'm trying to do the first (!) of the tutorials for RabbitMQ's java libraries here
I can compile the java version on the mac with no problem, and it runs fine, so I don't think the jar files are bad (and I rebuilt the rabbitmq client lib from source, and no change).
Here's the ported source (which, as I say, runs on Linux):
using [java] fanx.interop::Interop using [java] fanx.interop::ByteArray using [java] com.rabbitmq.client::ConnectionFactory using [java] com.rabbitmq.client::Connection using [java] com.rabbitmq.client::Channel class FSend { const static Str QUEUE_NAME := "hello" public static Void main() { factory := ConnectionFactory() factory.setHost("localhost") connection := factory.newConnection() channel := connection.createChannel() channel.queueDeclare(QUEUE_NAME, false, false, false, null) message := "Hello World!" buf := message.toBuf bytes := ByteArray(buf.size) Interop.toJava(buf.in).read(bytes) channel.basicPublish("", QUEUE_NAME, null, bytes) echo(" [x] Sent '" + message + "'") channel.close() connection.close() } }Thanks for any help. Here's my setup: