DATADIR may point to wrong directory in Python 3.7+
In Python 3.7+ (or in their updated distutils) a pip install
builds a "dist_wheel" first and then installs that.
This breaks the DATADIR resolution in https://gitlab.gnome.org/GNOME/meld/blob/5fe6a0849228f1f2e48bfd7924f4ab76237869f0/meld/build_helpers.py#L380: The --prefix
option is not given to a bdist_wheel build so it will always point to sys.prefix
(fallback path) which may then be incorect.
Example with log: pip install --prefix=/tmp/mycustommeldfolder --no-deps --ignore-installed --no-build-isolation -v .
Created temporary directory: /tmp/pip-ephem-wheel-cache-pit9nj8r
Created temporary directory: /tmp/pip-req-tracker-onl23q6y
Created requirements tracker '/tmp/pip-req-tracker-onl23q6y'
Created temporary directory: /tmp/pip-install-5s1506hj
Processing /tmp/meld-3.20.1
Created temporary directory: /tmp/pip-req-build-ln28xqoa
Added file:///tmp/meld-3.20.1 to build tracker '/tmp/pip-req-tracker-onl23q6y'
Running setup.py (path:/tmp/pip-req-build-ln28xqoa/setup.py) egg_info for package from file:///tmp/meld-3.20.1
Running command python setup.py egg_info
running egg_info
creating pip-egg-info/meld.egg-info
writing pip-egg-info/meld.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/meld.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/meld.egg-info/top_level.txt
writing manifest file 'pip-egg-info/meld.egg-info/SOURCES.txt'
reading manifest file 'pip-egg-info/meld.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pip-egg-info/meld.egg-info/SOURCES.txt'
Source in /tmp/pip-req-build-ln28xqoa has version 3.20.1, which satisfies requirement meld==3.20.1 from file:///tmp/meld-3.20.1
Removed meld==3.20.1 from file:///tmp/meld-3.20.1 from build tracker '/tmp/pip-req-tracker-onl23q6y'
Building wheels for collected packages: meld
Created temporary directory: /tmp/pip-wheel-26ld43gj
Building wheel for meld (setup.py) ... Destination directory: /tmp/pip-wheel-26ld43gj
Running command /sw/installed/Python/3.7.2-GCCcore-8.2.0/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-ln28xqoa/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-26ld43gj --python-tag cp37
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/meld
[CROP]
As you can see: bdist_wheel command is executed.
Meld will then fail to e.g. load DATADIR/meld/meld.css
.
Possible solution: Check for meld/meld.css
in some locations, first the configured DATADIR, then in a relative-to-current-file path.