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

398 commits

Author SHA1 Message Date
Henrik Grimler
53f050ef14
test: aportgen: device: add tests for boot img with exynos qcdt
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2638
2025-07-10 21:03:01 +02:00
Henrik Grimler
2872ec6be8
bootimg: exynos: extract platform and subtype from dt.img header
dtbtool-exynos has two options --platform and --subtype that are
embedded in dt.img header and need to match the values that the
bootloader expects. For most devices these values are 0x50a6 and
0x217584da, respectively, but for some they have other values.

Add functionality to parse the dt.img header and extract these values,
and add them to the deviceinfo as
bootimg_qcdt_exynos_{platform,subtype} if they are not equal to the
default values.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2638
2025-07-10 21:03:01 +02:00
Newbyte
7035c0239d
test: Move test_devices to where it should be
Consequence of tests being moved back and forth over time.

Fixes cd672222c4

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2616
2025-07-06 19:15:13 +02:00
Henrik Grimler
f25a8bf374
treewide: switch back to bootimg_qcdt{,_type}
In some refactoring work deviceinfo_bootimg_qcdt and
deviceinfo_bootimg_qcdt_type were accidentally renamed to just
deviceinfo_qcdt{,_type}. Change back to original name everywhere.

Among the notable changes is that we modify the bootimg header_v2 test
so that bootimg_qcdt="false" is acceptable in the deviceinfo. I am not
sure why it was added to the !expected substrings, we have plenty of
header_v2 devices with the property set.

Part-of: https://gitlab.postmarketos.org/postmarketos/pmbootstrap/-/merge_requests/2628
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2628
2025-07-03 17:01:33 +02:00
Pablo Correa Gómez
7d36c604f1
test: add small test for argument parsing
This is just a small detail, but in some way CLI options are similar
to public API. I did this while trying some changes, even if in the
end the issue to solve was not in pmbootstrap, I thought it'd make
sense to contribute this.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2626
2025-06-15 10:25:30 +02:00
J. Neuschäfer
5c03cdd37f
pmb.arch: Add support for s390x
This commit adds s390x to the list of supported architectures, to allow
users/developers to experiment with it.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2536
2025-05-25 11:32:01 +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
Caleb Connolly
8f0971eb92
core: Arch: add method to map to Go arch (MR 2474)
Map architectures to the strings used for GOARCH for cross compiling Go
applications.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2025-02-27 01:29:35 +01:00
Hugo Osvaldo Barrera
5a152aebae
test: move all tests into separate module (MR 2551)
When installing pmboostrap, all tests are installed alongside it. There
doesn't seem to be any way to selectively exclude some files inside
python modules, so move all test into a separate module instead.

This is the typical convention in python projects.

See: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/79862
Fixes: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2541
2025-02-13 01:28:20 +01:00
Caleb Connolly
1131db214a
Revert "CI: Add bootimg analysis integration test (MR 2467)" (MR 2483)
This test includes a binary blob which we want to avoid in our codebase.

It is also better suited as a unit test where it can contribute to code
coverage. Revert this and use a unit test version instead.

This reverts commit d19de946b3.
2024-11-29 16:49:54 +01:00
Newbyte
d19de946b3
CI: Add bootimg analysis integration test (MR 2467) 2024-11-07 00:43:09 +01:00
Caleb Connolly
1f7e352278
test: drop all tests (MR 2252)
(Commit message written by Oliver)

The tests relied on a lot of specifics of the old codebase. We decided
that it makes more sense to just remove all tests for now to get this
large patchset of refactorings and improvements done, and then gradually
add new tests / possibly adjust some of the old ones and bring them back
in future patches.

