1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 03:19:47 +03:00
Commit graph

3271 commits

Author SHA1 Message Date
Stefan Hansson
aebf99e988
Prepare 3.4.0 release 2025-05-13 19:42:56 +02:00
Pablo Correa Gómez
ba6bb4272d
pmb.parse.apkindex: account for provider_priority when locating packages
This fixes an issue where the local apk index has two packages in it
that provide the same thing, but this function was returning only the
one with the shortest name... which could be very bad :)

https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6475#note_480167

In the process, add tests for pmb.parse.apkindex.package function. Some of
the tests would fail without this patch, surfacing a bug where priorities
are not considered, but should, and that we are now fixing.

Co-authored-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2594
2025-05-13 19:19:00 +02:00
slonkazoid
71f01ddbeb
pmb.core.config: remove +1 from nproc defaults
Since Linux has switched to EEVDF[1], the $(($(nproc)+2)) hack is no
longer faster. The new scheduler is way more efficient and performs
better with only `nproc` threads.

 [1]: https://docs.kernel.org/scheduler/sched-eevdf.html

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2595
2025-05-11 17:28:35 +02:00
Luca Weiss
0bca7555d7
pmb.netboot: Initialize chroot before checking path in chroot
Otherwise with zapped chroots, the check will fail and pmbootstrap won't
be able to locate the netboot image.

Fixes: d01f6b90 ("pmb.netboot: Only attempt to install nbd after rootfs existance check (MR 2540)")

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2583
2025-05-08 23:14:05 +02:00
Oliver Smith
2177271fc8
build: fix duplicate install messages
Since cross-native2 was introduced, pmbootstrap now tells the user which
host and which build dependencies are getting installed. This makes
sense if they get installed into separate chroots, but not if they get
installed into the same chroot:

	$ pmbootstrap build hello-world-wrapper --force
	[16:47:19] Building 1 package
	[16:47:19]    * edge/hello-world-wrapper
	[16:47:19] => (1/1) edge/hello-world-wrapper: Installing dependencies
	[16:47:19] *** Install host dependencies
	[16:47:19] (native) install hello-world
	[16:47:20] *** Install build dependencies
	[16:47:20] (native) install hello-world
	[16:47:22] => edge/hello-world-wrapper: Building package

Don't list the depends separately if we are installing them into the
same chroot:

	$ pmbootstrap build hello-world-wrapper --force
	[16:51:35] Building 1 package
	[16:51:35]    * edge/hello-world-wrapper
	[16:51:35] => (1/1) edge/hello-world-wrapper: Installing dependencies
	[16:51:35] (native) install hello-world
	[16:51:36] => edge/hello-world-wrapper: Building package

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2589
2025-05-08 22:45:18 +02:00
Anri Dellal
d7b12d98e6
pmb: Rename pmb:gpu-accel and deviceinfo_gpu_accelerated
pmb:gpu-accel -> pmb:drm
deviceinfo_gpu_accelerated -> deviceinfo_drm

Allow deviceinfo_gpu_accelerated as deprecated property

Keep pmb:gpu-accel as valid option to avoid failures for older branches
of pmaports.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2591
2025-05-08 17:33:11 +02:00
Pablo Correa Gómez
496d1b657d
Revert "install: openrc: fix installing alpine-base early"
This reverts commit 6eb8cab84d.

This is a problematic way to solve the issue. We want to eventually
allow people to migrate from openrc, and having alpine-base in the
world file is an issue. Moreover, a package that runs rc-update
and doesn't depend on openrc simply has a packaging bug. This is
something that is documented, and should be generally fixed
(https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/2097).
If we manage to detect more issues, we should fix them in packaging
instead, like with
https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6474

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2593
2025-05-05 21:58:17 +02:00
Oliver Smith
b982e45c8d
pmb.build.package: fix strict mode
In strict mode, pmbootstrap uninstalls packages between builds. This was
broken since we switched from installing dependencies via abuild to
pmbootstrap since our code doesn't use "--virtual .makedepends-…" when
installing the makedepends:

  (088776) [15:32:34] (native) % cd /home/pmos/build; busybox su pmos -c SUDO_APK='abuild-apk --no-progress' HOME=/home/pmos abuild undeps ;
  ERROR: No such package: .makedepends-systemd-stage0

