Commit Graph

95 Commits

Author SHA1 Message Date
Thilo Fromm
f68167dad2 build_packages: add cmd line option to stop after breaking dep loops
This change adds a command line option to build_packages to stop
execution of the script after breaking circular dependencies (i.e.
before board packages are built). Helpful for debugging package build
issues.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-12-18 10:46:14 +01:00
Thilo Fromm
8f8f262f19 torcx: remove from scripts, use docker+containerd sysexts
This change removes torcx libraries, references, and commandline options
from build automation scripts and from build_library/.

Containerd and docker are shipped via sysexts which are included in the
base image.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-23 16:05:45 +02:00
Thilo Fromm
a6d8a89399 build_packages: fix systemd cyclic deps resolver
This change removes "curl" from the USE flags to be removed to build
systemd in the cyclic deps resolver step of build_packages. Excluding
curl from systemd's USE flags leads to build breakage:

09:06:25  !!! The ebuild selected to satisfy "sys-apps/systemd" for /build/amd64-usr/ has unmet requirements.
09:06:25  - sys-apps/systemd-252.11-r1::coreos USE="audit dns-over-tls elfutils gcrypt gnuefi http idn importd iptables kmod lz4 lzma openssl pam pcre policykit resolvconf seccomp selinux (sysv-utils) (vanilla) zstd -acl -apparmor -cgroup-hybrid -cryptsetup -curl -fido2 -gnutls -homed -pkcs11 -pwquality -qrcode (-split-usr) -test -tpm -xkb"
09:06:25
09:06:25    The following REQUIRED_USE flag constraints are unsatisfied:
09:06:25      importd? ( curl )
09:06:25
09:06:25    The above constraints are a subset of the following complete expression:
09:06:25      dns-over-tls? ( any-of ( gnutls openssl ) ) homed? ( cryptsetup pam openssl ) importd? ( curl lzma any-of ( gcrypt openssl ) ) pwquality? ( homed )

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-19 11:09:45 +02:00
Krzesimir Nowak
b2b42d9341 build_packages: Break another dep loop
It came up with net-libs/nghttp2 adding some integration with systemd.
2023-10-17 18:23:40 +02:00
Krzesimir Nowak
9fa5bc79ef update_chroot, build_packages: Ignore depclean failures
See the comment in update_chroot or build_packages for the reasoning.
2023-09-15 16:14:29 +02:00
Krzesimir Nowak
fa48f70a37 *: Make catalyst and emerge verbose by default
That way we can see a report of what emerge is going to do and the
status of the use flags for the installed packages. The downside is
that we are going to have reports about using deprecated and
unsupported profile in even more places.
2023-02-16 13:57:05 +01:00
Krzesimir Nowak
520b92ad7e *: Expand short emerge flags and use bash arrays
Emerge flags are cryptic in general, but short flags even more so, so
expand them. While at it, I noticed some places where bash arrays
could be used, so convert those places too.
2023-02-16 13:57:05 +01:00
Krzesimir Nowak
375ffa6579 common.sh: Drop the unnecessary hack
We have a user patch in coreos-overlay fixing this issue directly in
gcc-config.
2023-01-12 08:37:57 +01:00
Krzesimir Nowak
97bf185815 common: Extend liblto link fixup function
We need to fix another symlink created by gcc-config, so extend the
function that was doing it for some other links and rename it - it's
not about only liblto any more.
2022-11-09 10:13:24 +01:00
Krzesimir Nowak
b2d6f7fc6e *: Allow specifying extra URLs for torcx packages
Torcx manifest may contain paths and URLs as locations of
packages. There are two kinds of packages - vendored and
extra. Vendored packages normally have two locations - path to the
directory inside the image where the package is (which is why it's
called vendored), and a URL to the package on some remote
server. Extra packages only have a URL. But the URLs are added only
when we tell the build_torcx_store script to upload the packages at
the same time, which is what the old build pipeline was doing. With
the new pipeline, the upload happens as a separate step, thus the
upload is disabled when invoking build_torcx_store, and so the
packages are not getting URLs set. This change went unnoticed, because
a kola test checking the generated torcx manifest was only checking if
there is at least one location, either path or URL, and all the new
releases have no extra packages, only vendored ones.

