This repository was archived by the owner on May 30, 2023. It is now read-only.
Merged
Conversation
The systemd.eclass was not finding the systemd pkg-config file to figure out the system unit directory, so it was falling back to a hardcoded default (`/lib/systemd/system`). In one case (when overriding the `default.target` symlink), we tried to fix that by specifying the `PKG_CONFIG_LIBDIR` environment variable, but that still did not help. Using functions from `systemd.eclass` in a systemd ebuild is working only by chance here. This eclass is usually meant for ebuilds that depend on systemd and rely on systemd being already installed in the root filesystem. The functions in `systemd.eclass` that need to figure out some values from systemd's pkg-config file (like system unit directory) assume that systemd is already installed in the root filesystem, which is not the case when we actually are building and installing systemd. To add an insult to the injury, `systemd.eclass` is not using pkg-config directly, but rather a shell script that wraps pkg-config (for example `/usr/bin/x86_64-cros-linux-gnu-pkg-config`). The script clobbers the environment variables like `PKG_CONFIG_PATH` or `PKG_CONFIG_LIBDIR`, which is why overriding them did not work when fixing up the `default.target` symlink. Thus `systemd.eclass` was actually falling back to a hardcoded default value. The only way to control the script is through either SYSROOT or ROOT environment variables. So do so. This fixes merging the installed files into root file system using a newer version of portage. The failure was that systemd build system installs the `default.target` symlink in `/usr/lib/systemd/system` pointing to `graphical.target`, while we later try to override it to point it to `multi-user.target`. But instead of overriding a symlink, we installed a new symlink in `/lib/systemd/system`. Both `/lib` and `/usr/lib` are separate directories in the temporary installation directory, but in root filesystem, both are symlinks pointing to the same directory. Which means that we ended up with two different symlinks in temporary installation directory, and the new portage version could not decide which one to use during the merge into the root filesystem. I'm not sure what old portage version did here, likely worked by chance too.
Contributor
Author
|
amd64 build completed successfully, and arm64 got some unrelated failure during image matrix build: |
Contributor
|
I restarted the arm64 build |
pothos
approved these changes
Feb 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The systemd.eclass was not finding the systemd pkg-config file to
figure out the system unit directory, so it was falling back to a
hardcoded default (
/lib/systemd/system). In one case (whenoverriding the
default.targetsymlink), we tried to fix that byspecifying the
PKG_CONFIG_LIBDIRenvironment variable, but thatstill did not help.
Using functions from
systemd.eclassin a systemd ebuild is workingonly by chance here. This eclass is usually meant for ebuilds that
depend on systemd and rely on systemd being already installed in the
root filesystem.
The functions in
systemd.eclassthat need to figure out some valuesfrom systemd's pkg-config file (like system unit directory) assume
that systemd is already installed in the root filesystem, which is not
the case when we actually are building and installing systemd.
To add an insult to the injury,
systemd.eclassis not usingpkg-config directly, but rather a shell script that wraps pkg-config
(for example
/usr/bin/x86_64-cros-linux-gnu-pkg-config). The scriptclobbers the environment variables like
PKG_CONFIG_PATHorPKG_CONFIG_LIBDIR, which is why overriding them did not work whenfixing up the
default.targetsymlink. Thussystemd.eclasswasactually falling back to a hardcoded default value. The only way to
control the script is through either SYSROOT or ROOT environment
variables. So do so.
This fixes merging the installed files into root file system using a
newer version of portage. The failure was that systemd build system
installs the
default.targetsymlink in/usr/lib/systemd/systempointing to
graphical.target, while we later try to override it topoint it to
multi-user.target. But instead of overriding a symlink,we installed a new symlink in
/lib/systemd/system. Both/liband/usr/libare separate directories in the temporary installationdirectory, but in root filesystem, both are symlinks pointing to the
same directory. Which means that we ended up with two different
symlinks in temporary installation directory, and the new portage
version could not decide which one to use during the merge into the
root filesystem. I'm not sure what old portage version did here,
likely worked by chance too.
Test build: http://localhost:9091/job/os/job/manifest/1918/