Instead of restoring the logic and worrying about uninstalling deps in
the right chroots, just zap all chroots in strict mode.

I've also considered implementing "--virtual .makedepends-…" again, but
running zap on the chroots makes the logic much simpler, is easier to
maintain and makes so little speed difference that it is worth the
trade-off. We don't need to pass additional parameters fore the 2nd
chroot to zap in cross-native2, no need to figure out the virtual
package name in two places, etc.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2587
2025-04-22 16:15:51 +02:00
Oliver Smith
fda8963ed7
init: fix currently checked out channel detection
In "pmbootstrap init", always use the pmaports root path when figuring
out the channel of the checked out commit (-> edge, v24.12, ...).

Otherwise the systemd path may get used, which returns channels prefixed
with "systemd-", such as "systemd-edge".

The default UI is "console", and it was recently switched to use systemd
by default. Since then the channel in pmaports CI gets detected as
"systemd-edge", which is not the same as "edge" and so pmbootstrap
switched to the master branch during "pmbootstrap init", resulting in CI
running on the wrong branch:

[10:54:44] Currently checked out branch 'HEAD' of pmaports.git is on channel 'systemd-edge'.
[10:54:44] Switching to branch 'master' on channel 'edge'...

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2586
2025-04-21 13:30:30 +02:00
Oliver Smith
6eb8cab84d
install: openrc: fix installing alpine-base early
With recent changes we don't install alpine-base in the chroots anymore.
It still gets installed as postmarketos-base depends on it (for now,
this will change soon in master). But it is not guaranteed to be
installed before other packages which may run "rc-update" in their
postinst scripts.

Fix this by explicitly installing alpine-base early on during
"pmbootstrap install".

Fix for e.g. v24.12:pine64-pinephone:phosh images:

  (342/976) Installing eg25-manager-openrc (0.4.6-r5)
  (343/976) Installing device-pine64-pinephone-openrc (7-r0)
  Executing device-pine64-pinephone-openrc-7-r0.post-install
  lib/apk/exec/device-pine64-pinephone-openrc-7-r0.post-install: line 3: rc-update: not found
  ERROR: device-pine64-pinephone-openrc-7-r0.post-install: script exited with error 127

Related: https://builds.sr.ht/~postmarketos/job/1473669#task-img-743
Fixes: 12d125ab ("chroot: don't depende on alpine-base")

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2585
2025-04-18 10:38:34 +02:00
Oliver Smith
9e8c4b2810
lint: adjust comment for empty apkbuild_paths
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2584
2025-04-15 15:57:55 +02:00
Clayton Craft
7ab40a4336
pmb.lint: Don't try to lint apkbuild paths that are empty
This fixes an issue where pmb lint tries to lint an apkbuild using a repo path that the apkbuild doesn't exist in.
For example, it fixes this:

```
[22:13:26] (native) linting postmarketos-ui-cosmic with apkbuild-lint
[22:13:26] *** apkbuild-lint output ***
Error: File APKBUILD does not exist
[22:13:26] *** apkbuild-lint output ***
[22:13:26] ERROR: Linter failed!
Traceback (most recent call last):
  File "/builds/postmarketOS/pmaports/.ci/lib/apkbuild_linting.py", line 26, in <module>
    common.run_pmbootstrap(["-q", "lint"] + packages)
  File "/builds/postmarketOS/pmaports/.ci/lib/common.py", line 52, in run_pmbootstrap
    subprocess.run(cmd, universal_newlines=True, check=True)
  File "/usr/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pmbootstrap', '--aports', '/builds/postmarketOS/pmaports', '-q', 'lint', 'postmarketos-ui-cosmic']' returned non-zero exit status 2.
```

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2584
2025-04-15 11:51:29 +02:00
Anri Dellal
a80b27d0bd
install: Do not fail on invalid SSH key
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2576
2025-04-11 17:37:35 +02:00
Stephan Gerhold
e9038e50d6
pmb/install: Add option to create single combined boot/root partition
With recent rework in postmarketos-initramfs, we no longer need to mount
the /boot partition in the initramfs (assuming initramfs-extra is not
used). On devices that boot without accessing the boot file system (e.g.
Android boot images, fastboot, ...), that makes it possible to install
postmarketOS on a single (potentially encrypted) partition that contains
both root (/) and /boot files.

