Bug 1857918 - RFE: --addrepo does not work with --rebuild && --resultdir should warn for --chain mode
Summary: RFE: --addrepo does not work with --rebuild && --resultdir should warn for --...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 32
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Copr Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-16 18:16 UTC by Jan Kratochvil
Modified: 2020-10-02 09:10 UTC (History)
10 users (show)

Fixed In Version: mock-2.6-1.fc32 mock-2.6-1.el7 mock-2.6-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-19 22:39:07 UTC
Type: Bug


Attachments (Terms of Use)

Description Jan Kratochvil 2020-07-16 18:16:47 UTC
Description of problem:
I needed to install extra package for --rebuild, how to do that?

Version-Release number of selected component (if applicable):
mock-2.3-1.fc32.noarch

How reproducible:
Always.

Steps to Reproduce #1:
mock ... -a https://people.redhat.com/jkratoch/dwzrepo/ --rebuild X.src.rpm

Actual results:
-a is ignored.

Expected results:
Either -a works or at least mock errors out that -a and --rebuild are incompatible.

Steps to Reproduce #2:
mock ... -a https://people.redhat.com/jkratoch/dwzrepo/ --resultdir=$PWD/resultdir --chain X.src.rpm

Actual results:
$PWD/resultdir is created but there is no real content, the real content is in:
  /var/tmp/mock-chain-root-856187-246q4972/results/fedora-32-x86_64/dialog-1.3-24.20191210.fc32/

Expected results:
The real results are in $PWD/resultdir.

Additional info:
In general there are two implementation - for --rebuild and for --chain, they should be merged as much as possible.

I had to workaround it with:
    # --chain ignores --resultdir
    resultdirsrc="$(sed -n 's/^INFO: Results out to: //p' $srcrpm$ext.mocklog)"
    if [ ! -e $resultdirsrc/*/root.log ];then
      touch $srcrpm$ext.mockrfail
      break
    fi
    # With --chain $resultdir contains just some small *.log files.
    rm -rf $resultdir
    mv `dirname $resultdirsrc/*/root.log` $resultdir

Comment 1 Silvie Chlupova 2020-07-17 13:22:25 UTC
The switches should work together, I'm not sure what's causing the problem right now. Thank you for the report.

Comment 2 Jan Kratochvil 2020-07-17 13:30:09 UTC
man page:
       -a, --addrepo=REPO
              Add  this  repo  baseurl  to the yumconfig for the chroot. This can be specified multiple times. Let's you point to multiple paths beyond the default to pull build deps from.
              This has effect only for --chain command

The only code using 'options.repo':
        for baseurl in options.repos:
            util.add_local_repo(self.config, baseurl,
                                bootstrap=buildroot.bootstrap_buildroot)
is in function:
    def chain(self, args, options, buildroot):

Comment 3 Pavel Raiskup 2020-07-27 08:19:16 UTC
With --chain, you can use --localrepo=REPO option.  Both the
--resultdir and --addrepo options are documented to have no effect in
--chain mode.  But you are right that we should throw useful errors
with suggestions.

Comment 4 Pavel Raiskup 2020-07-27 08:27:34 UTC
And I don't see a reason why `-a` couldn't affect the `--rebuild` mode
at this moment, this is leftover IMO:

Mockchain (mock --chain now) used to be a completely different script
before; and it was merged quite recently into mock exactly for this reason
-- to de-duplicate the code-base..  when this happened, most of the stuff
historically implemented in mock started to automatically work in
mockchain, but we probably forgot about the `mockchain` things that
should/could be back-ported to `mock --rebuild`.

Comment 6 Fedora Update System 2020-09-15 18:33:05 UTC
FEDORA-2020-f7ce2b3a71 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-f7ce2b3a71

Comment 7 Fedora Update System 2020-09-15 18:33:26 UTC
FEDORA-2020-ef6074cb37 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-ef6074cb37

Comment 8 Fedora Update System 2020-09-15 18:34:11 UTC
FEDORA-2020-8b8b3ade7b has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-8b8b3ade7b

Comment 9 Fedora Update System 2020-09-16 05:21:34 UTC
FEDORA-EPEL-2020-07a27d3e56 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-07a27d3e56

Comment 10 Fedora Update System 2020-09-16 05:22:43 UTC
FEDORA-EPEL-2020-0996fb7a3c has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-0996fb7a3c

Comment 11 Fedora Update System 2020-09-16 14:30:08 UTC
FEDORA-2020-f7ce2b3a71 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-f7ce2b3a71`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-f7ce2b3a71

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2020-09-16 14:39:59 UTC
FEDORA-EPEL-2020-0996fb7a3c has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-0996fb7a3c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2020-09-16 14:58:22 UTC
FEDORA-EPEL-2020-07a27d3e56 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-07a27d3e56

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2020-09-16 15:36:00 UTC
FEDORA-2020-ef6074cb37 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-ef6074cb37`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-ef6074cb37

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2020-09-16 18:55:51 UTC
FEDORA-2020-8b8b3ade7b has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-8b8b3ade7b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-8b8b3ade7b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2020-09-19 22:39:07 UTC
FEDORA-2020-f7ce2b3a71 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2020-09-23 18:10:26 UTC
FEDORA-2020-ef6074cb37 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2020-09-25 16:43:54 UTC
FEDORA-2020-8b8b3ade7b has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2020-10-01 00:30:50 UTC
FEDORA-EPEL-2020-0996fb7a3c has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2020-10-01 01:41:49 UTC
FEDORA-EPEL-2020-07a27d3e56 has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Jan Kratochvil 2020-10-02 09:10:21 UTC
Thanks for the fix, it works. I could simplify my script now:
  https://git.jankratochvil.net/?p=massrebuild.git;a=commitdiff;h=010e5bfc63a70e5e5f384199443288e2490b4f3d


Note You need to log in before you can comment on or make changes to this bug.