Meld Meson build dev directory

I want to run meld from the project directory without installing

When I run

meson build
cd build

a meld executable is created under build/bin/. When I try running it, it fails because it can’t find /usr/share/meld/org.gnome.meld.gresource. Looking at it more closely, the meld “binary” has a function called “get_meld_path” that sets the project root directory. It sets it 1 level above the file directory, which is incorrect.

If I modify build/bin/meld to 2 levels above (i.e /home/$USER/meld) everything works fine.

I looked through the meson build files and I don’t see what’s generating this. I also grep for “get_meld_dir” but again no hits in the source tree.

Can someone point me to where this is coming from?

get_meld_dir() is in the bin/meld script.

However, what you’re trying to do isn’t supported. Meld already has built-in support for running without installing. From a freshly-cloned repository, just run bin/meld and it should work.

So running bin/meld will run with the changes in the source tree? No need to run the meson build first?

I thought you need to run meson setup build first so everything is staged correctly.

There are a few things that require additional work, but unless you’re changing translations, sourceview schemes or… probably a couple of other minor asset types that I can’t recall… yes, bin/meld will run with changes from the existing checkout.

And what if I’m changing those things?
bin/meld assumes the project root dir to be one level up from where the script is. If I run meson, that’s no longer true, the project root is 2 levels up (./build/bin).
Relying on the location of the bin file seems unreliable to me. You can build in a folder completely outside of the project dir.

Seems to me that meson should set the project dir somehow. Maybe the post install script can inject that?


It might be more useful if you describe what you’re trying to do and what isn’t working.

Meld’s development model is that you run bin/meld from the checkout. It looks like you’re trying to change this so that Meson is used for the development environment, which is unlikely to work because Meson’s design goes against making in-tree changes.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.