#771 Set mock old-chroot for runroot if not new-chroot
Closed 6 years ago by mikem. Opened 6 years ago by puiterwijk.
puiterwijk/koji runrootoldchroot  into  master

@@ -185,6 +185,8 @@ 

              mock_cmd = ['chroot']

              if new_chroot:

                  mock_cmd.append('--new-chroot')

+             else:

+                 mock_cmd.append('--old-chroot')

              if skip_setarch:

                  #we can't really skip it, but we can set it to the current one instead of of the chroot one

                  myarch = platform.uname()[5]

Is this is a flag we want to have across the board, or is this only needed for runroot...?

The kojid already has this. Runroot was missing it so far.

The code change looks fine, as does the test output. The only failure is gssapi on EL7, which is completely unrelated to this code.

:thumbsup:

This does not match the behavior in kojid, and will break on older versions of mock that have neither of these options. In kojid, these options are only passed if the tag has an explicit setting of True or False. Otherwise, neither is passed.

Actually, runroot calls BuildRoot.mock(), which contains this logic. Seems like we could end up with duplicate or conflicting args.

I think this change need to be a little smarter about overrides. It should probably consider the broot.config['extra']['mock.new_chroot'] value (if there is one), and the default behavior should continue be no override.

I'm also working on changing the default --*-chroot behavior of mock in kojid.

As @mikem said, the problem here is older versions of mock don't have such options, so we need to check version number when creating BuildRoot.

Since we use mock cmd rather than mock python module in koji, It's a little bit tricky here to check version of mock. I'll file another PR for review.

Opting for the solution in #823

Pull-Request has been closed by mikem

6 years ago