diff --git a/mock/py/mockbuild/buildroot.py b/mock/py/mockbuild/buildroot.py index ef99f0c14..4a87f3aab 100644 --- a/mock/py/mockbuild/buildroot.py +++ b/mock/py/mockbuild/buildroot.py @@ -211,7 +211,6 @@ def _setup_basedir(self): mockgid = grp.getgrnam('mock').gr_gid os.chown(self.basedir, os.getuid(), mockgid) os.chmod(self.basedir, 0o775) - file_util.mkdirIfAbsent(self.make_chroot_path()) @traceLog() def _setup_result_dir(self): @@ -276,6 +275,7 @@ def _fallback(message): def _init(self, prebuild): self.state.start("chroot init") self._setup_basedir() + file_util.mkdirIfAbsent(self.make_chroot_path()) self.plugins.call_hooks('mount_root') # intentionally we do not call bootstrap hook here - it does not have sense self._setup_nosync() diff --git a/releng/generate-release-notes b/releng/generate-release-notes index a4026459f..c9fa9cf87 100755 --- a/releng/generate-release-notes +++ b/releng/generate-release-notes @@ -10,6 +10,7 @@ TRANSFORM = { "issue": "https://github.com/rpm-software-management/mock/issues/{id}", "PR": "https://github.com/rpm-software-management/mock/pull/{id}", "commit": "https://github.com/rpm-software-management/mock/commit/{id}", + "copr_issue": "https://github.com/fedora-copr/copr/issues/{id}", } TEMP_FILE = ".Release-Notes-Next.md" diff --git a/releng/release-notes-next/create-rootdir-for-each-build.bugfix b/releng/release-notes-next/create-rootdir-for-each-build.bugfix new file mode 100644 index 000000000..9913d9c57 --- /dev/null +++ b/releng/release-notes-next/create-rootdir-for-each-build.bugfix @@ -0,0 +1,17 @@ +[commit#1e13b56ce3c0efdf81][] caused "basedir" to be created only once per Mock +run, but likewise directory "rootdir" was created only once. + +Since Mock automatically unmounts rootdir **after each build** and then +also **removes the rootdir** directory to finish the cleanup tasks (at +least if tmpfs or other "root" plugin is in use, --resultdir is in +use, ...), subsequent builds failed to re-mount the rootdir with, e.g.: + + ERROR: Command failed: + $ mount -n -t tmpfs -o mode=0755 -o nr_inodes=0 -o size=140g mock_chroot_tmpfs /var/lib/mock/fedora-37-x86_64-1694797505.326095/root + +This caused problems e.g. [in Fedora Copr][copr_issue#2916] where each +Mock build is actually a two-step build done like: + + mock --spec foo.spec --sources . --resultdir ... + +So Mock first builds SRPM, and then builds RPMs (two builds in one run).