When backporting the new pipeline to old LTS, the kola tests started
to fail, because old LTS had one extra package, and this is how I
noticed the problem.
2022-09-06 14:00:50 +02:00
Thilo Fromm
15778e54e9
build_packages: fix default torcx output root
In 9fba5789f9 we introduced 
--torcx_output_root as an optional command line parameter
and had it default to "${DEFAULT_BUILD_ROOT}", inadvertently 
diverging from the previous default, which was
"${DEFAULT_BUILD_ROOT}/torcx".

This change sets the correct default root "${DEFAULT_BUILD_ROOT}/torcx" to bring
build_packages back into alignment with build_image.
2022-01-05 13:28:49 +01:00
Thilo Fromm
9fba5789f9 ci-automation: simplified CI automation unsing containers
ci-automation builds on the SDK container and simplifies CI automation
build tasks (SDK bootstrap, SDK container, packages, image, VMs).

See ci-automation/README.md for a brief introduction.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-11-26 17:54:43 +01:00
Krzesimir Nowak
8e8cedcbf7 build_packages: Add another cycle to break
With the update of the sys-apps/util-linux package, another cycle has
reared its ugly head. Looks like the package got an optional
dependency on sys-fs/cryptsetup, so break it.
2021-10-12 14:39:07 +02:00
Krzesimir Nowak
cea18c41c3 *: Use the internal copy of cros_workon
The scripts that invoked `cros_workon` without specifying a path to
the script were not calling the internal `cros_workon` directly, but
rather a copy installed in `/usr/bin/cros_workon`.
`/usr/bin/cros_workon` comes from the `coreos-base/cros-devutil` and
is a wrapper script that sources `common.sh` file to figure the
location of the `scripts` and finally invokes the internal
`cros_workon`. Curious thing is that the sourced `common.sh` comes
from the `/usr/lib/crosutils` directory and contents of the directory
come from the `dev-util/crosutils` package. And that `common.sh` is
different from the one in the scripts directory, but fortunately the
part that detects the path to the `scripts` directory is the same. I'm
not sure where where exactly the copy of `common.sh` in
`/usr/lib/crosutils` comes from - likely from somewhere in
`https://chromium.googlesource.com/chromiumos/platform/crosutils`.

Just cut the middle layers and call the internal copy of `cros_workon`
directly.
2021-08-19 12:58:42 +02:00
Krzesimir Nowak
6ed7cd66d5 *: Drop jobs parameter
The `--jobs` parameter that some scripts defined was not used anywhere
in jenkins or mantle. So the value of the parameter always ended up
being equal to `${NUM_JOBS}` set by `common.sh`. Also, even if the
`--jobs` parameter was used for some script, that script usually
didn't forward the jobs value to other scripts, so the other scripts
ended up using `${NUM_JOBS}` again. Also, the `${FLAGS_jobs}` variable
was used by some functions in the build library, and those functions
were sometimes invoked by scripts that didn't define the
`${FLAGS_jobs}` variable. It is tedious to track which script should
actually define the parameter, and where it should be forwarded.

Just get rid of this half-working pretense. If you want to affect how
many jobs `emerge` uses, export the `NUM_JOBS` environment variable
before calling any script.

For `EMERGE_FLAGS` and `REBUILD_FLAGS` we unconditionally specify the
`--jobs` flag's value to `${NUM_JOBS}` because they are passed to
`emerge`. On the other hand we drop the `--jobs` parameter from the
`UPDATE_ARGS` variable, because this variable passed to `setup_board`
or `update_chroot`, which don't have this flag any more.
2021-02-17 13:26:36 +01:00
Krzesimir Nowak
7f2a437f0a build_packages: Build all packages in the broken cycle
Previously we broke the cycle caused by sys-apps/util-linux only,
while disabling cryptsetup USE flag in systemd to avoid another
cycle. That worked before, because the follow-up merge of the rest of
packages built sys-fs/cryptsetup before sys-apps/systemd. After an
update, the new portage is ordering the builds in different way and
sys-apps/systemd ended up being built before sys-fs/cryptsetup and
that failed during the configure phase because of unmet dependencies.

Better build all the packages taking part in the loop (not counting
the virtual packages), so we become less reliant on the package build
ordering. It is going to take slightly more time as we build a couple
of packages more.
2021-02-09 07:44:22 +01:00
Krzesimir Nowak
d575ef441a build_packages: Build multiple packages in one go when breaking loops
Instead of rebuilding just one package and maybe rebuilding others as
a fallout, force rebuilding all the mentioned packages. This makes the
build process a bit more robust against package build ordering
changes.

