yousseb / meld

Meld for macOS
https://yousseb.github.io/meld/
GNU General Public License v2.0
2.3k stars 120 forks source link

Doesn't work in MacOS Mohave #70

Open PVGrad opened 6 years ago

PVGrad commented 6 years ago

I run it

meld /etc/php.ini.default-previous /etc/php.ini.default-previous\~orig
/Applications/Meld.app/Contents/MacOS

And nothing happens - only icon of meld is showing, but no window Then I press ctrl+c to terminate process and this is the output:

Traceback (most recent call last):
  File "/usr/local/bin/meld", line 47, in <module>
    status = subprocess.call([MELDPATH] + arglist, env=environment)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1384, in wait
    pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt
PVGrad commented 6 years ago

As I understood - there were my local problems with python2.7 after system update to Mohave. So issue can be closed. Thanks

zzju commented 6 years ago

@PVGrad So how to resolve this problem? macOS 10.14 python --version Python 2.7.10

many thanks.

zzju commented 6 years ago

installed python 3, and re-installed meld 3.19, meld works again.

fafafariba commented 6 years ago

I have python 3 installed as well as meld 3.19, but still having the same problem as OP.

munepi commented 6 years ago

Please try to run the following Bash script _clean-meld-settings.sh to cleanup your some settings of Meld.

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"
munepi commented 6 years ago

Today morning (UCT+9 🇯🇵), I also have posted how to use/change custom-font with Meld plist settings in Issue Can't change font #38. The plist file ~//Library/Preferences/org.gnome.meld.plist is just the one. Please check and try the post if necessary.

fafafariba commented 6 years ago

Please try to run the following Bash script _clean-meld-settings.sh to cleanup your some settings of Meld.

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

This worked for me, thank you.

ppannuto commented 6 years ago

I've got approximately the same output running Meld (python version 2.7.15, OS X 10.14). Cleaning settings did not change anything for me:

/Applications/Meld.app/Contents/MacOS
^CTraceback (most recent call last):
  File "/Applications/Meld.app/Contents/MacOS/Meld", line 47, in <module>
    status = subprocess.call([MELDPATH] + arglist, env=environment)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1099, in wait
    pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 125, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt

Anything else I can try?

MaxBenChrist commented 6 years ago

Please try to run the following Bash script _clean-meld-settings.sh to cleanup your some settings of Meld.

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

this worked for me as well, thank you! 👍

JerryShih commented 6 years ago

Please try to run the following Bash script _clean-meld-settings.sh to cleanup your some settings of Meld.

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

this worked for me as well, thank you! 👍

It worked only 1 time after cleaning all setting. I still only see an icon for the second and the after runs.

munepi commented 6 years ago

