Commit Graph

50 Commits

Author SHA1 Message Date
Krzesimir Nowak
1e9ed6156c virtual/rust: Drop unused package
Mentions of virtual/rust in some scripts were replaced with
dev-lang/rust-bin. These were usually about skipping the update/build
of the package, and these already contained dev-lang/rust, so added
the -bin variant for completeness.
2025-01-24 11:41:22 +01:00
James Le Cuirot
8e5b5af225
dev-lang/rust: Drop our custom package in favour of upstream Gentoo's
It is not clear why this was forked originally. One reason was to avoid
the sys-apps/lsb-release dependency, but it probably wasn't just that.
It seems likely that the upstream package did not support cross targets
at the time. Now it does.

It appears that LTO was previously enabled by us following Gentoo rather
than through an explicit decision. They now disable it by default, so we
do likewise. It previously used "fat" LTO, which makes Rust especially
slow to build and reportedly made rustc slower than with "thin" LTO!
There seems little benefit in using thin LTO given that we rebuild Rust
almost as much as the packages that use it, plus we don't enable LTO
anywhere else.

We still avoid rustdoc to keep the size down using INSTALL_MASK. This
isn't as good as not building it in the first place, but this alone
isn't worth keeping a fork.

Cross targets are now handled via the admittedly experimental
RUST_CROSS_TARGETS support. This has been in place for a while, and I
think it is fairly widely used now. If it does disappear, it would
almost certainly be for something even better.

This also updates Rust from 1.80.0 to 1.80.1.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-08-15 16:54:11 +01:00
James Le Cuirot
7d85ee75da
Skip Catalyst stage2 as recommended by upstream Gentoo
From https://wiki.gentoo.org/wiki/Catalyst/Stage_Creation#Build_Stage3:

> It is not necessary to build stage2 in order to build stage3. Gentoo
> release engineering does not build stage2, and you should not need to
> unless you're intentionally building a stage2 as your goal.

We can now sync portage-stable/scripts with upstream because
bootstrap.sh is only used during stage2, and the changes we had are no
longer relevant. It seems likely the changes were already redundant
anyway.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-08-01 13:31:56 +01:00
James Le Cuirot
2ba2b0236d
Move Catalyst upgrade inside catalyst_init and add --jobs option
catalyst.sh is a library file, so it shouldn't upgrade Catalyst until
actually taking action.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-07-17 11:24:20 +01:00
James Le Cuirot
186f31168c
Upgrade to (at least) Catalyst 4 before trying to run Catalyst
The changes to support Catalyst 4 are not backwards compatible and we
need a seamless transition for builds in CI.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-07-15 14:28:05 +01:00
James Le Cuirot
872ea6d14d
Don't use repo snapshots for stage1 by updating seed the new way
This is what upstream Gentoo does. They would previously update the
entire seed, but this took a long time. Our seeds are much bigger, so we
kept repo snapshots to build stage1 against these instead. The new
method of only rebuilding packages with changed sub-slots is a good
compromise and removes the need to write stage1 hooks that selectively
catch the repository up.

This also avoids some conflicts by adding the `--ignore-world` option.
Gentoo seeds have nothing in @world. We have much more, but none of that
is needed for stage1.

This continues to exclude cross-*-cros-linux-gnu/* as that is not needed
for stage1. It now also excludes dev-lang/rust, because it is never a
DEPEND, so it would not break other packages in this way. It may fail to
run due to a sub-slot change in one of its own dependencies, but it is
also unlikely to be needed in stage1 and it is not configured to use the
system LLVM. If needs be, we could improve the behaviour of Portage's
@changed-subslot to respect `--with-bdeps`.

In my testing, it was unable to handle an SDK from 17 months ago, but
one from 7 months ago did work. In practise, we will always use a much
more recent one, which is far more likely to work.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-07-15 14:28:03 +01:00
James Le Cuirot
1d7d53fad9
Upgrade to Catalyst 4
Catalyst 4 has totally changed the way repositories are handled. It only
works when the name of the directory containing the repository matches
the configured name of that repository. This was not the case for us,
with the coreos repository residing in the coreos-overlay directory. We
wanted to move and rename our repositories anyway, but this is a big
change, so we'll do separately. For now, this just renames coreos to
coreos-overlay.

Catalyst 4 also ingests the main repository snapshot as a squashfs
rather than a tarball. It features a utility to generate such a
snapshot, but it doesn't fit Flatcar well, particularly because it
expects each ebuild repository to reside at the top level of its own git
repository. It was very easy to call tar2sqfs manually though.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-07-15 14:27:59 +01:00
Krzesimir Nowak
60aded12f5 build_library/catalyst.sh: Fix and extend snapshot handling
- Fix the snapshot name, it is not "portage-${VERSION}", but rather
  "gentoo-${VERSION}".

- After building the snapshot, remove all the similar files from the
  snapshots directory - Catalyst gets easily confused by them and
  bails out.

- Extend the `build_snapshot` function to optionally accept the config
  path and the snapshot name, so SDK's stage1 code can use this
  function instead of duplicating parts of it.
2023-05-25 12:35:29 +02:00
Krzesimir Nowak
120a746c88 build_library/catalyst.sh: Make some variables local 2023-05-24 13:50:50 +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
1d132574ac build_library/catalyst.sh: Do not use "which"
There's a bash built-in named command that could be used instead.
2023-02-16 13:57:05 +01:00
Krzesimir Nowak
409b47a932 *: Fix user-patches setup
Normally `ln -sf path/to/target at/name` will create a symlink at
`at/name` that points to `path/to/target`. But if `at/name` already
exists and is a directory or a symlink to some other directory, then
this command will create a symlink at `at/name/target` pointing to
`path/to/target`. There is an ambiguity between 1st and 3rd form of
`ln` (please refer to `man ln` for the available invocation forms). It
can be disambiguated by using the `-T` flag to force the 1st form.

In our case, if `/etc/portage/patches` symlink already existed and was
pointing to `<coreos-overlay>/coreos/user-patches`, we ended up with a
useless symlink at `<coreos-overlay>/coreos/user-patches/user-patches`
pointing to `<coreos-overlay>/coreos/user-patches`.
2023-01-31 12:00:22 +01:00
Krzesimir Nowak
0374f23660 update_chroot, build_library: Drop repos.conf customization
The "disabled" option was a Flatcar customization in
sys-apps/portage. We are trying to move to vanilla portage, so let's
see if this will work.
2023-01-11 10:45:35 +01:00
Krzesimir Nowak
f63ee98d00 *: Allow applying user patches
When setting up portage configuration, we set up a symlink in
${ROOT}/etc/portage/patches that points to the coreos/user-patches
directory inside the coreos-overlay. That way, we can add our custom
patches to coreos-overlay without the need for moving the packages
from portage-stable to coreos-overlay only to apply an extra patch.
2022-12-14 13:52:48 +01:00
Thilo Fromm
84d7bf63b1 bootstrap_sdk: no package updates in stage 1
This change updates the stage1 SDK bootstrap build to use local
("known good") package ebuilds only, preventing updated package ebuilds
to apply in stage 1. This fixes SDK build breakage we observed when
upgrading core libraries like readline.

The change also removes the seed update from stage 1 as it should not
be needed anymore now that we postpone any package updates to stage 2.

The following package ebuild repos are used for stage 1:
- for portage-stable, we simply copy /var/gentoo/repos/gentoo
   from the SDK root.
- coreos-overlay is more complicated since ebuilds are missing from
   the SDK. So we grok the version the SDK was built with from
     /mnt/host/source/.repo/manifests/default.xml
   and then we create a local stage 1 clone of
     https://github.com/kinvolk/coreos-overlay.git
   in which we then check out the revision noted in the default mnifest.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-03-03 17:32:38 +01:00
Krzesimir Nowak
0e41ffc336 build_library/catalyst.sh: Fix paths to ebuild repos
I have no idea how this thing worked before - the repos never were in
/usr/portage nor in /usr/local/portage… But the newer version of
portage seems to be pretty picky about the validity of repos location,
so fix them.
2021-02-03 16:47:59 +01:00
Dongsu Park
829cec45e8 jenkins: do not configure ccache variables
Setting the invalid CCACHE_ variables resulted in strange failure
in projects depending on meson, newer version like 0.55.3. For example
systemd build fails like the following errors:

```
 * ACCESS DENIED:  utimes:       /mnt/host/source/ccache
 * ACCESS DENIED:  utimes:       /mnt/host/source/ccache

F: utimes
S: deny
P: /mnt/host/source/ccache
A: /mnt/host/source/ccache
R: /mnt/host/source/ccache
C: ccache cc /build/amd64-usr/var/tmp/portage/sys-apps/systemd-246/work/systemd-246-abi_x86_64.amd64/meson-private/sanitycheckc.c -o /build/amd64-usr/var/tmp/portage/sys-apps/systemd-246/work/systemd-246-abi_x86_64.amd64/meson-private/sanitycheckc.exe -O1 -pipe -pipe -D_FILE_OFFSET_BITS=64
```

We should not set up ccache at all, as it has been already disabled in
coreos-overlay repo.
2020-10-26 15:38:57 +01:00
Kai Lüke
c016b581b4
build_library/catalyst.sh: Specify which gcc package to rebuild
The default update seed command does only specify gcc which leads to
an error because »The short ebuild name "gcc" is ambiguous«.
Choose the standard package name instead of the cross compiler packages
which are only known to emerge because we build them as part of an SDK
release now.
2020-07-27 20:31:17 +02:00
Dongsu Park
8047522874 build_library/catalyst: Update virtual/rust during catalyst stage1
Install `virtual/rust` to avoid version conflicts that happen in case of
rust versions in the SDK being different from those in the new ebuilds.

`/usr/share/catalyst/targets/stage1/stage1-chroot.sh` installs gcc and
its dependencies, including `dev-lang/rust`, while `virtual/rust` does
not get updated. That results in version conflicts between
`virtual/rust` and `dev-lang/rust`. To avoid such an issue, we should
update also `virtual/rust` when building stage1. Since `virtual/rust`
automatically pulls in `dev-lang/rust`, we do not need to explicitly
specify `dev-lang/rust` here.
2020-06-10 20:28:40 +02:00
Flatcar Buildbot
1dad511f69 2317.0.1 2019-11-07 19:40:01 +01:00
David Michael
2791e33eb5 Revert "catalyst: Temporarily disable update_seed again"
This reverts commit a85cb08443.
2019-05-02 03:23:07 +00:00
David Michael
a85cb08443 catalyst: Temporarily disable update_seed again
The glib security update blocks itself.  Disable this until a new
SDK is generated, then it can be reverted again.
2019-04-23 03:29:09 +00:00
David Michael
cea88d9c52 Revert "catalyst: Temporarily disable update_seed again"
This reverts commit 7d99b4dbdd.
2019-01-28 15:58:47 +00:00
David Michael
7d99b4dbdd catalyst: Temporarily disable update_seed again
The Perl update will break SDK bootstrapping during seed update, so
disable it again.  This can be reverted after bumping the SDK to a
version that includes the new Perl.
2019-01-25 18:12:55 +00:00
David Michael
e1761bee54 Revert "catalyst: Temporarily disable update_seed again"
This reverts commit 373d5a814b.
2018-11-16 14:11:00 +00:00
David Michael
373d5a814b catalyst: Temporarily disable update_seed again
This works around the edk2 rename breaking SDK bootstrapping.  It
can be reverted when an SDK has the new version built into it.
2018-10-25 17:08:02 -04:00
David Michael
a598864413 catalyst: Update sharedir for catalyst 3 2018-10-19 12:12:46 -04:00
David Michael
be1344f12d Revert "catalyst: Temporarily disable update_seed"
This reverts commit efbc542c59.
2018-06-29 13:38:08 +00:00
David Michael
efbc542c59 catalyst: Temporarily disable update_seed
This can be reverted after switching to an SDK with Python 3.6
built into it.
2018-06-25 09:28:37 -04:00
David Michael
09e3c49811 catalyst: Disable ccache
It provides no value when it works, and it's randomly causing
failures to build toolchains due to permissions problems after
certain releases.  This also requires taking it out of FEATURES in
the portage profile (which is the SDK profile by default).

Test Jenkins runs of SDK and toolchains jobs both ran in the same
time as with ccache enabled.
2018-03-05 17:58:25 -05:00
David Michael
a707c1b597 Revert "catalyst: temporarily disable update_seed"
This reverts commit 43807d6763.
2017-06-14 13:04:09 -07:00
David Michael
43807d6763 catalyst: temporarily disable update_seed
This can be reverted once there is a version of the SDK containing
the updated Perl 5.22 packages.
2017-03-21 21:12:40 -07:00
Bassam Tabbara
cbb4256a80 catalyst: workaround for bootstrap_sdk on Ubuntu
workaround for bootstrap_sdk on an Ubuntu host where /dev/shm is a
symlink to /run/shm. Since we mount the hosts /dev (for losetup) this
interferes with building python 2.7. The workaround is to disable the
/dev/shm during python builds. A longer term fix would be to not mount
the hosts /dev. Thanks for marineam for suggesting the fix on IRC.
2016-08-23 16:40:41 -07:00
Michael Marineau
8eceddd54f Revert "*: drop obsolete gentoo repo reference" 2016-05-24 14:20:43 -07:00
Michael Marineau
632d578b56 *: drop obsolete gentoo repo reference
Instead of patching portage to support the `disabled` flag now we just
patch it to leave the `[gentoo]` section out of the default repos.conf.

Follow up to 585275b268
2016-05-08 19:31:02 -07:00
Michael Marineau
582361b30c catalyst: allow GENTOO_MIRRORS to be passed in through the environment 2016-05-02 20:12:27 -07:00
Michael Marineau
5ba4c7181d *: drop usage of COREOS_VERSION_STRING
This variable was semi-deprecated ages ago so `version.txt` could follow
a similar variable naming pattern to `os-release`. Finally drop usage of
it here in favor of `$COREOS_VERSION`.
2016-02-15 13:55:55 -08:00
Michael Marineau
0ef030051c catalyst: re-enable ccache
Now that ccache is turned on by default in the profile portage complains
a lot if ccache isn't actually installed, sleeping 5 seconds for each
error message. Since pkgcache is in use ccache isn't going to make that
much of a difference but getting rid of those 5 second sleeps will. :)
2015-09-06 21:26:15 +00:00
Michael Marineau
6e6a0a4967 toolchain_util: include repos.conf in bootstrap build environments
This is required for the eventual removal of `$PORTDIR` and
`$PORTDIR_OVERLAY` and ensures toolchain rebuilds/updates with
`./build_packages --nousepkg` don't erroniously try to use ebuilds from
`/usr/portage` inside of the SDK.

In order to fix up the build_toolchains script the crossdev overlay
needs to be setup properly, previously only setup_board did it.

Overall silences a lot of warnings and fixes an issue with crossdev:

    /usr/bin/emerge-wrapper: line 48: /eclass/toolchain-funcs.eclass: No such file or directory
    /usr/bin/emerge-wrapper: line 49: tc-arch: command not found
2015-04-01 16:30:37 -07:00
Michael Marineau
5c7a101bfe catalyst: disable ccache and autoresume
Disable ccache as it is causing issues in other builds so disable it
everywhere to be safe. Disable the autoresume feature because our build
process doesn't actually make use of it.
2015-01-08 16:17:26 -08:00
Michael Marineau
3b40989d52 catalyst: make sure the 'portage' user can write to distfiles and ccache
Adding the update step appears to break permissions on the distfiles
directory. Ensure the portage user is correct and set the permissions on
directories it needs to write to in advance.
2014-12-17 12:46:18 -08:00
Michael Marineau
4debbfc257 catalyst: update GCC dependencies before building stage1
When bootstrapping a SDK we need to update GCC dependencies to ensure
the GCC built for stage1 is linked against the same library versions as
those that are included in the stage1. Without this updating the mpc
library just results in a broken stage1.
2014-12-17 12:44:10 -08:00
Michael Marineau
93b0ec304a fix(build_library): Remove reference to old SDK profile
The SDK's profile changed to coreos:coreos/amd64/sdk quite a long time
ago. Remove this last reference to it so the alias can be forgotten.
2014-06-10 14:45:56 -04:00
Michael Marineau
695ff028b3 fix(catalyst): Don't disable ebuild-locks
This doesn't make things go faster and I am suspicious that it makes
things worse. For example /etc/xml/catalog winds up empty from time to
time and I wonder if this locking is related to that.
2014-03-04 23:08:37 -08:00
Michael Marineau
a1026792aa fix(catalyst): Recreate portage snapshot with --rebuild 2014-02-09 17:37:53 -08:00
Michael Marineau
75972cd991 fix(catalyst): Always use the current SDK tarball as seed.
Right now there is some funky logic to either use a previous build as a
seed or the current SDK tarball if it happens to have been downloaded.
This is a bit confusing and doesn't work reliably since it is reasonable
for there to be neither a previous build or the current SDK available if
the SDK chroot was created some time ago. Fix this by using the new SDK
library and always use the latest SDK, downloading it if needed.
2013-11-23 20:32:55 -08:00
Michael Marineau
c5c9ea0b9b fix(common.sh): New variables for .cache and .repo/manfests
A number of places refer to these paths and that number is going to
grow. Since the standard pattern is to use environment variables for
commonly used paths it is time to add ones for these:
REPO_CACHE_DIR
REPO_MANIFESTS_DIR
2013-11-22 16:13:49 -08:00
Michael Marineau
e145b916f2 fix(catalyst.sh): Update catalyst build more aggressively.
Use 2*CPUs for the target load average but add load average throttling
to emerge in addition to make. Also work around how catalyst sets
FEATURES so we can disable extra locking for hopefully faster builds.
2013-11-07 13:28:13 -08:00
Michael Marineau
5adbfd8a32 fix(catalyst): Move catalyst scripts from lib to build_library.
Just seems like a better place for them.
2013-10-10 11:47:09 -07:00