This avoids the extra complexity of the subpartition setup we usually use
on such devices, and also avoids having to flash two partitions (when using
--split to avoid the subpartitions).

Add a --single-partition option to pmbootstrap install that allows
installing postmarketOS in this mode. For now this is just an option that
must be selected explicitly, in the future we could choose to make this the
default for Android-based devices with a large enough boot partition.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2512
2025-04-11 17:35:20 +02:00
Jens Reidel
ec0163ce63
Add option to auto-select the best mirror
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2559
2025-04-11 17:27:33 +02:00
Pablo Correa Gómez
987793bb24
core: small typing improvement 2025-04-11 17:19:10 +02:00
Pablo Correa Gómez
12d125ab8b
chroot: don't depende on alpine-base
In alpine it depends on openrc, and therefore we cannot install
systemd with it. This is necessary to get rid of the systemd-fork
and move forward with the usr-merge.

Requirement for: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6375
2025-04-11 17:19:10 +02:00
Alexey Minnekhanov
d5e4d76118
Log only if config was really changed
Print to stdout only if config option has been really changed.
If the new setting is equal to old one, be silent.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2539
2025-04-08 20:59:12 +03:00
Caleb Connolly
9d03657b80
build: package: install rsync even when package has no makedepends
When an APKBUILD has no makedepends, depends_build would be empty so we
would skip adding rsync when building with --src.

Fix this logic so we always add rsync even when there are no other
makedepends.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2581
2025-04-04 01:55:09 +02:00
fossdd
745ee74138
pmb.install._install: install locale config on default lang aswell
Reduces complexity allows applications and users to have a single source
of truth without involving /etc/profile.d/..

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2547
2025-04-03 22:58:29 +02:00
fossdd
50d2bb45f4
pmb.install._install: write lang configuration to /etc/locale.conf
Previous reasons to write the locales to /etc/profile.d/.. was because
musl-locales do only support reading from environment variables and not
/etc/locale.conf.

However systemd-localed (and glibc) uses /etc/locale.conf to read and
write locale configurations. gnome-control-center, for example, uses
localed to change locales.

In the sake of a single source of truth, allow pmb to write to
/etc/locale.conf and allow its consumers (e.g. g-c-c via systemd) to
read/change these variables.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2547
2025-04-03 22:58:29 +02:00
fossdd
9656c53a6a
pmb.install._install: remove installation of lang
lang gets moved to `_pmb_recommends` of postmarketos-base-ui to allow
switching between languages on en_US devices

Closes: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/3314

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2547
2025-04-03 22:58:24 +02:00
Theresa Schönhammer
ca1f87b873
install: remove redundant package musl-locales
lang depends on musl-locales

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2579
2025-03-31 17:45:48 +02:00
Caleb Connolly
a33112c211
build: envkernel: build for the correct channel
We currently always build kernel packages for the primary channel, which
will usually be systemd-edge. This will cause sideload to fail since it
correctly only looks in the edge repo.

Update envkernel to get the proper channel name and put the kernel
there, so they will always be in the local edge repo and not the
systemd-edge one.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2572
2025-03-20 23:03:35 +01:00
Anri Dellal
15d9516c8d
pmb.flasher: fix "flasher boot" crash if cmdline is empty
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2575
2025-03-20 23:01:29 +01:00
Oliver Smith
0ab75cfe2b
build.package: makedeps warning only for c-n2
Splitting makedepends in _host and _build only makes a difference when
building with cross-native2, as these packages end up in different
chroots.

For QEMU only and crossdirect we install all makedepends into the
foreign chroot. For cross-native (v1) we install everything into the
native chroot.

Show the warning only for cross-native2 so people don't think they have
to adjust their APKBUILDs here. Most of Alpine's APKBUILDs currently
don't have this split either.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2571
2025-03-20 22:39:11 +01:00
Oliver Smith
3dd7b5e1f3
CI: test build for x86 pkg on x86_64 machine
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2577
2025-03-20 22:36:17 +01:00
Oliver Smith
c0cdd5592d
build: fix cross-compile without CPU emulation
Fix cross compiling where CPU emulation is not needed, for example
building x86 packages on x86_64 machines.

