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

Restore bash completions #183

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Conversation

tamird
Copy link
Contributor

@tamird tamird commented Oct 16, 2024

05f9481 removed these as the shortest
path to preserving hermeticity of the build, but this solution was
overly aggressive. Restore the bash completions (and the config file) by
placing them in directories inside the package (rather than
system-wide).

Downstream distro packaging can move place the content of ./etc/ in
/etc/ and ./share/ in /usr/share/.

See #181.

setup.py Outdated Show resolved Hide resolved
@matttbe
Copy link
Collaborator

matttbe commented Oct 16, 2024

Please see my comment here: maybe it is fine to have an extra step for the bash completions stuff when installed from pip or similar. Because from what I understand here, the files will be generated, but very likely not used when installed in this location, no? In this case, maybe no need to generate them, but suggest (in the README?) running an extra command (or more) to set that up directly where needed, no?

There is also the issue with the config file: can it not be installed in a "shared" directory? e.g. the ones suggested by: https://pypi.org/project/platformdirs/

@tamird
Copy link
Contributor Author

tamird commented Oct 16, 2024

Please see my comment here: maybe it is fine to have an extra step for the bash completions stuff when installed from pip or similar. Because from what I understand here, the files will be generated, but very likely not used when installed in this location, no? In this case, maybe no need to generate them, but suggest (in the README?) running an extra command (or more) to set that up directly where needed, no?

I'm trying to keep this as close to the original logic as possible.

There is also the issue with the config file: can it not be installed in a "shared" directory? e.g. the ones suggested by: https://pypi.org/project/platformdirs/

I'm not going to change that here. Sounds unrelated to the breakage this is seeking to fix.

@hramrach
Copy link
Contributor

The point of installing bash-completion and the config file is to install them in the location where they are expected.

If they are installed somewhere 'private' that dos not address the problem caused by 'buildsystem modernization'.

@tamird
Copy link
Contributor Author

tamird commented Oct 16, 2024

This is addressed in the PR description:

Downstream distro packaging can move place the content of ./etc/ in
/etc/ and ./share/ in /usr/share/.

I don't know of a path toward hermetic builds that doesn't require coordination with distro packaging. If you do, please let us know.

@arighi
Copy link
Owner

arighi commented Oct 17, 2024

        File "/tmp/pip-build-env-qhrseqck/overlay/bin/register-python-argcomplete", line 5, in <module>
          from argcomplete.scripts.register_python_argcomplete import main
      ModuleNotFoundError: No module named 'argcomplete.scripts'

I'm getting this if I try to build virtme-ng with this change on Arch.

@tamird
Copy link
Contributor Author

tamird commented Oct 17, 2024

        File "/tmp/pip-build-env-qhrseqck/overlay/bin/register-python-argcomplete", line 5, in <module>
          from argcomplete.scripts.register_python_argcomplete import main
      ModuleNotFoundError: No module named 'argcomplete.scripts'

I'm getting this if I try to build virtme-ng with this change on Arch.

How are you building it?

@tamird
Copy link
Contributor Author

tamird commented Oct 17, 2024

Versions of python, pip, would be helpful to know as well.

@arighi
Copy link
Owner

arighi commented Oct 17, 2024

VNG_PACKAGE=1 BUILD_VIRTME_NG_INIT=1 pip install --break-system-packages .

This reverts commit 18b5f15, reversing
changes made to fedefac.
@tamird tamird force-pushed the restore-bash-completions branch from 0b82767 to f23966a Compare October 17, 2024 15:18
@arighi
Copy link
Owner

arighi commented Oct 17, 2024

Versions of python, pip, would be helpful to know as well.

arighi@gpd3~> python --version
Python 3.12.7
arighi@gpd3~> pip --version
pip 24.2 from /usr/lib/python3.12/site-packages/pip (python 3.12)

@tamird tamird force-pushed the restore-bash-completions branch from f23966a to 907bb11 Compare October 17, 2024 15:32
@tamird
Copy link
Contributor Author

tamird commented Oct 17, 2024

