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

Mock does not copy results with --short-circuit #1504

Closed
voxik opened this issue Nov 11, 2024 · 3 comments
Closed

Mock does not copy results with --short-circuit #1504

voxik opened this issue Nov 11, 2024 · 3 comments

Comments

@voxik
Copy link
Contributor

voxik commented Nov 11, 2024

Using command such as:

$ mock -r fedora-rawhide-x86_64 ruby-3.3.6-16.fc42.src.rpm -n --short-circuit install
INFO: mock.py version 5.9 starting (python version = 3.13.0, NVR = mock-5.9-1.fc42), args: /usr/libexec/mock/mock -r fedora-rawhide-x86_64 ruby-3.3.6-16.fc42.src.rpm -n --short-circuit install
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
INFO: Start(ruby-3.3.6-16.fc42.src.rpm)  Config(fedora-rawhide-x86_64)
Mock Version: 5.9
INFO: Mock Version: 5.9

 ... snip ...

Finish: rpmbuild ruby-3.3.6-16.fc42.src.rpm
Finish: build phase for ruby-3.3.6-16.fc42.src.rpm
INFO: Done(ruby-3.3.6-16.fc42.src.rpm) Config(fedora-rawhide-x86_64) 14 minutes 41 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/result
Finish: run

The result directory does not contain the resulting RPMs

$ ll /var/lib/mock/fedora-rawhide-x86_64/result/
celkem 21764
-rw-rw-r--. 1 vondruch mock  5255969 11. lis 17.13 build.log
-rw-rw-r--. 1 vondruch mock     3765 11. lis 16.59 hw_info.log
-rw-rw-r--. 1 vondruch mock    26007 11. lis 16.59 installed_pkgs.log
-rw-rw-r--. 1 vondruch mock   383523 11. lis 17.13 root.log
-rw-r--r--. 1 vondruch mock 16604787 11. lis 16.59 ruby-3.3.6-16.fc42.src.rpm
-rw-rw-r--. 1 vondruch mock     3722 11. lis 17.13 state.log
@praiskup
Copy link
Member

praiskup commented Nov 12, 2024

Honestly I never used --short-circuit with Mock so far, but - at least rpmbuild -bi doesn't produce any result RPMs that could be copied to result-dir (that would be rpmbuild -bb, and I'd expect this from Mock --short-circuit binary). Do you expect that extracted/patched sources should be copied? edited: s/--short-circuit build/--short-circuit binary/.

@praiskup praiskup moved this from Needs triage to Someday in future in CPT Kanban Nov 13, 2024
@voxik
Copy link
Contributor Author

voxik commented Nov 14, 2024

Honestly I never used --short-circuit with Mock so far, but - at least rpmbuild -bi doesn't produce any result RPMs that could be copied to result-dir (that would be rpmbuild -bb, and I'd expect this from Mock --short-circuit build). Do you expect that extracted/patched sources should be copied?

I probably don't understand why you mention -bi or -bb. I thought that Mock --short-circuit is using RPM --short-circuit.

I might be wrong and I have not tried to closely investigate, but what I expect is that Mock / rpmbuild simply keeps the buildroot as it was and continues with the %install section and everything else, until RPMs are produced. And my assumption is that the resulting packages are stored in the RPMS folder of Mock build directory.

@voxik
Copy link
Contributor Author

voxik commented Nov 14, 2024

Just confirmed that also the /var/lib/mock/ruby/root/builddir/build/RPMS/ dir is empty:

$ LC_ALL=C.UTF-8 ll /var/lib/mock/ruby/root/builddir/build/RPMS/
total 0

Reading the $ man 8 rpmbuild, it seems that the -bi is really not supposed to create the RPMS. And this is also documented in mock documentation:

       --short-circuit=STAGE
              Use rpmbuild's short-circuit mechanism to skip already executed stages of the build.  It doesn't produce RPMs, and it's useful only for debugging packaging. Implies --no-clean. STAGE specifies which stage will be  executed
              as the first.  Available values: prep, build, install, binary.

So I likely need to combine install and binary.

So everything likely works as expected. Thank you and sorry for the noise.

@voxik voxik closed this as completed Nov 14, 2024
@voxik voxik reopened this Nov 14, 2024
@github-project-automation github-project-automation bot moved this from Someday in future to Needs triage in CPT Kanban Nov 14, 2024
@voxik voxik closed this as completed Nov 14, 2024
@nikromen nikromen moved this from Needs triage to Done in CPT Kanban Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants