Compare commits

...

3 Commits

4 changed files with 51 additions and 10 deletions

View File

@ -20,13 +20,19 @@ common:
packager: "ALHP $march$ <alhp@harting.dev>"
makeflags: "-j$buildproc$"
# https://somegit.dev/ALHP/ALHP.GO/issues/110
rustflags: "-Copt-level=3 -Ctarget-cpu=$march$ -Clink-arg=-z -Clink-arg=pack-relative-relocs"
rustflags:
- "-Copt-level=3"
- "-Ctarget-cpu=$march$"
- "-Clink-arg=-z"
- "-Clink-arg=pack-relative-relocs"
ltoflags:
- "-falign-functions=32" # https://github.com/InBetweenNames/gentooLTO/issues/164
kcflags: " -march=$march$ -O3"
kcppflags: " -march=$march$ -O3"
fcflags: "$CFLAGS"
fflags: "$CFLAGS"
fcflags: "$FFLAGS"
fflags:
- "-O2": "-O3"
- "-march=$march$"
lto:
rustflags:
@ -35,4 +41,4 @@ lto:
options:
- "!lto": "lto"
cargo_profile_release_lto: "fat"
cargo_profile_release_lto: "fat"

View File

@ -249,6 +249,12 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
DBPackage: dbPkg,
}
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.RepoVersion == "" && dbPkg.SkipReason == "blacklisted":
log.Infof("[HK] requeue previously blacklisted package %s->%s", fullRepo, dbPkg.Pkgbase)
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearSkipReason().ClearTagRev().Exec(context.Background())
if err != nil {
return err
}
case dbPkg.Status == dbpackage.StatusFailed && dbPkg.RepoVersion != "":
log.Infof("[HK] package %s->%s failed but still present in repo, removing", fullRepo, dbPkg.Pkgbase)
pkg := &ProtoPackage{

View File

@ -97,7 +97,7 @@ package() {
`
func TestIncreasePkgRel(t *testing.T) { //nolint:paralleltest
pkgbuild, err := os.CreateTemp("", "")
pkgbuild, err := os.CreateTemp(t.TempDir(), "")
if err != nil {
t.Fatal("unable to setup temp. PKGBUILD")
}
@ -142,7 +142,7 @@ func TestIncreasePkgRel(t *testing.T) { //nolint:paralleltest
}
func TestIncreasePkgRelWithPkgSub(t *testing.T) { //nolint:paralleltest
pkgbuild, err := os.CreateTemp("", "")
pkgbuild, err := os.CreateTemp(t.TempDir(), "")
if err != nil {
t.Fatal("unable to setup temp. PKGBUILD")
}

View File

@ -26,6 +26,7 @@ import (
const (
pacmanConf = "/usr/share/devtools/pacman.conf.d/multilib.conf"
makepkgConf = "/usr/share/devtools/makepkg.conf.d/x86_64.conf"
makepkgConfExt = "/etc/makepkg.conf.d"
logDir = "logs"
pristineChroot = "root"
buildDir = "build"
@ -337,7 +338,7 @@ func setupChroot() error {
res, err := cmd.CombinedOutput()
log.Debug(string(res))
if err != nil {
return fmt.Errorf("error updating chroot: %w\n%s", err, string(res))
return fmt.Errorf("error updating chroot: %w: %s", err, string(res))
}
case os.IsNotExist(err):
err = os.MkdirAll(filepath.Join(conf.Basedir.Work, chrootDir), 0o755)
@ -349,15 +350,24 @@ func setupChroot() error {
res, err := cmd.CombinedOutput()
log.Debug(string(res))
if err != nil {
return fmt.Errorf("error creating chroot: %w\n%s", err, string(res))
return fmt.Errorf("error creating chroot: %w: %s", err, string(res))
}
// copy pacman.conf into pristine chroot to enable multilib
cmd = exec.Command("sudo", "cp", pacmanConf, //nolint:gosec
filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot, "etc/pacman.conf"))
res, err = cmd.CombinedOutput()
log.Debug(string(res))
if err != nil {
return fmt.Errorf("error copying pacman.conf to chroot: %w\n%s", err, string(res))
return fmt.Errorf("error copying pacman.conf to chroot: %w: %s", err, string(res))
}
// remove makepkg conf extension, they are covered by our custom makepkg
cmd = exec.Command("sudo", "rm_chroot.py", filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot, "etc/makepkg.conf.d"))
res, err = cmd.CombinedOutput()
log.Debug(string(res))
if err != nil {
return fmt.Errorf("error removing makepkg.conf.d from chroot: %w: %s", err, string(res))
}
default:
return err
@ -482,6 +492,8 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) {
}
if _, ok := subMap.(string); ok && len(orgMatch) > 0 {
log.Debugf("replace %s with %s", orgMatch[0], fmt.Sprintf("\n%s=%s%s%s",
strings.ToUpper(subSec.(string)), orgMatch[2], replaceStringsFromMap(subMap.(string), replaceMap), orgMatch[4]))
makepkgConf = strings.ReplaceAll(makepkgConf, orgMatch[0], fmt.Sprintf("\n%s=%s%s%s",
strings.ToUpper(subSec.(string)), orgMatch[2], replaceStringsFromMap(subMap.(string), replaceMap), orgMatch[4]))
continue
@ -534,7 +546,24 @@ func setupMakepkg(march string, flags map[string]any) error {
if err != nil {
return err
}
makepkgStr := string(t)
makepkgStrBuilder := new(strings.Builder)
makepkgStrBuilder.Write(t)
// read makepkg conf.d
makepkgConfExt, err := Glob(filepath.Join(makepkgConfExt, "*.conf"))
if err != nil {
return err
}
for _, makepkgExt := range makepkgConfExt {
ext, err := os.ReadFile(makepkgExt)
if err != nil {
return err
}
makepkgStrBuilder.Write(ext)
}
makepkgStr := makepkgStrBuilder.String()
makepkgStr, err = parseFlagSection(flags["common"], makepkgStr, march)
if err != nil {