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

test: prevent rpmbuild from writing to system rpmdb #1234

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/data/build-rpms-and-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ function build_rpms() {

# Note: _build_name_fmt requires escaped %% for use in headerSprintf()
rpmbuild -ba \
--dbpath "${RPMBUILD_TOPDIR}" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means it cannot read dependencies installed on the system for building packages.

Copy link
Member

@Conan-Kudo Conan-Kudo Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is a problem because we don't use --nodeps, so we actually do expect to have build deps installed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a possibility to add build-time dependencies to test packages? They don't have any and testcases will pass right now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, DNF5 tests should be self-contained, i.e. independent from the system RPM database. But I worry many of them are not. If rpmbuild --dbpath breaks the tests, the tests needs to be fixed in the pull request or before this pull request.

--define="_topdir ${RPMBUILD_TOPDIR}" \
--define="_srcrpmdir ${TARGET_DIR}" \
--define="_rpmdir ${TARGET_DIR}" \
--define="_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
--define="_source_payload w1.gzdio" \
--define="_binary_payload w1.gzdio" \
--nodeps \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--nodeps is not good. The tests needs to be adapted to resolve all dependencies from a nonsystem --dbpath.

"${SPEC}"

rm -rf "${RPMBUILD_TOPDIR}"
Expand Down
Loading