May be useful when breaking multiple dep loops that have some common
packages, so we build them all once.
2021-02-09 07:44:22 +01:00
Thilo Fromm
22b08b0ae4 build_packages, build_image_util.sh: fix up liblto symlink
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2020-11-16 19:06:59 +01:00
Vincent Batts
f104a53aeb
build_packages: export build host information
Signed-off-by: Vincent Batts <vbatts@kinvolk.io>
2020-08-28 13:51:22 -04:00
Kai Lüke
066deb9d09
build_packages: Add flag to ignore some binary packages
When the ebuild file changed but not its version nor its cross-workon
commit, the binary package would be used. Also some dependencies are not
encoded to trigger a rebuild of depending packages.
Allow to exclude some binary packages so that we can be sure that they
are rebuilt.
2020-05-11 16:26:35 +02:00
Marga Manterola
0eea902ddf Fix typo 2020-05-11 12:28:50 +02:00
Andrew Jeddeloh
a27b02bcb6 *: use cros_workon not cros_list_modified_pkgs
This removes a dependency on chromite
2018-05-30 13:07:58 -07:00
Andrew Jeddeloh
935466b68d *: remove restart_in_chroot_if_needed
Replace calls to restart_in_chroot_if_needed with assert_inside_chroot.
This removes a dependency on chromite.
2018-05-30 13:07:58 -07:00
David Michael
f91198ca0e build_packages: also build all torcx images by default
The idea is that once the installed board packages have changed,
the sysroot that was used to build any existing torcx packages may
no longer be compatible.  It will therefore run build_torcx_store,
passing relevant options to it, to build a new torcx store of
images with the current sysroot.

This adds --skip_torcx_store to use the previous behavior.
2017-06-02 14:22:53 -07:00
Michael Marineau
aed5e0d526 build_packages: fix @preserved-rebuild
When the --usepkgonly flag was added in d327840ce this step got wrapped
in an inverted test. It should normally be enabled.
2016-07-13 22:55:19 -07:00
Michael Marineau
9ab853a668 build_image: remove eclean, run in build_packages instead
Allows the binary package cache to be preserved when using build_image
without a fully populated board root.
2016-02-20 14:11:41 -08:00
Michael Marineau
9b00ea5495 *: disable reinstalling rebuilt binaries with --usepkgonly
When --usepkgonly is mixed with the right update flags it will
re-install any binary packages that have a newer build. Since the full
set of SDK and board packages are rebuilt quite often this leads to
excessive reinstalling.
2016-02-04 11:50:36 -08:00
Michael Marineau
d327840ce8 *: add --usepkgonly flag to avoid building from source 2016-02-03 18:29:16 -08:00
Michael Marineau
81ee5389c0 build_packages: accept package names as an argument 2016-02-03 18:29:16 -08:00
Michael Marineau
a42ffcddbb build_packages: include all flags in usage message 2016-02-03 17:37:38 -08:00
Michael Marineau
bf104d415e build_packages: remove old --reuse_pkgs_from_local_boards flag
Removed from setup_board in ancient times e6b3c608.
2016-02-03 17:30:10 -08:00
Michael Marineau
10a7864ff0 build_packages: flip weird inverted boolean flag
Use `--workon` and `--noworkon` instead of `--nonoworkon` and `--noworkon`
2016-02-03 17:26:24 -08:00
Michael Marineau
602412fd2a build_packages: remove unused --accept_licenses
This flag was dropped from setup_board way back in commit 7d6619df8.
2016-02-03 17:23:20 -08:00
Geoff Levand
57c129acfd setup_board: Call setup_qemu_static
setup_qemu_static only needs to be called once, and can
be done early so that it is available.  Move the call
of setup_qemu_static from build_packages to setup_board.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-11-19 15:08:00 -08:00
Andrej Rosano
acea447ccd build_packages: Fix ramdisk creation for non-native arches
Chrooting in the target non-native arch rootfs is required
for update-bootengine to be run correctly.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
2015-09-16 12:41:23 +02:00
Michael Marineau
f5970d877c build_packages: reduce the noise that --depclean generates 2015-08-04 14:46:09 -07:00
Michael Marineau
e881b270db update_chroot/build_packages: remove obsolete packages
Before attempting to do @preserved-rebuild to fix linked against old
libraries remove any packages that no longer have corresponding ebuilds,
making them impossible to rebuild. This uses `--depclean`'s secondary
meaning: `--unmerge` but only remove packages without dependencies.
2015-07-24 14:38:09 -07:00
Michael Marineau
9d4d888429 update_chroot/build_packages: trigger @preserved-rebuild
Rebuilds packages that are linked against old libraries that have been
upgraded or removed from the system. Skipping this can lead to shared
library checks looking ok in the build root but then built images have
broken library dependencies.
2015-07-12 15:48:21 -07:00
Michael Marineau
28c3c3def3 build_packages: be less aggressive about rebuilding packages
The --rebuild-if-unbuilt emerge option will recompile packages if any
build-time dependencies changed. This can be a useful safety to make
sure applications get re-linked and so forth. However recent versions of
portage have grown better defaults for choosing when to rebuild so lets
turn the build_packages flag around and leave emerge to do its default
behavior and see if that is sufficiently safe.
2015-07-08 13:45:18 -07:00
Michael Marineau
9db6ac5ef7 build_image: make building selinux policy optional 2015-07-01 23:11:09 -07:00
Michael Marineau
22e3c116cc build_packages: always rebuild when breaking dependency cycles
Previously we attempted to speed up the first build of a board by
pulling in binary packages regardless of their use flags, assuming that
if the package was already built the loop would not be an issue. Usually
this was true but not always. Now things like util-linux will always get
compiled when setting up a board for the first time but at least it
won't be as likely to fail.
2015-06-25 14:15:35 -07:00
Geoff Levand
dcc9a2b97d build_packages: Update help for CoreOS
Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-04-09 09:42:26 -07:00
Michael Marineau
03411ad4d8 build_packages: add support breaking loops with multiple use flags
Sorry, this is just getting bad. We need to switch to initializing the
board root stage3 style, similar to how the SDK or most any
semi-complicated Gentoo install starts. Breaking loops while merging
into a clean root is just too complicated.

