Description of problem: If I mount a directory into chroot using bind_mount plugin that has the target within build users home (/builddir by default), the directory contents get wiped when the buildroot is cleaned. Version-Release number of selected component (if applicable): mock-1.2.21-1.fc24.noarch How reproducible: always Steps to Reproduce: 1. mkdir ~/somedir; touch ~/somedir/foo 2. Add the following to mock config: config_opts['plugin_conf']['bind_mount_enable'] = True import os config_opts['plugin_conf']['bind_mount_opts']['dirs'].append((os.path.expanduser('~/.somedir'), '/builddir/somedir' )) 3. build something in given chroot Actual results: ~/somedir/foo gets deleted Expected results: ~/somedir contents are left untouched Additional info: I think mock should either move the mount execution to later phase (after cleaning) or use an equivalent of rm --one-filesystem when deleting.
This is expected behaviour. See relevant part from siteconfig.cfg # The build user's homedir is partially cleaned up even when --no-clean is # specified in order to prevent garbage from previous builds from altering # successive builds. Mock can be configured to exclude certain files/directories # from this. Default is SOURCES directory to support nosrc rpms. Paths are # relative to build user's homedir # config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES'] I will rather add this information to wiki documenting mount plugin.
Done. See https://github.com/rpm-software-management/mock/wiki/Plugin-Mount
(In reply to Miroslav Suchý from comment #1) > This is expected behaviour. See relevant part from siteconfig.cfg > > # The build user's homedir is partially cleaned up even when --no-clean is > # specified in order to prevent garbage from previous builds from altering > # successive builds. Mock can be configured to exclude certain > files/directories > # from this. Default is SOURCES directory to support nosrc rpms. Paths are > # relative to build user's homedir > # config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES'] > > I will rather add this information to wiki documenting mount plugin. I don't think that documenting is enough. After all, I'm the one who was reimplementing the cleanup logic (and the exclusions) during GSoC, so I knew all that already. And yet, I deleted my data this way. Because when using something as simple as mount plugin, people don't expect it will rm -rf their data outside of mock chroot. If you don't want to work on this, I'll try to prepare a solution myself.
> I'll try to prepare a solution myself. Fair enough.
Submitted: https://github.com/rpm-software-management/mock/pull/13 BTW, the exclusions didn't help with the problem, so you should revert the suggestion in the docs.
mock-1.3.3-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-1c15f1fddc
mock-1.3.3-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-5947ef9fd1
mock-1.3.3-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-77cb570c74
mock-1.3.3-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-3b5bb282f4
mock-1.3.3-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-1c15f1fddc
mock-1.3.3-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-3b5bb282f4
mock-1.3.3-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-77cb570c74
mock-1.3.3-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-5947ef9fd1
mock-1.3.3-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.3.3-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.3.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.3.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.