After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782887 - Cannot run meld installed in a jhbuild prefix
Cannot run meld installed in a jhbuild prefix
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: meld-maint
meld-maint
Depends on:
Blocks:
 
 
Reported: 2017-05-20 19:34 UTC by Ting-Wei Lan
Modified: 2017-05-26 23:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build_helpers: Use get_option_dict to get prefix value (1.19 KB, patch)
2017-05-20 19:45 UTC, Ting-Wei Lan
none Details | Review

Description Ting-Wei Lan 2017-05-20 19:34:12 UTC
meld is available in gnome-world moduleset shipped with jhbuild and can be installed without error using jhbuild.

$ jhbuild buildone meld
*** Building meld *** [1/1]
python3 setup.py build --build-base /home/lantw44/gnome/build/meld
...
*** Installing meld *** [1/1]
python3 setup.py build --build-base /home/lantw44/gnome/build/meld install --prefix /home/lantw44/gnome/devinstall --root /home/lantw44/gnome/devinstall/_jhbuild/root-meld
...
I: Moving temporary DESTDIR u'/home/lantw44/gnome/devinstall/_jhbuild/root-meld' into build prefix
I: Install complete: 312 files copied
...


However, meld/build_helpers.py isn't able to pick the value passed by --prefix during installation. It fallbacks to the default value /usr/local and causes meld to crash.

$ jhbuild run meld
Couldn't load Meld-specific CSS (/usr/local/share/meld/meld.css)
gtk-css-provider-error-quark: <broken file>:1:0Failed to import: Error opening file /usr/local/share/meld/meld.css: No such file or directory (2)
...
Traceback (most recent call last):
  • File "/home/lantw44/gnome/devinstall/lib/python3.5/site-packages/meld/meldapp.py", line 66 in do_startup
    builder = meld.ui.util.get_builder("application.ui")
  • File "/home/lantw44/gnome/devinstall/lib/python3.5/site-packages/meld/ui/util.py", line 40 in get_builder
    builder.add_from_file(ui_file(filename))
GLib.Error: g-file-error-quark: Failed to open file “/usr/local/share/meld/ui/application.ui”: No such file or directory (4)
Traceback (most recent call last):
  File "/home/lantw44/gnome/devinstall/lib/python3.5/site-packages/meld/meldapp.py", line 76, in do_command_line
    tab = self.parse_args(command_line)
  File "/home/lantw44/gnome/devinstall/lib/python3.5/site-packages/meld/meldapp.py", line 334, in parse_args
    focus=i == 0)
  File "/home/lantw44/gnome/devinstall/lib/python3.5/site-packages/meld/meldapp.py", line 147, in open_files
    window = self.get_meld_window()
  File "/home/lantw44/gnome/devinstall/lib/python3.5/site-packages/meld/meldapp.py", line 142, in get_meld_window
    return self.get_active_window().meldwindow
AttributeError: 'NoneType' object has no attribute 'meldwindow'
Comment 1 Ting-Wei Lan 2017-05-20 19:45:23 UTC
Created attachment 352245 [details] [review]
build_helpers: Use get_option_dict to get prefix value

The build_py class was added to support installing meld into an
alternative prefix, which is required in a jhbuild environment.
However, command_obj doesn't seem to work with current python3 version,
Replacing it with get_option_dict fixes the problem.
Comment 2 Kai Willadsen 2017-05-26 23:16:16 UTC
Looks good to me. I've just pushed your patch to master. Thanks!