Improve failure mode on OS X hosted mode when using Java6 or Safari2

7 views
Skip to first unread message

BobV

unread,
Jun 10, 2008, 1:57:49 PM6/10/08
to Google-Web-Toolkit-Contributors, Scott Blum, Kelly Norton
This patch checks the currently-installed version of Safari as well as
the JRE version being used. This resolves issues 2507 and 2462.

diffstat:
BootStrapPlatform.java | 67 67 + 0 - 0 !
1 file changed, 67 insertions(+)

--
Bob Vawter
Google Web Toolkit Team

check_mac_runtime_r3043.patch

Scott Blum

unread,
Jun 10, 2008, 2:08:33 PM6/10/08
to BobV, Google-Web-Toolkit-Contributors, Kelly Norton
Mostly LGTM.  Nitpicks:
- Can't you use Util.close() in the finally block of hasUsableSafari().
- How about childStdin/childStdout or something?  Lines 123-133 made me go OMGWTF until I realized what was actually going on.
- Can't you remove lines 113-114 since this is handled in the finally block?

BobV

unread,
Jun 10, 2008, 2:19:50 PM6/10/08
to Scott Blum, Google-Web-Toolkit-Contributors, Kelly Norton
On Tue, Jun 10, 2008 at 11:08 AM, Scott Blum <sco...@google.com> wrote:
> Mostly LGTM. Nitpicks:
> - Can't you use Util.close() in the finally block of hasUsableSafari().

Yes. We have both Util and Utility, I'd forgotten about the latter.

> - How about childStdin/childStdout or something? Lines 123-133 made me go
> OMGWTF until I realized what was actually going on.

Done.

> - Can't you remove lines 113-114 since this is handled in the finally block?

The stream has to be closed before the interpreter will start
processing the script.

diffstat:
BootStrapPlatform.java | 58 58 + 0 - 0 !
1 file changed, 58 insertions(+)

check_mac_runtime_r3043_r2.patch

Kelly Norton

unread,
Jun 10, 2008, 2:28:55 PM6/10/08
to BobV, Scott Blum, Google-Web-Toolkit-Contributors
echo 'version of application "Safari"' | osascript

This launches Safari if it is not already running which would mean that hosted mode would always launch Safari when it starts. I don't think that's what we want.

/kel
--
If you received this communication by mistake, you are entitled to one free ice cream cone on me. Simply print out this email including all relevant SMTP headers and present them at my desk to claim your creamy treat. We'll have a laugh at my emailing incompetence, and play a game of ping pong. (offer may not be valid in all States).

BobV

unread,
Jun 10, 2008, 2:31:58 PM6/10/08
to Kelly Norton, Scott Blum, Google-Web-Toolkit-Contributors
On Tue, Jun 10, 2008 at 11:28 AM, Kelly Norton <kno...@google.com> wrote:
> echo 'version of application "Safari"' | osascript
> This launches Safari if it is not already running which would mean that
> hosted mode would always launch Safari when it starts. I don't think that's
> what we want.

I don't see this behavior.

$ cat << EOF | osascript
> version of application "Safari"
> EOF
3.1.1

BobV

unread,
Jun 10, 2008, 3:08:24 PM6/10/08
to Kelly Norton, Scott Blum, Google-Web-Toolkit-Contributors
This patch is a non-starter on 10.4; I'll work up a JNI library to
check for the presence of the JavaScriptCore bundle.

BobV

unread,
Jun 10, 2008, 3:38:54 PM6/10/08
to Kelly Norton, Scott Blum, Google-Web-Toolkit-Contributors
Here's a new take on this that covers 80% of the cases with 20% of
the work: we'll do a fast-fail check for Java6 since we know that's a
non-starter. Then we'll try to initialize the native libraries. If
this fails, we'll emit some additional text about needing Safari 3 as
well as looking for JavaScriptCore in the usual location.

diffstat:
BootStrapPlatform.java | 19 18 + 1 - 0 !
shell/mac/LowLevelSaf.java | 13 12 + 1 - 0 !
2 files changed, 30 insertions(+), 2 deletions(-)

check_mac_runtime_r3043_r3.patch

Scott Blum

unread,
Jun 10, 2008, 5:36:33 PM6/10/08
to BobV, Kelly Norton, Google-Web-Toolkit-Contributors
LGTM.  This is for 1.5, right?

BobV

unread,
Jun 10, 2008, 5:38:53 PM6/10/08
to Scott Blum, Kelly Norton, Google-Web-Toolkit-Contributors
On Tue, Jun 10, 2008 at 2:36 PM, Scott Blum <sco...@google.com> wrote:
> LGTM. This is for 1.5, right?

1.5 and trunk. I assume the branch change should be a separate commit?

John Tamplin

unread,
Jun 10, 2008, 5:46:01 PM6/10/08
to Google-Web-Tool...@googlegroups.com
On Tue, Jun 10, 2008 at 5:38 PM, BobV <bo...@google.com> wrote:

On Tue, Jun 10, 2008 at 2:36 PM, Scott Blum <sco...@google.com> wrote:
> LGTM.  This is for 1.5, right?

1.5 and trunk.  I assume the branch change should be a separate commit?

We have been just committing to 1.5, then merging them as a batch (so whenever you need to merge 1.5 changes, you always merge up to releases/1.5:HEAD).

--
John A. Tamplin
Software Engineer, Google

Scott Blum

unread,
Jun 10, 2008, 7:35:11 PM6/10/08
to Google-Web-Tool...@googlegroups.com
What John said; just commit to 1.5.

BobV

unread,
Jun 10, 2008, 8:38:01 PM6/10/08
to Google-Web-Tool...@googlegroups.com
On Tue, Jun 10, 2008 at 4:35 PM, Scott Blum <sco...@google.com> wrote:
> What John said; just commit to 1.5.

Committed at r3048.

Reply all
Reply to author
Forward
0 new messages