Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building from source #1996

Closed
Pysis868 opened this issue Dec 22, 2021 · 2 comments
Closed

Error building from source #1996

Pysis868 opened this issue Dec 22, 2021 · 2 comments

Comments

@Pysis868
Copy link

Pysis868 commented Dec 22, 2021

Describe the bug

Error during building/compilation.

Expected behavior

Compiles successfully. Binary installed in system directories.

Actual behavior

Make error.

To Reproduce

https://guake.readthedocs.io/en/latest/user/installing.html#install-from-source

It says error is in Makefile:93, but better seems to be with 95 having the python setup, since setup.cfg:35, under [options.data_files], share/guake/po contains the string po/*.mo that is probably causing the issue, since other Makefile lines use find in a for loop that should avoid this error.

https://setuptools.pypa.io/en/latest/deprecated/distutils/setupscript.html?highlight=data_files#installing-additional-files

I only found this relevant doc for that setuptools configuration key, recommending path relative syntax. The top of that document section under 2. Writing the Setup Script mentions some formatting.

I don't have a lot of experience with Python, especially with the packaging engine. Would a solution be to set this line to functional code instead of string literals, or did something not install correctly in my system?

> git clone --recursive (xclip -out)
......
> ./scripts/bootstrap-dev-fedora.sh
Install packages needed for execution
Last metadata expiration check: 0:38:40 ago on Wed 26 Jan 2022 11:30:26 AM EST.
Package python3-devel-3.10.1-3.fc35.x86_64 is already installed.
Package python3-cairo-1.20.1-1.fc35.x86_64 is already installed.
Package python3-dbus-1.2.18-2.fc35.x86_64 is already installed.
Package python3-pip-21.2.3-4.fc35.noarch is already installed.
Package keybinder3-0.3.2-12.fc35.x86_64 is already installed.
Package libwnck-2.31.0-17.fc35.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Install packages needed for making guake
Last metadata expiration check: 0:38:43 ago on Wed 26 Jan 2022 11:30:26 AM EST.
Package gettext-0.21-8.fc35.x86_64 is already installed.
Package gsettings-desktop-schemas-41.0-1.fc35.x86_64 is already installed.
Package make-1:4.3-6.fc35.x86_64 is already installed.
Package pandoc-2.14.0.3-14.fc35.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Install needed development packages
Last metadata expiration check: 0:38:46 ago on Wed 26 Jan 2022 11:30:26 AM EST.
Package dconf-editor-3.38.3-2.fc35.x86_64 is already installed.
Package glade-3.38.2-4.fc35.x86_64 is already installed.
Package poedit-3.0.1-1.fc35.x86_64 is already installed.
Package gnome-tweaks-40.0-4.fc35.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
> make
generating desktop files
Generating path.py...
generating po/ca.po
......
generating po/zh_TW.po
rm -f .../guake/guake/data/gschemas.compiled
glib-compile-schemas --strict .../guake/guake/data
Warning: Schema “guake” has path “/apps/guake/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
......
Warning: Schema “guake.hooks” has path “/apps/guake/hooks/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
# 'make' target, so users can install guake without need to install the 'dev' dependencies
> sudo make install
......
Warning: Schema “guake” has path “/apps/guake/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.general” has path “/apps/guake/general/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.style” has path “/apps/guake/style/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.style.font” has path “/apps/guake/style/font/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.style.background” has path “/apps/guake/style/background/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.keybindings” has path “/apps/guake/keybindings/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.keybindings.global” has path “/apps/guake/keybindings/global/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.keybindings.local” has path “/apps/guake/keybindings/local/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “guake.hooks” has path “/apps/guake/hooks/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
for f in $(find po -iname "*.mo"); do \
	l="${f%%.*}"; \
	lb=$(basename $l); \
	install -Dm644 "$f" "//usr/local/share/locale/$lb/LC_MESSAGES/guake.mo"; \
done;
# you probably want to execute this target with sudo:
# sudo make install
#############################################################

Installing from source on your system is not recommended.
Please prefer you application package manager (apt, yum, ...)

#############################################################
WARNING: The wheel package is not available.
WARNING: The wheel package is not available.
WARNING: The wheel package is not available.
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/guake
......
writing byte-compilation script '/tmp/tmpbolwnjai.py'
/usr/bin/python3 -Wignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning /tmp/tmpbolwnjai.py
removing /tmp/tmpbolwnjai.py
running install_data
creating /usr/local/share/guake/po
error: can't copy 'po/*.mo': doesn't exist or not a regular file

> find po -type f -iname '*.mo' | wc -l
26

> git bisect start
> git bisect bad
> git checkout 3.8.1
> sudo make install
(success)
> git bisect good
> git bisect run sudo make install
......
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 127, in build_package_data
    srcfile in self.distribution.convert_2to3_doctests):
AttributeError: 'Distribution' object has no attribute 'convert_2to3_doctests'
make: *** [Makefile:93: install-guake] Error 1
b2f7570cb4f0836cac9769426891581ffb8c6ad0 is the first bad commit
commit b2f7570cb4f0836cac9769426891581ffb8c6ad0
Author: Eli Schwartz <eschwartz@archlinux.org>
Date:   Thu Sep 9 01:14:55 2021 -0400

    setup.cfg: migrate more settings from pbr to built-in setuptools config
    
    In setuptools 2712 setuptools learned to natively
    support globbing data files, and the pbr setting to do the exact same thing is
    not needed anymore. Pin the minimum build requirement to ensure the correct
    version is used.

 setup.cfg | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
bisect run success

Found a different error, but may help explain why there is an error in the setuptools config file, since it was recently created.


> uname -a | xclip
Linux <hostname> 5.15.10-200.fc35.x86_64 #1 SMP Fri Dec 17 14:46:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
> cat /etc/*release
Fedora release 35 (Thirty Five)
NAME="Fedora Linux"
VERSION="35 (Workstation Edition)"
......
> git log --pretty=reference -1
6dc23f3 (Add release note file, 2021-12-20)
@eli-schwartz
Copy link
Collaborator

Support for globbing was added to setuptools in the same version of setuptools that is pinned as a build requirement in setup.cfg.

You may need to update that first. According to https://repology.org/project/python:setuptools/versions the version of setuptools packaged in fedora 35 is too old.

But, setuptools is supposed to inject newer versions of itself and run using that instead, just like it installs local versions of any other unsatisfied build requirement.

Using python-build and installer/pip may purportedly be a more reliable wheel creation method as they wrap setuptools and install build requirements in a virtualenv. 🤷 But the current setup.py install method works fine for me.

convert_2to3_doctests as an error seems more like a setuptools bug.

@Pysis868
Copy link
Author

It does seem to be working now:

> sudo make install
install -dm755                                       "//usr/local/share/applications"
install -Dm644 ".../guake/guake/data/guake.desktop"       "//usr/local/share/applications/"
Regex version mismatch, expected: 10.39 2021-10-29 actual: 10.37 2021-05-26
......
Regex version mismatch, expected: 10.39 2021-10-29 actual: 10.37 2021-05-26
if [ 1 = 1 ]; then glib-compile-schemas //usr/local/share/glib-2.0/schemas; fi
Warning: Schema “apps.fluxgui” has path “/apps/fluxgui/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
......
Warning: Schema “guake.hooks” has path “/apps/guake/hooks/”.  Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
for f in $(find po -iname "*.mo"); do \
	l="${f%%.*}"; \
	lb=$(basename $l); \
	install -Dm644 "$f" "//usr/local/share/locale/$lb/LC_MESSAGES/guake.mo"; \
done;
Regex version mismatch, expected: 10.39 2021-10-29 actual: 10.37 2021-05-26
......
Regex version mismatch, expected: 10.39 2021-10-29 actual: 10.37 2021-05-26
# you probably want to execute this target with sudo:
# sudo make install
#############################################################

Installing from source on your system is not recommended.
Please prefer you application package manager (apt, yum, ...)

#############################################################
/usr/local/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
WARNING: The wheel package is not available.
WARNING: The wheel package is not available.
running install
/usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running build
running build_py
copying guake/__init__.py -> build/lib/guake
copying guake/main.py -> build/lib/guake
copying guake/_version.py -> build/lib/guake
copying guake/paths.py -> build/lib/guake
running install_lib
byte-compiling /usr/local/lib/python3.10/site-packages/guake/paths.py to paths.cpython-310.pyc
byte-compiling /usr/local/lib/python3.10/site-packages/guake/_version.py to _version.cpython-310.pyc
byte-compiling /usr/local/lib/python3.10/site-packages/guake/main.py to main.cpython-310.pyc
byte-compiling /usr/local/lib/python3.10/site-packages/guake/__init__.py to __init__.cpython-310.pyc
writing byte-compilation script '/tmp/tmpadipnk6l.py'
/usr/bin/python3 /tmp/tmpadipnk6l.py
removing /tmp/tmpadipnk6l.py
running install_data
copying po/ca.mo -> /usr/local/share/guake/po
......
copying po/zh_TW.mo -> /usr/local/share/guake/po
running install_egg_info
running egg_info
warning: no files found matching 'guake'
writing manifest file 'guake.egg-info/SOURCES.txt'
Copying guake.egg-info to /usr/local/lib/python3.10/site-packages/guake-3.8.2.dev27+g6dc23f3-py3.10.egg-info
running install_scripts
removed 'build/lib/guake/paths.py'
......
removed directory 'build'
removed 'guake.egg-info/PKG-INFO'
removed 'guake.egg-info/dependency_links.txt'
removed 'guake.egg-info/entry_points.txt'
removed 'guake.egg-info/requires.txt'
removed 'guake.egg-info/top_level.txt'
removed 'guake.egg-info/pbr.json'
removed 'guake.egg-info/SOURCES.txt'
removed directory 'guake.egg-info'

> pip show guake
Name: guake
Version: 3.8.2.dev27+g6dc23f3
Summary: Guake Terminal
Home-page: https://github.com/Guake/guake
Author: Gaetan Semet
Author-email: gaetan@xeberon.net
License: UNKNOWN
Location: /usr/local/lib/python3.10/site-packages
Requires: 
Required-by:

> git log --format='reference' -1
6dc23f3 (Add release note file, 2021-12-20)

> pip show setuptools
Name: setuptools
Version: 60.5.0
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
Author-email: distutils-sig@python.org
License: UNKNOWN
Location: /usr/local/lib/python3.10/site-packages
Requires: 
Required-by: APScheduler, key-mapper, launchpadlib, lazr.restfulclient, lazr.uri, Paste, setools, wadllib

That version must be 57.5.0; not sure how to use 2712 =/.
I must have a newer version of that package like you said since my source is too old to include this new commit I just found that would also affect this area: d882f07#diff-fa602a8a75dc9dcc92261bac5f533c2a85e34fcceaff63b3a3a81d9acde2fc52

I probably had these issues without updated system versions because those commits were very new, although it does specify the requirement in the file, so not sure, but glad it's resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants