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

check if bootstrap buildroot has tpmdir #1362

Closed
Closed
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
2 changes: 1 addition & 1 deletion mock/py/mockbuild/buildroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ def _setup_nosync(self):
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
if self.bootstrap_buildroot is not None:
if self.bootstrap_buildroot is not None and self.bootstrap_buildroot.tmpdir is not None:
Copy link
Member

Choose a reason for hiding this comment

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

To review this properly, I need help with interpreting 75e3f8a, @xsuchy do you remember the reasons for making bootstrap.tmpdir == buildroot.tmpdir?

Copy link
Member

Choose a reason for hiding this comment

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

@nikromen I bet the reason this happens is that bootstrap chroot is (sometimes, according to original reporter) locked, so bootstrap._init() is skipped.

Copy link
Member

Choose a reason for hiding this comment

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

Depending on the need for 75e3f8a, we may either update the _init_locked() fallback, or we can stop sharing the directories.

Copy link
Member

Choose a reason for hiding this comment

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

No. I do not remember. The only clue for today's-us is the comment above the code and the referenced issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@praiskup how 7b40a26 relates with the #1351 and this PR? Is still some action needed in this PR?

Copy link
Member

Choose a reason for hiding this comment

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

I think that what is happening is:

  • one mock process initializes the bootstrap chroot and buildroot, and has them "locked"
  • another mock process tries to initialize bootstrap, but fails to lock ... so it doesn't initialize the tmptdir value for bootstrap, so the buildroot's bootstrap_buildroot.tmpdir value is None later

The commit 7b40a26 relates to this because with that we started sharing tmpdir directory for bootstrap and target chroot's (both Buildroot's have the same .tmpdir value), the question is whether we need that.

The .tmpdir is only used by nosync logic, and nosync is broken. So it is quite complicated to fix at this point in time.

self.tmpdir = self.bootstrap_buildroot.tmpdir
if not os.path.isdir(self.tmpdir):
os.mkdir(self.tmpdir, 0o700)
Expand Down
3 changes: 3 additions & 0 deletions releng/release-notes-next/fix-mock-init.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mock --init occasionally failed because bootstrap buildroot hadn't
set up its temporary directory ([issue#1351][]).

Loading