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

move update-check out of xbps-src #31602

Closed
wants to merge 3 commits into from

Conversation

sgn
Copy link
Member

@sgn sgn commented Jun 22, 2021

Continue discussion from #31546

It's better to rewrite in a real programming language, however this is enough for now.

TODO: check only distfiles.

The eval step should be removed when we can remove all variable except pkgname and version from distfiles, and merge the first distfiles to the same line of distfiles=

@void-linux/pkg-committers
@the-maldridge moving out of xbps-src, we can drop the weird XBPS_ALLOW_CHROOT_BREAKOUT=yes from update-check container.

@the-maldridge
Copy link
Member

I had started a rewrite in Go, but our regexes require backtracking (\K) , which prevented this from being reasonable. If we had a mechanical way to remove our need for backtracking, it would be fairly easy to pick that back up and make it work.

@Gottox
Copy link
Member

Gottox commented Jun 22, 2021

Can you elaborate on the reason? 'It's better' is a bit vague for my taste.

@the-maldridge
Copy link
Member

@Gottox a primary reason is that shell lacks high parallelism and its difficult to extend. There's a lot more we could be doing with this data but because its in an awkward format its difficult to actually use.

@sgn
Copy link
Member Author

sgn commented Jun 22, 2021

The reason to move out of xbps-src is:

  • update-check doesn't need xbps
  • running inside xbps-src requires xbps
  • running inside xbps-src requires either chrooting (which requires xbps) or XBPS_ALLOW_CHROOT_BREAKOUT
  • rewrite in a real programming language could speed things up a bit

sgn added 3 commits June 23, 2021 23:35
This script will read necessary variables from template, then calling
the old update_check method.
The change is best-viewed with git diff --color-moved
@sgn sgn force-pushed the move-update-check-out-of-xbps-src branch from d332ba7 to 3a53591 Compare June 23, 2021 16:36
@Chocimier
Copy link
Member

check only distfiles

homepage and site are important too

remove all variable except pkgname and version from distfiles

There are templates that use wrksrc, _distver being custom transformation of version and more.

update-check doesn't need xbps

It uses dewey version sort with xbps-uhelper cmpver and needs to use it more. Current sort -Vu sorts beta releases as greater than final releases - so that xupdate updates templates that for some reasons are in 2beta1 version to 2beta2 rather than 2.

requires [...] XBPS_ALLOW_CHROOT_BREAKOUT

Is this problem?

could speed things up a bit

Test was done on templates with 0. prepended to version to force matches.
There are around 60 packages for which new versions are not detected after that change as for now, not counting R and ruby packages defining distfiles in build style.
Run time of void-updates -p 5 went down by 5min, from 2h 25min to 2h 20min. On same machine, xbps-src show for all packages takes around 10 min - limit of what can be expected to improve.
Roughly half of execution time was spent in void-updates' get_date - but this is not representative, as there are more found versions that usually.

My conclusion is that this is micro-optimization that doesn't touch real problem pointed by maldridge - templates being bash programs depending on lot of xbps-src code that are complex to really understand, hard or slow to process for all usecases, like cycle detection.

@github-actions
Copy link

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

@github-actions github-actions bot added the Stale label May 23, 2022
@github-actions github-actions bot closed this Jun 6, 2022
@sgn sgn deleted the move-update-check-out-of-xbps-src branch August 23, 2023 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants