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

Do not create temporary Buildroot.tmpdir for disabled nosync #1363

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
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
31 changes: 17 additions & 14 deletions mock/py/mockbuild/buildroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ def _setup_files_postinstall(self):

@traceLog()
def _setup_nosync(self):
if not self.config['nosync']:
return

multilib = ('x86_64', 's390x')
# ld_preload need to be same as in bootstrap because we call DNF in bootstrap, but
# but it will load nosync from the final chroot
Expand All @@ -903,20 +906,20 @@ def resolve(path):
shutil.copy2(nosync, dst)
return True

if self.config['nosync']:
target_arch = self.config['target_arch']
copied_lib = copy_nosync()
copied_lib64 = copy_nosync(lib64=True)
if not copied_lib and not copied_lib64:
self.root_log.warning("nosync is enabled but the library "
"wasn't found on the system")
return
if (target_arch in multilib and not self.config['nosync_force']
and copied_lib != copied_lib64):
self.root_log.warning("For multilib systems, both architectures"
" of nosync library need to be installed")
return
self.nosync_path = os.path.join(tmp_libdir, 'nosync.so')
target_arch = self.config['target_arch']
copied_lib = copy_nosync()
copied_lib64 = copy_nosync(lib64=True)
if not copied_lib and not copied_lib64:
self.root_log.warning("nosync is enabled but the library "
"wasn't found on the system")
return
if all([target_arch in multilib,
not self.config['nosync_force'],
copied_lib != copied_lib64]):
self.root_log.warning("For multilib systems, both architectures"
" of nosync library need to be installed")
return
self.nosync_path = os.path.join(tmp_libdir, 'nosync.so')

@traceLog()
def finalize(self):
Expand Down
3 changes: 3 additions & 0 deletions releng/release-notes-next/no-tmpdir-for-no-nosync.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The `nosync` logic was preparing temporary directories even when
`config_opts["nosync"] = False` (meaning nosync was disabled). This logic has
been optimized out. Works around [issue#1351][].
Loading