On what this does: util-linux now has a udev *and* a systemd use flag.
Since we use systemd they both are effectively the same and pull in the
systemd package. This adds support for disabling both flags during the
loop breaking procedure.
2015-03-18 11:59:25 -07:00
Michael Marineau
a518dc8df1 build_package: fix loop between two loop breaking steps
If util-linux has a binary package it will be used, but if that binary
package has +udev it will pull in systemd. systemd has a loop that needs
to be broken too so if the util-linux loop breaker doesn't also handle
the systemd one it all falls apart.

In short the comment above the loop breaker code noting that we can try
this until it gets wonky. Well, it is wonky and we need to re-do how
build_packages works as a result. This is just a temporary workaround
until we figure out a larger restructuring.
2014-07-22 14:49:52 -07:00
Michael Marineau
07cb281d6a build_image: install the complete system package set in dev images
dev images, now with fancy tools like `make`!
2014-07-19 17:29:05 -07:00
Michael Marineau
4d3c198161 tools: remove support for parallel_emerge
Using parallel_emerge has been disabled by default for all commands
except build_image for quite a while now, build_image kept it just
because it was still a bit faster than normal emerge. Keeping
parallel_emerge complicates future changes to build_image so it needs to
drop it entirely. Since that means nothing uses it by default we might
as well just rip out support for it entirely.
2014-07-19 16:38:17 -07:00
Michael Marineau
097196a6af build_packages: break dependency loop between util-linux and systemd.
This is required to enable the udev use flag.
2014-07-19 15:07:00 -07:00
Michael Marineau
55896af9c1 build_packages: break dependency loop when cryptsetup is enabled 2014-07-01 16:59:54 -07:00
Michael Marineau
691c588c75 fix(build_packages): Simplify emerge command, use board-packages ebuild.
The extra "dependency check" doesn't appear to be all that useful, so
don't waste time on it. Remove some unused command line options for
selecting which packages to build. Use new board-packages ebuild which
currently just includes 'coreos' and 'coreos-dev' but later can include
extra things like 'python-oem' which doesn't land in the base image.
2014-03-27 22:37:28 -07:00
Michael Marineau
7a43a07fef feat(setup_board): Configure binary package sources on the fly.
Generate list of board binhosts based on the new $COREOS_DOWNLOAD_ROOT
variable and optionally use packages only from a specific version
2014-02-09 14:24:01 -08:00