-
Notifications
You must be signed in to change notification settings - Fork 86
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
base: main
Are you sure you want to change the base?
Conversation
@@ -32,6 +32,7 @@ function build_rpms() { | |||
|
|||
# Note: _build_name_fmt requires escaped %% for use in headerSprintf() | |||
rpmbuild -ba \ | |||
--dbpath "${RPMBUILD_TOPDIR}" \ |
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 means it cannot read dependencies installed on the system for building packages.
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.
And this is a problem because we don't use --nodeps
, so we actually do expect to have build deps installed.
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 there a possibility to add build-time dependencies to test packages? They don't have any and testcases will pass right now.
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.
Maybe? I'm not sure.
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.
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.
rpmbuild with default dbpath will write to /var/lib/rpm. Set it to the temporary directory.
6c7075b
to
256508b
Compare
Eh, rpmbuild does not write to rpmdb. It will only read from it, and the only situation where that will result in actual writing is when the database doesn't exist at all. What is the actual problem you're experiencing? |
@pmatilai The main rpmdb itself does not get written as you say, but its WAL related files rpmdb.sqlite-{shm,wal} do. detail
|
There wouldn't be any system rpmdb on Gentoo. |
--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 \ |
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.
--nodeps is not good. The tests needs to be adapted to resolve all dependencies from a nonsystem --dbpath.
rpmbuild with default dbpath will write to /var/lib/rpm. Set it to the temporary directory.