Future tests will not be in the "test" directory, Caleb's reasoning:
> Easier to find relevant tests for a module, and avoid the big flat
> list of test files like we had before. Honestly was just a vibes
> thing after reading the docs.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Tweaked-By: Oliver Smith <ollieparanoid@postmarketos.org>
2024-06-23 12:38:38 +02:00
Caleb Connolly
48cd886401
more wip (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:38 +02:00
Caleb Connolly
34dd9d42ba
WIP: start ripping out args (MR 2252)
Cease merging pmbootstrap.cfg into args, implement a Context type to let
us pull globals out of thin air (as an intermediate workaround) and rip
args out of a lot of the codebase.

This is just a first pass, after this we can split all the state that
leaked over into Context into types with narrower scopes (like a
BuildContext(), etc).

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:38 +02:00
Caleb Connolly
e547bb7f9c
helpers: mount: drop args (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:38 +02:00
Caleb Connolly
0a0cba51e1
helpers: ui: rename list() to list_ui() (MR 2252)
list is a reserved keyword...

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:38 +02:00
Caleb Connolly
1be8653935
drop args from helpers.git and chroot.apk (MR 2252)
be gone!

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:38 +02:00
Caleb Connolly
52cf0e0fe3
test: drop args from run (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:38 +02:00
Caleb Connolly
cf651e56d5
chroot: combine user.py and root.py into run.py (MR 2252)
These are small related utility functions, combine them together.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:37 +02:00
Caleb Connolly
2a0ca33770
WIP: test: start fixing mypy errors (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:37 +02:00
Caleb Connolly
31cc898dd5
treewide: adopt pathlib.Path and type hinting (MR 2252)
With the new chroot type, we can now write fancy paths in the pythonic
way. Convert most of the codebase over, as well as adding various other
type hints.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:37 +02:00
Caleb Connolly
71e7af57e6
pmb.helpers.logging: wrap logging module (MR 2252)
We use a custom verbose log level in pmbootstrap, unfortunately it isn't
possible to correctly type this due to some limitations in the logging
library [1], [2].

Given that our usecase is fairly simple, we can just wrap the module
with our own so we only have to tell mypy to ignore the error once
instead of at every callsite.

[1]: https://github.com/cryptax/droidlysis/issues/15
[2]: https://github.com/python/typing/discussions/980

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:37 +02:00
Caleb Connolly
3bfc6474bb
WIP: test: type annotate suffix + pathlib (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:37 +02:00
Caleb Connolly
7b14ef597b
treewide: type hint args (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:37 +02:00
Caleb Connolly
198f302a36
treewide: add a Chroot type and adopt pathlib.Path (MR 2252)
Introduce a new module: pmb.core to contain explicitly typed pmbootstrap
API. The first component being Suffix and SuffixType. This explicitly
defines what suffixes are possible, future changes should aim to further
constrain this API (e.g. by validating against available device
codenames or architectures for buildroot suffixes).

Additionally, migrate the entire codebase over to using pathlib.Path.
This is a relatively new part of the Python standard library that uses a
more object oriented model for path handling. It also uses strong type
hinting and has other features that make it much cleaner and easier to
work with than pure f-strings. The Chroot class overloads the "/"
operator the same way the Path object does, allowing one to write paths
relative to a given chroot as:

builddir = chroot / "home/pmos/build"

The Chroot class also has a string representation ("native", or
"rootfs_valve-jupiter"), and a .path property for directly accessing the
absolute path (as a Path object).

The general idea here is to encapsulate common patterns into type hinted
code, and gradually reduce the amount of assumptions made around the
codebase so that future changes are easier to implement.

As the chroot suffixes are now part of the Chroot class, we also
implement validation for them, this encodes the rules on suffix naming
and will cause a runtime exception if a suffix doesn't follow the rules.
2024-06-23 12:38:37 +02:00
Newbyte
0df75422b4
treewide: Rename unmaintained to archived (MR 2308)
See https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5046
2024-05-15 17:06:37 +02:00
Clayton Craft
69cb189bdb
test: disable cross compile test (MR 2307)
This test is *only* failing in gitlab CI and I haven't been able to
figure out why (see [1]). Everything else (e.g. bpo, building packages
locally) seems to work fine. Since this is blocking pmbootstrap MRs, I'm
going to disable the test until we can figure out wtf is going on with
running it in gitlab CI.

1. https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2346
[ci:skip-build]: already built successfully in CI
2024-05-02 10:38:47 -07:00
Oliver Smith
105b5ec0bf
testdata/APKBUILD.var-replacements: add custom var (MR 2300)
Extend the testdata and test case to show that the parser can now handle
custom variables.
2024-04-17 17:05:09 +02:00
Oliver Smith
85ee201cf5
APKBUILD parser: recognize all top-level variables (MR 2300)
A common pattern in APKBUILDs, is to introduce custom variables prefixed
with underscores that get then used in makedepends and other variables.

For example:

  _wlrootsmakedepends="
	eudev-dev
  	# ...
  	"
  makedepends="
  	# ...
  	$_wlrootsmakedepends
  	"

Adjust the APKBUILD parser code, so it parses all top-level variables
and can use them further below when referenced inside other variables.
Before returning the parsed APKBUILD data, remove all variables that are
not in pmbootstrap's list of known APKBUILD parsing attributes (so the
result is the same).

I've compared "pmbootstrap apkbuild_parse" (which parses all APKBUILDs
in the currently checked out pmaports dir), before and after this
change, and the result is the same except for having more variables
successfully replaced.

- Performance Note-
This new implementation is actually faster than the previous one,
because we don't need to iterate through all known keys on each line of
the APKBUILDs. On my machine, average of 3 runs, parsing all APKBUILDs
of current pmaports master takes about half as long as with the previous
implementation.

  $ time pmbootstrap -q apkbuild_parse >/dev/null

-> old code: 0.954
-> new code: 0.483
2024-04-17 17:05:09 +02:00
Oliver Smith
8efee86388
test/test_parse_apkbuild: fix running standalone (MR 2300)
Add the "args" pytest.fixture to each test as argument, so it runs the
related code of initializing logging and the cache (see top of the
test_parse_apkbuild.py). Without this, running the test file without any
prior tests (that do these initializations) is not possible:

  $ pytest -xvv test/test_parse_apkbuild.py
  …
  >       if path in pmb.helpers.other.cache["apkbuild"]:
  E       TypeError: 'NoneType' object is not subscriptable
2024-04-17 17:05:05 +02:00
Oliver Smith
0d320d0613
pmbootstrap status: rework (MR 2294)
Reimplement "pmbootstrap status" to be just a simple and useful status
overview. The previous version ran a bunch of checks every time, and
would fail on these even if pmaports was used for normal development:
  * "non-official" branch checked out in pmaports
  * pmaports.git is not clean

The information about aports.git was also considered not so useful upon
revisiting this command, since it is only used for "pmbootstrap
aportgen". Most users don't need this, and if the user runs this
command, it will tell if aports.git is outdated.

All of the above made the previous version unpleasant to use and I
suspect most people stopped using the command after trying it out a few
times and seeing the irrelevant but loud NOK complaints.

New version:

  $ pmbootstrap status
  Channel: edge (pmaports: master_staging_systemd)
  Device:  qemu-amd64 (x86_64, kernel: virt)
  UI:      console
  systemd: no (default for selected UI)

Old version (without --details it only shows NOK checks):

  $ pmbootstrap status --details
  [00:55:20] *** CONFIG ***
  [00:55:20] Device: qemu-amd64 (x86_64, "QEMU amd64")
  [00:55:20] Kernel: virt
  [00:55:20] User Interface: console
  [00:55:20]
  [00:55:20] *** GIT REPOS ***
  [00:55:20] Path: /home/user/.local/var/pmbootstrap/cache_git
  [00:55:20] - aports_upstream (master)
  [00:55:20] - pmaports (master)
  [00:55:20]
  [00:55:20] *** CHECKS ***
  [00:55:20] [OK ] Chroots zapped recently (or non-existing)
  [00:55:20] [OK ] aports_upstream: on official channel branch
  [00:55:20] [OK ] aports_upstream: workdir is clean
  [00:55:20] [OK ] aports_upstream: tracking proper remote branch 'origin/master'
  [00:55:20] [OK ] aports_upstream: up to date with remote branch
  [00:55:20] [OK ] aports_upstream: remote information updated recently (via git fetch/pull)
  [00:55:20] [OK ] pmaports: on official channel branch
  [00:55:20] [OK ] pmaports: workdir is clean
  [00:55:20] [OK ] pmaports: tracking proper remote branch 'origin/master'
  [00:55:20] [OK ] pmaports: up to date with remote branch
  [00:55:20] [OK ] pmaports: remote information updated recently (via git fetch/pull)
  [00:55:20]
  [00:55:20] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
  [00:55:20] DONE!
2024-04-16 18:54:35 +00:00
Clayton Craft
ca844038f1
Revert "pmb.build._package: build depends of subpackages (MR 2292)"
This patch caused a regression[1] that needs to be debugged/fixed, so
reverting in the meantime.

This reverts commit 8b0dfe489a.

1. https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2341
2024-04-15 23:31:14 -07:00
Oliver Smith
8b0dfe489a
pmb.build._package: build depends of subpackages (MR 2292)
Make sure that we build depends of subpackages, to avoid errors like the
following:

* postmarketos-base has a subpackage postmarketos-base-nftables, which
  depends on postmarketos-config-nftables
* when pmbootstrap builds postmarketos-base with all its dependencies,
  it did not realize it depends on postmarketos-config-nftables through
  the subpackage, but it built it anyway
* when trying to install postmarketos-base-nftables, apk complains that
  there is no postmarketos-config-nftables:
  ERROR: unable to select packages:
    postmarketos-config-nftables (no such package):
      required by: postmarketos-base-nftables-32-r2[postmarketos-config-nftables]

This also adds the missing depenendencies to "pmbootstrap repo_missing",
which bpo uses to resolve dependencies.

Fixes: issue 2084
2024-04-12 14:03:15 +02:00
Newbyte
b473f8786e
test.test_apk: Replace osk-sdl with unl0kr in apk install test (MR 2289)
See https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2333
2024-04-04 10:59:58 +02:00
Newbyte
b9858fb9cb
test: Test pmb.parse.arch.machine_type_to_alpine (MR 2282) 2024-03-28 11:03:25 +01:00
Newbyte
ced93fee7b
pmb.parse.kconfig: Raise NonBugError on invalid kernel config (MR 2279)
The intent of 9a74848f19 was to not print
a stacktrace when this happened. However, I still opted to raise an
exception, so you still get a stacktrace, just with a more helpful
message. There's no need to give the user a big stacktrace here, so
raise a NonBugError instead of a RuntimeError.
2024-03-27 21:50:28 +01:00
Newbyte
812a3e4a85
test: Test subpackages which set a different architecture (MR 2267) 2024-02-26 20:55:49 +01:00
Clayton Craft
aa594b76fa
pmb.config: do not prompt for nonfree fw/userland (MR 2255)
This drops the prompt for using non-free firmware in images. The logic
for searching/installing non-free fw subpackages for devices is kept,
and will always be installed. This is to support the many device
packages in pmaports that still have nonfree-firmware subpackages. Going
forward, device packages can list firmware in `depends=` (for required
fw) or `pmb_recommends` (for optional fw).

nonfree-userland wasn't used in pmaports as far as I could find.
2024-02-15 16:00:56 -08:00
Andras Sebok
0c8b9c805f
pmb.aportgen: drop deviceinfo_screen_* (MR 2253) 2024-02-09 20:13:59 +01:00
Oliver Smith
37a7f3924d
Fix preserving proxy variables (MR 2237)
Fix "pmbootstrap chroot" and others not passing the proxy environment
variables correctly. Thanks to notfound405 for pointing this out!

Instead of only preserving proxy environment variables in
pmb.helpers.run_core, which should never be called directly, do it in
the calling functions:

* pmb.helpers.run.user
* pmb.helpers.run.root
* pmb.chroot.root
* pmb.chroot.user

This fixes that the environment variables were only really passed by
pmb.helpers.run.user, because the other functions would result in
something like:
  HTTP_PROXY=mytestproxy sudo env -i /usr/bin/sh -c '…'
This is needed to either elevate to root, or to elevate to root first
and then enter the chroot as root or user. Due to the "env -i", the
environment intentionally gets cleaned, but unintentionally also removes
the proxy environment variables that were explicitly set.

By adjusting the functions, they now run a variant of:
  sudo env -i /usr/bin/sh -c 'HTTP_PROXY=mytestproxy …'

The escaping is simplified in this example, run "pmbootstrap -v" to see
the not very readable, but proper escaping with shutil.quote().

Remove the previous test for preserving the environment variables in
pmb.helpers.run_core (as it should never be called directly), and test
instead the new behavior.

Fixes: issue 2299
Fixes: 13c4ac42 ("pmb.helpers.run_core: fix proxy env var logic")
2024-01-25 20:12:53 +00:00
Clayton Craft
19f8a3b8c8
pmb.install: support pmb_recommends for any package
This refactors the get_recommends function that was originally used for
UI packages to support pmb_recommends for any package (and subpackage).

Extending pmb_recommends will, for example, help us create better
generic device packages [1] and can be used to improve packaging for UIs
with shared pmb_recommends[2].

1. https://gitlab.com/postmarketOS/pmaports/-/merge_requests/4673
2. https://gitlab.com/postmarketOS/pmaports/-/merge_requests/3700

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20240102074605.23248-2-clayton@craftyguy.net%3E
2024-01-09 16:55:47 +01:00
Newbyte
ddc5c59562
aportgen: Only warn if binary version > APKBUILD version
Sometimes I want to build an older version of a package from Alpine, and
since package upgrades can involve things like patches and other
externalities just changing the pkgver and running checksum in pmaports
may not be enough. As such, it tends to be easier to revert the change
in the local aports repo and then fork than forking and then trying to
manually revert the changes yourself (since you can't have git do that
for you given that they are distinct repositories).

Prior to this patch, that was not possible since pmbootstrap would
assume older aport version equals outdated aports in general and as such
cancel the whole operation. Instead, just print a warning and helpful
information to make this workflow possible while also warning users that
they may want to update their local aports.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20231209111813.37756-1-newbyte@postmarketos.org%3E
2023-12-10 14:41:53 +01:00
Oliver Smith
d7f9769ee0
aportgen: remove binutils
Remove the code for generating binutils-aarch64 etc. packages, as these
live upstream in Alpine now. Having the generator scripts for binutils
cross pkgs is therefore not useful anymore and would just bitrot if we
kept it.

Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20231126121617.3855-1-ollieparanoid@postmarketos.org%3E
2023-12-03 20:11:31 +01:00
Clayton Craft
28b6106dd3
chroot.apk,apk_static: always disable interactive mode
This fixes an issue when pmb is run on an Alpine/pmOS host and apk.static sees
that /etc/apk/interactive is set on the host. It's really annoying to have the
build pause so apk can prompt when building chroots, so this uses a flag to apk
to disable interactive mode. I can't think of any situations where we would
actually want to prompt users when building chroots, by then all user
configuration should have been completed via pmb init/config.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Co-developed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20231110185320.8358-1-clayton@craftyguy.net%3E
2023-11-13 09:30:30 +01:00
Ben Westover
c10a3ce73b
parse.bootimg: Separate kernel and ramdisk MediaTek headers
Currently, pmbootstrap checks if either the kernel or the ramdisk in a boot.img
contains the MediaTek header, and if one does, it assumes both do. It hardcodes
the label KERNEL for the kernel and ROOTFS for the ramdisk.

My Amazon Echo Dot (gen 2) has a boot.img where only the kernel has the header,
but not the ramdisk. These changes (as well as those in my new boot-deploy MR)
account for that situation (and any possible label an image has) by splitting
bootimg_mtk_mkimage into two variables for the kernel and the ramdisk labels.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/46351
2023-11-13 09:30:24 +01:00
Pablo Correa Gómez
09a51601fb
test: cosmetic: install deviceinfo under /usr/share
To use the same convention as in pmaports.

See https://gitlab.com/postmarketOS/pmaports/-/merge_requests/4283

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230827174210.27896-1-pabloyoyoista@postmarketos.org%3E
2023-11-01 20:41:08 +01:00
Lauren N. Liberda
753e563ccc
parse: allow "-r" in pkgver
this seems to be parsed correctly, other than this one check

bug: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2260
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230813202045.24493-1-lauren@selfisekai.rocks%3E
2023-08-14 09:52:23 +02:00
Oliver Smith
f4fed3d99e
test/test_crossdirect: remove
Remove test_crossdirect_rust, the only test in test_crossdirect.py. The
behavior that was tested here with all the "mv /usr/bin/rustc" commands
was specific to version 4 and isn't valid anymore since version 5
(pmaports MR 4234).

The previous behavior was that crossdirect always tried to run rustc
from /native, and if it failed, it would fall back to using qemu. The
new behavior is that it runs rustc from /native only when it expects it
to succeed, and runs rustc via qemu otherwise, without attempting
/native first. As the logic to decide whether to use native rustc or not
is now done beforehand, it does not do the fallback to qemu if native
fails.

Note that the test hasn't been failing because we switch to the v23.06
channel and therefore use the older crossdirect version.

Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230806184729.4891-6-ollieparanoid@postmarketos.org%3E
2023-08-14 09:52:22 +02:00
Oliver Smith
147a0f5c4d
build: use sccache for rust
Cache the compiler output of rust code with sccache, like we use ccache
for c code.

I've considered using sccache to completely replace ccache since it can
cache output of C/C++ code too. But let's not do it for now since ccache
doesn't need to run a daemon in the background that needs to be stopped
when shutting down / zapping. Also it would need more refactoring.

Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230806184729.4891-5-ollieparanoid@postmarketos.org%3E
2023-08-14 09:52:22 +02:00
Oliver Smith
0ff6ad481d
install: remove /mnt/pmbootstrap at the end
Don't include the /mnt/pmbootstrap directories in the images created
with "pmbootstrap install".

Reviewed-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230806184729.4891-3-ollieparanoid@postmarketos.org%3E
2023-08-14 09:52:22 +02:00