sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
253 stars 241 forks source link

Configure check for empy3 with 0.116 fails with Fedora 32 #882

Closed aperezbios closed 4 years ago

aperezbios commented 4 years ago

@quozl , back in August, you committed a fix for configure.ac (d47694d) which now fails under Fedora 32.

When running configure, the empy test fails, even when the python3-empy package is installed.

You can successfully complete a build by simply commenting out the offending AC_PATH_PROGS([EMPY], [empy empy3]) test condition, or, by using the following hack:

AC_PATH_PROGS([EMPY], [empy empy3], [/usr/lib/python3.8/site_packages/em.py])

...but we should probably be using the AX_PYTHON_MODULE M4 macro instead: https://www.gnu.org/software/autoconf-archive/ax_python_module.html

This needs to be corrected in the configure.ac file for all python release tarballs.

quozl commented 4 years ago

Thanks for reporting this. I wouldn't have noticed.

./configure EMPY=%{python3_sitelib}/em.py
python3 -m em - -p $$ -D scaling=100 < gtkrc.em > sugar-100.gtkrc

Please make that change and test on Fedora 32?

Bottersnike commented 4 years ago

This appears to be a shortcoming of something within the sugar build system. The build system is looking for a binary named empy, however this is not part of empy. Comparison of the setup.py files for flake8 and empy shows flake8 explicitly telling python to install a binary named flake8 which runs flake8.main.cli.main() (https://gitlab.com/pycqa/flake8/blob/master/setup.cfg#L61), however the setup script for empy is far more minimal, and has no such addition. The empy binaries present in packages such as the one available on debian have been explicitly added by the package maintainers, and probably shouldn't be relied on existing. This same behaviour can easily be reproduced on any system by uninstalling the package manager's empy package and instead installing it system-wide with pip.

For what it's worth, this same issue occurs when installing python-empy, python2-empy, or just using pip, on Arch, as the arch packages, similarly to fedora, do not add this magic custom binary.

quozl commented 4 years ago

Excellent, thanks. That makes two distributions that don't provide a binary, and one that does. Does the change in my earlier comment work?

python3 -m em - -p $$ -D scaling=100 < gtkrc.em > sugar-100.gtkrc
aperezbios commented 4 years ago

Here's a workaround patch https://pastebin.com/raw/9JEa6tic

aperezbios commented 4 years ago

@quozl, can you please clarify what the command you've pasted in your previous comment is supposed to accomplish? It does not execute at a CLI, and fails with ":6: error: <class 'NameError'>: name 'scaling' is not defined"

Is it expected to?

quozl commented 4 years ago

Thanks for testing. This use of empy can be found in the first ten lines of Makefile.am in the data directory., and in several other makefiles in sugar-artwork, see https://github.com/sugarlabs/sugar-artwork/issues/111#issuecomment-527255737 for a diff. The command is a replacement for what is there. The command runs empy during build.

srevinsaju commented 4 years ago

On arch, it provides python-empy which does not create a executable, binary. For me adding this in the configure will make it good.

if python3 -m em --version; then echo empy found as Python module;
alias empy3='python3 -m em'; fi
quozl commented 4 years ago

Thanks @srevinsaju. I'm just curious; on Arch Linux, does the em.py file have execute bits set? I ask because the empy README gives two examples of use that would require execute bits.

srevinsaju commented 4 years ago

The em.py on Arch Linux is not executable. None of the python modules are executable. Where should I add this python3 -m em - -p $$ -D scaling=100 < gtkrc.em > sugar-100.gtkrc to test it?

quozl commented 4 years ago

The em.py on Arch Linux is not executable. None of the python modules are executable.

This goes against the Empy documentation, which gives a clear expectation that Empy is executable. Please report this bug against Arch Linux or Empy?

Where should I add this python3 -m em - -p $$ -D scaling=100 < gtkrc.em > sugar-100.gtkrc to test it?

This is very frustrating. I gave a complete reply to this in the thread Initial Release: Sugar packages 0.116 for Arch Linux. Did you miss it?