Commit Graph

25 Commits

Author SHA1 Message Date
Oliver Smith 099238525a
aportgen: use pmb.build.init_abuild_minimal
Use init_abuild_minimal instead of init to avoid installing gcc etc.
when generating checksums. This function has been added previously in
c6bcb0da ("Speed up 'pmbootstrap checksum'").

Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230613151807.568708-1-ollieparanoid@postmarketos.org%3E
2023-06-15 08:30:54 +02:00
Oliver Smith 9975d373b0
Bump copyright to 2023 2023-01-22 19:18:06 +01:00
Oliver Smith 6f6a3b0408
Happy new year 2022! 2022-01-02 22:39:14 +01:00
bo41 caf7973e24
args.arch_native: remove (MR 2130)
Replace "args.arch_native" with the direct function call in order to
avoid passing "args" to all functions. This is a step to get rid of this
args-passed-to-all-functions pattern in pmbootstrap.
2021-10-24 14:34:30 +02:00
BO41 77d39ecdf1
lint: enforce max line length (MR 2097) 2021-09-10 03:18:27 +02:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
Oliver Smith 0dfe489b78
pmbootstrap aportgen: replace arch=all with native (MR 1965)
Packages like binutils-*, busybox-static-*, gcc-*, grub-efi-*, musl-*
are only needed for the native architecture during cross compilation.
Don't bother with trying to build them for other arches to save time and
to avoid getting stuck frequently at "armv7/binutils-aarch64" etc.

A few people like to use pmbootstrap on aarch64 hosts (e.g. PineBook
Pro), so let's make it available for aarch64 again when we can build
aarch64 packages natively in CI and bpo. (They do get stuck there right
now, because of qemu user emulation.)

Related: https://gitlab.com/postmarketOS/build.postmarketos.org/-/issues/75
2020-09-21 17:48:34 +02:00
Oliver Smith 5b55abd4d2
pmbootstrap aportgen: don't use CDN alpine mirror (MR 1963)
Use a deterministic mirror URL instead of CDN for aportgen. Otherwise we
may generate a pmaport that wraps an apk from Alpine (e.g. musl-armv7)
locally with one up-to-date mirror given by the CDN. But then the build
will fail if CDN picks an outdated mirror for CI or BPO.
2020-09-18 03:20:25 +03:00
Oliver Smith bfbb095895
pmb/aportgen/musl.py: fix distfile collisions (MR 1947)
Add the Alpine mirrordir (e.g. "edge", "v3.12") to the distfile, so
musl-*.apk files of the same version and arch but from different
mirrordirs do not collide.

Let "abuild checksum" download these apks and generate the checksums,
instead of letting apk download them as side-effect of initializing
foreign arch chroots. The latter did not work anymore, because we would
copy the apk file with a glob that may matches the hash of either mirrordir.
Essentially:
    glob.glob(f"{args.work}/cache_apk_{arch}/{subpkgname}-{version}.*.apk")[0]

In the context of the on-device installer, I found that calculating this
hash is not trivial, so let's just avoid it here as well.

While at it, order the imports of musl.py alphabetically.
2020-06-24 04:41:54 +03:00
Oliver Smith 4f7a13084f
pmb/aportgen/musl.py: use channel alpine mirrordir (MR 1939)
On branch stable, we would use Alpine's mirrordir "v3.12" for example.
2020-06-21 12:07:29 +02:00
Oliver Smith ac90787e76
pmb/aportgen/musl.py: pass 'pmbootstrap lint' (MR 1939)
Remove quotes around pkgname and pkgver, indent with tabs and provide
a stub for arch_to_hostspec.
2020-06-21 12:07:09 +02:00
Oliver Smith 37ee340166
pmb/aportgen/musl.py: use f-string in APKBUILD (MR 1939) 2020-06-21 12:07:05 +02:00
Oliver Smith f21c216a26
Cosmetic: use SPDX license header (!1877)
While at it, also remove unnecessary "#!/usr/bin/env python3" in files
that only get imported, and adjust other empty/comment lines in the
beginnings of the files for consistency.

