-
Notifications
You must be signed in to change notification settings - Fork 83
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
update fedora spec file and tarball generation script #1770
Conversation
The offical fedora rpm depends on the url source tarball. Split tarball generation out so it is easier to generate. Generalize the naming of the tarball to follow the convention of -.tar.gz. Fix opae.spec to use the new source loction opae-/ Generalize the tarball excludes all hidden files Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
packaging/opae/rpm/create
Outdated
'python3-virtualenv' \ | ||
'python3-pip' \ | ||
'systemd' \ | ||
'systemd-rpm-macros' \ | ||
'rpmdevtools' | ||
do | ||
yum list installed "${pkg}" >/dev/null 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use dnf instead of yum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
- Fix code review comments Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
opae.spec
Outdated
License: BSD | ||
ExclusiveArch: x86_64 | ||
|
||
Group: Development/Libraries | ||
Vendor: Intel Corporation | ||
Requires: uuid, json-c, python3 | ||
URL: https://github.com/OPAE/%{name}-sdk | ||
Source0: https://github.com/OPAE/opae-sdk/releases/download/%{version}-1/%{name}.tar.gz | ||
Source0: https://github.com/OPAE/opae-sdk/releases/download/%{version}-1/%{name}-%{version}.tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the '1' in %{version}-1 should be replaced by a variable.
Perhaps using %{release} or %{Release} could work since the release is set in line 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Hi Ananda, Tim and Rodrigo,
If it's alright with you I'm reviewing 1770 in this email.
We were able to use the clean script to build successfully on Fedora 32.
However we did have a couple of problems when we tried to use the script on
Fedora rawhide.
ex/
There is failure in the build log
tools/extra/fpgadiag/cmakeFiles/eth-group.dir/eth-group.cpp.o"
Which looks like a new compiler warning is causing an error.
Is it necessary to resolve these problems for this pr or is this something
for later ?
Please let me know if you have any questions about testing this on rawhide.
Thank you
Gwen
…On Thu, Dec 10, 2020 at 5:43 PM Tim Whisonant ***@***.***> wrote:
***@***.**** approved this pull request.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#1770 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARY5FTJQO22GJ4UNAQ5I663SUFFG5ANCNFSM4UNV2YPQ>
.
|
packaging/opae/rpm/create
Outdated
rm -rf _build | ||
mkdir _build | ||
cd _build | ||
cmake .. -DOPAE_BUILD_LEGACY=ON -DOPAE_BUILD_TESTS=ON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command is erroring out because line 88 changes directory to the parent of the codebase root directory (${SDK_DIR}).
A better way would be to not change directories and use source/build paths when calling cmake.
CMAKE_BUILD_DIR="${SDK_DIR}/_build"
rm -rf ${CMAKE_BUILD_DIR}
mkdir ${CMAKE_BUILD_DIR}
cmake -S ${SDK_DIR} -B ${CMAKE_BUILD_DIR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
packaging/opae/rpm/create
Outdated
|
||
cd "${SCRIPT_DIR}" | ||
cp ./opae.spec "${RPMBUILD_DIR}/SPECS" | ||
|
||
${SDK_DIR}/packaging/changelog.py rpm \ | ||
--git-dir="${SDK_DIR}/.git" \ | ||
--project="opae" \ | ||
--project-version="${PROJECT_VERSION}" \ | ||
--project-version="${version}" \ | ||
>> "${RPMBUILD_DIR}/SPECS/opae.spec" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appends the latest changelog commits to the the end of the opae.spec copy which violates the requirement that the changelog be in reverse descending order.
We either need to insert the changelog commits in opae.spec or use the output of the this script to insert it in the appropriate location. I would recommend we do the former (committing it in opae.spec) instead of calling it in create. Doing it this way also allows for the creation of the RPM(s) depend only on the tarball and the .spec file itself.
It would looks something like the following (note, I had to manually set the release in this text as this changelog script only uses the version):
* Mon Dec 14 2020 The OPAE Dev Team <opae@lists.01.org> - 2.0.0-2
- fix code review comments
- fix coding style
- add create tarball script
- update fedora spec file and tarball generation script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was that there should be no changelog stored in opae.spec (the last thing in the file would be the %changelog line). This way, we don't need to maintain super long changelogs, and we're not shipping changelogs for releases where they don't apply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not fixed because this script is still appending changelog to the opae.spec copy in ${RPMBUILD_DIR}/SPECS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${RPMBUILD_DIR}/SPECS add change log specific to PR
%changelog-> Release info, highlights of this release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a change log is required in the fedora project so when this spec file is moved there at the least the release builds will need to be tracked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Remove ${RPMBUILD_DIR}/SPECS from RPM create file.
change log hard coded in opae.spec file
fpgad\ | ||
fpgad-api\ | ||
fpgad-vc\ | ||
%cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DOPAE_PRESERVE_REPOS=ON -DOPAE_BUILD_LEGACY=ON -DOPAE_BUILD_SAMPLES=ON -B $PWD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to specify python version as 3.9 as it defaults to 2.7.
-DOPAE_PYTHON_VERSION=3.9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by default rpm creation process uses python version 3.9 , no need to set python version in cmake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to tell OPAE build system which Python to look for. This default used to be 2.7 but was changed to 3.6 before it was changed to 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the cmake infra auto detect the python version and bail when it is not supported ? I am thinking of the use case where 3.8 would also work and the user would need to know to upgrade to 3.9 and to use 3.9 in the configure step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding -DOPAE_PYTHON_VERSION=3.9
we are essentially telling cmake to bail if the Python that is found is not 3.9.
That is why we should change it from 2.7 to 3.9. We could also omit the version from the call to find_package
but I'd rather not and be explicit about the required Python version.
@gwencasey96,
|
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
packaging/opae/rpm/create-tarball.sh
Outdated
--exclude=_build \ | ||
--exclude=.* \ | ||
--exclude=*~ \ | ||
--exclude=doc\sphinx \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be doc/sphinx
?
fpgad\ | ||
fpgad-api\ | ||
fpgad-vc\ | ||
%cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DOPAE_PRESERVE_REPOS=ON -DOPAE_BUILD_LEGACY=ON -DOPAE_BUILD_SAMPLES=ON -B $PWD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to tell OPAE build system which Python to look for. This default used to be 2.7 but was changed to 3.6 before it was changed to 3
opae.spec
Outdated
* Thu Sep 17 2020 Ananda Ravuri <ananda.ravuri@intel.com> 2.0.0-1 | ||
* Mon Dec 14 2020 The OPAE Dev Team <opae@lists.01.org> - 2.0.0-2 | ||
- fix code review comments | ||
- fix codeing style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/codeing/coding/
packaging/opae/rpm/create
Outdated
|
||
cd "${SCRIPT_DIR}" | ||
cp ./opae.spec "${RPMBUILD_DIR}/SPECS" | ||
|
||
${SDK_DIR}/packaging/changelog.py rpm \ | ||
--git-dir="${SDK_DIR}/.git" \ | ||
--project="opae" \ | ||
--project-version="${PROJECT_VERSION}" \ | ||
--project-version="${version}" \ | ||
>> "${RPMBUILD_DIR}/SPECS/opae.spec" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not fixed because this script is still appending changelog to the opae.spec copy in ${RPMBUILD_DIR}/SPECS.
Signed-off-by: lab <lab@psera2-dell21.ra.intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the Python files, we should either do one of the following choices:
- remove --record in the setup call and be a little more explicit in the glob pattern for the Python files installed.
%files devel
#...
/usr/lib/python3*/site-packages/opae
/usr/lib/python3*/site-packages/pacsign
- concatenate the two files (INSTALLED_OPAE_ADMIN_FILES, INSTALLED_PACSIGN_FILES) into a file that gets referenced in the %files devel section, like the following:
cat $prev/INSTALLED_OPAE_ADMIN_FILES >$prev/DEVEL_PYTHON_INSTALLED_FILES
cat $prev/INSTALLED_PACSIGN_FILES >>$prev/DEVEL_PYTHON_INSTALLED_FILES
%files devel -f DEVEL_PYTHON_INSTALLED_FILES
Also, pacsign has a dependency on python-pkcs11 but there doesn't seem to be an RPM that installs it.
Because of this, the dependency generator in rpmbuild will create an implicit dependency for it.
The best way to install it right now is with pip (pip install python-pkcs11
) and beecause we can't express this dependency as an RPM dependency right now, it's best we tell rpmbuild to disable the dependency generator with this %{?python_disable_dependency_generator}
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_dependencies
opae.spec
Outdated
@@ -166,15 +142,15 @@ DESTDIR=%{buildroot} cmake -DCOMPONENT=toolfpgad_api -P cmake_install.cmake | |||
DESTDIR=%{buildroot} cmake -DCOMPONENT=toolfpgad_vc -P cmake_install.cmake | |||
|
|||
prev=$PWD | |||
pushd %{_topdir}/BUILD/opae/python/opae.admin/ | |||
pushd %{_topdir}/BUILD/%{name}-%{version}/python/opae.admin/ | |||
%{__python3} setup.py install --single-version-externally-managed --root=%{buildroot} --record=$prev/INSTALLED_OPAE_ADMIN_FILES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--record is used to record the files installed but the file (INSTALLED_OPAE_ADMIN_FILES) isn't referenced
opae.spec
Outdated
%{__python3} setup.py install --single-version-externally-managed --root=%{buildroot} --record=$prev/INSTALLED_OPAE_ADMIN_FILES | ||
popd | ||
|
||
pushd %{_topdir}/BUILD/opae/python/pacsign | ||
pushd %{_topdir}/BUILD/%{name}-%{version}/python/pacsign | ||
%{__python3} setup.py install --single-version-externally-managed --root=%{buildroot} --record=$prev/INSTALLED_PACSIGN_FILES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--record is used to record the files installed but the file (INSTALLED_PACSIGN_FILES) isn't referenced.
opae.spec
Outdated
@@ -300,4 +281,4 @@ popd | |||
- Various compiler warning fixes | |||
- Various memory leak fixes | |||
- Various Static code scan bug fixes | |||
- Added new FPGA MMIO API to write 512 bits | |||
- Added new FPGA MMIO API to write 512 bits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing EOL char
I missed it was still missing this: %{?python_disable_dependency_generator}
%{__python3} setup.py install --single-version-externally-managed --root=%{buildroot} --record=$prev/INSTALLED_OPAE_ADMIN_FILES | ||
popd | ||
|
||
pushd %{_topdir}/BUILD/opae/python/pacsign | ||
pushd %{_topdir}/BUILD/%{name}-%{version}/python/pacsign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still missing this macro:
%{?python_disable_dependency_generator}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build was successful on Fedora rawhide as of yesterday and successful on Fedora 33 as of today-but you may have one extra rpmbuild directory you do not need with the tarball that create built
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
@@ -73,12 +73,12 @@ | |||
#define MAP_1G_HUGEPAGE (0x1e << MAP_HUGE_SHIFT) /* 2 ^ 0x1e = 1G */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is a part of opae-libs, so it needs to be submitted to that repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anandaravuri, please be sure this file is removed from the pull request and submitted to opae-libs instead.
issues above look ok. running rpmlint on opae and opae-devel show known problems. |
Hi Tom, regarding the placement of libfpgad-api.so.2.0.0, this library is the glue between the fpgad daemon and the plugins that it loads. The remainder of the fpgad files are also packaged in opae-devel. Should we place this file elsewhere when all the other files are in opae-devel? Just trying to understand the best approach. |
i think rpmlint is getting hung up with all the *.so going to -devel. I think libfpgad-api.so need to be handled like the other versioned *.so's .. I am thinking of something like this diff --git a/opae.spec b/opae.spec
|
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Fixes an rpmlint issue Signed-off-by: Tom Rix <trix@redhat.com>
Though the tarball can be extracted from the source rpm, it is convient to have it already have it with the rpms. This will make posting the tarball in the offical release easier. Signed-off-by: Tom Rix <trix@redhat.com>
This file is part of the jsonscheme internal testsuite, so it is not needed. Resolves an rpmlint issue with devel rpm. Signed-off-by: Tom Rix <trix@redhat.com>
Tom PR changes "Split tarball generation for rpm generation #1753" in incorporated
#1753
The offical fedora rpm depends on the url source tarball.
Split tarball generation out so it is easier to generate.
Generalize the naming of the tarball to follow the convention
of -.tar.gz.
Fix opae.spec to use the new source loction opae-/
Generalize the tarball excludes all hidden files
Signed-off-by: anandaravuri ananda.ravuri@intel.com