Skip to content
Snippets Groups Projects
Unverified Commit c45d7ec0 authored by Oliver Smith's avatar Oliver Smith
Browse files

cross/crossdirect: fakeroot: add helpful error msg (MR 5744)

Alpine's abuild runs build() without fakeroot, and package() with
fakeroot. From the APKBUILD reference page in the Alpine wiki:

> Note: Building in fakeroot will reduce performance for parallel
> builds dramatically. It is for this reason that we split the build
> and package process into two separate functions.

Every now and then we see a package that tries to run a compiler (gcc,
g++, clang, ...) during package() in the APKBUILD. This is a bug in the
APKBUILD / build system of the program we are packaging. All compiling
should be done during build().

Let crossdirect print the following when this happens:

  ============================================================================================
  ERROR: crossdirect was called with: LD_PRELOAD=libfakeroot.so
  This means your package tried to run a compiler during package().
  This is not supported by crossdirect, and usually not a good idea.
  * Try to fix your APKBUILD so it does not run the compiler during package(), only in build()
    * If you're using meson install, try to add '--no-rebuild'
  * If this is not possible, you can work around it by setting options="!pmb:crossdirect"
    (compilation will be slower!)
  ============================================================================================

Instead of:

  ERROR: crossdirect: can't handle LD_PRELOAD: libfakeroot.so
  Please report this at: https://gitlab.com/postmarketOS/pmaports/issues
  As a workaround, you can compile without crossdirect.

In the past I've also tried to add 'strcmp(ldPreload, "libfakeroot.so") == 0'
(pmaports MR 2231), and today I made the same patch. The current code
looks like it would then work by just using libfakeroot.so from the
native chroot, but it does not work. And as mentioned, if we hit this
then we are compiling in package() which is something we should not do
anyway!

Fixes: pmb issue 2039
Related: pma issue 2351, pma MR 5738
parent f30cb0d7
No related branches found
No related tags found
1 merge request!5744cross/crossdirect: fakeroot: add helpful error msg
Pipeline #209309 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment