Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#61819 - [root] missing entry in PYTHONPATH

Attached to Project: Community Packages
Opened by Sebastien Binet (bins) - Wednesday, 20 February 2019, 14:16 GMT
Last edited by Konstantin Gizdov (kgizdov) - Saturday, 23 February 2019, 17:28 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Konstantin Gizdov (kgizdov)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

ROOT-6.16/00 is now (?) installing python modules for rootls and friends under /usr/share/root/cli:

```
$> yay -Ql root | grep cmdLine
root /usr/share/root/cli/__pycache__/cmdLineUtils.cpython-37.pyc
root /usr/share/root/cli/cmdLineUtils.py
```

one should add that directory to the PYTHONPATH otherwise:
```
$> rootls
Traceback (most recent call last):
File "/usr/bin/rootls", line 10, in <module>
import cmdLineUtils
ModuleNotFoundError: No module named 'cmdLineUtils'
```

```
$> yay -Qi root
Name : root
Version : 6.16.00-1
Description : C++ data analysis framework and interpreter from CERN.
Architecture : x86_64
URL : http://root.cern.ch
Licenses : LGPL2.1
Groups : None
Provides : root-extra
Depends On : blas desktop-file-utils fcgi fftw ftgl giflib gl2ps glew gsl hicolor-icon-theme intel-tbb libafterimage librsvg libxpm
tex-gyre-fonts xxhash>=0.6.5-1
Optional Deps : cfitsio: Read images and data from FITS files [installed]
cern-vdt: Add a set of fast and vectorisable mathematical functions [installed]
libmariadbclient: MySQL support [installed]
openssl: OpenSSL support [installed]
postgresql-libs: PostgreSQL support [installed]
pythia8>=8.2.40-1: Pythia8 EG support
sqlite: SQLite support [installed]
tcsh: Legacy CSH support
unuran: Support non-uniform random numbers [installed]
vc: Add types for portable and intuitive SIMD programming
libxml2: XML parser interface [installed]
xrootd: Support remote file server and client [installed]
gcc-fortran: Enable the Fortran components of ROOT [installed]
Required By : None
Optional For : None
Conflicts With : root-extra
Replaces : root-extra
Installed Size : 306.74 MiB
Packager : Konstantin Gizdov <arch@kge.pw>
Build Date : Tue 19 Feb 2019 12:35:58 PM CET
Install Date : Tue 19 Feb 2019 03:48:39 PM CET
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
```
This task depends upon

Closed by  Konstantin Gizdov (kgizdov)
Saturday, 23 February 2019, 17:28 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in pkgrel 2
Comment by loqs (loqs) - Wednesday, 20 February 2019, 16:52 GMT
Is etc/profile.d/root.sh not being sourced on your system?
The PKGBUILD could be adjusted to place the python files in the standard location using the same approach as fedora.
Having 974 files in etc/root seems none standard to me.
Comment by Sebastien Binet (bins) - Wednesday, 20 February 2019, 17:39 GMT
ROOT doesn't get extra points for following standards, that's for sure :)

/etc/profile.d/root.sh is being sourced, but here is its current content:
```
if [ $PYTHONPATH ]; then
if [[ ":$PYTHONPATH:" == *":/usr/lib/root:"* ]]; then
return 0;
else
export PYTHONPATH=$PYTHONPATH:/usr/lib/root;
fi
else
export PYTHONPATH=/usr/lib/root;
fi

```

it worked fine previously (with ROOT-6.14/xx, when the "root" package was in AUR.)
but now, with ROOT-6.16/xx, there are additional python files there:
```
/usr/share/root/cli/__pycache__/cmdLineUtils.cpython-37.pyc
/usr/share/root/cli/cmdLineUtils.py
```

so either /etc/profile.d/root.sh needs to be updated to add /usr/share/root/cli to the PYTHONPATH, or we somehow tweak PKGBUILD to beat ROOT into installing these files under /usr/lib/root.
Comment by Eli Schwartz (eschwartz) - Wednesday, 20 February 2019, 17:59 GMT
> or we somehow tweak PKGBUILD to beat ROOT into installing these files under /usr/lib/root.

There is no beating ROOT here, we would need to beat the package maintainer (or at least ask why this change was made).

This is what the PKGBUILD does:

mv "${pkgdir}/usr/lib/root"/cmdLineUtils.py* "${pkgdir}/usr/share/root/cli/"
rm "${pkgdir}/usr/lib/root/__pycache__"/cmdLineUtils.*
python -m compileall "${pkgdir}/usr/share/root/cli/"
Comment by Konstantin Gizdov (kgizdov) - Friday, 22 February 2019, 09:34 GMT
ROOT creates and wants to use that path, but doesn't configure it properly and I missed to include it manually. One thing is to move everything to `python/site-packages`, remove `/etc/profile.d/root.sh` and hope PyROOT will find what it needs. I've been down that path before with varying success.

In any case, this is a bug. For the time being, I will move everything back in `/usr/lib/root`.
Comment by Konstantin Gizdov (kgizdov) - Friday, 22 February 2019, 10:25 GMT
Just for future reference, `/etc/root` is specifically for ROOT's own private config files and dictionaries. These are currently slowly being moved by upstream to relevant directories. However, in the current situation, leaving them in `/etc` will *pollute* your system with non-standard files. In fact, if you set `-Dgnuinstall=ON`, these go in `/etc/root` by default. In the future, some of these will be moved to `/usr/share/root`, some of them in `/usr/lib/root`. However, at the moment ROOT expects them there at runtime.

Also, ROOT doesn't try/want to install python modules in the standard python path at all. And on top of that the dynamic loading of libs doesn't help with moving files around. Thus the need for `/etc/profile.d/root.sh`. However, stuff is being done to remove this as well.

Loading...