@JerryShih That is an unofficial, bad know-how :-( , but please try the following three steps.

  1. move the original Mac-port starter script to Meld.distro below.

    $ mv /Applications/Meld.app/Contents/MacOS/Meld /Applications/Meld.app/Contents/MacOS/Meld.distro
    1. make a wrapper /Applications/Meld.app/Contents/MacOS/Meld of the Meld.distro below
      
      #!/bin/bash

    $ sudo xattr -r -d com.apple.quarantine /Applications/Meld.app/

    standard plist settings: OK

    ~/Library/Preferences/org.gnome.meld.plist

    $ defaults read org.gnome.meld

    $ defaults write org.gnome.meld "/org/gnome/meld/use-system-font" 0

    $ defaults write org.gnome.meld "/org/gnome/meld/custom-font" "Ricty, 18"

    FIXME: ad-hoc cleanup Meld settings

    (cd ${HOME} rm -rf ./.local/share/meld

    rm -f ./Library/Preferences/org.gnome.meld.plist

    rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/" )

    export G_ENABLE_DIAGNOSTIC=1 # 0 or 1

    export GTK_THEME=Adwaita # Adwaita or Adwaita:dark

    export GTK_DEBUG=interactive

    logger "/Applications/Meld.app/Contents/MacOS/Meld.distro" exec "/Applications/Meld.app/Contents/MacOS/Meld.distro" $@

    
    3. Then, `$ chmod +x /Applications/Meld.app/Contents/MacOS/Meld`

I remark that

JerryShih commented 6 years ago

@JerryShih That is an unofficial, bad know-how :-( , but please try the following three steps.

  1. move the original Mac-port starter script to Meld.distro below.
    $ mv /Applications/Meld.app/Contents/MacOS/Meld /Applications/Meld.app/Contents/MacOS/Meld.distro
  2. make a wrapper /Applications/Meld.app/Contents/MacOS/Meld of the Meld.distro below

    #!/bin/bash
    
    ## 
    # $ sudo xattr -r -d com.apple.quarantine /Applications/Meld.app/
    
    ## standard plist settings: OK
    # ~/Library/Preferences/org.gnome.meld.plist
    # $ defaults read org.gnome.meld
    # $ defaults write org.gnome.meld "/org/gnome/meld/use-system-font" 0
    # $ defaults write org.gnome.meld "/org/gnome/meld/custom-font" "Ricty, 18"
    
    ##FIXME: ad-hoc cleanup Meld settings
    (cd ${HOME}
    rm -rf ./.local/share/meld
    #rm -f ./Library/Preferences/org.gnome.meld.plist
    rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"
    )
    
    # export G_ENABLE_DIAGNOSTIC=1 # 0 or 1
    # export GTK_THEME=Adwaita # Adwaita or Adwaita:dark
    # export GTK_DEBUG=interactive
    
    logger "/Applications/Meld.app/Contents/MacOS/Meld.distro"
    exec "/Applications/Meld.app/Contents/MacOS/Meld.distro" $@
  3. Then, $ chmod +x /Applications/Meld.app/Contents/MacOS/Meld

I remark that

  • you are available some GTK-related environment variables inside the above wrapper Meld: G_ENABLE_DIAGNOSTIC, GTK_THEME, GTK_DEBUG.
  • you are also available some tips commented in the above wrapper Meld if necessary.
  • I also have posted how to use/change custom-font with Meld plist settings in Issue Can't change font #38. The plist file ~//Library/Preferences/org.gnome.meld.plist is just the one. Please check and try the post if necessary.

It just a wrapper to clean the setting before calling meld. What's the root cause for this problem? Do all gtk-base gui tools have the same problem?

yousseb commented 6 years ago

Not all gtk-based, just the pygtk-based require such wrapper.

And I apologize for not being able to help as efficiently on this thread (and others), but I promise that once I have some spare time on my hands + having collected some tricks and fixes from the people that comment on those issues, I'll create a new release that would include the fixes in one nifty release.

munepi commented 6 years ago

Hi @yousseb , Thank you for your information and follow-up. I exactly could not trace that problem around pygtk-something :-( So, I have made such ad-hoc wrapper. I'm looking forward to a new release!

yousseb commented 6 years ago

@munepi thank you for trying (and helping others get their cases resolved). I wish there was some means to tell the generated binary the path to look for libraries in a cleaner way to get rid of the python wrapper that I had to make. That on its own would have solved other issues on my list here.

But anyway, I guess I'll be able to put sometime into this within a month or so. Or at least I hope..

briskgopesh commented 6 years ago

!/bin/bash cd ${HOME} rm -rf ./.local/share/meld rm -f ./Library/Preferences/org.gnome.meld.plist rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

Work for me as well. 👍

chaosless commented 6 years ago

these steps fixed it for me too.. thanks!!

rm -rf ./.local/share/meld rm -f ./Library/Preferences/org.gnome.meld.plist rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

thanks @munepi i needed the wrapper to run cleanly

sysadmiral commented 6 years ago

these steps fixed it for me too.. thanks!!

rm -rf ./.local/share/meld rm -f ./Library/Preferences/org.gnome.meld.plist rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

This isn't really a "fix" though...

VR2ualize commented 5 years ago
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

Nice .. thanks for that :-)

oxoocoffee commented 5 years ago

I have same issue on Mojave with 3.19.0

bbqchickenrobot commented 5 years ago

The fix kind of works for me but the mouse isn't accurate when trying to manipulate the UI elements. I have to go about a quarter of an inch above the UI element for the click event to register. Hopefully this will be fixed sooner than later!

VR2ualize commented 5 years ago

The fix kind of works for me but the mouse isn't accurate when trying to manipulate the UI elements. I have to go about a quarter of an inch above the UI element for the click event to register. Hopefully this will be fixed sooner than later!

I also get that, but only when resizing the application window after opening, if I don't change the size of the application window I don't get that problem.

dluc commented 5 years ago

Please try to run the following Bash script _clean-meld-settings.sh to cleanup your some settings of Meld.

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

Thanks, this fixed it, without having to upgrade Python 🏁

Please add this to the release notes 😃

SemihGk commented 5 years ago

Please try to run the following Bash script _clean-meld-settings.sh to cleanup your some settings of Meld.

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

Removing some meld files temporarily fixed the issue. So, I wanted to try the wrapper solution as munepi posted above, but no luck I am receiving "There was a problem opening the file" error whenever Meld opens a file. Probably, I am doing something wrong at step2 of the wrapper solution. Anyway, I also look forward to waiting for an update for this issue. Thanks a lot for your help.

dluc commented 5 years ago

Using 3.19.0 and Meld stopped working again. Repeating the steps above fixed the issue one more time, but apparently there's a bug leading to the broken state at some point

yousseb commented 5 years ago

Hey guys, could you please run the _clean-meld-settings.sh script by @munepi in this thread then give this new build a shot?

https://github.com/yousseb/meld/releases/tag/os-11

preinking commented 5 years ago

Running 3.19.2 (r1) but the font size is 18pt and cannot be changed as this leads to a crash

ira-bv commented 5 years ago

tried newest version, no go.

 ↳ meld --version
 meld 3.19.2

But maybe this is a clue, Yousef?

 ↳ /Applications/Meld.app/Contents/MacOS/Meld-bin
 Couldn't set the locale: unsupported locale setting; falling back to 'C' locale

 ** (process:26632): WARNING **: 14:32:29.078: Failed to load shared library 
 '/Users/youssef/gtk/inst/lib/libglib-2.0.0.dylib' referenced by the typelib: 
 dlopen(/Users/youssef/gtk/inst/lib/libglib-2.0.0.dylib, 9): image not found

 ** (process:26632): WARNING **: 14:32:29.078: Failed to load shared library 
 '/Users/youssef/gtk/inst/lib/libgobject-2.0.0.dylib' referenced by the typelib: 
 dlopen(/Users/youssef/gtk/inst/lib/libgobject-2.0.0.dylib, 9): image not found
yousseb commented 5 years ago

Trying to figure this out. But no, it’s not those paths.

The Meld starter python script sets the DYLD_LIBRARY_PATH which tells dlopen where to look. In fact, this is the only reason why the script exists and I’ve been looking for a way around this forever. This is deep inside gopject-introspection python compiler. The only recommendation that I have is don’t start Meld-bin directly until I find a solution to telling gi to use relative path.

Alternatively, I could use some help in telling macOS not save state on crashes. Looks like this is what is happening.

On Sun, Dec 2, 2018 at 4:35 AM Ira Abramov notifications@github.com wrote:

tried newest version, no go.

↳ meld --version

meld 3.19.2

But maybe this is a clue, Yousef?

↳ /Applications/Meld.app/Contents/MacOS/Meld-bin

Couldn't set the locale: unsupported locale setting; falling back to 'C' locale

(process:26632): WARNING : 14:32:29.078: Failed to load shared library

'/Users/youssef/gtk/inst/lib/libglib-2.0.0.dylib' referenced by the typelib:

dlopen(/Users/youssef/gtk/inst/lib/libglib-2.0.0.dylib, 9): image not found

(process:26632): WARNING : 14:32:29.078: Failed to load shared library

'/Users/youssef/gtk/inst/lib/libgobject-2.0.0.dylib' referenced by the typelib:

dlopen(/Users/youssef/gtk/inst/lib/libgobject-2.0.0.dylib, 9): image not found

— You are receiving this because you were mentioned.

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

yousseb commented 5 years ago

One more build. Let's try this one guys:

https://github.com/yousseb/meld/releases/tag/osx-11

ira-bv commented 5 years ago

Seems to work and repetitively :) Thanks!! 👍

cmrust commented 5 years ago

Works repeatedly for me too! Thanks!

cyberdemon8 commented 5 years ago

Works!!! Thanks! 👍

preinking commented 5 years ago

Works for me as well Thanks! 👍

MaxBenChrist commented 5 years ago

Thanks!

is there already a release scheduled for homebrew/cask?

munepi commented 5 years ago

@yousseb The current Meld 3.19.2 (r2)'s starter script works fine!

SemihGk commented 5 years ago

I tried the latest build. When I merge some conflicts, I constantly receive: There was a problem opening the file “somepath/somefile_LOCAL.java”. There was a problem opening the file “somepath/somefile_BASE.java”. There was a problem opening the file “somepath/somefile_REMOTE.java”.

I checked the path. Those 3 files exist. Somehow, meld is unable to open those files. Is there any guess why it is happening? Stable build does not have this path problem if I run clean-meld.settings.sh script before each file conflict.

yousseb commented 5 years ago

@Semih thanks for the report. Let’s open a separate issue for it and please share your .gitconfig in the issue as well.

On Thu, Dec 6, 2018 at 7:53 AM Semih notifications@github.com wrote:

I tried the latest build. When I merge some conflicts, I constantly receive: There was a problem opening the file “somepath/somefile_LOCAL.java”. There was a problem opening the file “somepath/somefile_BASE.java”. There was a problem opening the file “somepath/somefile_REMOTE.java”.

I checked the path. Those 3 files exist. Somehow, meld is unable to open those files. Is there any guess why it is happening? Stable build does not have this path problem if I use clean-meld.settings.sh script before each file conflict.

— You are receiving this because you were mentioned.

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

SemihGk commented 5 years ago

Sure. I will open a separate ticket. Thank you for the response.

knumat commented 5 years ago

@yousseb Thanks for the updated build! It starts up fine for me on macOS 10.14.1 (Mojave). Hurray!

https://github.com/yousseb/meld/releases/tag/osx-11

I am seeing a similar issue to @bbqchickenrobot where I have to click a bit above the buttons when I first start it up. However, once I resize the window, everything seems to be fine (which is the opposite behavior that @decentralizeduser saw). After some experimentation, it appears that showing/hiding tab bar does not re-layout the contents of the window, but resizing the window does. I probably notice this more than more users because I enabled Settings -> Dock -> Prefer Tabs When Opening Documents -> Always.

Reproduction steps:

  1. Start Meld.
  2. Select View -> Show Tab Bar
  3. Move the mouse over a button and notice that the hover effect is doesn't line up with the top/bottom edges (mouse needs to be 1/4inch higher).
  4. Resize the window.
  5. Move the mouse over a button and notice that the hover effect properly lines up with the top/bottom edges.
  6. Select View -> Hide Tab Bar
  7. Move the mouse over a button and notice that the hover effect is doesn't line up with the top/bottom edges (mouse needs to be 1/4inch lower).
  8. Resize the window.
  9. Move the mouse over a button and notice that the hover effect properly lines up with the top/bottom edges.

Let me know if you would like me to file a separate issue.

nobodo commented 5 years ago

That mouse disalignment issue is not limited to Meld only. There is at least one third party program (GLM 3 by Genelec) that has the same issue which has the same workaround by resizing the window. I have tried to isolate the problem and it could be related to the tabbed layout, but I'm not sure which library to blaim.

oliveratutexas commented 5 years ago

I installed via cask and am still have some of these problems, the script

#!/bin/bash

cd ${HOME}
rm -rf ./.local/share/meld
rm -f ./Library/Preferences/org.gnome.meld.plist
rm -rf "./Library/Saved Application State/org.gnome.meld.savedState/"

worked on the first run for me, not sure what else to do. For git mergetool config I had

[diff]
  tool = meld
[difftool]
  prompt = false
[difftool "meld"]
  trustExitCode = true
  cmd =  meld --args $LOCAL $REMOTE
[merge]
  tool = meld
[mergetool]
  prompt = false
[mergetool "meld"]
  trustExitCode = true
  cmd =  echo "$LOCAL" && echo "$BASE" && echo $REMOTE && meld --auto-merge $LOCAL $BASE $REMOTE --output=$MERGED

tried on MacOS mohave latest version, python 3, installed via cask

dsbecker commented 5 years ago

The following will ensure that the parameters are always fully qualified paths. It used to work as you had it on the last version, but the latest builds sometimes don't. This is how I fixed it.

[diff]
  tool = meld
[difftool "meld"]
  cmd = open -W -n -a Meld --args $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\")
  trustExitCode = true
[merge]
  tool = meld
[mergetool "meld"]
  cmd = open -W -n -a Meld --args --auto-merge  $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") --output=$(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\")
  trustExitCode = true
oliveratutexas commented 5 years ago

The following will ensure that the parameters are always fully qualified paths. It used to work as you had it on the last version, but the latest builds sometimes don't. This is how I fixed it.

[diff]
  tool = meld
[difftool "meld"]
  cmd = open -W -n -a Meld --args $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\")
  trustExitCode = true
[merge]
  tool = meld
[mergetool "meld"]
  cmd = open -W -n -a Meld --args --auto-merge  $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") --output=$(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\")
  trustExitCode = true

That helped, thank you!

fiendish commented 5 years ago

3.19.2-r6 still exhibits this issue if I ctrl+C meld from the terminal. When I run meld again I get only the Meld menu bar and no window. But if I go to Meld->Quit Meld in the menu, then it works again after that.

bmusat commented 5 years ago

When you run 'meld' from the command line and ctrl-C it, meld does not clean up after itself. You need to delete the ~/Library/Saved Application State/org.gnome.meld.savedState/ before restarting. This directory is deleted if you Meld->Quit Meld which is why that works.

I modified the /usr/local/Caskroom/meld/3.19.2-r6,osx-15/meld.wrapper.sh script installed by brew to the following:

!/bin/sh

rm -rf ~/Library/Saved\ Application\ State/org.gnome.meld.savedState exec '/Applications/Meld.app/Contents/MacOS/Meld' "$@"

and now Meld works if you invoke it from the command line every time.

I don't think there is any need to remove these other two directories or files since they only contain your preferences and recently compared files:

rm -rf ./.local/share/meld rm -f ./Library/Preferences/org.gnome.meld.plist

p1nox commented 5 years ago

Thanks @bmusat , worked for me 💯 🎉

bmusat commented 5 years ago

Also wanted to note that if you are still having problems then you might have an old Meld process lying around. To see if you do:

pgrep -fi meld

will list the PIDs and then:

pkill -fi meld

will kill them off.. and the meld.wrapper.sh script in my previous post above should clean up the rest. I suppose you could add the pkill in that script as well, just to be sure, but I don't think it's necessary.

rmeffan commented 5 years ago

Running meld 3.19.2-r6,osx-15, and I ran into the problem described with this issue. It's possible that it either started after upgrading to Mojave from ElCap, but it's also possible that I have used CTRL-C at some point to kill meld when it wasn't responding.

I ran the cleanup script that was recommended in this comment, and it resolved the issue.

If the problem recurs, I will try modifying the wrapper as described here.

Thanks, all!

ffloimair commented 5 years ago

I'm having the same issue. Have to run the 3 additional steps above manually each time before starting Meld. Otherwise the window won't show.