From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id A3C5A1FF9C for ; Tue, 27 Oct 2020 13:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2900490AbgJ0NLS (ORCPT ); Tue, 27 Oct 2020 09:11:18 -0400 Received: from mail-gateway-shared02.cyon.net ([194.126.200.224]:50818 "EHLO mail-gateway-shared02.cyon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2900487AbgJ0NLS (ORCPT ); Tue, 27 Oct 2020 09:11:18 -0400 X-Greylist: delayed 512 seconds by postgrey-1.27 at vger.kernel.org; Tue, 27 Oct 2020 09:11:17 EDT Received: from s019.cyon.net ([149.126.4.28]) by mail-gateway-shared02.cyon.net with esmtpsa (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim) (envelope-from ) id 1kXOcb-0000qe-PZ for git@vger.kernel.org; Tue, 27 Oct 2020 14:02:43 +0100 Received: from [10.20.10.232] (port=4370 helo=mail.cyon.ch) by s019.cyon.net with esmtpa (Exim 4.93) (envelope-from ) id 1kXOca-00FkNJ-L0; Tue, 27 Oct 2020 14:02:40 +0100 Subject: Re: [PATCH] gitk: macOS: ignore osascript errors To: Stefan Haller , paulus@ozlabs.org Cc: git@vger.kernel.org References: <20201025175149.11853-1-dev+git@drbeat.li> From: Beat Bolli Message-ID: <1bd2f23c-9429-470d-d536-a5c844721715@drbeat.li> Date: Tue, 27 Oct 2020 14:02:40 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-CH Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - s019.cyon.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - drbeat.li X-Get-Message-Sender-Via: s019.cyon.net: authenticated_id: ig@drbeat.li X-Authenticated-Sender: s019.cyon.net: ig@drbeat.li X-OutGoing-Spam-Status: No, score=-1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 26.10.20 18:21, Stefan Haller wrote: > On 25.10.20 18:51, Beat Bolli wrote: >> Starting gitk on a macOS 10.14.6 (Mojave) system fails with the error >> >>      Error in startup script: 2020-10-25 17:16:44.568 >> osascript[36810:18758270] >>      Error loading /Library/QuickTime/EyeTV MPEG >> Support.component/Contents/MacOS/EyeTV MPEG Support: >>      dlopen(/Library/QuickTime/EyeTV MPEG >> Support.component/Contents/MacOS/EyeTV MPEG Support, 0x0106): >>      code signature in (/Library/QuickTime/EyeTV MPEG >> Support.component/Contents/MacOS/EyeTV MPEG Support) >>      not valid for use in process: mapping process is a platform >> binary, but mapped file is not >>      [[this same message repeated dozens of times]] > > While the code change itself makes sense to me, the justification is a > bit strange. This error message suggests that something is messed up on > your system. Your commit message makes it sound as if all people on > macOS 10.14.6 get this error, which is not the case. You're right; renaming the parent directory makes the error go away, but I'd still like to keep my system working with all installed software. >> Ignore errors from the osascript invocation, especially because this >> macOS >> version seems to correctly place the gitk window in the foreground. > > Whether gitk comes to the foreground on start depends on the Tcl/Tk > version, not the macOS version. With Tk 8.6 it does, so it might > actually be nice to add a version check here. (I'm not requesting that > you actually do that as part of this patch; just saying.) wish(1) version 8.5 is bundled with macOS Mojave. > >> Signed-off-by: Beat Bolli >> --- >>   gitk | 4 ++-- >>   1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/gitk b/gitk >> index 23d9dd1..8551711 100755 >> --- a/gitk >> +++ b/gitk >> @@ -12290,11 +12290,11 @@ if {[catch {package require Tk 8.4} err]} { >>     # on OSX bring the current Wish process window to front >>   if {[tk windowingsystem] eq "aqua"} { >> -    exec osascript -e [format { >> +    catch { exec osascript -e [format { >>           tell application "System Events" >>               set frontmost of processes whose unix id is %d to true >>           end tell >> -    } [pid] ] >> +    } [pid] ] } >>   } > > Like I said, the change itself looks good to me, especially since the > corresponding code in git gui is also guarded by a catch. > > Best, > Stefan Cheers, Beat