forked from ALHP/ALHP.GO
Compare commits
2 Commits
master
...
feat/rust_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
20ea64acdc | ||
be46f92cbe |
13
main.go
13
main.go
@@ -218,7 +218,6 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
for {
|
||||
select {
|
||||
case pkgL := <-b.repoAdd[repo]:
|
||||
b.repoWG.Add(1)
|
||||
toAdd := make([]string, 0)
|
||||
for _, pkg := range pkgL {
|
||||
toAdd = append(toAdd, pkg.PkgFiles...)
|
||||
@@ -264,7 +263,6 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
if err != nil {
|
||||
log.Warningf("Error updating lastupdate: %v", err)
|
||||
}
|
||||
b.repoWG.Done()
|
||||
case pkgL := <-b.repoPurge[repo]:
|
||||
for _, pkg := range pkgL {
|
||||
if _, err := os.Stat(filepath.Join(conf.Basedir.Repo, pkg.FullRepo, "os", conf.Arch, pkg.FullRepo) + ".db.tar.xz"); err != nil {
|
||||
@@ -281,13 +279,7 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
|
||||
var realPkgs []string
|
||||
for _, filePath := range pkg.PkgFiles {
|
||||
if _, err := os.Stat(filePath); err == nil {
|
||||
realPkgs = append(realPkgs, Package(filePath).Name())
|
||||
}
|
||||
}
|
||||
|
||||
if len(realPkgs) == 0 {
|
||||
continue
|
||||
realPkgs = append(realPkgs, Package(filePath).Name())
|
||||
}
|
||||
|
||||
b.repoWG.Add(1)
|
||||
@@ -301,7 +293,7 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
}
|
||||
|
||||
if pkg.DbPackage != nil {
|
||||
_ = pkg.DbPackage.Update().ClearRepoVersion().ClearHash().Exec(context.Background())
|
||||
_ = pkg.DbPackage.Update().ClearRepoVersion().Exec(context.Background())
|
||||
}
|
||||
|
||||
for _, file := range pkg.PkgFiles {
|
||||
@@ -421,6 +413,7 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
}
|
||||
if !eligible {
|
||||
log.Debugf("skipped package %s (%v)", pkg.Pkgbase, err)
|
||||
b.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
||||
continue
|
||||
}
|
||||
|
||||
|
10
utils.go
10
utils.go
@@ -588,12 +588,6 @@ func housekeeping(repo string, march string, wg *sync.WaitGroup) error {
|
||||
}
|
||||
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
|
||||
}
|
||||
} else if dbPkg.Status == dbpackage.StatusLatest && dbPkg.RepoVersion == "" {
|
||||
log.Infof("[HK] reseting missing package %s with no repo version", dbPkg.Pkgbase)
|
||||
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearHash().ClearRepoVersion().Exec(context.Background())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,6 +731,10 @@ func setupMakepkg(march string) error {
|
||||
makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"")
|
||||
makepkgStr = reMarch.ReplaceAllString(makepkgStr, "${1}"+march)
|
||||
makepkgStr = strings.ReplaceAll(makepkgStr, "#PACKAGER=\"John Doe <john@doe.com>\"", "PACKAGER=\"ALHP "+march+" <alhp@harting.dev>\"")
|
||||
// enable rust flags and patch them
|
||||
makepkgStr = strings.ReplaceAll(makepkgStr, "#RUSTFLAGS=", "RUSTFLAGS=")
|
||||
makepkgStr = strings.ReplaceAll(makepkgStr, "-C opt-level=2", "-C opt-level=3")
|
||||
makepkgStr = strings.ReplaceAll(makepkgStr, "-C opt-level=3", "-C opt-level=3 -C target-cpu="+march+" -C lto=fat -C codegen-units=1 -C strip=symbols -C linker-plugin-lto")
|
||||
|
||||
// write makepkg
|
||||
err = os.WriteFile(lMakepkg, []byte(makepkgStr), 0644)
|
||||
|
Reference in New Issue
Block a user