kevinconway / rpmvenv Goto Github PK
View Code? Open in Web Editor NEWRPM packager for Python virtualenv.
License: MIT License
RPM packager for Python virtualenv.
License: MIT License
Hi there!
I found some weird behavior when I tried to build my python package. Without any changes in a configuration file build can randomly fail. After some investigations I decided to look into the generated spec file.
Pay attention to the following output of rpmvenv --spec
command with the same configuration file:
First run:
# Macros
%define venv_cmd virtualenv --always-copy --python=/opt/python38/bin/python3.8
%define venv_name test-venv
%define venv_install_dir /opt/%{venv_name}
%define venv_dir %{buildroot}/%{venv_install_dir}
%define venv_bin %{venv_dir}/bin
%define venv_python %{venv_bin}/python
%define venv_pip %{venv_python} %{venv_bin}/pip install
%define __prelink_undo_cmd %{nil}
# Globals
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Tags
Name: test-rpmvenv-package
Version: 0.1a
Release: 1
BuildRoot: %(mktemp -ud %{_tmppath}/%{SOURCE0}-%{version}-%{release}-XXXXXX)
Requires: python38, systemd
Summary: blahblah
Group: Application/System
License: Proprietary
Url: https://example.com
Source0: /home/homier/Documents/test
AutoReq: No
AutoProv: No
# Blocks
%prep
rm -rf %{buildroot}/*
mkdir -p %{buildroot}/%{venv_install_dir}
%clean
rm -rf %{buildroot}
%install
pathfix.py -pni "%{venv_install_dir}/bin/python3.8 %{py3_shbang_opts}" %{venv_dir}/lib/python3.8/site-packages/ %{venv_bin}/*
%{venv_cmd} %{venv_dir}
cd %{SOURCE0}
%{venv_pip} -r requirements.txt
cd -
find %{venv_dir} -type d -name "__pycache__" -print0 | xargs -0 rm -rf
# RECORD files are used by wheels for checksum. They contain path names which
# match the buildroot and must be removed or the package will fail to build.
find %{buildroot} -name "RECORD" -exec rm -rf {} \;
# Change the virtualenv path to the target installation direcotry.
venvctrl-relocate --source=%{venv_dir} --destination=/%{venv_install_dir}
%description
Blahblah
%files
/%{venv_install_dir}
Second run:
# Macros
%define venv_cmd virtualenv --always-copy --python=/opt/python38/bin/python3.8
%define venv_name test-venv
%define venv_install_dir /opt/%{venv_name}
%define venv_dir %{buildroot}/%{venv_install_dir}
%define venv_bin %{venv_dir}/bin
%define venv_python %{venv_bin}/python
%define venv_pip %{venv_python} %{venv_bin}/pip install
%define __prelink_undo_cmd %{nil}
# Globals
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Tags
AutoReq: No
AutoProv: No
Name: test-rpmvenv-package
Version: 0.1a
Release: 1
BuildRoot: %(mktemp -ud %{_tmppath}/%{SOURCE0}-%{version}-%{release}-XXXXXX)
Requires: python38, systemd
Summary: blahblah
Group: Application/System
License: Proprietary
Url: https://example.com
Source0: /home/homier/Documents/test
# Blocks
%install
pathfix.py -pni "%{venv_install_dir}/bin/python3.8 %{py3_shbang_opts}" %{venv_dir}/lib/python3.8/site-packages/ %{venv_bin}/*
%{venv_cmd} %{venv_dir}
cd %{SOURCE0}
%{venv_pip} -r requirements.txt
cd -
find %{venv_dir} -type d -name "__pycache__" -print0 | xargs -0 rm -rf
# RECORD files are used by wheels for checksum. They contain path names which
# match the buildroot and must be removed or the package will fail to build.
find %{buildroot} -name "RECORD" -exec rm -rf {} \;
# Change the virtualenv path to the target installation direcotry.
venvctrl-relocate --source=%{venv_dir} --destination=/%{venv_install_dir}
%description
Blahblah
%prep
mkdir -p %{buildroot}/%{venv_install_dir}
rm -rf %{buildroot}/*
%files
/%{venv_install_dir}
%clean
rm -rf %{buildroot}
And the third run:
# Macros
%define venv_cmd virtualenv --always-copy --python=/opt/python38/bin/python3.8
%define venv_name test-venv
%define venv_install_dir /opt/%{venv_name}
%define venv_dir %{buildroot}/%{venv_install_dir}
%define venv_bin %{venv_dir}/bin
%define venv_python %{venv_bin}/python
%define venv_pip %{venv_python} %{venv_bin}/pip install
%define __prelink_undo_cmd %{nil}
# Globals
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Tags
AutoReq: No
AutoProv: No
Name: test-rpmvenv-package
Version: 0.1a
Release: 1
BuildRoot: %(mktemp -ud %{_tmppath}/%{SOURCE0}-%{version}-%{release}-XXXXXX)
Requires: python38, systemd
Summary: blahblah
Group: Application/System
License: Proprietary
Url: https://example.com
Source0: /home/homier/Documents/test
# Blocks
%prep
mkdir -p %{buildroot}/%{venv_install_dir}
rm -rf %{buildroot}/*
%files
/%{venv_install_dir}
%install
%{venv_cmd} %{venv_dir}
cd %{SOURCE0}
%{venv_pip} -r requirements.txt
cd -
find %{venv_dir} -type d -name "__pycache__" -print0 | xargs -0 rm -rf
# RECORD files are used by wheels for checksum. They contain path names which
# match the buildroot and must be removed or the package will fail to build.
find %{buildroot} -name "RECORD" -exec rm -rf {} \;
# Change the virtualenv path to the target installation direcotry.
venvctrl-relocate --source=%{venv_dir} --destination=/%{venv_install_dir}
pathfix.py -pni "%{venv_install_dir}/bin/python3.8 %{py3_shbang_opts}" %{venv_dir}/lib/python3.8/site-packages/ %{venv_bin}/*
%clean
rm -rf %{buildroot}
%description
Blahblah
Look at the install
and pre
blocks. The ordering of commands to be executed is completely random. It doesn't make any sense to create a buildroot directory and then delete it immediately. Also since I need to fix shebangs inside python files, I passed pathfix.py command to {"blocks": "install": []}
expecting it would be executed in the end of installation, not in the beginning.
Environment:
OS - Fedora 31, CentOS 8
Python version - python 3.7, python 3.8
Hi,
I want to add in spec file a service description like this:
https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Systemd
how to do this ?
Hi,
We'd like to use rpmvenv to install a number of packages listed in a requirements file without the need for a setup.py file. The use-case is to install circus in a virtual env and symlink the command line utilities to the usr bin dir. rpmvenv seems ideal for this however at the moment we have to create a dummy setup.py file in order for it to work.
What are your thoughts on making this part optional and allowing just the use of the requirements file?
Thanks
Colin
Hello,
I don't have a deep knowledge about python.
How can i get the executable command rpmenv from your source code?
Thanks
I tried to see if this was reported but couldn't. Also already tried with QA_SKIP_BUILD_ROOT=1 and strip_binaries: false
Config:
{
"extensions": {
"enabled": [
"python_venv",
"blocks"
]
},
"core": {
"group": "Application/System",
"license": "MIT",
"name": "some-rpm-package-name",
"summary": "short package summary",
"version": "1.2.3"
},
"python_venv": {
"require_setup_py": false,
"name": "name_of_venv_dir_to_create",
"path": "/path/where/to/install/venv",
"strip_binaries": false
},
"blocks": {
"desc": [
"some long package description",
"each array element is a new line"
]
}
}
Error:
...
Successfully installed PyYAML-3.13 certifi-2018.10.15 chardet-3.0.4 gevent-1.3.7 greenlet-0.4.15 grequests-0.3.0 idna-2.7 pprint-0.1 requests-2.20.1 urllib3-1.24.1
RPM build errors:
Symlink points to BuildRoot: /path/where/to/install/venv/name_of_venv_dir_to_create/lib64 -> /tmp/rpmvenv4y1Ddb/BUILDROOT/some-rpm-package-name-1.2.3-1.x86_64/path/where/to/install/venv/name_of_venv_dir_to_create/lib
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenv4y1Ddb' /tmp/rpmvenv4y1Ddb/SOURCES/package.spec.
This is on Centos7
$ rpmbuild --version
RPM version 4.11.3
The command I'm using is:
QA_SKIP_BUILD_ROOT=1 rpmvenv ./foo.config.json --verbose
Any ideas?
Using the example the rpm is not build because all files from the virtualenv are unpackaged file(s). I also don't see in the sprec file that they are included.
What do I mess?
spec-file:
%define venv_cmd virtualenv --always-copy
%define venv_name virtualenv
%define venv_install_dir /opt/Scripts/%{venv_name}
%define venv_dir %{buildroot}/%{venv_install_dir}
%define venv_bin %{venv_dir}/bin
%define venv_python %{venv_bin}/python
%define venv_pip %{venv_python} %{venv_bin}/pip install
%define __prelink_undo_cmd %{nil}
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]/brp-python-bytecompile[[:space:]].$!!g')
AutoReq: No
AutoProv: No
Name: vmwarescripts
Version: 1.2.3
Release: 1
BuildRoot: %(mktemp -ud %{_tmppath}/%{SOURCE0}-%{version}-%{release}-XXXXXX)
Summary: short package summary
Group: Application/System
License: MIT
Source0: /dev/vmware_scripts
%prep
mkdir -p %{buildroot}/%{venv_install_dir}
rm -rf %{buildroot}/*
%clean
rm -rf %{buildroot}
%files
/%{venv_install_dir}
%description
some long package description
each array element is a new line
%install
%{venv_cmd} %{venv_dir}
%{venv_pip} -r %{SOURCE0}/requirements.txt
cd %{SOURCE0}
%{venv_python} setup.py install
cd -
find %{buildroot} -name "RECORD" -exec rm -rf {} ;
venvctrl-relocate --source=%{venv_dir} --destination=/%{venv_install_dir}
find %{venv_dir}/lib -type f -name "*.so" | xargs -r strip
Hello! Thanks for rpmvenv !
I try pack apache-airflow to rpm with all dependencies
sudo yum -y install epel-release rpmdevtools wget
sudo yum -y install python3-pip
pip3 install --user rpmvenv
pip3 install --user virtualenv
wget https://raw.githubusercontent.com/apache/airflow/constraints-1.10.12/constraints-3.6.txt
mv constraints-3.6.txt requirements.txt
echo "{}" > conf.json && \
LC_ALL=en_US.UTF-8 rpmvenv conf.json \
--core_name="apache-airflow" \
--core_version="1.10.14" \
--core_license="ASL 2.0" \
--core_summary="apache-airflow" \
--extensions_enabled="blocks,python_venv" \
--python_venv_name="apache-airflow" \
--blocks_desc="apache-airflow" \
--python_venv_require_setup_py="false"
Error
mysqlclient_355a493b594d461ab5d88bfdbf320ed5/setup_posix.py", line 28, in mysql_config\n raise EnvironmentError("%s not found" % (mysql_config.path,))\n OSError: mysql_config not found\n ----------------------------------------\nERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\nerror: Bad exit status from /var/tmp/rpm-tmp.XDwsOJ (%install)\n Bad exit status from /var/tmp/rpm-tmp.XDwsOJ (%install)\n'.
Have user and group airflow
[airflow@airflow ~]$ id
uid=1000(airflow) gid=1000(airflow) groups=1000(airflow)
Install package
sudo yum install -y python3-devel python3-pip gcc gcc-c++ cyrus-sasl-devel krb5-devel
sudo yum -y install epel-release rpmdevtools wget
Install rpmvenv
pip3 install --user rpmvenv
pip3 install --user virtualenv
Create requirements.txt
Create rpm
echo "{}" > conf.json && \
LC_ALL=en_US.UTF-8 rpmvenv conf.json \
--core_name="apache-airflow" \
--core_version="1.10.12" \
--core_license="ASL 2.0" \
--core_summary="apache-airflow" \
--extensions_enabled="blocks,python_venv" \
--python_venv_name="apache-airflow" \
--python_venv_path="/home/airflow" \
--blocks_desc="apache-airflow" \
--python_venv_require_setup_py="false" \
--file_permissions_user="airflow" \
--file_permissions_group="airflow"
Install rpm. After install rpm.
[airflow@airflow ~]$ ls -l /home/airflow/apache-airflow
total 20
-rw-r--r-- 1 root root 11340 Jan 25 10:09 LICENSE
drwxr-xr-x 3 root root 4096 Jan 25 10:20 bin
drwxr-xr-x 3 root root 31 Jan 25 10:20 etc
drwxr-xr-x 3 root root 23 Jan 25 10:20 lib
drwxr-xr-x 3 root root 23 Jan 25 10:21 lib64
-rw-r--r-- 1 root root 201 Jan 25 10:07 pyvenv.cfg
How change permission?
Thanks!
Dear Kevin,
It seems that libraries (.so) cannot be reliably stripped:
135: 'find %{venv_dir}/lib -type f -name "*.so" | xargs -r strip'
Returns:
Not enough room for program headers, try linking with -N
I tried editing it into this:
135: 'find %{venv_dir}/lib -type f -name "*.so" | xargs -r -0 strip'
Returns:
Warning: could not locate....reason: File name too long (_pylibmc.cpython-34m.so for example)
135: 'find %{venv_dir}/lib -type f -name "*.so" -print0 | xargs -r -0 strip'
Also fails:
Not enough room for program headers, try linking with -N
What would be a proper way to tackle this? Should we temporarily disable the stripping of libraries?
Might be related to: #pypa/manylinux#78 and #NixOS/patchelf#10.
Regards,
Neurocinetics
I've noticed that some of absolute paths in generated spec and shebangs have doubled slash, e.g. I have files section with config and spec shows:
%config(noreplace) //lib/systemd/system/my-app.service
%config(noreplace) //etc/my-app/.env
Also shebang of my script /usr/bin/python
has changed to #!/opt/my-company//my-app/bin/python
.
Probably that's not problem but my daemon in the output of top
then shows this double slashed path, which I don't like honestly to say.
... /opt/my-company//my-app/bin/python /opt/my-company/my-app/bin/my-server.py
Also, due to this problem I have to set parent directory in rpmvenv.json
without first slash, e.g.
"python_venv": {
"name": "my-app",
"path": "opt/my-company/",
"pip_flags": "--no-warn-script-location"
},
I'd like to fix this if you provide some hints. I suppose all paths need to be processed via os.path.normpath
.
rpmvenv broke recently (past few months), it throws error in loader.py in validate_extensions.
On one server if works with semver==2.9.1 but breaks with semver==2.10.0 or 2.10.1.
However our build pipeline fails even if semver==2.9.1.
This server is running semver==2.10.0 and fails. It works with semver==2.9.1
(env) [centos@deveast-zabbix-proxy1 sbc-api-mpact]$ rpmvenv --verbose sbc-api-mpact-rpmvenv.json Traceback (most recent call last): File "/home/centos/podrouting-test/env/bin/rpmvenv", line 8, in <module> sys.exit(main()) File "/home/centos/podrouting-test/env/lib/python2.7/site-packages/rpmvenv/cli.py", line 119, in main extensions_loader.validate_extensions(extensions) File "/home/centos/podrouting-test/env/lib/python2.7/site-packages/rpmvenv/extensions/loader.py", line 56, in validate_extensions if not semver.match(ext.version, version): File "/home/centos/podrouting-test/env/lib/python2.7/site-packages/semver.py", line 76, in wrapper return func(*args, **kwargs) File "/home/centos/podrouting-test/env/lib/python2.7/site-packages/semver.py", line 780, in match return ver.match(match_expr) File "/home/centos/podrouting-test/env/lib/python2.7/site-packages/semver.py", line 604, in match cmp_res = self.compare(match_version) File "/home/centos/podrouting-test/env/lib/python2.7/site-packages/semver.py", line 403, in compare cls.__name__, type(other) TypeError: Expected str or VersionInfo instance, but got <type 'unicode'>
something, to let the user know it's working,
also a -v/verbose flag would be nice so we could see what's going on while it's doing it.
I recently want to build an rpm but failed to execute the python in side it. Can you help take a look?
python 2.7.15
build host : ubuntu
install host:centos
I even tried to compile a python and then install everything from scratch. but still report same error.
Traceback (most recent call last):
File "/usr/bin/path/lib/python2.7/site.py", line 171, in <module>
main()
File "/usr/bin/path/lib/python2.7/site.py", line 19, in main
load_host_site()
File "/usr/bin/path/lib/python2.7/site.py", line 42, in load_host_site
reload(sys.modules["site"]) # noqa # call system site.py to setup import libraries
ImportError: No module named site
Hello!
Thanks for rpmvenv!
May be automation create json?
For example, create rpm from CLI rpmvenv without created json by hand.
rpmvenv --name "some-rpm-package-name" --version "1.2.3"
rpmvenv go to pypi.org and get information from site. After rpmvenv create json and build rpm.
Using either the tool, or the spec file it generates, the %{venv_dir}/bin/activate*
files contain the full build root path which causes the rpm build to fail. Adding find %{venv_dir}/bin -type f | xargs sed -i "s#%{buildroot}##g"
at the end of %install
fixes the issue.
Python: 3.7.4
Pip: 20.0.2
Virtualenv: 20.0.18
requirements.txt either should not include these deps, or require them only on Python 2.6, or 2.7 if the stdlib version isnt acceptable:
Hello!
On Fedora Server 33 I get following error while trying to install RPM:
file /usr/lib/.build-id/35/4145047f3835a62cb82cb1939f53181bf1ed85 from install of xxx-0.1-1.x86_64 conflicts with file from package python3-3.9.2-1.fc33.x86_64
Is there a way to not include in the final RPM /usr/lib/.build-id/
directory? here is a more detailed description of issue I face and some discussion.
Add some tests that recreate the scenario described in #31 to prevent regressions.
rpmvenv rpmvenv.json
...
+ venvctrl-relocate --source=/tmp/rpmvenv126rjt63/BUILDROOT/archer-dlbcl_web-1.0.8-1_.el7.centos.x86_64//usr/share/archer/venv//dlbcl_web --destination=//usr/share/archer/venv//dlbcl_web
Traceback (most recent call last):
File "/usr/bin/venvctrl-relocate", line 9, in <module>
load_entry_point('venvctrl==0.2.1', 'console_scripts', 'venvctrl-relocate')()
File "/usr/lib/python3.4/site-packages/venvctrl/cli/relocate.py", line 53, in main
relocate(args.source, args.destination, args.move)
File "/usr/lib/python3.4/site-packages/venvctrl/cli/relocate.py", line 24, in relocate
venv.relocate(destination)
File "/usr/lib/python3.4/site-packages/venvctrl/venv/relocate.py", line 35, in relocate
os.path.join(destination, 'bin', 'python')
File "/usr/lib/python3.4/site-packages/venvctrl/venv/base.py", line 178, in shebang
self.writeline(new_shebang, 0)
File "/usr/lib/python3.4/site-packages/venvctrl/venv/base.py", line 86, in writeline
for count, new_line in enumerate(file_handle):
File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 157: ordinal not in range(128)
error: Bad exit status from /var/tmp/rpm-tmp.BZi8gI (%install)
It looks like the specific issue is from boto3
. There are some files in that distribution that are UTF-8.
The underlying problem appears to be in venvctrl-relocate
when it attempts to shebang replaces files. It looks like this section is not aware of encoding or decoding.
It seems like the problem is best fixed there, but it is a lot easier to reproduce in rpmvenv
, so I thought'd I'd open the bug here.
I think I can make a simple fix in venvctrl
, but I was curious if you had any better insight on how you want to deal with this.
I made a simple docker image that can replicate this problem reliably, https://github.com/23jodys/venvctrl_bug_report/tree/master.
Thanks!
There seems to be a difference in the way pytest.raises()
under PY26 vs the rest when dealing with the SystemExit
exception raised by sys.exit()
. Figure out why it returns the exit code as the value in PY26 (not the correct behaviour) and the exception instance in the rest (the correct behaviour).
First of all, thanks you for this project. Really useful, seriously, thanks!
I was wondering if it's possible to define users/groups and permissions per mapping:
"file_extras": {
"files": [
{
"src": "bin/stupidbin",
"dest": "/usr/local/bin/stupidbin",
"user": "myapp",
"group": "appgroup",
"permissions": "0755"
}
]
}
Is it possible? What do you think? Can we implement that feature?
Hello! Thanks for rpmvenv!
How pack directory to rpm ?
I install airflow in virtualenv
cd /home
python3 -m venv airflow
source /home/airflow/airflow/bin/activate
python3 -m pip install apache-airflow[postgres,redis,hdfs,hive,kerberos,ldap,ssh]==1.10.12 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-1.10.12/constraints-3.6.txt"
Created airflow.json
{
"extensions": {
"enabled": [
"python_venv",
"blocks"
]
},
"core": {
"group": "Application/System",
"license": "ASL 2.0",
"name": "airflow",
"summary": "airflow",
"version": "1.10.12"
},
"python_venv": {
"require_setup_py": false,
"name": "airflow",
"path": "/home/airflow/airflow",
"cmd": "virtualenv",
"flags": ["--always-copy"],
"requirements": ["requirements.txt"],
"use_pip_install": true,
"remove_pycache": true,
"strip_binaries": true
},
"blocks": {
"desc": [
"airflow description"
]
}
}
Error
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenv1geu4v1p' /tmp/rpmvenv1geu4v1p/SOURCES/package.spec.
The stderr was: b"+ umask 022\n+ cd /tmp/rpmvenv1geu4v1p/BUILD\n+ rm -rf '/tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64/*'\n+ mkdir -p /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64//home/airflow/airflow/airflow\n+ exit 0\n+ umask 022\n+ cd /tmp/rpmvenv1geu4v1p/BUILD\n+ '[' /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64 '!=' / ']'\n+ rm -rf /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64\n++ dirname /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64\n+ mkdir -p /tmp/rpmvenv1geu4v1p/BUILDROOT\n+ mkdir /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64\n+ virtualenv --always-copy /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64//home/airflow/airflow/airflow\n+ cd /tmp/rpmvenv1geu4v1p/SOURCES/airflow\n+ /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64//home/airflow/airflow/airflow/bin/python /tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64//home/airflow/airflow/airflow/bin/pip install -r requirements.txt\nERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'\nWARNING: You are using pip version 20.3.3; however, version 21.0 is available.\nYou should consider upgrading via the '/tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64//home/airflow/airflow/airflow/bin/python -m pip install --upgrade pip' command.\nerror: Bad exit status from /var/tmp/rpm-tmp.4RO1gZ (%install)\n Bad exit status from /var/tmp/rpm-tmp.4RO1gZ (%install)\n".
The stdout was: b'Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.It1QXt\nExecuting(%install): /bin/sh -e /var/tmp/rpm-tmp.4RO1gZ\ncreated virtual environment CPython3.6.8.final.0-64 in 893ms\n creator CPython3Posix(dest=/tmp/rpmvenv1geu4v1p/BUILDROOT/airflow-1.10.12-1.x86_64/home/airflow/airflow/airflow, clear=False, no_vcs_ignore=False, global=False)\n seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/airflow/.local/share/virtualenv)\n added seed packages: pip==20.3.3, setuptools==51.3.3, wheel==0.36.2\n activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator\n\n\nRPM build errors:\n'.
The 0.27.0
and 1.0.0
releases are the last that will support Python 2 and Python 3.5 and below. I've left a note about this in the README and the GitHub releases. The 2.x.x
version range will be used for versions that support only versions of Python that are still supported by the community.
See https://github.com/kevinconway/rpmvenv#note-python-2-support for a requirements.txt
that you can use for Python 2 if you plan to continue using the 0.x
or 1.x
releases.
During building of an RPM I've got this warning for several libs that install some scripts to venv/bin:
WARNING: The script dotenv is installed in '/tmp/rpmvenvvkfptr18/BUILDROOT/myproject-1.x86_64/opt/myproject/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
It will be nice if your tool will use suggested pip option.
I try build rpm:
echo "{}" > conf.json && rpmvenv conf.json --core_name="msgpack" --core_version="0.6.1" --core_license="MIT" --summary="Package created by rpmvenv" --python_venv_path="/tmp/msgpack"
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenvgYnm4a' /tmp/rpmvenvgYnm4a/SOURCES/package.spec.
The stderr was: error: Summary field must be present in package: (main package)
.
The stdout was: .
and
echo "{}" > conf.json && rpmvenv conf.json --core_name="msgpack" --core_version="0.6.1" --core_license="MIT" --blocks_desc="Package created by rpmvenv" --python_venv_path="/tmp/msgpack"
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenvdx3aq_' /tmp/rpmvenvdx3aq_/SOURCES/package.spec.
The stderr was: error: Summary field must be present in package: (main package)
.
The stdout was: .
How correct build rpm?
I have a static directory within a rpmvenv'd packaged web application that I'm copying into the root of the installation dir and I have specified permissons:
{
"file_permissions": {
"user": "appuser",
"group": "appuser",
"create_user": true,
"create_group": true
},
"file_extras": {
"files": [
{
"src": "app/static",
"dest": "/opt/app/static"
}
]
}
}
However when installing the RPM the static directory always has the proper owner/group but the other files are occasionally installed as root:root.
Calling rpmvenv repeatedly with --spec | grep -A 2 "%files"
shows the defattr
reference occasionally occurring after the installation root path. Does order there matter?
Note, I've also removed the file_extras
block altogether and reproduced intermittently built RPMs that fail to apply the defined permissions.
I'll dig into your code and submit a PR if I can find an easy way to preserve ordering.
Hello when i'm building rpm i get error on step
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
/sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /bin/true
+ /usr/lib/rpm/brp-strip-comment-note /bin/true /usr/bin/objdump
+ /usr/lib/rpm/brp-strip-static-archive /bin/true
+ /usr/lib/rpm/brp-python-hardlink
+ PYTHON3=/usr/libexec/platform-python
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
*** ERROR: ambiguous python shebang in /lib/python3.8/site-packages/editor.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
Hi!
I am attempting to use rpmvenv
for the first time.
This is my config file:
[root@cltest virtualenv]# cat venv.json
{
"extensions": {
"enabled": [
"python_venv"
]
},
"core": {
"group": "Application/System",
"name": "iSPyAPI",
"description": "Internal WebOps platform API",
"license": "Copyright",
"version": "1.0.0"
},
"python_venv": {
"name": "env",
"path": "/opt/ispyapi",
"cmd": "virtualenv",
"flags": ["--always-copy"],
"name": "ispyapi",
"path": "/usr/share/python-ispyapi",
"python": "python3.7",
"require_setup_py": true,
"requirements": ["requirements.txt"]
}
}
However, when attempting to build the RPM, I get an error:
[root@cltest virtualenv]# rpmvenv venv.json
Traceback (most recent call last):
File "/usr/local/bin/rpmvenv", line 11, in <module>
load_entry_point('rpmvenv==0.23.0', 'console_scripts', 'rpmvenv')()
File "/usr/local/lib/python3.6/site-packages/rpmvenv/cli.py", line 113, in main
strict=True,
File "/usr/local/lib/python3.6/site-packages/confpy/parser.py", line 218, in parse_options
config=configuration_from_paths(paths=files, strict=strict),
File "/usr/local/lib/python3.6/site-packages/confpy/parser.py", line 75, in configuration_from_paths
cfg = configfile_from_path(path, strict=strict).config
File "/usr/local/lib/python3.6/site-packages/confpy/loaders/base.py", line 76, in config
setattr(name, item, value)
File "/usr/local/lib/python3.6/site-packages/confpy/core/namespace.py", line 139, in __setattr__
return object.__setattr__(self, name, value)
AttributeError: can't set attribute
Do you have any idea why that is? I feel like something is wrong with my config file, but I'm not sure what it is when comparing mine to the documentation.
I would like to have post install block scriptlets to be my special python script executed. According to rpm docs there is option to execute arbitrary interpreter in %post %preun, e.g.
%post -p /usr/bin/python3
print("This is {} code".format("python"))
I just want to provide my script content somehow without writing it into rpmvenv.json line-by-line.
https://rpm-packaging-guide.github.io/#triggers-and-scriptlets
see section "Using Non-Shell Scripts in SPEC File"
Is it possible to achieve that in some [simple] way or my request requires heavy patching of your code?
Thanks for rpmvenv.
I try build rpm for python package on CentOS 7.
sudo yum -y install epel-release rpmdevtools
sudo yum -y install python2-pip
pip install --user rpmvenv
echo "{}" > conf.json && rpmvenv conf.json --core_name="msgpack" --core_version="0.6.1" --core_license="MIT" --core_summary="Package created by rpmvenv" --python_venv_path="/tmp/msgpack"
Error:
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenvhQBuQb' /tmp/rpmvenvhQBuQb/SOURCES/package.spec.
Traceback (most recent call last):
File "/home/centos/.local/bin/rpmvenv", line 9, in <module>
load_entry_point('rpmvenv==0.23.0', 'console_scripts', 'rpmvenv')()
File "/home/centos/.local/lib/python2.7/site-packages/rpmvenv/cli.py", line 160, in main
os.linesep,
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
Currently it seems impossible to set the file mode on extra files. In many cases, config files for example should have more tight permissions (say 0600) and this currently doesn't seem possible with rpmvenv.
Cheers
Fotis
Hello!
Thanks for rpmvenv!
After last release was many commit.
May be create new release?
Hi,
I am not sure if this problem is related to rpmvenv, maybe more with rpmbuild.
When I run rpmvenv ,
it fails with the following RPM build error:
<--
Found '/tmp/rpmvenvEUnH5a/BUILDROOT/mypkg-3.1-1.x86_64' in installed files; aborting
-->
Also setting the following env. var. before running rpmvenv seems to fix th problem:
export QA_SKIP_BUILD_ROOT=1
My config:
CentOS Linux release 7.1.1503 (Core)
Hello!
Thanks for rpmvenv!
I try build rpm for Python package with option --blocks_desc="msgpack"
But get error The stderr was: error: Package has no %description
echo "{}" > conf.json && LC_ALL=en_US.UTF-8 rpmvenv conf.json --core_name="msgpack" --core_version="0.6.1" --core_license="MIT" --core_summary="msgpack" --blocks_desc="msgpack"
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenv3ECQBe' /tmp/rpmvenv3ECQBe/SOURCES/package.spec.
The stderr was: error: Package has no %description: msgpack
.
The stdout was: .
rpmvenv is returning 1 instead of 0 in case of success.
$ rpmvenv rpmvenv.json
RPM generated at ./foobar-0.9.5-1.x86_64.rpm
../foobar-0.9.5-1.x86_64.rpm
$ echo $?
1
It would be nice if these tests where given a skipable marker, like 'online', so pytest -k 'not online'
works.
A nice online check is whether name github.com can be resolved.
In the meantime pytest -k 'not test_python_cmd_build'
wfm.
[ 31s] E subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/kevinconway/rpmvenv.git', '/tmp/pytest-of-abuild/pytest-0/test_python_cmd_build_https___3/rpmvenv']' returned non-zero exit status 128.
[ 31s]
[ 31s] /usr/lib64/python3.6/subprocess.py:291: CalledProcessError
[ 31s] ---------------------------- Captured stderr setup -----------------------------
[ 31s] Cloning into '/tmp/pytest-of-abuild/pytest-0/test_python_cmd_build_https___3/rpmvenv'...
[ 31s] fatal: unable to access 'https://github.com/kevinconway/rpmvenv.git/': Could not resolve host: github.com
[ 31s] =========================== short test summary info ============================
[ 31s] ERROR tests/test_cli.py::test_python_cmd_build[https://github.com/kevinconway/rpmvenv.git-python2.7-False-True-True]
[ 31s] ERROR tests/test_cli.py::test_python_cmd_build[https://github.com/kevinconway/rpmvenv.git-python2.7-False-True-False]
[ 31s] ERROR tests/test_cli.py::test_python_cmd_build[https://github.com/kevinconway/rpmvenv.git-python2.7-False-False-True]
[ 31s] ERROR tests/test_cli.py::test_python_cmd_build[https://github.com/kevinconway/rpmvenv.git-python2.7-False-False-False]
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.s9DD3M
+ umask 022
+ cd /tmp/rpmvenvzfest6gh/BUILD
+ rm -rf /tmp/rpmvenvzfest6gh/BUILDROOT/python-smoker-1.2.3-1.x86_64
+ exit 0
Traceback (most recent call last):
File "/home/bialix/.local/bin/rpmvenv", line 8, in <module>
sys.exit(main())
File "/home/bialix/.local/lib/python3.6/site-packages/rpmvenv/cli.py", line 142, in main
args['verbose'],
File "/home/bialix/.local/lib/python3.6/site-packages/rpmvenv/cli.py", line 78, in generate_rpm
shutil.move(pkg, destination)
File "/usr/lib64/python3.6/shutil.py", line 548, in move
raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path './python-smoker-1.2.3-1.x86_64.rpm' already exists
Maybe proper error message would be better than traceback.
project directory:
.
./setup.py
./MyModule
./MyModule/VERSION
./MyModule/__init__.py
./MyModule/dostuff.py
./bin
./bin/script1
./MyModule.rpmvenv.json
./requirements.txt
./setup.py:
from setuptools import setup
if __name__ == '__main__':
setup(
name=package_name,
version='1.0.0',
packages=['MyModule'],
include_package_data=True,
data_files=[('MyModule', ['./VERSION'])],
zip_safe=False,
scripts=['./bin/script1']
)
./MyModule.rpmvenv.json:
{
"core": {
"version": "1.0.0",
"group": "Application/System",
"name": "MyModule",
"license": "MIT",
"summary": "short package summary"
},
"blocks": {
"desc": ["some long package description",
"each array element is a new line"]},
"extensions": {
"enabled": ["python_venv", "blocks"]
},
"python_venv": {
"path": "/opt/myCompany",
"flags": [],
"name": "MyModule",
"pip_flags": "--trusted-host pypi.org --trusted-host files.pythonhosted.org --index-url http://localhost:8080/simple"
}
}
Broken Case:
(user1@localhost)(/tmp/MyModule)# rpmvenv ./MyModule.rpmvenv.json
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenvDvZXA7' /tmp/rpmvenvDvZXA7/SOURCES/package.spec.
The stderr was: + umask 022
+ cd /tmp/rpmvenvDvZXA7/BUILD
+ rm -rf '/tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/*'
+ mkdir -p /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64//opt/myCompany/MyModule
+ exit 0
+ umask 022
+ cd /tmp/rpmvenvDvZXA7/BUILD
+ '[' /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64 '!=' / ']'
+ rm -rf /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64
++ dirname /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64
+ mkdir -p /tmp/rpmvenvDvZXA7/BUILDROOT
+ mkdir /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64
+ virtualenv /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64//opt/myCompany/MyModule
+ cd /tmp/rpmvenvDvZXA7/SOURCES/Issue
+ /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64//opt/myCompany/MyModule/bin/python /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64//opt/myCompany/MyModule/bin/pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org --index-url http://localhost:8080/simple -r requirements.txt
You must give at least one requirement to install (see "pip help install")
You are using pip version 9.0.1, however version 19.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
+ cd -
+ cd /tmp/rpmvenvDvZXA7/SOURCES/Issue
+ /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64//opt/myCompany/MyModule/bin/python setup.py install
+ cd -
+ find /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64 -name RECORD -exec rm -rf '{}' ';'
+ venvctrl-relocate --source=/tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64//opt/myCompany/MyModule --destination=//opt/myCompany/MyModule
+ xargs -r strip
+ find /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64//opt/myCompany/MyModule/lib -type f -name '*.so'
+ /usr/lib/rpm/check-buildroot
error: Bad exit status from /var/tmp/rpm-tmp.T61KyS (%install)
Bad exit status from /var/tmp/rpm-tmp.T61KyS (%install)
.
The stdout was: Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.MwyCoA
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.T61KyS
New python executable in /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/opt/myCompany/MyModule/bin/python
Installing setuptools, pip, wheel...done.
/tmp/rpmvenvDvZXA7/BUILD
running install
running bdist_egg
running egg_info
creating MyModule.egg-info
writing MyModule.egg-info/PKG-INFO
writing top-level names to MyModule.egg-info/top_level.txt
writing dependency_links to MyModule.egg-info/dependency_links.txt
writing manifest file 'MyModule.egg-info/SOURCES.txt'
reading manifest file 'MyModule.egg-info/SOURCES.txt'
writing manifest file 'MyModule.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/MyModule
copying MyModule/__init__.py -> build/lib/MyModule
copying MyModule/dostuff.py -> build/lib/MyModule
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/MyModule
copying build/lib/MyModule/__init__.py -> build/bdist.linux-x86_64/egg/MyModule
copying build/lib/MyModule/dostuff.py -> build/bdist.linux-x86_64/egg/MyModule
byte-compiling build/bdist.linux-x86_64/egg/MyModule/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/MyModule/dostuff.py to dostuff.pyc
installing package data to build/bdist.linux-x86_64/egg
running install_data
copying ./MyModule/VERSION -> build/bdist.linux-x86_64/egg/MyModule
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.7
copying and adjusting ./bin/script1 -> build/scripts-2.7
changing mode of build/scripts-2.7/script1 from 644 to 755
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/script1 -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/script1 to 755
copying MyModule.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying MyModule.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying MyModule.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying MyModule.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying MyModule.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating dist
creating 'dist/MyModule-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing MyModule-1.0.0-py2.7.egg
creating /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/opt/myCompany/MyModule/lib/python2.7/site-packages/MyModule-1.0.0-py2.7.egg
Extracting MyModule-1.0.0-py2.7.egg to /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/opt/myCompany/MyModule/lib/python2.7/site-packages
Adding MyModule 1.0.0 to easy-install.pth file
Installing script1 script to /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/opt/myCompany/MyModule/bin
Installed /tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/opt/myCompany/MyModule/lib/python2.7/site-packages/MyModule-1.0.0-py2.7.egg
Processing dependencies for MyModule==1.0.0
Finished processing dependencies for MyModule==1.0.0
/tmp/rpmvenvDvZXA7/BUILD
/tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/opt/myCompany/MyModule/lib/python2.7/site-packages/MyModule-1.0.0-py2.7.egg/EGG-INFO/scripts/script1:#!/tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64/opt/myCompany/MyModule/bin/python
Found '/tmp/rpmvenvDvZXA7/BUILDROOT/MyModule-1.0.0-1.x86_64' in installed files; aborting
RPM build errors:
.
Working Case
(user1@localhost)(/tmp/MyModule)#./setup.py build
running build
running build_py
creating build
creating build/lib
creating build/lib/MyModule
copying MyModule/__init__.py -> build/lib/MyModule
copying MyModule/dostuff.py -> build/lib/MyModule
running egg_info
creating MyModule.egg-info
writing MyModule.egg-info/PKG-INFO
writing top-level names to MyModule.egg-info/top_level.txt
writing dependency_links to MyModule.egg-info/dependency_links.txt
writing manifest file 'MyModule.egg-info/SOURCES.txt'
reading manifest file 'MyModule.egg-info/SOURCES.txt'
writing manifest file 'MyModule.egg-info/SOURCES.txt'
running build_scripts
creating build/scripts-2.7
copying and adjusting ./bin/script1 -> build/scripts-2.7
changing mode of build/scripts-2.7/script1 from 644 to 755
(user1@localhost)(/tmp/MyModule)# rpmvenv ./MyModule.rpmvenv.json
RPM generated at ./MyModule-1.0.0-1.x86_64.rpm
Seems to be an issue somewhere in venvctrl relocate not getting the shebangs in the bin unless its already built (?). Work around is simple but shouldnt be necessary I suppose.
This is a wonderful lib and we almost gave up on it because we couldn't figure out what was causing what appeared to be intermittent failures -- so if this is intentional design a sensible error message or revised documentation would be nice.
This version of virtualenv
adds a nushell
activation script:
https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst#v2080-2021-09-16
The reference to BUILDROOT is not removed from these scripts so /usr/lib/rpm/check-buildroot
fails after venvctrl-relocate
.
It can be worked around by adding "--activators", "bash,cshell,fish,powershell,python"
to the python_venv
flags configuration.
Hi,
With rpmvenv, what would be the best way to prevent overwriting config files during package upgrade ?
I found this link with instructions, but I don't know if those can be used with rpmvenv
Hello!
Sorry that i create many issue.
sudo yum -y install epel-release rpmdevtools
sudo yum -y install python3-pip
pip3 install --user rpmvenv
pip3 install --user virtualenv
echo "pip" > requirements.txt && \
echo "msgpack==0.6.1" >> requirements.txt && \
echo "{}" > conf.json && \
LC_ALL=en_US.UTF-8 rpmvenv conf.json \
--core_name="msgpack" \
--core_version="0.6.1" \
--core_license="MIT" \
--core_summary="msgpack" \
--extensions_enabled="blocks,python_venv" \
--python_venv_name="msgpack" \
--blocks_desc="msgpack" \
--python_venv_require_setup_py="false"
Error:
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenvb_0k58hd' /tmp/rpmvenvb_0k58hd/SOURCES/package.spec.
The stderr was: b"+ umask 022\n+ cd /tmp/rpmvenvb_0k58hd/BUILD\n+ rm -rf '/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/*'\n+ mkdir -p /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack\n+ exit 0\n+ umask 022\n+ cd /tmp/rpmvenvb_0k58hd/BUILD\n+ '[' /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64 '!=' / ']'\n+ rm -rf /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64\n++ dirname /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64\n+ mkdir -p /tmp/rpmvenvb_0k58hd/BUILDROOT\n+ mkdir /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64\n+ virtualenv --always-copy /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack\n+ cd /tmp/rpmvenvb_0k58hd/SOURCES/centos\n+ /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/pip install -r requirements.txt\n+ cd -\n+ find /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64 -name RECORD -exec rm -rf '{}' ';'\n+ venvctrl-relocate --source=/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack --destination=//usr/share/python/msgpack\n+ find /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/lib -type f -name '*.so'\n+ xargs -r strip\n+ /usr/lib/rpm/check-buildroot\nerror: Bad exit status from /var/tmp/rpm-tmp.I4ud1f (%install)\n Bad exit status from /var/tmp/rpm-tmp.I4ud1f (%install)\n".
The stdout was: b"Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.rT8rXM\nExecuting(%install): /bin/sh -e /var/tmp/rpm-tmp.I4ud1f\ncreated virtual environment CPython3.6.8.final.0-64 in 400ms\n creator CPython3Posix(dest=/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack, clear=False, global=False)\n seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/home/centos/.local/share/virtualenv/seed-app-data/v1.0.1)\n activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator\nRequirement already satisfied: pip in /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (20.0.2)\nCollecting msgpack==0.6.1\n Downloading msgpack-0.6.1-cp36-cp36m-manylinux1_x86_64.whl (248 kB)\nInstalling collected packages: msgpack\nSuccessfully installed msgpack-0.6.1\n/tmp/rpmvenvb_0k58hd/BUILD\n/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/bin/activate:VIRTUAL_ENV='/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack'\n/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/bin/activate.csh:setenv VIRTUAL_ENV '/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack'\n/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/bin/activate.fish:set -gx VIRTUAL_ENV '/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack'\nFound '/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64' in installed files; aborting\n\n\nRPM build errors:\n".
rpmbuild:
LANG=C rpmbuild -ba --define='_topdir /tmp/rpmvenvb_0k58hd' /tmp/rpmvenvb_0k58hd/SOURCES/package.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.HzcSTK
+ umask 022
+ cd /tmp/rpmvenvb_0k58hd/BUILD
+ rm -rf /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr
+ mkdir -p /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.l3dOej
+ umask 022
+ cd /tmp/rpmvenvb_0k58hd/BUILD
+ '[' /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64 '!=' / ']'
+ rm -rf /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64
++ dirname /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64
+ mkdir -p /tmp/rpmvenvb_0k58hd/BUILDROOT
+ mkdir /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64
+ virtualenv --always-copy /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack
created virtual environment CPython3.6.8.final.0-64 in 275ms
creator CPython3Posix(dest=/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/home/centos/.local/share/virtualenv/seed-app-data/v1.0.1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
+ cd /tmp/rpmvenvb_0k58hd/SOURCES/centos
+ /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/pip install -r requirements.txt
Requirement already satisfied: pip in /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (20.0.2)
Collecting msgpack==0.6.1
Using cached msgpack-0.6.1-cp36-cp36m-manylinux1_x86_64.whl (248 kB)
Installing collected packages: msgpack
Successfully installed msgpack-0.6.1
+ cd -
/tmp/rpmvenvb_0k58hd/BUILD
+ find /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64 -name RECORD -exec rm -rf '{}' ';'
+ venvctrl-relocate --source=/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack --destination=//usr/share/python/msgpack
+ find /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/lib -type f -name '*.so'
+ xargs -r strip
+ /usr/lib/rpm/check-buildroot
/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/bin/activate:VIRTUAL_ENV='/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack'
/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/bin/activate.csh:setenv VIRTUAL_ENV '/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack'
/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/bin/activate.fish:set -gx VIRTUAL_ENV '/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack'
Found '/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64' in installed files; aborting
error: Bad exit status from /var/tmp/rpm-tmp.l3dOej (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.l3dOej (%install)
show scipt /var/tmp/rpm-tmp.l3dOej
cat /var/tmp/rpm-tmp.l3dOej
#!/bin/sh
RPM_SOURCE_DIR="/tmp/rpmvenvb_0k58hd/SOURCES"
RPM_BUILD_DIR="/tmp/rpmvenvb_0k58hd/BUILD"
RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic"
RPM_LD_FLAGS="-Wl,-z,relro "
RPM_ARCH="x86_64"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="msgpack"
RPM_PACKAGE_VERSION="0.6.1"
RPM_PACKAGE_RELEASE="1"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64"
export RPM_BUILD_ROOT
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH
set -x
umask 022
cd "/tmp/rpmvenvb_0k58hd/BUILD"
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"
mkdir -p `dirname "$RPM_BUILD_ROOT"`
mkdir "$RPM_BUILD_ROOT"
virtualenv --always-copy /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack
cd /tmp/rpmvenvb_0k58hd/SOURCES/centos
/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/pip install -r requirements.txt
cd -
# RECORD files are used by wheels for checksum. They contain path names which
# match the buildroot and must be removed or the package will fail to build.
find /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64 -name "RECORD" -exec rm -rf {} \;
# Change the virtualenv path to the target installation direcotry.
venvctrl-relocate --source=/tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack --destination=//usr/share/python/msgpack
# Strip native modules as they contain buildroot paths intheir debug information
find /tmp/rpmvenvb_0k58hd/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/lib -type f -name "*.so" | xargs -r strip
/usr/lib/rpm/check-buildroot
/usr/lib/rpm/redhat/brp-compress
/usr/lib/rpm/redhat/brp-strip /usr/bin/strip
/usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
/usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
/usr/lib/rpm/redhat/brp-python-hardlink
/usr/lib/rpm/redhat/brp-java-repack-jars
Hello!
Sorry that i create many issue.
sudo yum -y install epel-release rpmdevtools
sudo yum -y install python3-pip
pip3 install --user rpmvenv
pip3 install --user virtualenv
echo "pip" > requirements.txt && echo "{}" > conf.json && LC_ALL=en_US.UTF-8 rpmvenv conf.json --core_name="msgpack" --core_version="0.6.1" --core_license="MIT" --core_summary="msgpack" --extensions_enabled="blocks,python_venv" --python_venv_name="msgpack" --blocks_desc="msgpack"
Error:
echo "pip" > requirements.txt && echo "{}" > conf.json && LC_ALL=en_US.UTF-8 rpmvenv conf.json --core_name="msgpack" --core_version="0.6.1" --core_license="MIT" --core_summary="msgpack" --extensions_enabled="blocks,python_venv" --python_venv_name="msgpack" --blocks_desc="msgpack"
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenv0_8srqcp' /tmp/rpmvenv0_8srqcp/SOURCES/package.spec.
The stderr was: b"+ umask 022\n+ cd /tmp/rpmvenv0_8srqcp/BUILD\n+ rm -rf '/tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64/*'\n+ mkdir -p /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack\n+ exit 0\n+ umask 022\n+ cd /tmp/rpmvenv0_8srqcp/BUILD\n+ '[' /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64 '!=' / ']'\n+ rm -rf /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64\n++ dirname /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64\n+ mkdir -p /tmp/rpmvenv0_8srqcp/BUILDROOT\n+ mkdir /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64\n+ virtualenv --always-copy /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack\n+ cd /tmp/rpmvenv0_8srqcp/SOURCES/centos\n+ /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/pip install -r requirements.txt\n+ cd -\n+ cd /tmp/rpmvenv0_8srqcp/SOURCES/centos\n+ /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python setup.py install\n/tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python: can't open file 'setup.py': [Errno 2] No such file or directory\nerror: Bad exit status from /var/tmp/rpm-tmp.ihTzgg (%install)\n Bad exit status from /var/tmp/rpm-tmp.ihTzgg (%install)\n".
The stdout was: b'Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.FzN97j\nExecuting(%install): /bin/sh -e /var/tmp/rpm-tmp.ihTzgg\ncreated virtual environment CPython3.6.8.final.0-64 in 236ms\n creator CPython3Posix(dest=/tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack, clear=False, global=False)\n seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/home/centos/.local/share/virtualenv/seed-app-data/v1.0.1)\n activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator\nRequirement already satisfied: pip in /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (20.0.2)\n/tmp/rpmvenv0_8srqcp/BUILD\n\n\nRPM build errors:\n'.
run rpmbuild by hand
LC_ALL=en_US.UTF-8 rpmbuild -ba --define='_topdir /tmp/rpmvenv0_8srqcp' /tmp/rpmvenv0_8srqcp/SOURCES/package.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.oGodnq
+ umask 022
+ cd /tmp/rpmvenv0_8srqcp/BUILD
+ rm -rf /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64/usr
+ mkdir -p /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.DaBYvv
+ umask 022
+ cd /tmp/rpmvenv0_8srqcp/BUILD
+ '[' /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64 '!=' / ']'
+ rm -rf /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64
++ dirname /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64
+ mkdir -p /tmp/rpmvenv0_8srqcp/BUILDROOT
+ mkdir /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64
+ virtualenv --always-copy /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack
created virtual environment CPython3.6.8.final.0-64 in 256ms
creator CPython3Posix(dest=/tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/home/centos/.local/share/virtualenv/seed-app-data/v1.0.1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
+ cd /tmp/rpmvenv0_8srqcp/SOURCES/centos
+ /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/pip install -r requirements.txt
Requirement already satisfied: pip in /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64/usr/share/python/msgpack/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (20.0.2)
+ cd -
/tmp/rpmvenv0_8srqcp/BUILD
+ cd /tmp/rpmvenv0_8srqcp/SOURCES/centos
+ /tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python setup.py install
/tmp/rpmvenv0_8srqcp/BUILDROOT/msgpack-0.6.1-1.x86_64//usr/share/python/msgpack/bin/python: can't open file 'setup.py': [Errno 2] No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.DaBYvv (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.DaBYvv (%install)
Add documentation for generating rpm spec file.
I've created simple smoke test script to test how rpmvenv works and it failed to create an rpm.
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenvepiq47s_' /tmp/rpmvenvepiq47s_/SOURCES/package.spec.
The stderr was: b'+ umask 022\n+ cd /tmp/rpmvenvepiq47s_/BUILD\n+ rm -rf \'/tmp/rpmvenvepiq47s_/BUILDROOT/python-smoker-1.2.3-1.x86_64/*\'\n+ mkdir -p /tmp/rpmvenvepiq47s_/BUILDROOT/python-smoker-1.2.3-1.x86_64//opt/test/smoker/venv\n+ exit 0\n+ umask 022\n+ cd /tmp/rpmvenvepiq47s_/BUILD\n+ \'[\' /tmp/rpmvenvepiq47s_/BUILDROOT/python-smoker-1.2.3-1.x86_64 \'!=\' / \']\'\n+ rm -rf /tmp/rpmvenvepiq47s_/BUILDROOT/python-smoker-1.2.3-1.x86_64\n++ dirname /tmp/rpmvenvepiq47s_/BUILDROOT/python-smoker-1.2.3-1.x86_64\n+ mkdir -p /tmp/rpmvenvepiq47s_/BUILDROOT\n+ mkdir /tmp/rpmvenvepiq47s_/BUILDROOT/python-smoker-1.2.3-1.x86_64\n+ virtualenv --always-copy /tmp/rpmvenvepiq47s_/BUILDROOT/python-smoker-1.2.3-1.x86_64//opt/test/smoker/venv\nTraceback (most recent call last):\n File "/usr/local/bin/virtualenv", line 5, in <module>\n from virtualenv.__main__ import run_with_catch\nModuleNotFoundError: No module named \'virtualenv\'\nerror: Bad exit status from /var/tmp/rpm-tmp.omHnCd (%install)\n Bad exit status from /var/tmp/rpm-tmp.omHnCd (%install)\n'.
The stdout was: b'Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.jgbdB7\nExecuting(%install): /bin/sh -e /var/tmp/rpm-tmp.omHnCd\n\n\nRPM build errors:\n'.
I think this is the real error:
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from virtualenv.__main__ import run_with_catch
ModuleNotFoundError: No module named 'virtualenv'
My json config for rpmvenv:
{
"extensions": {
"enabled": [
"python_venv",
"blocks"
]
},
"core": {
"group": "Application/System",
"license": "MIT",
"name": "python-smoker",
"summary": "short package summary",
"version": "1.2.3"
},
"python_venv": {
"name": "venv",
"path": "/opt/test/smoker"
},
"blocks": {
"desc": [
"smoking test"
]
}
}
Probably due virtualenv version is too new? Can you suggest which virtualenv I should be using?
virtualenv 20.10.0
Hi,
I have a question regarding rpm dependencies.
My program needs following packages to be installed:
Requires: gcc
Requires: python >= 2.6
Requires: python-pip
Requires: python-devel
Requires: openssl-devel
Requires: sqlite
Requires: sqlite-devel
Requires: libxslt-devel
Requires: libxml2-devel
Requires: zlib-devel
Requires: libffi-devel
Currently, I use a two steps procedure which is
rpmrebuild -pe <rpmfile>
but doing it in one step would be great.
Is it possible to specify those dependencies using the json file ?
Hello,
When I run rpmvenv to package my python library I get a wierd error saying it was not possible to import the library 'time'.
Although if I create a virtual env myself and import time, it works just fine.
This is for CentOS Linux 7 (Core)
The json file, for now, is pretty basic (almost equal to the one in the example):
{
"extensions": {
"enabled": [
"python_venv",
"blocks"
]
},
"core": {
"group": "Application/System",
"license": "MIT",
"name": "myRPM",
"summary": "short package summary",
"version": "1.0"
},
"python_venv": {
"name": "venv",
"path": "/usr/share/myPathRPM/"
},
"blocks": {
"desc": [
"some long package description",
"each array element is a new line"
]
}
}
And the output is:
[user@localhost ~]$ rpmvenv build.json
There was an error generating the RPM.
The exit code was: 1.
The rpmbuild command was: rpmbuild -ba --define='_topdir /tmp/rpmvenvgduuy3rh' /tmp/rpmvenvgduuy3rh/SOURCES/package.spec.
The stderr was: b'+ umask 022
+ cd /tmp/rpmvenvgduuy3rh/BUILD
+ rm -rf \'/tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64/*\'
+ mkdir -p /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64//usr/share/myPathRPM//venv
+ exit 0
+ umask 022
+ cd /tmp/rpmvenvgduuy3rh/BUILD
+ \'[\' /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64 \'!=\' / \']\'
+ rm -rf /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64
++ dirname /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64
+ mkdir -p /tmp/rpmvenvgduuy3rh/BUILDROOT
+ mkdir /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64
+ virtualenv --always-copy /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64//usr/share/myPathRPM//venv
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/usr/lib/python3.4/site-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/usr/lib/python3.4/site-packages/virtualenv.py", line 945, in create_environment
download=download,
File "/usr/lib/python3.4/site-packages/virtualenv.py", line 901, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python3.4/site-packages/virtualenv.py", line 797, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /tmp/rpmvenvgduuy3rh...M/venv/bin/python3.4 - setuptools pip wheel failed with error code 1
error: Bad exit status from /var/tmp/rpm-tmp.hbCgy8 (%install)
Bad exit status from /var/tmp/rpm-tmp.hbCgy8 (%install)
'.
The stdout was: b'Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.tU518l
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.hbCgy8
Using base prefix \'/usr\'
Cannot find file lib (bad symlink)
New python executable in /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64/usr/share/myPathRPM/venv/bin/python3.4
Also creating executable in /tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64/usr/share/myPathRPM/venv/bin/python
Installing setuptools, pip, wheel...
Complete output from command /tmp/rpmvenvgduuy3rh...M/venv/bin/python3.4 - setuptools pip wheel:
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
File "/tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64/usr/share/myPathRPM/venv/lib64/python3.4/tempfile.py", line 34, in <module>
import shutil as _shutil
File "/tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64/usr/share/myPathRPM/venv/lib64/python3.4/shutil.py", line 14, in <module>
import tarfile
File "/tmp/rpmvenvgduuy3rh/BUILDROOT/myRPM-1.0-1.x86_64/usr/share/myPathRPM/venv/lib64/python3.4/tarfile.py", line 47, in <module>
import time
ImportError: No module named \'time\'
----------------------------------------
...Installing setuptools, pip, wheel...done.
RPM build errors:
'.
Any help please?
Thank you!
Hello! Thanks for rpmvenv!
I try pack apache-airflow to rpm with all dependencies
sudo yum -y install epel-release rpmdevtools wget
sudo yum -y install python3-pip
pip3 install --user rpmvenv
pip3 install --user virtualenv
create requirements.txt with my dependencies
echo "{}" > conf.json && \
LC_ALL=en_US.UTF-8 rpmvenv conf.json \
--core_name="apache-airflow" \
--core_version="1.10.12" \
--core_license="ASL 2.0" \
--core_summary="apache-airflow" \
--extensions_enabled="blocks,python_venv" \
--python_venv_name="apache-airflow" \
--blocks_desc="apache-airflow" \
--python_venv_require_setup_py="false"
Pack application by path /usr/share/python/apache-airflow
ls /usr/share/python/apache-airflow
LICENSE bin etc lib lib64 pyvenv.cfg
How pack application to user virtualenv?
How correct change path in python_venv?
Hey there, cool project!
I can't see a way to specify the Vendor and Packager tags. You can see the tags detailed here: http://ftp.rpm.org/max-rpm/s1-rpm-inside-tags.html
Thanks
Fotis
Hi,
rpmvenv
generated the following spec file from my virtualenv.
After installing all the packages from requirements.txt
, it seem to be running setup.py install
from the virtualenv. My virtualenv does not have any setup.py and hence the rpm build fails.
Is there any reason I should be having setup.py in my virtualenv
directory ?
%install
%{venv_cmd} %{venv_dir}
%{venv_pip} -r %{SOURCE0}/requirements.txt
cd %{SOURCE0}
%{venv_python} setup.py install
cd -
Trace:
+ cd /tmp/rpmvenv1fghuk2r/SOURCES/jupyterhub
+ /tmp/rpmvenv1fghuk2r/BUILDROOT/some-rpm-package-name-1.2.3-1.x86_64//opt/test/jupyterhub/bin/python setup.py install
/tmp/rpmvenv1fghuk2r/BUILDROOT/some-rpm-package-name-1.2.3-1.x86_64//opt/test/jupyterhub/bin/python: can't open file 'setup.py': [Errno 2] No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.3IcTwM (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.3IcTwM (%install)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.