I see. This should be fixed now.

tamird@Tamirs-MacBook-Pro src % python3 -m venv virtme-venv
tamird@Tamirs-MacBook-Pro src % source virtme-venv/bin/activate
(virtme-venv) tamird@Tamirs-MacBook-Pro src % cd virtme-ng                   
(virtme-venv) tamird@Tamirs-MacBook-Pro virtme-ng % VNG_PACKAGE=1 BUILD_VIRTME_NG_INIT=1 pip install .

The solution was to use argparse as a library instead of a binary; I guess pip doesn't install binstubs during setup.py.

@tamird tamird force-pushed the restore-bash-completions branch 2 times, most recently from 484deaf to ec96058 Compare October 18, 2024 01:05
@tamird
Copy link
Contributor Author

tamird commented Oct 18, 2024

Thinking about this more I think we can possibly restore the --break-system-packages behavior. It just won't work in a hermetic build, but that's ok. See the updated commit message.

@hramrach
Copy link
Contributor

[ 2s] -----------------------------------------------------------------
[ 2s] ----- building virtme.spec (user abuild)
[ 2s] -----------------------------------------------------------------
[ 2s] -----------------------------------------------------------------
[ 2s] WARNING could not set SOURCE_DATE_EPOCH, ensure mtime is in $TOPDIR/SOURCES/_scmsync.obsinfo or BUILD_CHANGELOG_TIMESTAMP is set in /.buildenv
[ 2s] WARNING could not set SOURCE_DATE_EPOCH, ensure BUILD_RELEASE is set in /.buildenv
[ 2s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature --define '_build_create_debug 1' /home/abuild/rpmbuild/SOURCES/virtme.spec
[ 2s] Executing(%prep): /usr/bin/bash -e /var/tmp/rpm-tmp.ldVhFn
[ 2s] + umask 022
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + rm -rf virtme-ng-1.29+git58.ec96058
[ 2s] + /usr/lib/rpm/rpmuncompress -x /home/abuild/rpmbuild/SOURCES/virtme-ng-1.29+git58.ec96058.tar.xz
[ 2s] + STATUS=0
[ 2s] + '[' 0 -ne 0 ']'
[ 2s] + cd virtme-ng-1.29+git58.ec96058
[ 2s] + rm -rf /home/abuild/rpmbuild/BUILD/virtme-ng-1.29+git58.ec96058-SPECPARTS
[ 2s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILD/virtme-ng-1.29+git58.ec96058-SPECPARTS
[ 2s] + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
[ 2s] + RPM_EC=0
[ 2s] ++ jobs -p
[ 2s] + exit 0
[ 2s] Executing(%build): /usr/bin/bash -e /var/tmp/rpm-tmp.8OYbcR
[ 2s] + umask 022
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64
[ 2s] ++ dirname /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64
[ 2s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[ 2s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64
[ 2s] + cd virtme-ng-1.29+git58.ec96058
[ 2s] ++ '[' -f _current_flavor ']'
[ 2s] ++ true
[ 2s] + last_flavor=
[ 2s] + '[' -z '' ']'
[ 2s] + last_flavor=tmp
[ 2s] + '[' tmp '!=' python3 ']'
[ 2s] + '[' -d build ']'
[ 2s] + '[' -d _build.python3 ']'
[ 2s] + echo python3
[ 2s] + python_flavor=python3
[ 2s] + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
[ 2s] running build
[ 2s] running build_py
[ 2s] running build_manpages
[ 2s] generating man/vng.1
[ 2s] BUILD_VIRTME_NG_INIT: 0
[ 2s] creating build
[ 2s] creating build/lib
[ 2s] creating build/lib/virtme_ng
[ 2s] copying virtme_ng/init.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/mainline.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/run.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/spinner.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/utils.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/version.py -> build/lib/virtme_ng
[ 2s] creating build/lib/virtme
[ 2s] copying virtme/init.py -> build/lib/virtme
[ 2s] copying virtme/architectures.py -> build/lib/virtme
[ 2s] copying virtme/cpiowriter.py -> build/lib/virtme
[ 2s] copying virtme/mkinitramfs.py -> build/lib/virtme
[ 2s] copying virtme/modfinder.py -> build/lib/virtme
[ 2s] copying virtme/qemu_helpers.py -> build/lib/virtme
[ 2s] copying virtme/resources.py -> build/lib/virtme
[ 2s] copying virtme/util.py -> build/lib/virtme
[ 2s] copying virtme/virtmods.py -> build/lib/virtme
[ 2s] creating build/lib/virtme/commands
[ 2s] copying virtme/commands/init.py -> build/lib/virtme/commands
[ 2s] copying virtme/commands/configkernel.py -> build/lib/virtme/commands
[ 2s] copying virtme/commands/mkinitramfs.py -> build/lib/virtme/commands
[ 2s] copying virtme/commands/run.py -> build/lib/virtme/commands
[ 2s] creating build/lib/virtme/guest
[ 2s] copying virtme/guest/init.py -> build/lib/virtme/guest
[ 2s] running egg_info
[ 2s] creating virtme_ng.egg-info
[ 2s] writing virtme_ng.egg-info/PKG-INFO
[ 2s] writing dependency_links to virtme_ng.egg-info/dependency_links.txt
[ 2s] writing entry points to virtme_ng.egg-info/entry_points.txt
[ 2s] writing requirements to virtme_ng.egg-info/requires.txt
[ 2s] writing top-level names to virtme_ng.egg-info/top_level.txt
[ 2s] writing manifest file 'virtme_ng.egg-info/SOURCES.txt'
[ 2s] reading manifest file 'virtme_ng.egg-info/SOURCES.txt'
[ 2s] adding license file 'LICENSE'
[ 2s] writing manifest file 'virtme_ng.egg-info/SOURCES.txt'
[ 2s] copying virtme/guest/virtme-init -> build/lib/virtme/guest
[ 2s] copying virtme/guest/virtme-snapd-script -> build/lib/virtme/guest
[ 2s] copying virtme/guest/virtme-sound-script -> build/lib/virtme/guest
[ 2s] copying virtme/guest/virtme-udhcpc-script -> build/lib/virtme/guest
[ 2s] running build_scripts
[ 2s] creating build/scripts-3.11
[ 2s] copying bin/virtme-prep-kdir-mods -> build/scripts-3.11
[ 2s] + find . -name pycache -type d -exec rm -fr '{}' +
[ 2s] + RPM_EC=0
[ 2s] ++ jobs -p
[ 2s] + exit 0
[ 2s] Executing(%install): /usr/bin/bash -e /var/tmp/rpm-tmp.tHgApQ
[ 2s] + umask 022
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64
[ 2s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[ 2s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64
[ 2s] + cd virtme-ng-1.29+git58.ec96058
[ 2s] + export PYTHONDONTWRITEBYTECODE=1
[ 2s] + PYTHONDONTWRITEBYTECODE=1
[ 2s] ++ '[' -f _current_flavor ']'
[ 2s] ++ cat _current_flavor
[ 2s] + last_flavor=python3
[ 2s] + '[' -z python3 ']'
[ 2s] + '[' python3 '!=' python3 ']'
[ 2s] + echo python3
[ 2s] + python_flavor=python3
[ 2s] + myargs=
[ 2s] + /usr/bin/python3 setup.py install -O1 --skip-build --force --root /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64 --prefix /usr
[ 2s] running install
[ 2s] /usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
[ 2s] !!
[ 2s]
[ 2s] ********************************************************************************
[ 2s] Please avoid running setup.py directly.
[ 2s] Instead, use pypa/build, pypa/installer or other
[ 2s] standards-based tools.
[ 2s]
[ 2s] See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
[ 2s] ********************************************************************************
[ 2s]
[ 2s] !!
[ 2s] self.initialize_options()
[ 2s] running install_lib
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/mainline.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/run.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/spinner.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/utils.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/version.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/architectures.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/cpiowriter.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/mkinitramfs.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/modfinder.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/qemu_helpers.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/resources.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/util.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/virtmods.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/configkernel.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/mkinitramfs.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/run.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-init -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-snapd-script -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-sound-script -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-udhcpc-script -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] warning: install_lib: byte-compiling is disabled, skipping.
[ 2s]
[ 2s] running install_data
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/etc
[ 2s] copying cfg/virtme-ng.conf -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/etc
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/share
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/share/bash-completion
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/share/bash-completion/completions
[ 2s] copying virtme-ng-prompt -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/share/bash-completion/completions
[ 2s] copying vng-prompt -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/share/bash-completion/completions
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/share/man
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.ec96058-0.x86_64/usr/share/man/man1
[ 2s] error: can't copy 'vng.1': doesn't exist or not a regular file

05f9481 removed these as the shortest
path to preserving hermeticity of the build, but this solution was
overly aggressive. Restore the bash completions to their previous
locations. This should place them in system-global locations when built
with `--break-system-packages` while otherwise preserving hermiticity.

In a hermetic build these files end up in the venv's site-packages:
```
tamird@Tamirs-MacBook-Pro src % python3 -m venv virtme-venv
tamird@Tamirs-MacBook-Pro src % source virtme-venv/bin/activate
(virtme-venv) tamird@Tamirs-MacBook-Pro src % cd virtme-ng
(virtme-venv) tamird@Tamirs-MacBook-Pro virtme-ng % VNG_PACKAGE=1 BUILD_VIRTME_NG_INIT=1 pip install .
Processing /Users/tamird/src/virtme-ng
[snip]
(virtme-venv) tamird@Tamirs-MacBook-Pro virtme-ng % cd ../virtme-venv
(virtme-venv) tamird@Tamirs-MacBook-Pro virtme-venv % ls lib/python3.13/site-packages/{etc,usr/share}
lib/python3.13/site-packages/etc:
total 8
drwxr-xr-x   3 tamird  staff    96B Oct 17 21:01 .
drwxr-xr-x  26 tamird  staff   832B Oct 17 21:01 ..
-rw-r--r--   1 tamird  staff    33B Oct 17 21:01 virtme-ng.conf

lib/python3.13/site-packages/usr/share:
total 0
drwxr-xr-x  4 tamird  staff   128B Oct 17 21:01 .
drwxr-xr-x  3 tamird  staff    96B Oct 17 21:01 ..
drwxr-xr-x  3 tamird  staff    96B Oct 17 21:01 bash-completion
drwxr-xr-x  3 tamird  staff    96B Oct 17 21:01 man
```
@tamird
Copy link
Contributor Author

tamird commented Oct 18, 2024

@hramrach thanks. should be fixed now.

@tamird tamird force-pushed the restore-bash-completions branch from ec96058 to 0cf73c3 Compare October 18, 2024 10:54
@arighi
Copy link
Owner

arighi commented Oct 18, 2024

@tamird this one seems to work also for me, good job!

I'd still prefer to tag a new release without this PR, then merge this and then see if we need to fix other cases.

@tamird
Copy link
Contributor Author

tamird commented Oct 18, 2024

Sounds good, thanks.

@hramrach
Copy link
Contributor

hramrach commented Oct 18, 2024

I tried to add back the detection if argparse-manpage is available hramrach@96f7e40 but now its unavailability also breaks bash completion:

[ 1s] -----------------------------------------------------------------
[ 1s] ----- building virtme.spec (user abuild)
[ 1s] -----------------------------------------------------------------
[ 1s] -----------------------------------------------------------------
[ 2s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature --define '_build_create_debug 1' /home/abuild/rpmbuild/SOURCES/virtme.spec
[ 2s] setting SOURCE_DATE_EPOCH=1729252800
[ 2s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.BT4wtM
[ 2s] + umask 022
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + rm -rf virtme-ng-1.29+git58.0cf73c3
[ 2s] + /usr/bin/xz -dc /home/abuild/rpmbuild/SOURCES/virtme-ng-1.29+git58.0cf73c3.tar.xz
[ 2s] + /usr/bin/tar -xof -
[ 2s] + STATUS=0
[ 2s] + '[' 0 -ne 0 ']'
[ 2s] + cd virtme-ng-1.29+git58.0cf73c3
[ 2s] + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
[ 2s] + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch
[ 2s] + /usr/bin/cat /home/abuild/rpmbuild/SOURCES/fix-no-man.patch
[ 2s] + exit 0
[ 2s] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.6he7KR
[ 2s] + umask 022
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64
[ 2s] ++ dirname /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64
[ 2s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[ 2s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64
[ 2s] + cd virtme-ng-1.29+git58.0cf73c3
[ 2s] ++ '[' -f _current_flavor ']'
[ 2s] ++ true
[ 2s] + last_flavor=
[ 2s] + '[' -z '' ']'
[ 2s] + last_flavor=tmp
[ 2s] + '[' tmp '!=' python311 ']'
[ 2s] + '[' -d build ']'
[ 2s] + '[' -d _build.python311 ']'
[ 2s] + echo python311
[ 2s] + python_flavor=python311
[ 2s] + /usr/bin/python3.11 setup.py build '--executable=/usr/bin/python3.11 -s'
[ 2s] running build
[ 2s] running build_py
[ 2s] creating build
[ 2s] creating build/lib
[ 2s] creating build/lib/virtme_ng
[ 2s] copying virtme_ng/init.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/mainline.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/run.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/spinner.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/utils.py -> build/lib/virtme_ng
[ 2s] copying virtme_ng/version.py -> build/lib/virtme_ng
[ 2s] creating build/lib/virtme
[ 2s] copying virtme/init.py -> build/lib/virtme
[ 2s] copying virtme/architectures.py -> build/lib/virtme
[ 2s] copying virtme/cpiowriter.py -> build/lib/virtme
[ 2s] copying virtme/mkinitramfs.py -> build/lib/virtme
[ 2s] copying virtme/modfinder.py -> build/lib/virtme
[ 2s] copying virtme/qemu_helpers.py -> build/lib/virtme
[ 2s] copying virtme/resources.py -> build/lib/virtme
[ 2s] copying virtme/util.py -> build/lib/virtme
[ 2s] copying virtme/virtmods.py -> build/lib/virtme
[ 2s] creating build/lib/virtme/commands
[ 2s] copying virtme/commands/init.py -> build/lib/virtme/commands
[ 2s] copying virtme/commands/configkernel.py -> build/lib/virtme/commands
[ 2s] copying virtme/commands/mkinitramfs.py -> build/lib/virtme/commands
[ 2s] copying virtme/commands/run.py -> build/lib/virtme/commands
[ 2s] creating build/lib/virtme/guest
[ 2s] copying virtme/guest/init.py -> build/lib/virtme/guest
[ 2s] running egg_info
[ 2s] creating virtme_ng.egg-info
[ 2s] writing virtme_ng.egg-info/PKG-INFO
[ 2s] writing dependency_links to virtme_ng.egg-info/dependency_links.txt
[ 2s] writing entry points to virtme_ng.egg-info/entry_points.txt
[ 2s] writing requirements to virtme_ng.egg-info/requires.txt
[ 2s] writing top-level names to virtme_ng.egg-info/top_level.txt
[ 2s] writing manifest file 'virtme_ng.egg-info/SOURCES.txt'
[ 2s] reading manifest file 'virtme_ng.egg-info/SOURCES.txt'
[ 2s] adding license file 'LICENSE'
[ 2s] writing manifest file 'virtme_ng.egg-info/SOURCES.txt'
[ 2s] copying virtme/guest/virtme-init -> build/lib/virtme/guest
[ 2s] copying virtme/guest/virtme-snapd-script -> build/lib/virtme/guest
[ 2s] copying virtme/guest/virtme-sound-script -> build/lib/virtme/guest
[ 2s] copying virtme/guest/virtme-udhcpc-script -> build/lib/virtme/guest
[ 2s] running build_scripts
[ 2s] creating build/scripts-3.11
[ 2s] copying bin/virtme-prep-kdir-mods -> build/scripts-3.11
[ 2s] + find . -name pycache -type d -exec rm -fr '{}' +
[ 2s] + exit 0
[ 2s] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.bAR3XX
[ 2s] + umask 022
[ 2s] + cd /home/abuild/rpmbuild/BUILD
[ 2s] + cd virtme-ng-1.29+git58.0cf73c3
[ 2s] + export PYTHONDONTWRITEBYTECODE=1
[ 2s] + PYTHONDONTWRITEBYTECODE=1
[ 2s] ++ '[' -f _current_flavor ']'
[ 2s] ++ cat _current_flavor
[ 2s] + last_flavor=python311
[ 2s] + '[' -z python311 ']'
[ 2s] + '[' python311 '!=' python311 ']'
[ 2s] + echo python311
[ 2s] + python_flavor=python311
[ 2s] + myargs=
[ 2s] + /usr/bin/python3.11 setup.py install -O1 --skip-build --force --root /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64 --prefix /usr
[ 2s] running install
[ 2s] /usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
[ 2s] !!
[ 2s]
[ 2s] ********************************************************************************
[ 2s] Please avoid running setup.py directly.
[ 2s] Instead, use pypa/build, pypa/installer, pypa/build or
[ 2s] other standards-based tools.
[ 2s]
[ 2s] See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
[ 2s] ********************************************************************************
[ 2s]
[ 2s] !!
[ 2s] self.initialize_options()
[ 2s] running install_lib
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/mainline.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/run.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/spinner.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/utils.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] copying build/lib/virtme_ng/version.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme_ng
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/architectures.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/cpiowriter.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/mkinitramfs.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/modfinder.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/qemu_helpers.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/resources.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/util.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] copying build/lib/virtme/virtmods.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/configkernel.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/mkinitramfs.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] copying build/lib/virtme/commands/run.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/commands
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/init.py -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-init -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-snapd-script -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-sound-script -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] copying build/lib/virtme/guest/virtme-udhcpc-script -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/lib/python3.11/site-packages/virtme/guest
[ 2s] warning: install_lib: byte-compiling is disabled, skipping.
[ 2s]
[ 2s] running install_data
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/etc
[ 2s] copying cfg/virtme-ng.conf -> /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/etc
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/share
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/share/bash-completion
[ 2s] creating /home/abuild/rpmbuild/BUILDROOT/virtme-1.29+git58.0cf73c3-0.x86_64/usr/share/bash-completion/completions
[ 2s] error: can't copy 'virtme-ng-prompt': doesn't exist or not a regular file
[ 2s] error: Bad exit status from /var/tmp/rpm-tmp.bAR3XX (%install)

@tamird
Copy link
Contributor Author

tamird commented Oct 18, 2024

Why do you need detection? setup.py specifies argparse as a build dependency, why isn't it always available?

@tamird
Copy link
Contributor Author

tamird commented Oct 18, 2024

Your detection logic is incorrect, you've skipped the entire BuildPy implementation, so you're also not building virtme-ng-init nor generating completion scripts.

@hramrach
Copy link
Contributor

Why is get_build_py_cmd imported from build_manpages?

Sure, stuff that should be built isn't because of that when build_manpages is unavailable, that's the problem.

@arighi
Copy link
Owner

arighi commented Oct 18, 2024

Alright v1.31 is out, so let's merge this and fix other potential breakage in tree.

@arighi arighi merged commit cefbab5 into arighi:main Oct 18, 2024
4 checks passed
@tamird tamird deleted the restore-bash-completions branch October 18, 2024 13:50
@hramrach
Copy link
Contributor

Can the argparse-manpage still work with this build system?

@hramrach
Copy link
Contributor

detection

@hramrach
Copy link
Contributor

Addressed in #186

I suppose it might make sense to release this as well to get wider testing and see if there are any remaining issues.

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

Successfully merging this pull request may close these issues.

4 participants