Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop sysroot-wrappers and *-config script wrappers #2207

Merged
merged 8 commits into from
Aug 9, 2024

Conversation

chewi
Copy link
Contributor

@chewi chewi commented Aug 8, 2024

Drop sysroot-wrappers and *-config script wrappers

Supersedes #2177.

Gentoo will soon start patching gcc to respect the ESYSROOT environment variable so that cross-compiling into a different directory works out of the box. This removes the need for our own sysroot wrappers. This approach does not have the downside of sysroot paths leaking into the final build.

While working on this, I unintentionally dropped the generation of our *-config script wrappers but found that this only broke one package, so I fixed that up. I then flushed out the few remaining instances of this issue that were being masked by presence of these scripts on the build host. The Gentoo fixes for those can be taken in the round as it does not actually affect our build.

The included eclass changes have already been merged into Gentoo.

How to use

Do a full Flatcar build, preferably in two phases.

Testing done

I have previously done several two-phase builds in Jenkins. I will now perform a fresh one.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update) -- N/A
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

Signed-off-by: James Le Cuirot <[email protected]>
Otherwise packages subsequently built by this script do not have the
patches applied.

Signed-off-by: James Le Cuirot <[email protected]>
It will patch gcc to respect ESYSROOT when cross-compiling, effectively
adding the --sysroot flag without the use of flags or wrappers. This
hasn't been merged into Gentoo yet, but it has been given the nod. When
it does get merged, it was only be for newer gcc versions than we're
currently using, so we'll need this user patch in the meantime
regardless.

Signed-off-by: James Le Cuirot <[email protected]>
…ss fixes

It was previously relying on xmlsec1-config and dnet-config scripts that
we were creating wrappers for.

Signed-off-by: James Le Cuirot <[email protected]>
pkg-config is usually preferable, but this simpler approach works here
because krb5-config is a shell script and the headers and libraries are
in standard paths.

It was previously relying on a wrapper we were creating. It still works
without that, but only because krb5-config also exists on the host, and
we shouldn't assume that.

Signed-off-by: James Le Cuirot <[email protected]>
Gentoo avoids using these scripts as much as possible because they don't
play well when cross-compiling. Wrappers can help, but this approach is
considered too messy for Gentoo itself, and there are always other ways
around the problem.

I found that only app-emulation/open-vm-tools failed to build without
these wrappers. I have fixed this in Gentoo (and Flatcar) and sent a
simple patch further upstream.

I knew that other instances of this problem were being masked by the
presence of these scripts on the build host, so I manually removed them
all before rebuilding all of the board packages. This found about 8 more
affected packages, most of which were looking for krb5-config. These
have now been addressed in Gentoo or Flatcar as necessary. The Gentoo
fixes have not been applied to Flatcar yet, but they can be taken in the
round.

Signed-off-by: James Le Cuirot <[email protected]>
@chewi chewi merged commit 58be59f into main Aug 9, 2024
1 check failed
@chewi chewi deleted the chewi/no-sysroot-wrappers-gcc branch August 9, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

3 participants