git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: macOS: ignore osascript errors
@ 2020-10-25 17:51 Beat Bolli
  2020-10-26 17:21 ` Stefan Haller
  0 siblings, 1 reply; 3+ messages in thread
From: Beat Bolli @ 2020-10-25 17:51 UTC (permalink / raw)
  To: paulus; +Cc: git, Beat Bolli

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 executing
    "exec osascript -e [format {
            tell application "System Events"
                set frontmost of processes whose unix id is %d to true
            end te..."
        invoked from within
    "if {[tk windowingsystem] eq "aqua"} {
        exec osascript -e [format {
            tell application "System Events"
                set frontmost of processes ..."
        (file "./gitk" line 12265)

Ignore errors from the osascript invocation, especially because this macOS
version seems to correctly place the gitk window in the foreground.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
 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] ] }
 }
 
 # Unset GIT_TRACE var if set
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gitk: macOS: ignore osascript errors
  2020-10-25 17:51 [PATCH] gitk: macOS: ignore osascript errors Beat Bolli
@ 2020-10-26 17:21 ` Stefan Haller
  2020-10-27 13:02   ` Beat Bolli
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Haller @ 2020-10-26 17:21 UTC (permalink / raw)
  To: Beat Bolli, paulus; +Cc: git

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.

> 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.)

> Signed-off-by: Beat Bolli <dev+git@drbeat.li>
> ---
>   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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gitk: macOS: ignore osascript errors
  2020-10-26 17:21 ` Stefan Haller
@ 2020-10-27 13:02   ` Beat Bolli
  0 siblings, 0 replies; 3+ messages in thread
From: Beat Bolli @ 2020-10-27 13:02 UTC (permalink / raw)
  To: Stefan Haller, paulus; +Cc: git

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 <dev+git@drbeat.li>
>> ---
>>   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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-27 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-25 17:51 [PATCH] gitk: macOS: ignore osascript errors Beat Bolli
2020-10-26 17:21 ` Stefan Haller
2020-10-27 13:02   ` Beat Bolli

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).