meld icon indicating copy to clipboard operation
meld copied to clipboard

py2app error starting Meld on Mojave from command line

Open Stuk opened this issue 6 years ago • 38 comments

I have installed meld 3.19.2-r6,osx-15 from Homebrew, and get the following error when launching from the command line:

py2app stub executable has encountered a fatal error, and will now terminate.

The Info.plist file must have a PyRuntimeLocations array containing string values for preferred Python runtime locations. These strings should be "otool -L" style mach ids; "@executable_stub" and "~" prefixes will be translated accordingly.

Launching Meld from Finder works fine.

Any ideas what's wrong here?

Stuk avatar Jan 03 '19 21:01 Stuk

Instead of using a symlink, try using an alias.

alias meld=/Applications/..path../Meld

On Thu, Jan 3, 2019 at 1:44 PM Stuart Knightley [email protected] wrote:

I have installed meld 3.19.2-r6,osx-15 from Homebrew, and get the following error when launching from the command line:

py2app stub executable has encountered a fatal error, and will now terminate.

The Info.plist file must have a PyRuntimeLocations array containing string values for preferred Python runtime locations. These strings should be "otool -L" style mach ids; "@executable_stub" and "~" prefixes will be translated accordingly.

Launching Meld from Finder works fine.

Any ideas what's wrong here?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yousseb/meld/issues/77, or mute the thread https://github.com/notifications/unsubscribe-auth/AEgDipieUUWADcFUdFSM3tsXYhFkcSi7ks5u_nmjgaJpZM4Zoz81 .

yousseb avatar Jan 03 '19 21:01 yousseb

Thank you!

It now "launches", but there's only a dock icon, which when clicked shows the Meld menu in the menubar, but no Meld window appears. Clicking "New Comparison..." doesn't do anything.

Stuk avatar Jan 03 '19 21:01 Stuk

Try running meld —help One time. The next time it will work

On Thu, Jan 3, 2019 at 1:57 PM Stuart Knightley [email protected] wrote:

Thank you!

It now "launches", but there's only a dock icon, which when clicked shows the Meld menu in the menubar, but no Meld window appears. Clicking "New Comparison..." doesn't do anything.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/yousseb/meld/issues/77#issuecomment-451290637, or mute the thread https://github.com/notifications/unsubscribe-auth/AEgDikUbbk6O2zGIbpam60eQOydK0n-Rks5u_nzmgaJpZM4Zoz81 .

yousseb avatar Jan 03 '19 22:01 yousseb

I gave that a go, restarted, tried again, and unfortunately it's still in the same state as above.

Stuk avatar Jan 04 '19 21:01 Stuk

Why symlink is crashing? 😢 It was working just fine before...

Anyway, I found solution to make git difftool work properly with meld on Mac OS Mojave: Use this in ~/.gitconfig:

[diff]
    tool = meld

[mergetool "meld"]
    path = /Applications/Meld.app/Contents/MacOS/Meld

mvp avatar Jan 05 '19 00:01 mvp

I have installed meld 3.19.2-r6,osx-15 from Homebrew, and get the following error when launching from the command line:

py2app stub executable has encountered a fatal error, and will now terminate. The Info.plist file must have a PyRuntimeLocations array containing string values for preferred Python runtime locations. These strings should be "otool -L" style mach ids; "@executable_stub" and "~" prefixes will be translated accordingly.

Launching Meld from Finder works fine.

Any ideas what's wrong here?

install by brew ,get same error image meld[15055:76740] The Info.plist file must have a PyRuntimeLocations array containing string values for preferred Python runtime locations. These strings should be "otool -L" style mach ids; "@executable_stub" and "~" prefixes will be translated accordingly.

there is something wrong with /usr/local/bin/meld use open -W -a Meld --args $FILE1 $FILE2 $FILE3 to compare files or create a new /usr/local/bin/meld with below content

#!/bin/bash
open -W -a Meld --args $@

mtjo avatar Jan 07 '19 02:01 mtjo

Why symlink is crashing? 😢 It was working just fine before...

Anyway, I found solution to make git difftool work properly with meld on Mac OS Mojave: Use this in ~/.gitconfig:

[diff]
    tool = meld

[mergetool "meld"]
    path = /Applications/Meld.app/Contents/MacOS/Meld

work fine with this config

[diff]
	tool = meld
	external = git-meld.sh

[difftool]
	prompt = false
[difftool "meld"]
	trustExitCode = true
	cmd = open -W -a Meld --args \"$LOCAL\" \"$PWD/$REMOTE\"
[merge]
	tool = meld
[mergetool]
	prompt = false
