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

xbps-src: check for existing packages before syncing chroot repodata #37595

Merged

Conversation

JamiKettunen
Copy link
Contributor

@JamiKettunen JamiKettunen commented Jun 17, 2022

Testing the changes

  • I tested the changes in this PR: briefly

This significantly speeds up the package building process for build scripts etc. that run ./xbps-src pkg ... on a long list of packages that may already have up-to-date local packages built when configured with XBPS_PRESERVE_PKGS set.

I still have one question: what to do with the existing call to check_existing_pkg in common/xbps-src/libexec/build.sh? The script appears to be executed from a few other scripts as well so I left it alone for now.

Example with a single package

Before this patch:

void-packages $ time ./xbps-src pkg helvum
=> xbps-src: updating repositories for host (x86_64)...
[*] Updating repository `https://repo-default.voidlinux.org/current/x86_64-repodata' ...
[*] Updating repository `https://repo-default.voidlinux.org/current/nonfree/x86_64-repodata' ...
[*] Updating repository `https://repo-default.voidlinux.org/current/debug/x86_64-repodata' ...
[*] Updating repository `https://repo-default.voidlinux.org/current/multilib/x86_64-repodata' ...
[*] Updating repository `https://repo-default.voidlinux.org/current/multilib/nonfree/x86_64-repodata' ...
=> xbps-src: updating software in / masterdir...
=> xbps-src: cleaning up / masterdir...
=> helvum-0.3.4_2: removing autodeps, please wait...
=> WARNING: helvum-0.3.4_2: skipping build due to existing /host/binpkgs//helvum-0.3.4_2.x86_64.xbps

real	0m1.980s
user	0m0.504s
sys	0m0.113s

After this patch:

void-packages $ time ./xbps-src pkg helvum
=> WARNING: helvum-0.3.4_2: skipping build due to existing /host/binpkgs//helvum-0.3.4_2.x86_64.xbps

real	0m0.062s
user	0m0.041s
sys	0m0.024s

Previously this would add up to about a minute of waiting for essentially no reason if 30 packages already have up-to-date local packages, while with this patch it would only take about 2 seconds to come to the same conclusion with the same package list.

This significantly speeds up the package building process for build
scripts etc. that run './xbps-src pkg ...' on a long list of packages
that may already have up-to-date local packages built when configured
with XBPS_PRESERVE_PKGS set.
@JamiKettunen JamiKettunen marked this pull request as draft June 17, 2022 10:23
@Chocimier
Copy link
Member

Looks good to me. Leaving check in other places is correct.

@JamiKettunen
Copy link
Contributor Author

Cool, I'll mark this as ready for review then :)

@JamiKettunen JamiKettunen marked this pull request as ready for review June 17, 2022 17:02
@the-maldridge the-maldridge merged commit bda1ef7 into void-linux:master Jun 17, 2022
@JamiKettunen JamiKettunen deleted the faster-skip-existing-build branch June 18, 2022 12:39
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

Successfully merging this pull request may close these issues.

None yet

4 participants