Jump to content
Read the Funtoo Newsletter: Summer 2023 ×

Fixes for abi-riscv-lp64(d) Rebuild Issues


Recommended Posts

  • Funtoo Linux BDFL

Recent updates to the Portage tree will cause Portage to want to rebuild nearly everything on Funtoo systems. When you experience this after a world update, there is a way to avoid rebuilding everything. To work around this, run the following script as root:

#!/usr/bin/python3
import os

bad_flags = {"abi_riscv_lp64", "abi_riscv_lp64d"}
for dp, dn, fn in os.walk("/var/db/pkg"):
    for targ_fn in [ "IUSE", "IUSE_EFFECTIVE" ]:
        if targ_fn not in fn:
            continue
        usep = os.path.join(dp, targ_fn)
        with open(usep, "r") as usef:
            old_dat = usef.read()
            old_flags = set(old_dat.split())
            new_flags = old_flags - bad_flags
        if old_flags == new_flags:
            continue
        with open(usep + ".bak", "w") as usef:
            usef.write(old_dat)
        with open(usep, "w") as usef:
            usef.write(" ".join(sorted(list(new_flags))))

This script will remove "abi_riscv_lp64" and "abi_riscv_lp64d" from IUSE and IUSE_EFFECTIVE in /var/db/pkg entries, eliminating the "urge" for Portage to rebuild everything.

Link to comment
Share on other sites

×
×
  • Create New...