This is the case with both:
* CrossCompile.UNNECESSARY
* arch != Arch.native()

Fix the logic in CrossCompile().build_chroot that returned the native
chroot in that case instead of Chroot.buildroot(arch).

Fix error:
  /usr/bin/abuild: line 2692: x86_64-alpine-linux-musl-strip: not found

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2577
2025-03-20 22:36:12 +01:00
Anri Dellal
ac328581af
pmb.ci: choose multiple scripts at once interactively
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2574
2025-03-20 22:01:14 +01:00
Oliver Smith
aced51132c
CI: ruff: use 0.11.0 (Cannot use star annotation)
Ruff 0.11.1 is incorrectly printing the following types of errors:

pmb/helpers/logging.py:169:34: SyntaxError: Cannot use star annotation on Python 3.10 (syntax was added in Python 3.11)
    |
169 | def critical(msg: object, *args: str, **kwargs: Any) -> None:
    |                                  ^^^
170 |     logging.critical(msg, *args, **kwargs)
    |

But the code works fine in Python 3.10 (see pytest-python3.10 CI job).
This is a known upstream bug, pin to the previous version until it is
fixed.

Related: https://github.com/astral-sh/ruff/issues/16874
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2578
2025-03-20 21:41:02 +01:00
Oliver Smith
4bf3f11b78
pmb.helpers.apk: support PMB_APK_NO_CACHE
Add a new environment variable that disables apk's caching feature for
space constrained environments such as the bpo image build jobs.

Currently we have a workaround in place in bpo: the apk cache is moved
to a tmpfs. But this is fragile and just disabling the apk cache is a
more elegant solution.

I've decided to make this an env var instead of a full pmbootstrap
option since this option is not relevant for normal users, only for CI
jobs in space constrained environments. Also we already have another
`PMB_APK_` env var.

Related: bpo issue 136
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2553
2025-03-17 07:09:10 +01:00
Caleb Connolly
dcc4137ee8
FIXUP: build: abstract CrossCompile type logic
* Make CrossCompile a proper enum type rather than a string literal,
* Introduce methods to get the correct host/build chroots depending on the
  cross compile type and target architecture.
* Remove autodetect.chroot() since it doesn't do what we expect, adjust
  all users to use cross.build_chroot() instead.
* Refactor package building to correctly use cross.host_chroot() and
  cross.build_chroot().

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Oliver Smith
0eaedba632
CI: test different cross compilation methods
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Oliver Smith
215a0de035
pmb.build.package: log the cross compile type
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Oliver Smith
bef3b43343
pmb.types.CrossCompileType: split up None
Replace None with the three things it is actually used for to make the
code easier to follow:
* "autodetect"
* "unnecessary"
* "qemu-only"

I've used the term "unnecessary" instead of "native", because "native"
was previously used for "cross-native", then "cross-native2" and it
still sounds similar to these.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Oliver Smith
0625ece550
pmb.build.backend.run_abuild: remove cross default
This function doesn't handle the case of being called without a value
set for cross (it does not autodetect it) and callers don't expect that.
So unset the default value.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Oliver Smith
b2eb812254
pmb/build/autodetect: remove deprecated comment
As discussed with Caleb, it makes sense to keep using "cross-native" for
packages where we don't need to set up a foreign chroot because it is
faster.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Oliver Smith
9e0c4a8393
pmb.build: fix internal cross compiling names
Use the same names as in the documentation for:
"cross-native" (not "kernel")
"cross-native2" (not "native")

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:30:04 +01:00
Oliver Smith
53d705194f
build: print !tracedeps warning for cross-native 1
Building without !tracedeps is a problem with cross-native version 1 but
not version 2. Fix the warning.

Fixes: 2ee916f5 ("build: add pmb:cross-native2 (MR 2474)")

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2568
2025-03-16 16:29:59 +01:00
Oliver Smith
58119697fd
docs/cross_compiling: fix makedeps host/build desc
* makedepends_build is for the native chroot
* makedepends_host is for the foreign chroot

I had it the other way around in the documentation. The variables are so
far not documented here yet:
* https://gitlab.alpinelinux.org/alpine/abuild/-/blob/master/APKBUILD.5.scd
* https://wiki.alpinelinux.org/wiki/APKBUILD_Reference

