Monday, October 26, 2009

Updates to the Antipasto Arduino IDE: Frickin's, Fixes, and Features

Matt mentioned a few of the issues with Apple and Java, so I thought it might be helpful to add a little technical detail on what's happening and why. The fixes are all part of the latest Antipasto Arduino IDE I uploaded last night, which can be downloaded here.

And given the situation, I chose to express myself through a series of F-words: Frickin's, Fixes, and Features.

Frickin's 1: Apple Breaks Java

Here's the bad news from Apple that was posted to a mailing list regarding Jan's broken Java app:
On Jun 16, 2009, at 7:23 AM, Jan Andersson wrote:

After the latest upgrade starting several of my Java-based applications fails
(when I have changed the plist to say 1.6+). This includes IntelliJ, Install4J
and DbVisualizer.

This is part of a change to the double-clickable app launching policy (which we explained in detail in the developer preview release notes). To enabled the Finder's "Run in 32-bit mode" checkbox for Java apps, and to make the transition to 64-bit by default easier, we've modified the JavaApplicationLauncher.framework to only launch application's in the architectures they have present in their JavaApplicationStub.

The thinking is that if you haven't rebundled, you likely haven't ever considered that you'd be run in 64-bit mode (and when users have dragged Java SE 6 to the top of their Java Preferences, they found that some of their applications stopped working). By preventing apps from being launched in 64-bit if they haven't rebundled, we can maintain the widest compatibility, with a minor impact on developers (and actually let them have a say in what their version and architecture requirements are).

Hope this explains what you are seeing,
Mike Swingler
Java Runtime Engineer
Apple Inc.

Apple Translation:
We don't care if we break all the Java applications out there...that's your problem, not ours.

So in response to this, Matt and I (and a few others - thanks esp. to Nick!) worked really hard to re-bundle the Arduino IDE as a 64-bit bit native. You're probably asking, why not just check the box in the Get Info window to run in 32-bit mode? Well, that was my first thought too, but the check box mysteriously disappeared, so that wasn't an option any more. Dang.

In any case, that means we needed to ensure everything is 64-bit compatible, including all the contributed libraries the IDE heavily depends on. Especially the infamous librxtxSerial library that provides serial connectivity to the boards. So when everything came together, I recompiled everything for 64-bit.

Fixes: Now the Arduino IDE runs on Mac OS X with Java 1.6+, as a 64-bit native application.

Frickin's 2: Apple PackageMaker Relocation Bugs

Aside from the Java issue, have you ever installed an application on your system and the .app file mysteriously disappears? If you have, like me, you've probably been the victim of a bug with Apple's PackageMaker utility that comes standard in OS X.

As it turns out, when building an installer package inside of a relative directory, like the Arduino IDE needs to, PackageMaker thinks I'm trying to relocate the installed Application on the target computer to a random directory. Installation result due to this bug: A full Arduino IDE installation with a missing file. Not a pleasant surprise.

The fix is more of a hack, and it's to scan for and manually strip out any XML in the packager maker build files that point to obscure package relocation settings.

Fixes: Now the Arduino IDE should always have an file in the Applications/Arduino directory.

Features: TouchShield Core Consolidation

A positive outcome of the getting back into IDE development was updates to the TouchShield core. The biggest thing is that the Stealth and Slide libraries have now been consolidated into a single core. This allows for easier code maintenance and allows for contributed libraries to run on both boards. As it turns out, this is the only thing I can indirectly thank Apple for breaking Java for.

Features: Reference Panel Added

I like to be able to browse reference docs, even when I don't have an internet connection. To see it, click Help Menu->Reference.

Features: Libraries and Reference Docs are now Core-Specific

Thanks to Andrew for suggesting this one. He was creating graphics libraries for Slide, which don't run on the Arduino. With this update, core-specific libraries like those can be dropped into to the following directory: hardware/cores/*/src/components/library

Each core also has its own reference html docs. These show up in the right-hand reference panel (see above). The reference html docs for each core exist in the following directory: hardware/cores/*/reference

Features: Compile and Upload is Now Non-blocking

Greg asked about making edits to my sketches while uploading or compiling, so now the IDE allows that to happen.

This is just a start, and hopefully it tackles a few of the issues that I've been getting emails about. I've put the IDE up here. Feel free to give it a spin and let me know if there's anything else I should take care of, or if you've got a chunk of code to include as well.


Mellis said...

Did you try stripping the 64-bit architecture out of your JavaApplicationStub to get the app to run in 32-bit mode?

Anonymous said...

Will this have any impact on the Illuminato Genesis? I haven't been able to get acceptable functionality out of it, and have gotten zero support despite multiple emails. I won't be buying another Liquidware product until I see some resolution on this. I hope all your products don't receive such poor support.

Matt said...

Sorry about that...what email have you been trying? inthebitz at gmail will work fine, or you can call Justin at 860 506 3762

Let me know and I'll help you out

Matt said...

@mellis - yeah, that's what i'm working on now

@spedtoe169 - hey, it's the other matt... what email address were you using, i want to make sure i'm getting all emails, and i don't think i ever saw one from you? ps, actually i'm really proud of how quickly i reply to people who email me, liquidware or not!

Unknown said...

well the updating version is not working on my machine OSX 10.6.1 , Java 1.6.0_15 from Apple Inc

I uninstalled any previous versions, gave this one a clean install, navigated to examples folder . double clicked Digital/Blink/Blink.pde the arduino Ide appeared for a second on the dock, bounced and disappeared ...

Matt said...

ok it's definitely a java runtime permissions issue. let me try, lots of coding going on over here... chris and i have rewritten several 1000 lines already...

i'm gonna post it all up onto github when we're done. btw windows 7 also has a file permissions issue (thanks skylar) that we're working through too right now... i'll keep checking back here and keep updates. i'm going to try to post again in the next day or two...

Matt said...

@spedtoe169 - ps, have you sent your email yet? i really want to make sure i'm not missing it, but i seriously haven't gotten anything yet, am i going insane? my email is inthebitz at gmail, and other emails are coming through just fine?

let me know!