This makes files easier to read, and makes the pmbootstrap codebase more
consistent with the build.postmarketos.org codebase.
2020-02-24 03:11:10 +03:00
Oliver Smith 948e3f931f
Change copyright to 2020 2020-01-06 02:43:00 +01:00
Oliver Smith c90521a888
aportgen musl-*: use 'busybox tar' in package() too
Follow up to last commit, turns out we need to use it in both functions
or otherwise at least gitlab-ci can fail, as seen in this MR:
https://gitlab.com/postmarketOS/pmaports/merge_requests/270

After using 'busybox tar' instead of 'tar' in both places in the
APKBUILDs, it went through.
2019-03-10 01:59:21 +01:00
Oliver Smith d52fcb9876
aportgen musl-*: use 'busybox tar' in package_dev (!1763)
Use 'busybox tar' to avoid 'tar: Child returned status 141' on some
machines (builds.sr.ht, gitlab-ci).

See pmaports#26.

[skip ci]: already ran through successfully
2019-03-10 01:42:00 +01:00
Oliver Smith f16bdaf0ca
Update copyright to 2019
Happy new year \o/
2019-01-02 09:31:20 +01:00
Oliver Smith 8268dc0e3d pmbootstrap: kill process if silent for 5 minutes (rewrite logging) 2018-07-14 01:13:28 +00:00
Oliver Smith 255c715624
Fix aportgen without initializing buildenv
After initializing the build environment, the cache_distfiles folder
currently is writable by everyone (which is not ideal, fix following
soon). The aportgen code for `busybox-static-*` and `musl-*` copies
the foreign arch `.apk` file to the distfiles, but it executes this
action as regular user and not as root. This only works as long as
build initialization ran before (which may not be the case on Travis
and expecting this to run before is a bug in general).

With this commit, the copy action gets executed as root, so it works
in any case. I'm commiting this directly (without a PR), because it
is a super simple fix and it unblocks our continuous integration.

Local testing:
$ pmbootstrap -y zap
$ sudo rm -r ~/.local/var/pmbootstrap/cache_distfiles
$ pmbootstrap aportgen musl-armhf
2018-03-12 17:17:32 +01:00
Oliver Smith db5e69630e
Index parser: support multiple package providers (#1202)
* The APKINDEX parser used to return a dictionary with one package for
  a given package name. This works for the installed packages database,
  because there can only be one provider for a package. But when
  parsing packages from binary repositories, we need to support
  multiple providers for one package. It is now possible to get a
  dictionary with either multiple providers, or just a single provider
  for each package.
* Dependency parsing logic has been adjusted, to support multiple
  providers. For multiple providers, the one with the same package
  name as the package we are looking up is prefered. If there is none
  (eg. "so:libEGL.so.1" is provided by "mesa-egl"), it prefers packages
  that will be installed anyway, and after that packages that are
  already installed. When all else fails, it just picks the first one
  and prints a note in the "pmbootstrap log".
* Added testcases for all functions in pmb.parse.apkindex and
  pmb.parse.depends
* pmbootstrap chroot has a new "--add" parameter to specify packages
  that pmbootstrap should build if neccessary, and install in the
  chroot. This can be used to quickly test the depencency resolution
  of pmbootstrap without doing a full "pmbootstrap install".

Fixes #1122.
2018-02-20 19:52:28 +00:00
Oliver Smith 9f674675eb
Don't compile cross-compiler packages for the host arch
Example: Building gcc-armhf for armhf does not make sense, so this
commit changes arch="all" to arch="aarch64 x86_64". This helps to
simplify the repository scripts (#970).
2018-01-20 19:17:23 +01:00
Oliver Smith 7750c1dd40
Happy new year! (update copyright to 2018) 2018-01-04 04:53:35 +01:00
Pablo Castellano 7e79d20a0b aportgen: Added end of file newline 2017-06-25 21:40:49 +02:00
Oliver Smith 55e276053a
Meaningful error in aportgen musl*, when aports repo is outdated 2017-06-15 03:05:04 +02:00
Oliver Smith ae950fb9f7
Hello, there! 2017-05-26 22:08:45 +02:00