But it now matches the comments Caleb had written for the cross-native2
implementation, and also what can be found in e.g. the abuild APKBUILD
in aports.git:

  makedepends_build="pkgconfig scdoc"
  makedepends_host="openssl-dev>3 zlib-dev"

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2566
[ci:skip-build]: already built successfully in CI
2025-03-14 21:28:37 +00:00
Clayton Craft
7f886967d1
docs/env_variables: document PMB_FDE_PASSWORD
Co-authored-by: Oliver Smith <ollieparanoid@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2538
2025-03-14 09:45:04 -07:00
Clayton Craft
561ff0dc4c
pmb.install.format: add support for setting FDE passphrase
This adds support for using an environment variable to set the FDE
passphrase, allowing us to automate image creation when using FDE.
The method used here was borrowed from how we set the password with when
using the --password arg: write to a temp file, call something in the
chroot to read/use it, then remove it.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2538
2025-03-14 09:45:04 -07:00
Frieder Hannenheim
6465a6aa87
sideload: get channel from package not from global pmaports (MR 2569)
Currently packages that are not in the systemd channel cannot be
sideloaded when using the systemd channel. This is because apk sideload
uses the global aports channel and not the channel of the package. Fix
it with this patch.
2025-03-10 22:22:50 +01:00
Newbyte
3770641430
pmb.qemu.run: Use NonBugError for nonexistent rootfs code path (MR 2540)
We fully expect to reach this code path within normal use of
pmbootstrap. It's not a bug if we get here. As such, use NonBugError to
indicate that and clean up the output.
2025-03-10 22:15:52 +01:00
Newbyte
8c55680b03
pmb.flasher.frontend: Use NonBugError for nonexistent rootfs code path (MR 2540)
We fully expect to reach this code path within normal use of
pmbootstrap. It's not a bug if we get here. As such, use NonBugError to
indicate that and clean up the output.
2025-03-10 22:15:52 +01:00
Newbyte
3ef25e1467
pmb.netboot: Use NonBugError for nonexistent rootfs code path (MR 2540)
We fully expect to reach this code path within normal use of
pmbootstrap. It's not a bug if we get here. As such, use NonBugError to
indicate that and clean up the output.
2025-03-10 22:15:52 +01:00
Newbyte
d01f6b9079
pmb.netboot: Only attempt to install nbd after rootfs existance check (MR 2540)
The install action will initialise the native chroot, so this way we
don't have to initialise the chroot in this code path. It also gives
users feedback quicker if they haven't already initialised the rootfs
since this way they don't have to wait around for nbd to be installed
before being told that they need to generate the rootfs first.

Closes https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2549
2025-03-10 22:15:47 +01:00
Oliver Smith
06bd8d98a1
cross-native2: set CGO_CFLAGS, CGO_LDFLAGS (MR 2565)
Cross compiling go programs with cross-native2 fails for armv7, riscv64
and armhf unless we use CGO_ENABLED=1 in the APKBUILD (see related
aports issue).

Add --sysroot to CGO_CFLAGS, so cgo can find the includes and doesn't
fail with:

  go build -buildmode=pie -modcacherw -trimpath -buildvcs=false -ldflags "-s -w -X main.Version=2.6.1" -o mkinitfs ./cmd/mkinitfs
  # runtime/cgo
  _cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory

Add it to LDFLAGS too for linking against libraries from the sysroot.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15809
Related: https://stackoverflow.com/a/38835938
2025-03-09 15:27:27 +01:00
Stefan Hansson
32389415e3
pmb.config: Add pmb:cross-native2 to custom valid options (MR 2564)
This is needed for the linter to know about this option.

Fixes 2ee916f5d6
2025-03-08 04:03:35 +01:00
Clayton Craft
a5f7d6087a
pmb.build: install checkdepends when building (MR 2563)
Fixes a bug where checkdepends are not being installed, and packages
that run tests that depend on something in checkdepends fail because
it's missing. For example, the `plasma-workspace` forked pkg in pmaports
tells abuild to run `xwfb-run` in `check()`, this binary comes from
`xwayland-run`, which is listed in the `checkdepends`. However this
isn't being installed and so `pmb build` ultimately fails to build the
package.
2025-03-06 14:15:23 -08:00