Learn more about these different git repos.
Other Git URLs
Try this:
$ fedpkg --release rawhide prep -- --define 'python_wheel_dir XXX' ... error: Macro %python_wheel_dir has empty body Could not execute prep: Failed to execute command.
With the debug output, we see what happens:
$ fedpkg --debug --verbose --release rawhide prep -- --define 'python_wheel_dir XXX' Creating repo object from /home/churchyard/rpmbuild/fedora-scm/python-virtualenv Not downloading already downloaded virtualenv-20.10.0.tar.gz Initiating a koji session to https://koji.fedoraproject.org/kojihub Extra args '['--define', 'python_wheel_dir XXX']' are passed to rpmbuild command Running: rpmbuild --define '_sourcedir /home/churchyard/rpmbuild/fedora-scm/python-virtualenv' --define '_specdir /home/churchyard/rpmbuild/fedora-scm/python-virtualenv' --define '_builddir /home/churchyard/rpmbuild/fedora-scm/python-virtualenv' --define '_srcrpmdir /home/churchyard/rpmbuild/fedora-scm/python-virtualenv' --define '_rpmdir /home/churchyard/rpmbuild/fedora-scm/python-virtualenv' --define '_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' --define 'dist %{?distprefix}.fc36' --define 'fedora 36' --eval '%undefine rhel' --define 'fc36 1' --eval '%undefine fc33' --define python_wheel_dir XXX --nodeps -bp /home/churchyard/rpmbuild/fedora-scm/python-virtualenv/python-virtualenv.spec error: Macro %python_wheel_dir has empty body Could not execute prep: Failed to execute command. Traceback (most recent call last): File "/usr/bin/fedpkg", line 33, in <module> sys.exit(load_entry_point('fedpkg==1.41', 'console_scripts', 'fedpkg')()) File "/usr/lib/python3.9/site-packages/fedpkg/__main__.py", line 87, in main sys.exit(client.args.command()) File "/usr/lib/python3.9/site-packages/pyrpkg/cli.py", line 2568, in prep self.cmd.prep(builddir=self.args.builddir, File "/usr/lib/python3.9/site-packages/pyrpkg/__init__.py", line 2967, in prep self._run_command(cmd, shell=True) File "/usr/lib/python3.9/site-packages/pyrpkg/__init__.py", line 1178, in _run_command raise rpkgError('Failed to execute command.') pyrpkg.errors.rpkgError: Failed to execute command.
Special attention to --define python_wheel_dir XXX, I would expect it to be --define 'python_wheel_dir XXX' as that is what I passed on the command line.
--define python_wheel_dir XXX
--define 'python_wheel_dir XXX'
A workaround is to escape the space:
$ fedpkg --release rawhide prep -- --define 'python_wheel_dir\ XXX'
I believe that at this point, everything is alright:
Extra args '['--define', 'python_wheel_dir XXX']' are passed to rpmbuild command
But later on, Commands. _run_command(shell=True) runs and it does ' '.join(cmd) which joins the individual parts of the command as strings.
Commands. _run_command(shell=True)
' '.join(cmd)
As a solution, I believe one of the two approaches might work:
shlex.join(cmd)
--define
shlex.join()
extra_args
cmd
Commit cfcaa85 fixes this issue
Thanks!
Commit 8cdc041 relates to this ticket
Metadata Update from @onosek: - Issue set to the milestone: 1.65
Login to comment on this ticket.