Skip to content
Snippets Groups Projects

pmbootstrap lint: avoid looping and copying files

Merged Imported Administrator requested to merge feature/one-call-to-lint-them-all into master
All threads resolved!

Before this commit, package folders were copied into the chroot one by one in order to run apkbuild-lint on them. This logic is replaced by mounting pmaports.git into the chroot and using a single apkbuild-lint invocation to lint the supplied packages.

Both of these changes result in a performance improvement, especially when linting multiple packages at once.

Before this change:

$ time ./pmbootstrap.py -q lint $(cd ../pmaports/cross; echo *) \
    > /dev/null

real    0m5,261s
user    0m7,046s
sys     0m1,842s

Using the pmaports.git mount but calling apkbuild-lint in a loop:

$ time ./pmbootstrap.py -q lint $(cd ../pmaports/cross; echo *) \
    > /dev/null

real    0m4,089s
user    0m6,418s
sys     0m1,219s

After this change:

$ time ./pmbootstrap.py -q lint $(cd ../pmaports/cross; echo *) \
    > /dev/null

real    0m3,518s
user    0m5,968s
sys     0m0,959s

Additionally, running apkbuild-lint from the pmaports.git mount point has the benefit that every printed violation contains a nice source identifier à la "./cross/grub-x86/APKBUILD". This makes it possible to differentiate between different packages even though only a single apkbuild-lint invocation is used.

Relates: postmarketOS/pmaports#564

Edited by Administrator

Merge request reports

Checking pipeline status.

Merged by AdministratorAdministrator 3 years ago (Sep 3, 2021 6:03pm UTC)

Loading

Pipeline #187772 passed

Pipeline passed for ac4c967e on master

Deployed to dep‎loy‎ 5 months ago

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator marked this merge request as draft · Imported

    marked this merge request as draft

    By Johannes Marbach on 2021-08-30T07:50:22

  • Administrator added 1 commit · Imported

    added 1 commit

    • 36191041 - pmbootstrap lint: avoid looping and copying files

    Compare with previous version

    By Johannes Marbach on 2021-08-30T08:22:31

  • Administrator marked this merge request as ready · Imported

    marked this merge request as ready

    By Johannes Marbach on 2021-08-30T08:37:55

    • Author Owner
      Resolved by Administrator

      Additionally, running apkbuild-lint from the pmaports.git mount point has the benefit that every printed violation contains a nice source identifier à la "./cross/grub-x86/APKBUILD". This makes it possible to differentiate between different packages even though only a single apkbuild-lint invocation is used.

      Do you have an example of this new output?

      By clayton craft on 2021-08-30T15:43:43

      Edited by Ghost User
  • Administrator resolved all threads · Imported

    resolved all threads

    By clayton craft on 2021-08-30T15:55:44

  • Administrator approved this merge request · Imported

    approved this merge request

    By Alexey Min on 2021-09-01T09:02:13

  • Administrator approved this merge request · Imported

    approved this merge request

    By clayton craft on 2021-09-03T17:51:44

  • Administrator added 12 commits · Imported

    added 12 commits

    • 36191041...0b95779e - 11 commits from branch postmarketOS:master
    • ac4c967e - pmbootstrap lint: avoid looping and copying files (MR 2100)

    Compare with previous version

    By clayton craft on 2021-09-03T17:52:57

  • Author Owner

    @cherrypicker thanks for the excellent patch :D

    By clayton craft on 2021-09-03T17:53:20

  • Administrator enabled an automatic merge when the pipeline for ac4c967e succeeds · Imported

    enabled an automatic merge when the pipeline for ac4c967e succeeds

    By clayton craft on 2021-09-03T17:53:32

  • Administrator merged · Imported

    merged

Please register or sign in to reply
Loading