[mergetool "meld"]
	trustExitCode = true
	cmd = open -W -a Meld --args --auto-merge \"$PWD/$LOCAL\" \"$PWD/$BASE\" \"$PWD/$REMOTE\" --output=\"$PWD/$MERGED\"

mtjo avatar Jan 07 '19 08:01 mtjo

Well, git has some knowledge about meld by default, and I wanted to make use of it as much as possible, without using any extra scripts or configs. By default, git is trying to find meld from path, but it crashes on Mojave. Setting just path as I did above makes it work for all modes: diff, merge, etc.

That said, real solution to this problem is fixing symlink to work again.

mvp avatar Jan 07 '19 08:01 mvp

Well, git has some knowledge about meld by default, and I wanted to make use of it as much as possible, without using any extra scripts or configs. By default, git is trying to find meld from path, but it crashes on Mojave. Setting just path as I did above makes it work for all modes: diff, merge, etc.

That said, real solution to this problem is fixing symlink to work again.

another way is to downgrade to the old version

mtjo avatar Jan 07 '19 12:01 mtjo

use open -W -a Meld --args $FILE1 $FILE2 $FILE3 to compare files or create a new /usr/local/bin/meld with below content

#!/bin/bash
open -W -a Meld --args $@

Your replacement /usr/local/bin/meld suggestion does not work for me, as it converts all paths to root-oriented instead of pwd-oriented ("foo" becomes "/foo", "../foo" becomes "/foo", etc).

Using alias meld="/Applications/Meld.app/Contents/MacOS/Meld" and just removing /usr/local/bin/meld works correctly.

fiendish avatar Jan 07 '19 16:01 fiendish

For the moment I have reverted to version 3.19.2-r3 to resolve the issue with the Meld window not appearing:

brew cask uninstall meld
brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/c7296b5939b9b785eaca28cca398d5634f7b960a/Casks/meld.rb

Stuk avatar Jan 07 '19 22:01 Stuk

this variant of /usr/local/bin/meld works for me:

#!/bin/sh
exec /Applications/Meld.app/Contents/MacOS/Meld "$@"

ploxiln avatar Jan 09 '19 18:01 ploxiln

None of the variants above work. Best case is with the @mtjo's solution, where the menu bar appears a few seconds after running the command from the CLI, but no window appears.

Switching on fullscreen mode causes the whole screen to go black. Same problem using either one or two screens. With two screens, only one goes black, the one containing the menu bar.

When opening a comparison from the menu, the menu navigation works normally, but no window appears.

fgm avatar Jan 12 '19 08:01 fgm

brew cask formula has been updated now. Simply re-installing solved the issue for me.

brew cask reinstall meld

hindol avatar Jan 29 '19 09:01 hindol

Unfortunately pulling the latest forumla and reinstalling meld did not fix my issue :(

Stuk avatar Feb 04 '19 00:02 Stuk

I’ll make this the highest priority of the next release. My apologies, but I’m terribly busy at the moment. Give it a week to ten days (crossing fingers).

On Sun, Feb 3, 2019 at 4:01 PM Stuart Knightley [email protected] wrote:

Unfortunately pulling the latest forumla and reinstalling meld did not fix my issue :(

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/yousseb/meld/issues/77#issuecomment-460101341, or mute the thread https://github.com/notifications/unsubscribe-auth/AEgDik8rcj5hIuB_hjXLtHTBYNW4FEkMks5vJ3hbgaJpZM4Zoz81 .

yousseb avatar Feb 04 '19 00:02 yousseb

No worries! Thank you for your hard work :)

Stuk avatar Feb 04 '19 00:02 Stuk

Just for the record, with this Meld can be started from the Applications folder, but the "meld" command line is no longer available, making it pretty much unavailable. Maybe it is possible to create a symlink to something within the app, but which file ?

fgm avatar Feb 04 '19 07:02 fgm

The file is /Applications/Meld.app/Contents/MacOS/Meld but a symlink to that file does not work - apparently because the dynamic linking uses some relative paths and is confused, and the result is py2app PyRuntimeLocations error in the original report.

My technique posted above, of using a script instead of a symlink to invoke that Meld executable inside the application folder, works for me on macOS 10.13 High Sierra, but it is quite possible that it does not work on 10.12 or 10.14 (but I expect it should work for everyone on 10.13). I submitted the change to Hombrew-Cask which creates a script wrapper - and somewhat confusingly creates a symlink to the script wrapper inside the versioned cask folder in order to follow Homebrew conventions. So if you install the latest version of the Cask you should get something like this:

$ which meld
/usr/local/bin/meld
$ ls -l /usr/local/bin/meld
lrwxr-xr-x  1 yourname  admin  57 Jan 19 03:28 /usr/local/bin/meld -> /usr/local/Caskroom/meld/3.19.2-r6,osx-15/meld.wrapper.sh
$ cat /usr/local/Caskroom/meld/3.19.2-r6,osx-15/meld.wrapper.sh
#!/bin/sh
exec '/Applications/Meld.app/Contents/MacOS/Meld' "$@"

If the meld command is not working for you, I suggest reporting:

  • version of macOS which you are running
  • output of command: which meld
  • output of command: ls -l $(which meld)
  • output of command: file $(which meld)

ploxiln avatar Feb 04 '19 07:02 ploxiln

I'm getting the same as you for those commands:

/usr/local/bin/meld
lrwxr-xr-x  1 xxxx  wheel  57 Feb  3 15:20 /usr/local/bin/meld -> /usr/local/Caskroom/meld/3.19.2-r6,osx-15/meld.wrapper.sh
/usr/local/bin/meld: POSIX shell script text executable, ASCII text
#!/bin/sh
exec '/Applications/Meld.app/Contents/MacOS/Meld' "$@"

Stuk avatar Feb 04 '19 18:02 Stuk

Which version of macOS are you running? Are you still getting the original error text exactly?

Could you try modifying the script to something like:

#!/bin/sh
cd /Applications/Meld.app/Contents/MacOS
exec ./Meld "$@"

ploxiln avatar Feb 04 '19 19:02 ploxiln

I'm on 10.14.2 (18C54). I'm no longer getting the original error, but this issue:

It now "launches", but there's only a dock icon, which when clicked shows the Meld menu in the menubar, but no Meld window appears. Clicking "New Comparison..." doesn't do anything. https://github.com/yousseb/meld/issues/77#issuecomment-451290637

I tried modifying the script, but still get the same issue :(

Stuk avatar Feb 04 '19 19:02 Stuk

I see, sorry, the wrapper script only addresses the py2app PyRuntimeLocations thing.

ploxiln avatar Feb 04 '19 19:02 ploxiln

To run meld from terminal without py2app error or app not showing up add this to your ~/.bash_profile:

alias meld="rm -r ~/.local/share/meld ~/Library/Preferences/org.gnome.meld.plist ~/Library/Saved\ Application\ State/org.gnome.meld.savedState/; /Applications/Meld.app/Contents/MacOS/Meld"

aminasadi0 avatar Feb 28 '19 10:02 aminasadi0

@aminasadi0 's alias works for normal meld usage 👍 .

However, the git integration doesn't work. I tried wrapping meld in a script named differently, but git knows about meld and rejects use of the script. Then I renamed the script to "meld", ensuring it was in the path before meld itself, but then meld doesn't appear.

fgm avatar Mar 01 '19 07:03 fgm

@fgm, for git integration, adding just this to .gitconfig makes it work:

[mergetool "meld"]
path = /Applications/Meld.app/Contents/MacOS/Meld

That said, it's surprising that fixing this takes so long.

mvp avatar Mar 01 '19 20:03 mvp

Author here: I suggest alias meld=/Applications/Meld.app/Contents/MacOS/Meld Then call meld as usual.

It's taking so long simply because I'm the sole contributor to the OSX port (contributors welcome) and I've been too busy followed by being too sick.

yousseb avatar Mar 01 '19 20:03 yousseb

@mvp / @yousseb : thanks for the suggestions, but neither work. This was my first try, but with that I gest the meld icon in the Alt-tab apps list, but nothing on the screen, even when focusing it.

fgm avatar Mar 02 '19 12:03 fgm

To re-state the current status on my OS X mojave 10.14.6 system:

  • meld version 3.19.2-r6,osx-15 has the "window is invisible problem"
  • After downgrading to meld version 3.19.2-r3,osx-12 everything works as expected. In particular there are no problems with / errors from py2app.

I'm willing to help debugging this, but I'd need some help where to start searching.

m8mble avatar Jul 24 '19 13:07 m8mble

I'm running into the same issue – sometimes the meld cli invocation seems to start Meld, and the icon shows, but it doesn't bring up any window.

When this happens, I've found the following workaround to be nice enough:

  • ctrl+c out of the CLI meld
  • Open the Meld app (from /Applications), which will bring up the splash "file comparison" window
  • Close the Meld app
  • CLI meld will now work again 👍

@yousseb thanks heaps for your work on getting Meld to OS X, it's such a useful tool!

Pluies avatar Jul 24 '19 15:07 Pluies