Alpine build tools
Go to file
Dominique Martinet dd07911cbf abuild: add default_pyc helper
Python by default pre-compiles cache files in __pycache__ directories,
which we currently happily install along in python packages.

Theses .pyc files are rather big and the time/space tradeoff could be
left to users if we just split these out to a -pyc subpackage.

With this default_pyc helper, one can add $pkgname-pyc to their
package's subpackages and it will automatically split off the pyc files
in a package that will be automatically installed if the virtual 'pyc'
package is installed.
Note that this does not work so easily if there already were python
subpackages, the function could be adjusted to strip off the last dash
if required but that seems rather rare.

Random data, sizes:
 - python3: currently 47MiB, split into 23M (main package) / 24M (pyc)
 - py3-markdown: currently 700KiB, 368K (main) / 288K (pyc)

Random benchmark, with python3-pyc:
hyperfine --warmup 5 -m 100 \
    "python3 -c 'import time; print(time.strftime(\"%T\"))'"
  Time (mean ± σ):      24.5 ms ±   2.5 ms    [User: 18.4 ms, System: 6.0 ms]
  Range (min … max):    19.4 ms …  28.9 ms    148 runs

without python3-pyc (same as user without root permissions, root would
generate files on first root, for reference this command generates 184KB
of pyc files):
hyperfine --warmup 5 -m 100 \
    -p 'rm -rf /usr/lib/python3.10/__pycache__ /usr/lib/python3.10/encodings/__pycache__' \
    "python3 -c 'import time; print(time.strftime(\"%T\"))'"
  Time (mean ± σ):      53.7 ms ±   4.3 ms    [User: 39.3 ms, System: 14.3 ms]
  Range (min … max):    47.0 ms …  65.6 ms    100 runs

Link: https://gitlab.alpinelinux.org/alpine/aports/-/issues/11906
Suggested-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
2023-04-18 13:22:14 +00:00
tests functions: read default configs from /usr/share/abuild/default.conf 2023-04-18 13:26:49 +02:00
.editorconfig .editorconfig: add Makefile rules 2020-03-23 13:16:01 +00:00
.gitattributes gitlab: highlight abuild.in as shell 2022-05-03 12:42:36 +02:00
.gitignore git ignore abulid.conf and fix make clean 2023-04-18 15:14:28 +02:00
.gitlab-ci.yml ci: add job to run tests 2021-10-07 17:24:10 +02:00
APKBUILD.5.scd Convert man pages to scdoc 2021-10-11 18:31:29 +00:00
COPYING add license GPL-2.0-only WITH OpenSSL-Exception 2020-10-23 11:30:25 -03:00
Makefile git ignore abulid.conf and fix make clean 2023-04-18 15:14:28 +02:00
abuild-fetch.c abuild-fetch: try harder to yield 2023-04-18 11:22:54 +02:00
abuild-gzsplit.c abuild: avoid calculations with void pointers 2021-10-11 18:34:27 +00:00
abuild-keygen.in abuild-keygen: use doas instead of sudo 2022-06-22 16:41:51 +02:00
abuild-rmtemp.c *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
abuild-sign.in abuild-sign: fix --installed to detect missing keys 2022-06-22 16:13:07 +02:00
abuild-sudo.c abuild: avoid calculations with void pointers 2021-10-11 18:34:27 +00:00
abuild-tar.c abuild-tar: improve invalid opt handling 2023-04-17 13:01:05 +02:00
abuild.conf.in Install default config as /usr/share/abuild/default.conf 2023-04-18 13:47:17 +02:00
abuild.in abuild: add default_pyc helper 2023-04-18 13:22:14 +00:00
abump.in abump: source APKBUILD in subshell 2022-10-15 11:06:53 +00:00
apkbuild-cpan.in apkbuild-cpan.in: remove perl-dev as a makedepends default 2023-04-14 06:41:14 +00:00
apkbuild-gem-resolver.in add .editorconfig and fix code formatting 2016-08-20 16:16:37 +02:00
apkbuild-pypi.in apkbuild-pypi.in: remove empty variables 2021-01-23 20:43:26 +00:00
apkgrel.in apkgrel: fix usage and invalid options and add test 2023-01-10 17:47:22 +01:00
bootchartd replace deprecated `...` syntax with $(...) in shell scripts 2016-08-23 00:09:07 +02:00
buildlab.in buildlab: use grep -E instead of egrep 2022-09-12 17:20:47 +02:00
checkapk.in *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
config.guess Update config.guess, config.sub, to 2021-06-03 2023-04-14 08:35:48 +02:00
config.sub Update config.guess, config.sub, to 2021-06-03 2023-04-14 08:35:48 +02:00
default.conf default.conf: drop -fomit-frame-pointer 2023-04-18 13:50:22 +02:00
functions.sh.in functions: read default configs from /usr/share/abuild/default.conf 2023-04-18 13:26:49 +02:00
newapkbuild.1.scd Convert man pages to scdoc 2021-10-11 18:31:29 +00:00
newapkbuild.in Replace the rust install preset with an empty section 2023-03-28 11:44:45 +02:00
sample.APKBUILD sample.APKBUILD: use https for sourceforge download links 2018-09-24 21:43:49 +02:00
sample.confd sample: use lowercase in init.d/conf.d sample files 2009-12-30 08:55:33 +00:00
sample.initd sample.initd: modernize 2016-06-13 12:34:05 +00:00
sample.post-install fix typo in sample for pre and post install 2020-02-05 17:27:26 +01:00
sample.pre-install fix typo in sample for pre and post install 2020-02-05 17:27:26 +01:00