Compare commits
42 Commits
38a7b6562c
...
main
Author | SHA1 | Date | |
---|---|---|---|
9c2fa9bc2d | |||
01404adad5 | |||
d057e18453 | |||
bcfaccfec5 | |||
f4f64e1999 | |||
48c66d429a | |||
daf6f13542 | |||
b73f1c8f60 | |||
70a09fbc7d | |||
a933dee30f | |||
9369f36c29 | |||
cc754cf4c7 | |||
185837bd3c | |||
26d33f20d3 | |||
362c5d379c | |||
8784e63a9d | |||
1c90e20a10 | |||
2e080c8268 | |||
1b76a0fcf3 | |||
7ed9dac855 | |||
9aa5ed719e | |||
3cfebda5e2 | |||
d4dbfdea1c | |||
ab238cf897 | |||
7c8626dfcb | |||
9695d146c5 | |||
286134674b | |||
15027f99e7 | |||
f3fa0664f9 | |||
f8c878edbf | |||
0e81ca2437 | |||
aadacf5979 | |||
60619e91e7 | |||
8dccbbee84 | |||
453c6d8a3a | |||
3da529478b | |||
30cf4e6ecb | |||
7f2286c8d2 | |||
fe2a3f7f9f | |||
10baa7d290 | |||
f66be19131 | |||
e3ce572dfa |
@@ -14,7 +14,7 @@ linters-settings:
|
||||
disabled-checks:
|
||||
- whyNoLint
|
||||
- filepathJoin
|
||||
gomnd:
|
||||
mnd:
|
||||
checks:
|
||||
- argument
|
||||
- case
|
||||
@@ -90,3 +90,5 @@ linters:
|
||||
# remove for new projects
|
||||
- errname
|
||||
- goerr113
|
||||
- depguard
|
||||
- noctx
|
||||
|
101
README.md
101
README.md
@@ -1,54 +1,41 @@
|
||||
# ALHP
|
||||
|
||||
[](https://somegit.dev/anonfunc/ALHP.GO/src/branch/master/LICENSE)
|
||||
[](https://status.alhp.dev)
|
||||
[](https://goreportcard.com/report/somegit.dev/ALHP/ALHP.GO)
|
||||
[](https://pkg.go.dev/somegit.dev/ALHP/ALHP.GO)
|
||||
[](https://somegit.dev/anonfunc/ALHP.GO/src/branch/master/LICENSE)
|
||||
[](https://liberapay.com/anonfunc/)
|
||||
|
||||
Buildbot for Archlinux-based repos build with different
|
||||
Buildbot for Archlinux based repos with different
|
||||
[x86-64 feature levels](https://www.phoronix.com/scan.php?page=news_item&px=GCC-11-x86-64-Feature-Levels), `-O3` and
|
||||
[LTO](https://en.wikipedia.org/wiki/Interprocedural_optimization).
|
||||
|
||||
> 📢 **x86-64-v4** repos just released. [If your CPU supports v4](#1-check-your-system-for-support), you
|
||||
> can [try them out](#switch-between-levels).
|
||||
|
||||
> ⚠️ NVIDIA graphic users using the **proprietary driver** is highly recommended reading the
|
||||
> [FAQ about Linux kernel modules](#directly-linked-kernel-modules) ⚠️
|
||||
> [!WARNING]
|
||||
> NVIDIA graphics users using the **proprietary driver** are strongly encouraged to read the
|
||||
> [FAQ about Linux kernel modules](#directly-linked-kernel-modules) before enabling any repos.
|
||||
|
||||
---
|
||||
<!-- TOC -->
|
||||
|
||||
* [Quickstart](#quickstart)
|
||||
* [Quick Start](#quick-start)
|
||||
* [FAQ](#faq)
|
||||
* [Remove ALHP packages](#remove-alhp-packages)
|
||||
* [LTO](#lto)
|
||||
* [Linux Kernel packages](#linux-kernel-packages)
|
||||
* [Directly linked kernel modules](#directly-linked-kernel-modules)
|
||||
* [Mirrors](#mirrors)
|
||||
* [What packages are built](#what-packages-are-built)
|
||||
* [Why is package X not up-to-date](#why-is-package-x-not-up-to-date)
|
||||
* [Debug symbols](#debug-symbols)
|
||||
* [Switch between levels/repos](#switch-between-levels)
|
||||
* [Matrix](#matrix)
|
||||
* [Donations](#donations)
|
||||
* [License and Legal](#license-and-legal)
|
||||
|
||||
<!-- TOC -->
|
||||
|
||||
---
|
||||
|
||||
## Quickstart
|
||||
## Quick Start
|
||||
|
||||
### 1. Check your system for support
|
||||
|
||||
> **Important**: Before you enable any of these repos, check if your system supports the feature level you want to
|
||||
> enable
|
||||
(e.g. `x86-64-v3`).
|
||||
> **If you don't check beforehand, you might be unable to boot your system anymore and need to downgrade any package
|
||||
that you may have upgraded.**
|
||||
> [!CAUTION]
|
||||
> Before enabling any of these repos, make sure that your system supports the level of functionality you want to
|
||||
> enable (e.g. `x86-64-v3`).
|
||||
> **If you don't check first, you may not be able to boot your system and will have to downgrade any packages you may
|
||||
have upgraded.**
|
||||
|
||||
Check which feature-levels your CPU supports with
|
||||
Check which feature levels your CPU supports with
|
||||
|
||||
```bash
|
||||
/lib/ld-linux-x86-64.so.2 --help
|
||||
@@ -63,10 +50,14 @@ Subdirectories of glibc-hwcaps directories, in priority order:
|
||||
x86-64-v2 (supported, searched)
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> ALHP repos for `x86-64-v2`, `x86-64-v3` and `x86-64-v4` are currently available. You can see all available
|
||||
> repositories [here](https://alhp.dev/).
|
||||
|
||||
### 2. Install keyring & mirrorlist
|
||||
|
||||
Install [alhp-keyring](https://aur.archlinux.org/packages/alhp-keyring/)
|
||||
and [alhp-mirrorlist](https://aur.archlinux.org/packages/alhp-mirrorlist/) from **AUR**.
|
||||
and [alhp-mirrorlist](https://aur.archlinux.org/packages/alhp-mirrorlist/) from the **AUR**.
|
||||
|
||||
Example with `yay`:
|
||||
|
||||
@@ -78,15 +69,16 @@ yay -S alhp-keyring alhp-mirrorlist
|
||||
|
||||
### 3. Choose a mirror (optional)
|
||||
|
||||
Edit `/etc/pacman.d/alhp-mirrorlist` and comment out/in mirrors you want to have enabled/disabled. Per default selected
|
||||
is a cloudflare-based mirror which
|
||||
[*should* provide decent speed worldwide](https://somegit.dev/ALHP/ALHP.GO/issues/38#issuecomment-891).
|
||||
> Note: Only `alhp.dev` is hosted by ALHP directly. If you have problems with a mirror,
|
||||
Edit `/etc/pacman.d/alhp-mirrorlist` and comment in/out the mirrors you want to enable/disable.
|
||||
By default, a CDN mirror provided by ALHP is selected.
|
||||
> [!NOTE]
|
||||
> `cdn.alhp.dev` and `alhp.dev` are provided directly by ALHP. If you have problems with a mirror,
|
||||
> open an issue at [the mirrorlist repo](https://somegit.dev/ALHP/alhp-mirrorlist).
|
||||
|
||||
### 4. Modify /etc/pacman.conf
|
||||
### 4. Modify pacman.conf
|
||||
|
||||
Add the appropriate repos **above** your regular Archlinux repos.
|
||||
Add the ALHP repos to your `/etc/pacman.conf`. Make sure the appropriate ALHP repository is **above** the Archlinux
|
||||
repo.
|
||||
|
||||
Example for `x86-64-v3`:
|
||||
|
||||
@@ -94,12 +86,12 @@ Example for `x86-64-v3`:
|
||||
[core-x86-64-v3]
|
||||
Include = /etc/pacman.d/alhp-mirrorlist
|
||||
|
||||
[extra-x86-64-v3]
|
||||
Include = /etc/pacman.d/alhp-mirrorlist
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra-x86-64-v3]
|
||||
Include = /etc/pacman.d/alhp-mirrorlist
|
||||
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
@@ -112,11 +104,11 @@ Include = /etc/pacman.d/mirrorlist
|
||||
```
|
||||
|
||||
Replace `x86-64-v3` with the x86-64 feature level you want to enable.
|
||||
> ALHP builds for `x86-64-v2`, `x86-64-v3` and `x86-64-v4` at the moment. You can see all available
|
||||
> repositories
|
||||
> [here](https://alhp.dev/).
|
||||
|
||||
### 5. Update package database and upgrade:
|
||||
> [!TIP]
|
||||
> Multiple layers can be stacked as described in https://somegit.dev/ALHP/ALHP.GO/issues/255#issuecomment-3335.
|
||||
|
||||
### 5. Update package database and upgrade
|
||||
|
||||
```
|
||||
pacman -Suy
|
||||
@@ -126,9 +118,9 @@ pacman -Suy
|
||||
|
||||
### Remove ALHP packages
|
||||
|
||||
To disable ALHP remove all *x86-64-vX* entries in `/etc/pacman.conf` and remove `alhp-keyring` and `alhp-mirrorlist`.
|
||||
To disable ALHP, remove all *x86-64-vX* entries in `/etc/pacman.conf` and remove `alhp-keyring` and `alhp-mirrorlist`.
|
||||
|
||||
After that you can refresh pacmans databases and downgrade all packages like:
|
||||
After that, you can update pacman's databases and downgrade all packages, like
|
||||
|
||||
```
|
||||
pacman -Suuy
|
||||
@@ -136,7 +128,7 @@ pacman -Suuy
|
||||
|
||||
### LTO
|
||||
|
||||
Enabled for all packages build after 04 Nov 2021 12:07:00
|
||||
Enabled for all packages built after 04 Nov 2021 12:07:00
|
||||
UTC. [More details.](https://somegit.dev/ALHP/ALHP.GO/issues/52)
|
||||
LTO status is visible per package on the package status page.
|
||||
|
||||
@@ -146,7 +138,7 @@ LTO status is visible per package on the package status page.
|
||||
|
||||
### Directly linked kernel modules
|
||||
|
||||
Due to our increase in pkgrel, building the kernel packages **breaks all directly linked modules** like `nvidia`
|
||||
Due to our increase in pkgrel, building the kernel packages **will break any directly linked modules** such as `nvidia`
|
||||
(not `nvidia-dkms`) or `virtualbox-host-modules-arch` (not `virtualbox-host-dkms`). **Their respective `dkms`-variant is
|
||||
not affected**. This issue is being tracked in #68, a solution is being worked on.
|
||||
|
||||
@@ -158,19 +150,18 @@ so, [see alhp-mirrorlist for how to become one](https://somegit.dev/ALHP/alhp-mi
|
||||
### What packages are built
|
||||
|
||||
Packages [excluded](https://www.reddit.com/r/archlinux/comments/oflged/alhp_archlinux_recompiled_for_x8664v3_experimental/h4fkinu?utm_source=share&utm_medium=web2x&context=3)
|
||||
from building (besides all 'any' architecture packages) are being listed in issue #16.
|
||||
Also [package status page](https://status.alhp.dev) (search for `blacklisted`).
|
||||
from building (besides all `any` architecture packages) are being listed in issue #16.
|
||||
See also [package status page](https://status.alhp.dev) (search for `blacklisted`).
|
||||
|
||||
### Why is package X not up-to-date
|
||||
|
||||
Also relevant for: **I can't find package X / Application X fails to start because it links to an old/newer lib**
|
||||
|
||||
ALHP build packages **after** they are released in the official Archlinux Repos (not including `[*-testing]`).
|
||||
This leads to packages being delayed if the current batch contains many packages or packages which take a while to
|
||||
ALHP builds packages **after** they are released in the official Archlinux repos (excluding `[*-testing]`).
|
||||
This will cause packages to be delayed if the current batch contains many packages, or packages that take a while to
|
||||
build (e.g. `chromium`).
|
||||
|
||||
You can always check on the progress of the current build-cycle on
|
||||
the [package status page](https://status.alhp.dev).
|
||||
You can always check on the progress of the current build cycle on the [package status page](https://status.alhp.dev).
|
||||
Please refrain from opening issues caused by packages currently in queue/not yet build/not yet moved to the repo.
|
||||
Please keep in mind that large rebuilds such as `openssl` or `python` can take days to complete on our current build
|
||||
hardware.
|
||||
@@ -188,16 +179,16 @@ echo "https://debuginfod.alhp.dev" > /etc/debuginfod/alhp.urls
|
||||
### Switch between levels
|
||||
|
||||
If you want to switch between levels, e.g. from `x86-64-v3` to `x86-64-v4`, you need to revert to official packages
|
||||
first, then enable your desired repos again.
|
||||
first, and then enable your desired repos again.
|
||||
|
||||
1. Comment or remove ALHP repo entries in `/etc/pacman.conf`.
|
||||
1. Comment out or remove the ALHP repo entries in `/etc/pacman.conf`.
|
||||
2. Downgrade packages with `pacman -Suuy`.
|
||||
3. Clear pacman's package cache with `pacman -Scc`.
|
||||
4. Uncomment/add your desired repos to `/etc/pacman.conf` and update with `pacman -Suy`.
|
||||
|
||||
## Matrix
|
||||
|
||||
For any non-issue questions or if you just want to chat, ALHP has a matrix
|
||||
For any non-issue questions, or if you just want to chat, ALHP has a Matrix
|
||||
room [here](https://matrix.to/#/#alhp:ofsg.eu) (`#alhp@ofsg.eu`). You can also find me (@idlegandalf)
|
||||
in `#archlinux:archlinux.org`.
|
||||
|
||||
@@ -211,5 +202,5 @@ work ALHP would not be possible.
|
||||
|
||||
## License and Legal
|
||||
|
||||
This project including all of its source files is released under the terms of the GNU General Public License version 2
|
||||
(or any later version). See [LICENSE](https://somegit.dev/ALHP/ALHP.GO/src/branch/master/LICENSE) for details.
|
||||
This project and all of its source code is released under the terms of the GNU General Public License, version 2
|
||||
or any later version. See [LICENSE](https://somegit.dev/ALHP/ALHP.GO/src/branch/master/LICENSE) for details.
|
||||
|
104
buildmanager.go
104
buildmanager.go
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/c2h5oh/datasize"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/sethvargo/go-retry"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
@@ -26,6 +27,9 @@ type BuildManager struct {
|
||||
building []*ProtoPackage
|
||||
buildingLock *sync.RWMutex
|
||||
queueSignal chan struct{}
|
||||
metrics struct {
|
||||
queueSize *prometheus.GaugeVec
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) error {
|
||||
@@ -74,12 +78,13 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
||||
}
|
||||
|
||||
// check if package can be built with current memory limit
|
||||
if datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB > conf.Build.MemoryLimit {
|
||||
if datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB > conf.Build.MemoryLimit { //nolint:gosec
|
||||
log.Warningf("[Q] %s->%s exeeds memory limit: %s->%s", pkg.FullRepo, pkg.Pkgbase,
|
||||
datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB, conf.Build.MemoryLimit)
|
||||
datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB, conf.Build.MemoryLimit) //nolint:gosec
|
||||
doneQLock.Lock()
|
||||
doneQ = append(doneQ, pkg)
|
||||
doneQLock.Unlock()
|
||||
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "queued").Dec()
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -88,9 +93,9 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
||||
b.buildingLock.RUnlock()
|
||||
|
||||
// check if package can be build right now
|
||||
if currentMemLoad+(datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB) > conf.Build.MemoryLimit {
|
||||
if currentMemLoad+(datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB) > conf.Build.MemoryLimit { //nolint:gosec
|
||||
log.Debugf("[Q] skipped package with max_rss %s while load %s: %s->%s",
|
||||
datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB, currentMemLoad, pkg.Pkgbase, pkg.March)
|
||||
datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB, currentMemLoad, pkg.Pkgbase, pkg.March) //nolint:gosec
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
@@ -106,14 +111,18 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
||||
b.building = append(b.building, pkg)
|
||||
b.buildingLock.Unlock()
|
||||
queueNoMatch = false
|
||||
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "queued").Dec()
|
||||
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "building").Inc()
|
||||
|
||||
go func(pkg *ProtoPackage) {
|
||||
dur, err := pkg.build(ctx)
|
||||
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "building").Dec()
|
||||
if err != nil && !errors.Is(err, ErrorNotEligible) {
|
||||
log.Warningf("[Q] error building package %s->%s in %s: %s", pkg.FullRepo, pkg.Pkgbase, dur, err)
|
||||
b.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
||||
} else if err == nil {
|
||||
log.Infof("[Q] build successful: %s->%s (%s)", pkg.FullRepo, pkg.Pkgbase, dur)
|
||||
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "built").Inc()
|
||||
}
|
||||
doneQLock.Lock()
|
||||
b.buildingLock.Lock()
|
||||
@@ -147,7 +156,7 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *BuildManager) repoWorker(repo string) {
|
||||
func (b *BuildManager) repoWorker(ctx context.Context, repo string) {
|
||||
for {
|
||||
select {
|
||||
case pkgL := <-b.repoAdd[repo]:
|
||||
@@ -159,7 +168,7 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
|
||||
args := []string{"-s", "-v", "-p", "-n", filepath.Join(conf.Basedir.Repo, repo, "os", conf.Arch, repo) + ".db.tar.xz"}
|
||||
args = append(args, toAdd...)
|
||||
cmd := exec.Command("repo-add", args...)
|
||||
cmd := exec.CommandContext(ctx, "repo-add", args...)
|
||||
res, err := cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
if err != nil && cmd.ProcessState.ExitCode() != 1 {
|
||||
@@ -167,7 +176,7 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
}
|
||||
|
||||
for _, pkg := range pkgL {
|
||||
err = pkg.toDBPackage(true)
|
||||
err = pkg.toDBPackage(ctx, true)
|
||||
if err != nil {
|
||||
log.Warningf("error getting db entry for %s: %v", pkg.Pkgbase, err)
|
||||
continue
|
||||
@@ -185,10 +194,12 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
} else {
|
||||
pkgUpd = pkgUpd.SetDebugSymbols(dbpackage.DebugSymbolsNotAvailable)
|
||||
}
|
||||
pkg.DBPackage = pkgUpd.SaveX(context.Background())
|
||||
if pkg.DBPackage, err = pkgUpd.Save(ctx); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
cmd = exec.Command("paccache", "-rc", filepath.Join(conf.Basedir.Repo, repo, "os", conf.Arch), "-k", "1") //nolint:gosec
|
||||
cmd = exec.CommandContext(ctx, "paccache", "-rc", filepath.Join(conf.Basedir.Repo, repo, "os", conf.Arch), "-k", "1") //nolint:gosec
|
||||
res, err = cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
if err != nil {
|
||||
@@ -210,6 +221,12 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
log.Warningf("[%s/%s] unable to find files: %v", pkg.FullRepo, pkg.Pkgbase, err)
|
||||
continue
|
||||
} else if len(pkg.PkgFiles) == 0 {
|
||||
if pkg.DBPackage != nil {
|
||||
err = pkg.DBPackage.Update().ClearRepoVersion().ClearTagRev().Exec(ctx)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -228,7 +245,7 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
b.repoWG.Add(1)
|
||||
args := []string{"-s", "-v", filepath.Join(conf.Basedir.Repo, pkg.FullRepo, "os", conf.Arch, pkg.FullRepo) + ".db.tar.xz"}
|
||||
args = append(args, realPkgs...)
|
||||
cmd := exec.Command("repo-remove", args...)
|
||||
cmd := exec.CommandContext(ctx, "repo-remove", args...)
|
||||
res, err := cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
if err != nil && cmd.ProcessState.ExitCode() == 1 {
|
||||
@@ -236,7 +253,10 @@ func (b *BuildManager) repoWorker(repo string) {
|
||||
}
|
||||
|
||||
if pkg.DBPackage != nil {
|
||||
_ = pkg.DBPackage.Update().ClearRepoVersion().ClearTagRev().Exec(context.Background())
|
||||
err = pkg.DBPackage.Update().ClearRepoVersion().ClearTagRev().Exec(ctx)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
for _, file := range pkg.PkgFiles {
|
||||
@@ -262,14 +282,14 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
gitPath := filepath.Join(conf.Basedir.Work, stateDir)
|
||||
for {
|
||||
if _, err := os.Stat(gitPath); os.IsNotExist(err) {
|
||||
cmd := exec.Command("git", "clone", "--depth=1", conf.StateRepo, gitPath) //nolint:gosec
|
||||
cmd := exec.CommandContext(ctx, "git", "clone", "--depth=1", conf.StateRepo, gitPath) //nolint:gosec
|
||||
res, err := cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
if err != nil {
|
||||
log.Fatalf("error cloning state repo: %v", err)
|
||||
}
|
||||
} else if err == nil {
|
||||
cmd := exec.Command("git", "reset", "--hard")
|
||||
cmd := exec.CommandContext(ctx, "git", "reset", "--hard")
|
||||
cmd.Dir = gitPath
|
||||
res, err := cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
@@ -277,7 +297,7 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
log.Fatalf("error reseting state repo: %v", err)
|
||||
}
|
||||
|
||||
cmd = exec.Command("git", "pull")
|
||||
cmd = exec.CommandContext(ctx, "git", "pull")
|
||||
cmd.Dir = gitPath
|
||||
res, err = cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
@@ -291,8 +311,8 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
for _, repo := range repos {
|
||||
wg.Add(1)
|
||||
splitRepo := strings.Split(repo, "-")
|
||||
go func() { //nolint:contextcheck
|
||||
err := housekeeping(splitRepo[0], strings.Join(splitRepo[1:], "-"), wg)
|
||||
go func() {
|
||||
err := housekeeping(ctx, splitRepo[0], strings.Join(splitRepo[1:], "-"), wg)
|
||||
if err != nil {
|
||||
log.Warningf("[%s] housekeeping failed: %v", repo, err)
|
||||
}
|
||||
@@ -300,7 +320,7 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
err := logHK() //nolint:contextcheck
|
||||
err := logHK(ctx)
|
||||
if err != nil {
|
||||
log.Warningf("log-housekeeping failed: %v", err)
|
||||
}
|
||||
@@ -314,7 +334,7 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
}
|
||||
|
||||
if err := retry.Fibonacci(ctx, 1*time.Second, func(_ context.Context) error {
|
||||
if err := setupChroot(); err != nil {
|
||||
if err := setupChroot(ctx); err != nil {
|
||||
log.Warningf("unable to upgrade chroot, trying again later")
|
||||
return retry.RetryableError(err)
|
||||
}
|
||||
@@ -330,20 +350,21 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
}
|
||||
b.alpmMutex.Unlock()
|
||||
|
||||
queue, err := b.genQueue() //nolint:contextcheck
|
||||
queue, err := b.genQueue(ctx)
|
||||
if err != nil {
|
||||
log.Errorf("error building queue: %v", err)
|
||||
} else {
|
||||
log.Debugf("build-queue with %d items", len(queue))
|
||||
err = b.buildQueue(ctx, queue)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
log.Debugf("build-queue with %d items", len(queue))
|
||||
err = b.buildQueue(ctx, queue)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ctx.Err() == nil {
|
||||
for _, repo := range repos {
|
||||
err = movePackagesLive(repo) //nolint:contextcheck
|
||||
err = movePackagesLive(ctx, repo)
|
||||
if err != nil {
|
||||
log.Errorf("[%s] error moving packages live: %v", repo, err)
|
||||
}
|
||||
@@ -352,12 +373,13 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
b.metrics.queueSize.Reset()
|
||||
log.Debugf("build-cycle finished")
|
||||
time.Sleep(time.Duration(*checkInterval) * time.Minute)
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BuildManager) genQueue() ([]*ProtoPackage, error) {
|
||||
func (b *BuildManager) genQueue(ctx context.Context) ([]*ProtoPackage, error) {
|
||||
stateFiles, err := Glob(filepath.Join(conf.Basedir.Work, stateDir, "**/*"))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error scanning for state-files: %w", err)
|
||||
@@ -366,7 +388,7 @@ func (b *BuildManager) genQueue() ([]*ProtoPackage, error) {
|
||||
var pkgbuilds []*ProtoPackage
|
||||
for _, stateFile := range stateFiles {
|
||||
stat, err := os.Stat(stateFile)
|
||||
if err != nil || stat.IsDir() || strings.Contains(stateFile, ".git") {
|
||||
if err != nil || stat.IsDir() || strings.Contains(stateFile, ".git") || strings.Contains(stateFile, "README.md") {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -403,28 +425,28 @@ func (b *BuildManager) genQueue() ([]*ProtoPackage, error) {
|
||||
Arch: arch,
|
||||
}
|
||||
|
||||
err = pkg.toDBPackage(false)
|
||||
err = pkg.toDBPackage(ctx, false)
|
||||
if err != nil {
|
||||
log.Warningf("[QG] error getting/creating dbpackage %s: %v", state.Pkgbase, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if !pkg.isAvailable(alpmHandle) {
|
||||
if !pkg.isAvailable(ctx, alpmHandle) {
|
||||
log.Debugf("[QG] %s->%s not available on mirror, skipping build", pkg.FullRepo, pkg.Pkgbase)
|
||||
continue
|
||||
}
|
||||
|
||||
aBuild, err := pkg.IsBuild()
|
||||
aBuild, err := pkg.IsBuilt()
|
||||
if err != nil {
|
||||
log.Warningf("[QG] %s->%s error determining build packages: %v", pkg.FullRepo, pkg.Pkgbase, err)
|
||||
log.Warningf("[QG] %s->%s error determining built packages: %v", pkg.FullRepo, pkg.Pkgbase, err)
|
||||
}
|
||||
if aBuild {
|
||||
log.Infof("[QG] %s->%s already build, skipping build", pkg.FullRepo, pkg.Pkgbase)
|
||||
log.Infof("[QG] %s->%s already built, skipping build", pkg.FullRepo, pkg.Pkgbase)
|
||||
continue
|
||||
}
|
||||
|
||||
if pkg.DBPackage == nil {
|
||||
err = pkg.toDBPackage(true)
|
||||
err = pkg.toDBPackage(ctx, true)
|
||||
if err != nil {
|
||||
log.Warningf("[QG] error getting/creating dbpackage %s: %v", state.Pkgbase, err)
|
||||
continue
|
||||
@@ -435,12 +457,22 @@ func (b *BuildManager) genQueue() ([]*ProtoPackage, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
if !pkg.isEligible(context.Background()) {
|
||||
// try download .SRCINFO from repo
|
||||
srcInfo, err := downloadSRCINFO(pkg.DBPackage.Pkgbase, state.TagRev)
|
||||
if err == nil {
|
||||
pkg.Srcinfo = srcInfo
|
||||
}
|
||||
|
||||
if !pkg.isEligible(ctx) {
|
||||
continue
|
||||
}
|
||||
|
||||
pkg.DBPackage = pkg.DBPackage.Update().SetStatus(dbpackage.StatusQueued).SaveX(context.Background())
|
||||
pkg.DBPackage, err = pkg.DBPackage.Update().SetStatus(dbpackage.StatusQueued).Save(ctx)
|
||||
if err != nil {
|
||||
log.Warningf("[QG] error updating dbpackage %s: %v", state.Pkgbase, err)
|
||||
}
|
||||
pkgbuilds = append(pkgbuilds, pkg)
|
||||
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "queued").Inc()
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -45,3 +45,6 @@ build:
|
||||
|
||||
logging:
|
||||
level: INFO
|
||||
|
||||
metrics:
|
||||
port: 9568
|
||||
|
@@ -109,7 +109,7 @@ const DefaultStatus = StatusUnknown
|
||||
const (
|
||||
StatusSkipped Status = "skipped"
|
||||
StatusFailed Status = "failed"
|
||||
StatusBuild Status = "build"
|
||||
StatusBuilt Status = "built"
|
||||
StatusQueued Status = "queued"
|
||||
StatusDelayed Status = "delayed"
|
||||
StatusBuilding Status = "building"
|
||||
@@ -125,7 +125,7 @@ func (s Status) String() string {
|
||||
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
|
||||
func StatusValidator(s Status) error {
|
||||
switch s {
|
||||
case StatusSkipped, StatusFailed, StatusBuild, StatusQueued, StatusDelayed, StatusBuilding, StatusLatest, StatusSigning, StatusUnknown:
|
||||
case StatusSkipped, StatusFailed, StatusBuilt, StatusQueued, StatusDelayed, StatusBuilding, StatusLatest, StatusSigning, StatusUnknown:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("dbpackage: invalid enum value for status field: %q", s)
|
||||
|
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -61,7 +62,7 @@ func (dpq *DBPackageQuery) Order(o ...dbpackage.OrderOption) *DBPackageQuery {
|
||||
// First returns the first DBPackage entity from the query.
|
||||
// Returns a *NotFoundError when no DBPackage was found.
|
||||
func (dpq *DBPackageQuery) First(ctx context.Context) (*DBPackage, error) {
|
||||
nodes, err := dpq.Limit(1).All(setContextOp(ctx, dpq.ctx, "First"))
|
||||
nodes, err := dpq.Limit(1).All(setContextOp(ctx, dpq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -84,7 +85,7 @@ func (dpq *DBPackageQuery) FirstX(ctx context.Context) *DBPackage {
|
||||
// Returns a *NotFoundError when no DBPackage ID was found.
|
||||
func (dpq *DBPackageQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = dpq.Limit(1).IDs(setContextOp(ctx, dpq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = dpq.Limit(1).IDs(setContextOp(ctx, dpq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -107,7 +108,7 @@ func (dpq *DBPackageQuery) FirstIDX(ctx context.Context) int {
|
||||
// Returns a *NotSingularError when more than one DBPackage entity is found.
|
||||
// Returns a *NotFoundError when no DBPackage entities are found.
|
||||
func (dpq *DBPackageQuery) Only(ctx context.Context) (*DBPackage, error) {
|
||||
nodes, err := dpq.Limit(2).All(setContextOp(ctx, dpq.ctx, "Only"))
|
||||
nodes, err := dpq.Limit(2).All(setContextOp(ctx, dpq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -135,7 +136,7 @@ func (dpq *DBPackageQuery) OnlyX(ctx context.Context) *DBPackage {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (dpq *DBPackageQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = dpq.Limit(2).IDs(setContextOp(ctx, dpq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = dpq.Limit(2).IDs(setContextOp(ctx, dpq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -160,7 +161,7 @@ func (dpq *DBPackageQuery) OnlyIDX(ctx context.Context) int {
|
||||
|
||||
// All executes the query and returns a list of DBPackages.
|
||||
func (dpq *DBPackageQuery) All(ctx context.Context) ([]*DBPackage, error) {
|
||||
ctx = setContextOp(ctx, dpq.ctx, "All")
|
||||
ctx = setContextOp(ctx, dpq.ctx, ent.OpQueryAll)
|
||||
if err := dpq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -182,7 +183,7 @@ func (dpq *DBPackageQuery) IDs(ctx context.Context) (ids []int, err error) {
|
||||
if dpq.ctx.Unique == nil && dpq.path != nil {
|
||||
dpq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, dpq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, dpq.ctx, ent.OpQueryIDs)
|
||||
if err = dpq.Select(dbpackage.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -200,7 +201,7 @@ func (dpq *DBPackageQuery) IDsX(ctx context.Context) []int {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (dpq *DBPackageQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, dpq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, dpq.ctx, ent.OpQueryCount)
|
||||
if err := dpq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -218,7 +219,7 @@ func (dpq *DBPackageQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (dpq *DBPackageQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, dpq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, dpq.ctx, ent.OpQueryExist)
|
||||
switch _, err := dpq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -251,8 +252,9 @@ func (dpq *DBPackageQuery) Clone() *DBPackageQuery {
|
||||
inters: append([]Interceptor{}, dpq.inters...),
|
||||
predicates: append([]predicate.DBPackage{}, dpq.predicates...),
|
||||
// clone intermediate query.
|
||||
sql: dpq.sql.Clone(),
|
||||
path: dpq.path,
|
||||
sql: dpq.sql.Clone(),
|
||||
path: dpq.path,
|
||||
modifiers: append([]func(*sql.Selector){}, dpq.modifiers...),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,7 +467,7 @@ func (dpgb *DBPackageGroupBy) Aggregate(fns ...AggregateFunc) *DBPackageGroupBy
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (dpgb *DBPackageGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, dpgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, dpgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := dpgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -513,7 +515,7 @@ func (dps *DBPackageSelect) Aggregate(fns ...AggregateFunc) *DBPackageSelect {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (dps *DBPackageSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, dps.ctx, "Select")
|
||||
ctx = setContextOp(ctx, dps.ctx, ent.OpQuerySelect)
|
||||
if err := dps.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ var (
|
||||
columnCheck sql.ColumnCheck
|
||||
)
|
||||
|
||||
// columnChecker checks if the column exists in the given table.
|
||||
// checkColumn checks if the column exists in the given table.
|
||||
func checkColumn(table, column string) error {
|
||||
initCheck.Do(func() {
|
||||
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
|
||||
|
@@ -13,7 +13,7 @@ var (
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "pkgbase", Type: field.TypeString},
|
||||
{Name: "packages", Type: field.TypeJSON, Nullable: true},
|
||||
{Name: "status", Type: field.TypeEnum, Nullable: true, Enums: []string{"skipped", "failed", "build", "queued", "delayed", "building", "latest", "signing", "unknown"}, Default: "unknown"},
|
||||
{Name: "status", Type: field.TypeEnum, Nullable: true, Enums: []string{"skipped", "failed", "built", "queued", "delayed", "building", "latest", "signing", "unknown"}, Default: "unknown"},
|
||||
{Name: "skip_reason", Type: field.TypeString, Nullable: true},
|
||||
{Name: "repository", Type: field.TypeEnum, Enums: []string{"extra", "core", "multilib"}},
|
||||
{Name: "march", Type: field.TypeString},
|
||||
|
@@ -5,6 +5,6 @@ package runtime
|
||||
// The schema-stitching logic is generated in somegit.dev/ALHP/ALHP.GO/ent/runtime.go
|
||||
|
||||
const (
|
||||
Version = "v0.13.1" // Version of ent codegen.
|
||||
Sum = "h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=" // Sum of ent codegen.
|
||||
Version = "v0.14.2" // Version of ent codegen.
|
||||
Sum = "h1:ywld/j2Rx4EmnIKs8eZ29cbFA1zpB+DA9TLL5l3rlq0=" // Sum of ent codegen.
|
||||
)
|
||||
|
@@ -15,7 +15,7 @@ func (DBPackage) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.String("pkgbase").NotEmpty().Immutable(),
|
||||
field.Strings("packages").Optional(),
|
||||
field.Enum("status").Values("skipped", "failed", "build", "queued", "delayed", "building",
|
||||
field.Enum("status").Values("skipped", "failed", "built", "queued", "delayed", "building",
|
||||
"latest", "signing", "unknown").Default("unknown").Optional(),
|
||||
field.String("skip_reason").Optional(),
|
||||
field.Enum("repository").Values("extra", "core", "multilib"),
|
||||
|
12
flags.yaml
12
flags.yaml
@@ -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:
|
||||
|
48
go.mod
48
go.mod
@@ -1,11 +1,11 @@
|
||||
module somegit.dev/ALHP/ALHP.GO
|
||||
|
||||
go 1.22.3
|
||||
go 1.23.0
|
||||
|
||||
toolchain go1.22.4
|
||||
toolchain go1.23.1
|
||||
|
||||
require (
|
||||
entgo.io/ent v0.13.1
|
||||
entgo.io/ent v0.14.3
|
||||
github.com/Jguer/go-alpm/v2 v2.2.2
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
|
||||
github.com/Morganamilo/go-srcinfo v1.0.0
|
||||
@@ -13,36 +13,46 @@ require (
|
||||
github.com/gobwas/glob v0.2.3
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/jackc/pgx/v4 v4.18.3
|
||||
github.com/otiai10/copy v1.14.0
|
||||
github.com/sethvargo/go-retry v0.2.4
|
||||
github.com/otiai10/copy v1.14.1
|
||||
github.com/prometheus/client_golang v1.21.1
|
||||
github.com/sethvargo/go-retry v0.3.0
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
ariga.io/atlas v0.24.0 // indirect
|
||||
ariga.io/atlas v0.32.0 // indirect
|
||||
github.com/agext/levenshtein v1.2.3 // indirect
|
||||
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bmatcuk/doublestar v1.3.4 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
|
||||
github.com/go-openapi/inflect v0.21.0 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/hashicorp/hcl/v2 v2.21.0 // indirect
|
||||
github.com/go-openapi/inflect v0.21.1 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
|
||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
||||
github.com/jackc/pgconn v1.14.3 // indirect
|
||||
github.com/jackc/pgio v1.0.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/pgtype v1.14.3 // indirect
|
||||
github.com/kr/pretty v0.3.0 // indirect
|
||||
github.com/jackc/pgtype v1.14.4 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||
github.com/zclconf/go-cty v1.14.4 // indirect
|
||||
golang.org/x/crypto v0.24.0 // indirect
|
||||
golang.org/x/mod v0.18.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
golang.org/x/sys v0.21.0 // indirect
|
||||
golang.org/x/text v0.16.0 // indirect
|
||||
golang.org/x/tools v0.22.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/otiai10/mint v1.6.3 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.63.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/zclconf/go-cty v1.16.2 // indirect
|
||||
github.com/zclconf/go-cty-yaml v1.1.0 // indirect
|
||||
golang.org/x/crypto v0.36.0 // indirect
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/sync v0.12.0 // indirect
|
||||
golang.org/x/sys v0.31.0 // indirect
|
||||
golang.org/x/text v0.23.0 // indirect
|
||||
golang.org/x/tools v0.31.0 // indirect
|
||||
google.golang.org/protobuf v1.36.5 // indirect
|
||||
)
|
||||
|
131
go.sum
131
go.sum
@@ -1,7 +1,11 @@
|
||||
ariga.io/atlas v0.24.0 h1:ssK25BIfVbVIYt+STIfqgrlEpfJrLtKtdWU2/U23YP4=
|
||||
ariga.io/atlas v0.24.0/go.mod h1:uSfJty48trd+YIWkRp7OENP5Wjgy6KzVW6JHv6tko2o=
|
||||
entgo.io/ent v0.13.1 h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=
|
||||
entgo.io/ent v0.13.1/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
|
||||
ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83 h1:nX4HXncwIdvQ8/8sIUIf1nyCkK8qdBaHQ7EtzPpuiGE=
|
||||
ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83/go.mod h1:Oe1xWPuu5q9LzyrWfbZmEZxFYeu4BHTyzfjeW2aZp/w=
|
||||
ariga.io/atlas v0.32.0 h1:y+77nueMrExLiKlz1CcPKh/nU7VSlWfBbwCShsJyvCw=
|
||||
ariga.io/atlas v0.32.0/go.mod h1:Oe1xWPuu5q9LzyrWfbZmEZxFYeu4BHTyzfjeW2aZp/w=
|
||||
entgo.io/ent v0.14.2 h1:ywld/j2Rx4EmnIKs8eZ29cbFA1zpB+DA9TLL5l3rlq0=
|
||||
entgo.io/ent v0.14.2/go.mod h1:aDPE/OziPEu8+OWbzy4UlvWmD2/kbRuWfK2A40hcxJM=
|
||||
entgo.io/ent v0.14.3 h1:wokAV/kIlH9TeklJWGGS7AYJdVckr0DloWjIcO9iIIQ=
|
||||
entgo.io/ent v0.14.3/go.mod h1:aDPE/OziPEu8+OWbzy4UlvWmD2/kbRuWfK2A40hcxJM=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||
@@ -17,8 +21,14 @@ github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7l
|
||||
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
|
||||
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
|
||||
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
|
||||
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
|
||||
github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500 h1:6lhrsTEnloDPXyeZBvSYvQf8u86jbKehZPVDDlkgDl4=
|
||||
github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
|
||||
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
@@ -26,7 +36,6 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU=
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -34,6 +43,8 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-openapi/inflect v0.21.0 h1:FoBjBTQEcbg2cJUWX6uwL9OyIW8eqc9k4KhN4lfbeYk=
|
||||
github.com/go-openapi/inflect v0.21.0/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw=
|
||||
github.com/go-openapi/inflect v0.21.1 h1:swwdJV4YPbuQaz68rHiBeQj+MWeBjDDNyEAi78Fhu4g=
|
||||
github.com/go-openapi/inflect v0.21.1/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
|
||||
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
@@ -41,13 +52,14 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
|
||||
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
|
||||
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
|
||||
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14=
|
||||
github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA=
|
||||
github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos=
|
||||
github.com/hashicorp/hcl/v2 v2.23.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA=
|
||||
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
|
||||
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
|
||||
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
|
||||
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
|
||||
@@ -68,6 +80,7 @@ github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5W
|
||||
github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=
|
||||
github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78=
|
||||
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA=
|
||||
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
|
||||
@@ -86,8 +99,8 @@ github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCM
|
||||
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
|
||||
github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM=
|
||||
github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
|
||||
github.com/jackc/pgtype v1.14.3 h1:h6W9cPuHsRWQFTWUZMAKMgG5jSwQI0Zurzdvlx3Plus=
|
||||
github.com/jackc/pgtype v1.14.3/go.mod h1:aKeozOde08iifGosdJpz9MBZonJOUJxqNpPBcMJTlVA=
|
||||
github.com/jackc/pgtype v1.14.4 h1:fKuNiCumbKTAIxQwXfB/nsrnkEI6bPJrrSiMKgbJ2j8=
|
||||
github.com/jackc/pgtype v1.14.4/go.mod h1:aKeozOde08iifGosdJpz9MBZonJOUJxqNpPBcMJTlVA=
|
||||
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
|
||||
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
|
||||
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
|
||||
@@ -99,17 +112,25 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f
|
||||
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
@@ -124,23 +145,37 @@ github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwp
|
||||
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
|
||||
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
|
||||
github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w=
|
||||
github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks=
|
||||
github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/otiai10/copy v1.14.1 h1:5/7E6qsUMBaH5AnQ0sSLzzTg1oTECmcCmT6lvF45Na8=
|
||||
github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3DoZm9I=
|
||||
github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs=
|
||||
github.com/otiai10/mint v1.6.3/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA=
|
||||
github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
|
||||
github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk=
|
||||
github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
|
||||
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
||||
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
|
||||
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
|
||||
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
|
||||
github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k=
|
||||
github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18=
|
||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
|
||||
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
|
||||
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec=
|
||||
github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw=
|
||||
github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=
|
||||
github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas=
|
||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
|
||||
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
|
||||
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
@@ -161,15 +196,17 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 h1:67A5tweHp3C7osHjrYsy6pQZ00bYkTTttZ7kiOwwHeA=
|
||||
github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117/go.mod h1:XCsSkdKK4gwBMNrOCZWww0pX6AOt+2gYc5Z6jBRrNVg=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8=
|
||||
github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
|
||||
github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70=
|
||||
github.com/zclconf/go-cty v1.16.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
|
||||
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo=
|
||||
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
|
||||
github.com/zclconf/go-cty-yaml v1.1.0 h1:nP+jp0qPHv2IhUVqmQSzjvqAWcObN0KBkUl2rWBdig0=
|
||||
github.com/zclconf/go-cty-yaml v1.1.0/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs=
|
||||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
@@ -194,15 +231,19 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
|
||||
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
||||
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
||||
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
|
||||
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
|
||||
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
@@ -215,8 +256,10 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
|
||||
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
|
||||
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -235,8 +278,10 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
@@ -252,8 +297,10 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
@@ -265,17 +312,23 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
|
||||
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
|
||||
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
|
||||
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
|
||||
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
|
||||
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
|
||||
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
|
||||
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
|
||||
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
||||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
@@ -13,7 +13,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
func housekeeping(ctx context.Context, repo, march string, wg *sync.WaitGroup) error {
|
||||
defer wg.Done()
|
||||
fullRepo := repo + "-" + march
|
||||
log.Debugf("[%s] start housekeeping", fullRepo)
|
||||
@@ -26,7 +26,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
for _, path := range packages {
|
||||
mPackage := Package(path)
|
||||
|
||||
dbPkg, err := mPackage.DBPackage(db)
|
||||
dbPkg, err := mPackage.DBPackage(ctx, db)
|
||||
if ent.IsNotFound(err) {
|
||||
log.Infof("[HK] removing orphan %s->%s", fullRepo, filepath.Base(path))
|
||||
pkg := &ProtoPackage{
|
||||
@@ -63,7 +63,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
pkgResolved.DB().Name() != pkg.Repo.String() ||
|
||||
pkgResolved.Architecture() != pkg.Arch ||
|
||||
pkgResolved.Name() != mPackage.Name() ||
|
||||
Contains(conf.Blacklist.Packages, pkg.Pkgbase) {
|
||||
MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages) {
|
||||
switch {
|
||||
case err != nil:
|
||||
log.Infof("[HK] %s->%s not included in repo (resolve error: %v)", pkg.FullRepo, mPackage.Name(), err)
|
||||
@@ -79,7 +79,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
case pkgResolved.Name() != mPackage.Name():
|
||||
log.Infof("[HK] %s->%s not included in repo (name mismatch: repo:%s != pkg:%s)", pkg.FullRepo,
|
||||
mPackage.Name(), pkgResolved.Name(), mPackage.Name())
|
||||
case Contains(conf.Blacklist.Packages, pkg.Pkgbase):
|
||||
case MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages):
|
||||
log.Infof("[HK] %s->%s not included in repo (blacklisted pkgbase %s)", pkg.FullRepo, mPackage.Name(), pkg.Pkgbase)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
log.Errorf("[HK] %s->%s unable to get pkg-files: %v", pkg.FullRepo, mPackage.Name(), err)
|
||||
continue
|
||||
}
|
||||
err = db.DBPackage.DeleteOne(pkg.DBPackage).Exec(context.Background())
|
||||
err = db.DBPackage.DeleteOne(pkg.DBPackage).Exec(ctx)
|
||||
pkg.DBPackage = nil
|
||||
buildManager.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
||||
if err != nil {
|
||||
@@ -99,7 +99,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
}
|
||||
|
||||
if pkg.DBPackage.LastVerified.Before(pkg.DBPackage.BuildTimeStart) {
|
||||
err := pkg.DBPackage.Update().SetLastVerified(time.Now().UTC()).Exec(context.Background())
|
||||
err := pkg.DBPackage.Update().SetLastVerified(time.Now().UTC()).Exec(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -147,7 +147,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
DBPackage: dbPkg,
|
||||
}
|
||||
|
||||
if !pkg.isAvailable(alpmHandle) {
|
||||
if !pkg.isAvailable(ctx, alpmHandle) {
|
||||
log.Infof("[HK] %s->%s not found on mirror, removing", pkg.FullRepo, pkg.Pkgbase)
|
||||
err = db.DBPackage.DeleteOne(dbPkg).Exec(context.Background())
|
||||
if err != nil {
|
||||
@@ -161,9 +161,11 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
// check lastVersionBuild
|
||||
if dbPkg.LastVersionBuild != dbPkg.RepoVersion {
|
||||
log.Infof("[HK] %s->%s updating lastVersionBuild %s -> %s", fullRepo, dbPkg.Pkgbase, dbPkg.LastVersionBuild, dbPkg.RepoVersion)
|
||||
dbPkg, err = dbPkg.Update().SetLastVersionBuild(dbPkg.RepoVersion).Save(context.Background())
|
||||
nDBPkg, err := dbPkg.Update().SetLastVersionBuild(dbPkg.RepoVersion).Save(ctx)
|
||||
if err != nil {
|
||||
log.Warningf("[HK] error updating lastVersionBuild for %s->%s: %v", fullRepo, dbPkg.Pkgbase, err)
|
||||
} else {
|
||||
dbPkg = nDBPkg
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +190,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
ClearRepoVersion().
|
||||
ClearTagRev().
|
||||
SetStatus(dbpackage.StatusQueued).
|
||||
Save(context.Background())
|
||||
Save(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -224,25 +226,31 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
if dbPkg.TagRev != nil && state.TagRev == *dbPkg.TagRev && state.PkgVer != dbPkg.Version {
|
||||
log.Infof("[HK] reseting package %s->%s with mismatched state information (%s!=%s)",
|
||||
fullRepo, dbPkg.Pkgbase, state.PkgVer, dbPkg.Version)
|
||||
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearTagRev().Exec(context.Background())
|
||||
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearTagRev().Exec(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case dbPkg.Status == dbpackage.StatusLatest && dbPkg.RepoVersion == "":
|
||||
log.Infof("[HK] reseting missing package %s->%s with no repo version", fullRepo, dbPkg.Pkgbase)
|
||||
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearTagRev().ClearRepoVersion().Exec(context.Background())
|
||||
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearTagRev().ClearRepoVersion().Exec(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.RepoVersion != "" && strings.HasPrefix(dbPkg.SkipReason, "blacklisted"):
|
||||
log.Infof("[HK] delete blacklisted package %s->%s", fullRepo, dbPkg.Pkgbase)
|
||||
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.RepoVersion != "" && !strings.HasPrefix(dbPkg.SkipReason, "delayed"):
|
||||
log.Infof("[HK] delete skipped package %s->%s", fullRepo, dbPkg.Pkgbase)
|
||||
pkg := &ProtoPackage{
|
||||
FullRepo: fullRepo,
|
||||
March: march,
|
||||
DBPackage: dbPkg,
|
||||
}
|
||||
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
|
||||
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.SkipReason == "blacklisted" && !MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages):
|
||||
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{
|
||||
@@ -258,7 +266,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func logHK() error {
|
||||
func logHK(ctx context.Context) error {
|
||||
// check if package for log exists and if error can be fixed by rebuild
|
||||
logFiles, err := Glob(filepath.Join(conf.Basedir.Repo, logDir, "/**/*.log"))
|
||||
if err != nil {
|
||||
@@ -287,7 +295,7 @@ func logHK() error {
|
||||
dbpackage.Pkgbase(pkg.Pkgbase),
|
||||
dbpackage.March(pkg.March),
|
||||
dbpackage.StatusEQ(dbpackage.StatusSkipped),
|
||||
).Exist(context.Background())
|
||||
).Exist(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -306,7 +314,7 @@ func logHK() error {
|
||||
if rePortError.MatchString(sLogContent) || reSigError.MatchString(sLogContent) || reDownloadError.MatchString(sLogContent) ||
|
||||
reDownloadError2.MatchString(sLogContent) {
|
||||
rows, err := db.DBPackage.Update().Where(dbpackage.Pkgbase(pkg.Pkgbase), dbpackage.March(pkg.March),
|
||||
dbpackage.StatusEQ(dbpackage.StatusFailed)).ClearTagRev().SetStatus(dbpackage.StatusQueued).Save(context.Background())
|
||||
dbpackage.StatusEQ(dbpackage.StatusFailed)).ClearTagRev().SetStatus(dbpackage.StatusQueued).Save(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -320,7 +328,7 @@ func logHK() error {
|
||||
dbpackage.March(pkg.March),
|
||||
dbpackage.StatusEQ(dbpackage.StatusFailed),
|
||||
dbpackage.LtoNotIn(dbpackage.LtoAutoDisabled, dbpackage.LtoDisabled),
|
||||
).ClearTagRev().SetStatus(dbpackage.StatusQueued).SetLto(dbpackage.LtoAutoDisabled).Save(context.Background())
|
||||
).ClearTagRev().SetStatus(dbpackage.StatusQueued).SetLto(dbpackage.LtoAutoDisabled).Save(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -337,7 +345,7 @@ func debugHK() {
|
||||
for _, march := range conf.March {
|
||||
if _, err := os.Stat(filepath.Join(conf.Basedir.Debug, march)); err == nil {
|
||||
log.Debugf("[DHK/%s] start cleanup debug packages", march)
|
||||
cleanCmd := exec.Command("paccache", "-rc", filepath.Join(conf.Basedir.Debug, march), "-k", "1") //nolint:gosec
|
||||
cleanCmd := exec.Command("paccache", "-rc", filepath.Join(conf.Basedir.Debug, march), "-k", "1")
|
||||
res, err := cleanCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
log.Warningf("[DHK/%s] cleanup debug packages failed: %v (%s)", march, err, string(res))
|
||||
|
11
main.go
11
main.go
@@ -86,7 +86,8 @@ func main() {
|
||||
}(db)
|
||||
}
|
||||
|
||||
if err := db.Schema.Create(context.Background(), migrate.WithDropIndex(true), migrate.WithDropColumn(true)); err != nil {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
if err := db.Schema.Create(ctx, migrate.WithDropIndex(true), migrate.WithDropColumn(true)); err != nil {
|
||||
log.Panicf("automigrate failed: %v", err)
|
||||
}
|
||||
|
||||
@@ -100,11 +101,13 @@ func main() {
|
||||
repoWG: new(sync.WaitGroup),
|
||||
}
|
||||
|
||||
err = setupChroot()
|
||||
buildManager.setupMetrics(conf.Metrics.Port)
|
||||
|
||||
err = setupChroot(ctx)
|
||||
if err != nil {
|
||||
log.Panicf("unable to setup chroot: %v", err)
|
||||
}
|
||||
err = syncMarchs()
|
||||
err = syncMarchs(ctx)
|
||||
if err != nil {
|
||||
log.Panicf("error syncing marchs: %v", err)
|
||||
}
|
||||
@@ -115,8 +118,6 @@ func main() {
|
||||
log.Panicf("error while ALPM-init: %v", err)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
go func() {
|
||||
_ = buildManager.syncWorker(ctx)
|
||||
}()
|
||||
|
26
metrics.go
Normal file
26
metrics.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (b *BuildManager) setupMetrics(port uint32) {
|
||||
b.metrics.queueSize = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
||||
Name: "build_queue_size",
|
||||
Help: "Build queue size",
|
||||
}, []string{"repository", "status"})
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/", promhttp.Handler())
|
||||
go func() {
|
||||
err := http.ListenAndServe(fmt.Sprintf(":%d", port), mux) //nolint:gosec
|
||||
if err != nil {
|
||||
log.Errorf("failed to start metrics server: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
@@ -70,12 +70,12 @@ func (pkg Package) HasValidSignature() (bool, error) {
|
||||
}
|
||||
|
||||
// DBPackage returns ent.DBPackage for package
|
||||
func (pkg Package) DBPackage(db *ent.Client) (*ent.DBPackage, error) {
|
||||
return pkg.DBPackageIsolated(*pkg.MArch(), pkg.Repo(), db)
|
||||
func (pkg Package) DBPackage(ctx context.Context, db *ent.Client) (*ent.DBPackage, error) {
|
||||
return pkg.DBPackageIsolated(ctx, *pkg.MArch(), pkg.Repo(), db)
|
||||
}
|
||||
|
||||
// DBPackageIsolated returns ent.DBPackage like DBPackage, but not relying on the path for march and repo
|
||||
func (pkg Package) DBPackageIsolated(march string, repo dbpackage.Repository, db *ent.Client) (*ent.DBPackage, error) {
|
||||
func (pkg Package) DBPackageIsolated(ctx context.Context, march string, repo dbpackage.Repository, db *ent.Client) (*ent.DBPackage, error) {
|
||||
dbPkg, err := db.DBPackage.Query().Where(func(s *sql.Selector) {
|
||||
s.Where(
|
||||
sql.And(
|
||||
@@ -83,7 +83,7 @@ func (pkg Package) DBPackageIsolated(march string, repo dbpackage.Repository, db
|
||||
sql.EQ(dbpackage.FieldMarch, march),
|
||||
sql.EQ(dbpackage.FieldRepository, repo)),
|
||||
)
|
||||
}).Only(context.Background())
|
||||
}).Only(ctx)
|
||||
if ent.IsNotFound(err) {
|
||||
log.Debugf("not found in database: %s", pkg.Name())
|
||||
return nil, err
|
||||
|
113
proto_package.go
113
proto_package.go
@@ -43,11 +43,6 @@ var (
|
||||
)
|
||||
|
||||
func (p *ProtoPackage) isEligible(ctx context.Context) bool {
|
||||
globMatch, err := MatchGlobList(p.Pkgbase, conf.Blacklist.Packages)
|
||||
if err != nil {
|
||||
log.Errorf("error parsing blob from no-build list: %v", err)
|
||||
}
|
||||
|
||||
skipping := false
|
||||
switch {
|
||||
case p.Arch == "any":
|
||||
@@ -55,19 +50,28 @@ func (p *ProtoPackage) isEligible(ctx context.Context) bool {
|
||||
p.DBPackage.SkipReason = "arch = any"
|
||||
p.DBPackage.Status = dbpackage.StatusSkipped
|
||||
skipping = true
|
||||
case globMatch:
|
||||
case MatchGlobList(p.Pkgbase, conf.Blacklist.Packages):
|
||||
log.Debugf("skipped %s: package on no-build list", p.Pkgbase)
|
||||
p.DBPackage.SkipReason = "blacklisted"
|
||||
p.DBPackage.Status = dbpackage.StatusSkipped
|
||||
skipping = true
|
||||
case p.DBPackage.MaxRss != nil && datasize.ByteSize(*p.DBPackage.MaxRss)*datasize.KB > conf.Build.MemoryLimit:
|
||||
log.Debugf("skipped %s: memory limit exceeded (%s)", p.Pkgbase, datasize.ByteSize(*p.DBPackage.MaxRss)*datasize.KB)
|
||||
case p.DBPackage.MaxRss != nil && datasize.ByteSize(*p.DBPackage.MaxRss)*datasize.KB > conf.Build.MemoryLimit: //nolint:gosec
|
||||
log.Debugf("skipped %s: memory limit exceeded (%s)", p.Pkgbase, datasize.ByteSize(*p.DBPackage.MaxRss)*datasize.KB) //nolint:gosec
|
||||
p.DBPackage.SkipReason = "memory limit exceeded"
|
||||
p.DBPackage.Status = dbpackage.StatusSkipped
|
||||
skipping = true
|
||||
case p.isPkgFailed():
|
||||
log.Debugf("skipped %s: failed build", p.Pkgbase)
|
||||
skipping = true
|
||||
case p.Srcinfo != nil:
|
||||
// skip haskell packages, since they cannot be optimized currently (no -O3 & march has no effect as far as I know)
|
||||
if Contains(p.Srcinfo.MakeDepends, "ghc") || Contains(p.Srcinfo.MakeDepends, "haskell-ghc") ||
|
||||
Contains(p.Srcinfo.Depends, "ghc") || Contains(p.Srcinfo.Depends, "haskell-ghc") {
|
||||
log.Debugf("skipped %s: haskell", p.Pkgbase)
|
||||
p.DBPackage.SkipReason = "haskell"
|
||||
p.DBPackage.Status = dbpackage.StatusSkipped
|
||||
skipping = true
|
||||
}
|
||||
}
|
||||
|
||||
if skipping {
|
||||
@@ -201,21 +205,33 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
||||
cmd := exec.CommandContext(ctx, "makechrootpkg", "-c", "-D", filepath.Join(conf.Basedir.Work, makepkgDir), //nolint:gosec
|
||||
"-l", chroot, "-r", filepath.Join(conf.Basedir.Work, chrootDir), "--", "-m", "--noprogressbar", "--config",
|
||||
filepath.Join(conf.Basedir.Work, makepkgDir, fmt.Sprintf(makepkgFile, p.March)))
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
cmd.Dir = filepath.Dir(p.Pkgbuild)
|
||||
var out bytes.Buffer
|
||||
cmd.Stdout = &out
|
||||
cmd.Stderr = &out
|
||||
|
||||
err = cmd.Start()
|
||||
if err != nil {
|
||||
if err = cmd.Start(); err != nil {
|
||||
return time.Since(start), fmt.Errorf("error starting build: %w", err)
|
||||
}
|
||||
|
||||
pgid, err := syscall.Getpgid(cmd.Process.Pid)
|
||||
if err != nil {
|
||||
log.Errorf("error getting PGID: %v", err)
|
||||
}
|
||||
|
||||
done := make(chan bool)
|
||||
result := make(chan int64)
|
||||
go pollMemoryUsage(pgid, 1*time.Second, done, result)
|
||||
|
||||
err = cmd.Wait()
|
||||
close(done)
|
||||
peakMem := <-result
|
||||
close(result)
|
||||
|
||||
Rusage, ok := cmd.ProcessState.SysUsage().(*syscall.Rusage)
|
||||
if !ok {
|
||||
log.Panicf("Rusage is not of type *syscall.Rusage, are we running on unix-like?")
|
||||
log.Panicf("rusage is not of type *syscall.Rusage, are we running on unix-like?")
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -226,13 +242,13 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
||||
if p.DBPackage.Lto != dbpackage.LtoAutoDisabled && p.DBPackage.Lto != dbpackage.LtoDisabled &&
|
||||
(reLdError.MatchString(out.String()) || reRustLTOError.MatchString(out.String())) {
|
||||
p.DBPackage.Update().SetStatus(dbpackage.StatusQueued).SetSkipReason("non-LTO rebuild").SetLto(dbpackage.LtoAutoDisabled).ExecX(ctx)
|
||||
return time.Since(start), errors.New("ld/lto-incomp error detected, LTO disabled")
|
||||
return time.Since(start), errors.New("ld/lto-incompatibility error detected, LTO disabled")
|
||||
}
|
||||
|
||||
if reDownloadError.MatchString(out.String()) || reDownloadError2.MatchString(out.String()) ||
|
||||
rePortError.MatchString(out.String()) || reSigError.MatchString(out.String()) {
|
||||
p.DBPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(ctx)
|
||||
return time.Since(start), errors.New("known builderror detected")
|
||||
return time.Since(start), errors.New("known build error detected")
|
||||
}
|
||||
|
||||
err = os.MkdirAll(filepath.Join(conf.Basedir.Repo, logDir, p.March), 0o755)
|
||||
@@ -306,12 +322,12 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
||||
}
|
||||
|
||||
updatePkg := p.DBPackage.Update().
|
||||
SetStatus(dbpackage.StatusBuild).
|
||||
SetStatus(dbpackage.StatusBuilt).
|
||||
SetLto(dbpackage.LtoEnabled).
|
||||
SetBuildTimeStart(start).
|
||||
SetLastVersionBuild(p.Version).
|
||||
SetTagRev(p.State.TagRev).
|
||||
SetMaxRss(Rusage.Maxrss).
|
||||
SetMaxRss(peakMem).
|
||||
SetIoOut(Rusage.Oublock).
|
||||
SetIoIn(Rusage.Inblock).
|
||||
SetUTime(Rusage.Utime.Sec).
|
||||
@@ -407,7 +423,24 @@ func (p *ProtoPackage) increasePkgRel(buildNo int) error {
|
||||
return err
|
||||
}
|
||||
|
||||
nStr := rePkgRel.ReplaceAllLiteralString(string(fStr), "pkgrel="+p.Srcinfo.Pkgrel+"."+strconv.Itoa(buildNo))
|
||||
// increase buildno if already existing
|
||||
var nStr string
|
||||
if strings.Contains(p.Srcinfo.Pkgrel, ".") {
|
||||
pkgRelSplit := strings.Split(p.Srcinfo.Pkgrel, ".")
|
||||
pkgRelBuildNo, err := strconv.Atoi(pkgRelSplit[len(pkgRelSplit)-1])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
nStr = rePkgRel.ReplaceAllLiteralString(string(fStr), "pkgrel="+pkgRelSplit[0]+"."+strconv.Itoa(buildNo+pkgRelBuildNo))
|
||||
versionSplit := strings.Split(p.Version, "-")
|
||||
versionSplit[len(versionSplit)-1] = pkgRelSplit[0] + "." + strconv.Itoa(buildNo+pkgRelBuildNo)
|
||||
p.Version = strings.Join(versionSplit, "-")
|
||||
} else {
|
||||
nStr = rePkgRel.ReplaceAllLiteralString(string(fStr), "pkgrel="+p.Srcinfo.Pkgrel+"."+strconv.Itoa(buildNo))
|
||||
p.Version += "." + strconv.Itoa(buildNo)
|
||||
}
|
||||
|
||||
_, err = f.Seek(0, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -422,7 +455,6 @@ func (p *ProtoPackage) increasePkgRel(buildNo int) error {
|
||||
return err
|
||||
}
|
||||
|
||||
p.Version += "." + strconv.Itoa(buildNo)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -445,7 +477,7 @@ func (p *ProtoPackage) importKeys() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
||||
func (p *ProtoPackage) isAvailable(ctx context.Context, h *alpm.Handle) bool {
|
||||
dbs, err := h.SyncDBs()
|
||||
if err != nil {
|
||||
return false
|
||||
@@ -461,7 +493,7 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
||||
case p.DBPackage != nil && len(p.DBPackage.Packages) > 0:
|
||||
pkg, err = dbs.FindSatisfier(p.DBPackage.Packages[0])
|
||||
default:
|
||||
cmd := exec.Command("unbuffer", "pacsift", "--exact", "--base="+p.Pkgbase, "--repo="+p.Repo.String(), //nolint:gosec
|
||||
cmd := exec.CommandContext(ctx, "unbuffer", "pacsift", "--exact", "--base="+p.Pkgbase, "--repo="+p.Repo.String(), //nolint:gosec
|
||||
"--sysroot="+filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot))
|
||||
var res []byte
|
||||
res, err = cmd.Output()
|
||||
@@ -469,18 +501,12 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
||||
log.Warningf("error getting packages from pacsift for %s: %v", p.Pkgbase, err)
|
||||
return false
|
||||
} else if len(res) == 0 {
|
||||
log.Warningf("error getting packages from pacsift for %s", p.Pkgbase)
|
||||
return false
|
||||
}
|
||||
|
||||
// workaround for https://github.com/andrewgregory/pacutils/issues/66
|
||||
// TODO: remove once fixed
|
||||
rRes := reReplacePacsiftWarning.ReplaceAllString(string(res), "")
|
||||
if strings.TrimSpace(rRes) == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
if len(strings.Split(strings.TrimSpace(rRes), "\n")) > 0 {
|
||||
pacsiftLines := strings.Split(strings.TrimSpace(rRes), "\n")
|
||||
if len(strings.Split(strings.TrimSpace(string(res)), "\n")) > 0 {
|
||||
pacsiftLines := strings.Split(strings.TrimSpace(string(res)), "\n")
|
||||
|
||||
var splitPkgs []string
|
||||
for _, line := range pacsiftLines {
|
||||
@@ -488,7 +514,10 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
||||
}
|
||||
|
||||
if p.DBPackage != nil {
|
||||
p.DBPackage = p.DBPackage.Update().SetPackages(splitPkgs).SaveX(context.Background())
|
||||
p.DBPackage, err = p.DBPackage.Update().SetPackages(splitPkgs).Save(ctx)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
}
|
||||
pkg, err = dbs.FindSatisfier(splitPkgs[0])
|
||||
} else {
|
||||
@@ -631,8 +660,8 @@ func (p *ProtoPackage) findPkgFiles() error {
|
||||
if p.DBPackage != nil {
|
||||
realPkgs = append(realPkgs, p.DBPackage.Packages...)
|
||||
} else {
|
||||
for _, realPkg := range p.Srcinfo.Packages {
|
||||
realPkgs = append(realPkgs, realPkg.Pkgname)
|
||||
for i := range p.Srcinfo.Packages {
|
||||
realPkgs = append(realPkgs, p.Srcinfo.Packages[i].Pkgname)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,7 +680,7 @@ func (p *ProtoPackage) findPkgFiles() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProtoPackage) toDBPackage(create bool) error {
|
||||
func (p *ProtoPackage) toDBPackage(ctx context.Context, create bool) error {
|
||||
if p.DBPackage != nil {
|
||||
return nil
|
||||
}
|
||||
@@ -660,13 +689,16 @@ func (p *ProtoPackage) toDBPackage(create bool) error {
|
||||
dbpackage.Pkgbase(p.Pkgbase),
|
||||
dbpackage.March(p.March),
|
||||
dbpackage.RepositoryEQ(p.Repo),
|
||||
).Only(context.Background())
|
||||
).Only(ctx)
|
||||
if err != nil && ent.IsNotFound(err) && create {
|
||||
dbPkg = db.DBPackage.Create().
|
||||
dbPkg, err = db.DBPackage.Create().
|
||||
SetPkgbase(p.Pkgbase).
|
||||
SetMarch(p.March).
|
||||
SetRepository(p.Repo).
|
||||
SaveX(context.Background())
|
||||
Save(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err != nil && !ent.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
@@ -684,7 +716,7 @@ func (p *ProtoPackage) exists() (bool, error) {
|
||||
return dbPkg, nil
|
||||
}
|
||||
|
||||
func (p *ProtoPackage) isMirrorLatest(h *alpm.Handle) (latest bool, foundPkg alpm.IPackage, version string, err error) {
|
||||
func (p *ProtoPackage) isMirrorLatest(h *alpm.Handle) (latest bool, foundPkg *alpm.Package, version string, err error) {
|
||||
dbs, err := h.SyncDBs()
|
||||
if err != nil {
|
||||
return false, nil, "", err
|
||||
@@ -718,7 +750,12 @@ func (p *ProtoPackage) isMirrorLatest(h *alpm.Handle) (latest bool, foundPkg alp
|
||||
}
|
||||
|
||||
if alpm.VerCmp(svn2gitVer, pkg.Version()) > 0 {
|
||||
return false, pkg, svn2gitVer, nil
|
||||
switch v := pkg.(type) {
|
||||
case *alpm.Package:
|
||||
return false, v, svn2gitVer, nil
|
||||
default:
|
||||
return false, nil, "", fmt.Errorf("invalid package type: %T", pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,7 +766,7 @@ func (p *ProtoPackage) PkgbaseEquals(p2 *ProtoPackage, marchSensitive bool) bool
|
||||
return (marchSensitive && (p.Pkgbase == p2.Pkgbase && p.FullRepo == p2.FullRepo)) || (!marchSensitive && p.Pkgbase == p2.Pkgbase)
|
||||
}
|
||||
|
||||
func (p *ProtoPackage) IsBuild() (bool, error) {
|
||||
func (p *ProtoPackage) IsBuilt() (bool, error) {
|
||||
if p.DBPackage == nil {
|
||||
return false, nil
|
||||
}
|
||||
|
@@ -51,10 +51,55 @@ package() {
|
||||
# vim:set sw=2 et:
|
||||
`
|
||||
|
||||
const PkgbuildTestWithPkgrelSub = `# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
|
||||
|
||||
pkgname=gnome-todo
|
||||
pkgver=41.0+r69+ga9a5b7cd
|
||||
pkgrel=1.1
|
||||
pkgdesc="Task manager for GNOME"
|
||||
url="https://wiki.gnome.org/Apps/Todo"
|
||||
arch=(x86_64)
|
||||
license=(GPL)
|
||||
depends=(evolution-data-server libpeas python gtk4 libportal-gtk4 libadwaita)
|
||||
makedepends=(gobject-introspection appstream-glib git meson yelp-tools)
|
||||
groups=(gnome-extra)
|
||||
_commit=a9a5b7cdde0244331d2d49220f04018be60c018e # master
|
||||
source=("git+https://gitlab.gnome.org/GNOME/gnome-todo.git#commit=$_commit")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
pkgver() {
|
||||
cd $pkgname
|
||||
git describe --tags | sed 's/^GNOME_TODO_//;s/_/./g;s/[^-]*-g/r&/;s/-/+/g'
|
||||
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd $pkgname
|
||||
}
|
||||
|
||||
build() {
|
||||
arch-meson $pkgname build
|
||||
meson compile -C build
|
||||
}
|
||||
|
||||
check() (
|
||||
glib-compile-schemas "${GSETTINGS_SCHEMA_DIR:=$PWD/$pkgname/data}"
|
||||
export GSETTINGS_SCHEMA_DIR
|
||||
|
||||
meson test -C build --print-errorlogs
|
||||
)
|
||||
|
||||
package() {
|
||||
meson install -C build --destdir "$pkgdir"
|
||||
}
|
||||
|
||||
# vim:set sw=2 et:
|
||||
`
|
||||
|
||||
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")
|
||||
t.Fatal("unable to setup temp. PKGBUILD")
|
||||
}
|
||||
defer func(name string) {
|
||||
_ = os.Remove(name)
|
||||
@@ -62,7 +107,7 @@ func TestIncreasePkgRel(t *testing.T) { //nolint:paralleltest
|
||||
|
||||
_, err = pkgbuild.WriteString(PkgbuildTest)
|
||||
if err != nil {
|
||||
t.Fatal("Unable to write to temp. PKGBUILD")
|
||||
t.Fatal("unable to write to temp. PKGBUILD")
|
||||
}
|
||||
_ = pkgbuild.Close()
|
||||
|
||||
@@ -95,3 +140,48 @@ func TestIncreasePkgRel(t *testing.T) { //nolint:paralleltest
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestIncreasePkgRelWithPkgSub(t *testing.T) { //nolint:paralleltest
|
||||
pkgbuild, err := os.CreateTemp(t.TempDir(), "")
|
||||
if err != nil {
|
||||
t.Fatal("unable to setup temp. PKGBUILD")
|
||||
}
|
||||
defer func(name string) {
|
||||
_ = os.Remove(name)
|
||||
}(pkgbuild.Name())
|
||||
|
||||
_, err = pkgbuild.WriteString(PkgbuildTestWithPkgrelSub)
|
||||
if err != nil {
|
||||
t.Fatal("unable to write to temp. PKGBUILD")
|
||||
}
|
||||
_ = pkgbuild.Close()
|
||||
|
||||
buildPkg := &ProtoPackage{
|
||||
Pkgbase: "gnome-todo",
|
||||
Pkgbuild: pkgbuild.Name(),
|
||||
}
|
||||
|
||||
err = buildPkg.increasePkgRel(1)
|
||||
if err != nil {
|
||||
t.Logf("increasePkgRel: %v", err)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
versionSplit := strings.Split(buildPkg.Version, "-")
|
||||
if versionSplit[len(versionSplit)-1] != "1.2" {
|
||||
t.Logf("increasePkgRel: expected 1.2 pkgrel, got: %s", buildPkg.Version)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
buildPkg.Srcinfo = nil
|
||||
err = buildPkg.genSrcinfo()
|
||||
if err != nil {
|
||||
t.Logf("increasePkgRel: %v", err)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if buildPkg.Srcinfo.Pkgrel != "1.2" {
|
||||
t.Logf("increasePkgRel: expected 1.2 pkgrel, got: %s", buildPkg.Srcinfo.Pkgrel)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
277
utils.go
277
utils.go
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/Jguer/go-alpm/v2"
|
||||
@@ -10,7 +11,9 @@ import (
|
||||
"github.com/gobwas/glob"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -24,6 +27,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"
|
||||
@@ -83,6 +87,9 @@ type Conf struct {
|
||||
Interval string
|
||||
}
|
||||
MaxCloneRetries uint64 `yaml:"max_clone_retries"`
|
||||
Metrics struct {
|
||||
Port uint32
|
||||
}
|
||||
}
|
||||
|
||||
type Globs []string
|
||||
@@ -138,7 +145,7 @@ func pkgList2MaxMem(pkgList []*ProtoPackage) datasize.ByteSize {
|
||||
var sum uint64
|
||||
for _, pkg := range pkgList {
|
||||
if pkg.DBPackage.MaxRss != nil {
|
||||
sum += uint64(*pkg.DBPackage.MaxRss)
|
||||
sum += uint64(*pkg.DBPackage.MaxRss) //nolint:gosec
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +171,7 @@ func stateFileMeta(stateFile string) (repo string, subRepo *string, arch string,
|
||||
return
|
||||
}
|
||||
|
||||
func movePackagesLive(fullRepo string) error {
|
||||
func movePackagesLive(ctx context.Context, fullRepo string) error {
|
||||
if _, err := os.Stat(filepath.Join(conf.Basedir.Work, waitingDir, fullRepo)); os.IsNotExist(err) {
|
||||
return nil
|
||||
} else if err != nil {
|
||||
@@ -184,7 +191,7 @@ func movePackagesLive(fullRepo string) error {
|
||||
|
||||
for _, file := range pkgFiles {
|
||||
pkg := Package(file)
|
||||
dbPkg, err := pkg.DBPackageIsolated(march, dbpackage.Repository(repo), db)
|
||||
dbPkg, err := pkg.DBPackageIsolated(ctx, march, dbpackage.Repository(repo), db)
|
||||
if err != nil {
|
||||
if strings.HasSuffix(pkg.Name(), "-debug") {
|
||||
mkErr := os.MkdirAll(filepath.Join(conf.Basedir.Debug, march), 0o755)
|
||||
@@ -200,10 +207,11 @@ func movePackagesLive(fullRepo string) error {
|
||||
filepath.Join(conf.Basedir.Debug, march, filepath.Base(file)))
|
||||
}
|
||||
|
||||
err = os.Rename(file, filepath.Join(conf.Basedir.Debug, march, filepath.Base(file)))
|
||||
err = Copy(file, filepath.Join(conf.Basedir.Debug, march, filepath.Base(file)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = os.Remove(file)
|
||||
_ = os.Remove(file + ".sig")
|
||||
continue
|
||||
}
|
||||
@@ -230,14 +238,16 @@ func movePackagesLive(fullRepo string) error {
|
||||
continue
|
||||
}
|
||||
|
||||
err = os.Rename(file, filepath.Join(conf.Basedir.Repo, fullRepo, "os", conf.Arch, filepath.Base(file)))
|
||||
err = Copy(file, filepath.Join(conf.Basedir.Repo, fullRepo, "os", conf.Arch, filepath.Base(file)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Rename(file+".sig", filepath.Join(conf.Basedir.Repo, fullRepo, "os", conf.Arch, filepath.Base(file)+".sig"))
|
||||
_ = os.Remove(file)
|
||||
err = Copy(file+".sig", filepath.Join(conf.Basedir.Repo, fullRepo, "os", conf.Arch, filepath.Base(file)+".sig"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = os.Remove(file + ".sig")
|
||||
|
||||
toAdd = append(toAdd, &ProtoPackage{
|
||||
DBPackage: dbPkg,
|
||||
@@ -259,8 +269,8 @@ func packages2slice(pkgs any) []string {
|
||||
switch v := pkgs.(type) {
|
||||
case []srcinfo.Package:
|
||||
var sPkgs []string
|
||||
for _, p := range v {
|
||||
sPkgs = append(sPkgs, p.Pkgname)
|
||||
for i := range v {
|
||||
sPkgs = append(sPkgs, v[i].Pkgname)
|
||||
}
|
||||
|
||||
return sPkgs
|
||||
@@ -323,36 +333,46 @@ func initALPM(root, dbpath string) (*alpm.Handle, error) {
|
||||
return h, nil
|
||||
}
|
||||
|
||||
func setupChroot() error {
|
||||
func setupChroot(ctx context.Context) error {
|
||||
_, err := os.Stat(filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot))
|
||||
switch {
|
||||
case err == nil:
|
||||
cmd := exec.Command("arch-nspawn", "-C", pacmanConf, filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot), //nolint:gosec
|
||||
"pacman", "-Syuu", "--noconfirm")
|
||||
cmd := exec.CommandContext(ctx, "arch-nspawn", "-C", pacmanConf, //nolint:gosec
|
||||
filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot), "pacman", "-Syuu", "--noconfirm")
|
||||
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)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cmd := exec.Command("mkarchroot", "-C", pacmanConf, "-M", makepkgConf, //nolint:gosec
|
||||
cmd := exec.CommandContext(ctx, "mkarchroot", "-C", pacmanConf, "-M", makepkgConf, //nolint:gosec
|
||||
filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot), "base-devel", "multilib-devel")
|
||||
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))
|
||||
}
|
||||
|
||||
cmd = exec.Command("sudo", "cp", pacmanConf, //nolint:gosec
|
||||
// copy pacman.conf into pristine chroot to enable multilib
|
||||
cmd = exec.CommandContext(ctx, "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.CommandContext(ctx, "sudo", "rm_chroot.py", //nolint:gosec
|
||||
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
|
||||
@@ -360,7 +380,7 @@ func setupChroot() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func syncMarchs() error {
|
||||
func syncMarchs(ctx context.Context) error {
|
||||
files, err := os.ReadDir(conf.Basedir.Repo)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -394,7 +414,7 @@ func syncMarchs() error {
|
||||
repos = append(repos, fRepo)
|
||||
buildManager.repoAdd[fRepo] = make(chan []*ProtoPackage, 1000)
|
||||
buildManager.repoPurge[fRepo] = make(chan []*ProtoPackage, 1000)
|
||||
go buildManager.repoWorker(fRepo)
|
||||
go buildManager.repoWorker(ctx, fRepo)
|
||||
|
||||
if _, err := os.Stat(filepath.Join(conf.Basedir.Repo, fRepo, "os", conf.Arch)); os.IsNotExist(err) {
|
||||
log.Debugf("creating path %s", filepath.Join(conf.Basedir.Repo, fRepo, "os", conf.Arch))
|
||||
@@ -477,6 +497,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
|
||||
@@ -485,12 +507,18 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) {
|
||||
if len(orgMatch) == 0 {
|
||||
// no match found, assume env var and append it
|
||||
log.Debugf("no match found for %s:%v, appending", subSec, subMap)
|
||||
if strings.Contains(subMap.(string), " ") {
|
||||
makepkgConf += fmt.Sprintf("\nexport %s=%q", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap))
|
||||
switch sm := subMap.(type) {
|
||||
case string:
|
||||
if strings.Contains(sm, " ") {
|
||||
makepkgConf += fmt.Sprintf("\nexport %s=%q", strings.ToUpper(subSec.(string)), replaceStringsFromMap(sm, replaceMap))
|
||||
continue
|
||||
}
|
||||
makepkgConf += fmt.Sprintf("\nexport %s=%s", strings.ToUpper(subSec.(string)), replaceStringsFromMap(sm, replaceMap))
|
||||
continue
|
||||
case []string:
|
||||
makepkgConf += fmt.Sprintf("\nexport %s=%q", strings.ToUpper(subSec.(string)), replaceStringsFromMap(strings.Join(sm, " "), replaceMap)) //nolint:lll
|
||||
continue
|
||||
}
|
||||
makepkgConf += fmt.Sprintf("\nexport %s=%s", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap))
|
||||
continue
|
||||
}
|
||||
|
||||
log.Debugf("original %s: %v (%d)", subSec, flags, len(flags))
|
||||
@@ -523,7 +551,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 {
|
||||
@@ -625,11 +670,11 @@ func Glob(pattern string) ([]string, error) {
|
||||
|
||||
func (globs Globs) Expand() ([]string, error) {
|
||||
var matches = []string{""}
|
||||
for _, glob := range globs {
|
||||
for _, g := range globs {
|
||||
var hits []string
|
||||
var hitMap = map[string]bool{}
|
||||
for _, match := range matches {
|
||||
paths, err := filepath.Glob(match + glob)
|
||||
paths, err := filepath.Glob(match + g)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -659,15 +704,189 @@ func (globs Globs) Expand() ([]string, error) {
|
||||
return matches, nil
|
||||
}
|
||||
|
||||
func MatchGlobList(target string, globs []string) (bool, error) {
|
||||
func MatchGlobList(target string, globs []string) bool {
|
||||
for _, lGlob := range globs {
|
||||
tGlob, err := glob.Compile(lGlob)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to compile glob %s: %w", lGlob, err)
|
||||
log.Warningf("failed to compile glob %s: %v", lGlob, err)
|
||||
return false
|
||||
}
|
||||
if tGlob.Match(target) {
|
||||
return true, nil
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func Copy(srcPath, dstPath string) (err error) {
|
||||
r, err := os.Open(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func(r *os.File) {
|
||||
_ = r.Close()
|
||||
}(r)
|
||||
|
||||
w, err := os.Create(dstPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if c := w.Close(); err == nil {
|
||||
err = c
|
||||
}
|
||||
}()
|
||||
|
||||
_, err = io.Copy(w, r)
|
||||
return err
|
||||
}
|
||||
|
||||
func downloadSRCINFO(pkg, tag string) (*srcinfo.Srcinfo, error) {
|
||||
resp, err := http.Get(fmt.Sprintf(
|
||||
"https://gitlab.archlinux.org/archlinux/packaging/packages/%s/-/raw/%s/.SRCINFO", pkg, tag),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, errors.New(resp.Status)
|
||||
}
|
||||
|
||||
bResp, err := io.ReadAll(resp.Body)
|
||||
defer resp.Body.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
nSrcInfo, err := srcinfo.Parse(string(bResp))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nSrcInfo, nil
|
||||
}
|
||||
|
||||
func getDescendantPIDs(rootPID int) ([]int, error) {
|
||||
pidToPpid := map[int]int{}
|
||||
var descendants []int
|
||||
|
||||
procEntries, err := os.ReadDir("/proc")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, entry := range procEntries {
|
||||
if !entry.IsDir() || entry.Name()[0] < '0' || entry.Name()[0] > '9' {
|
||||
continue
|
||||
}
|
||||
pidStr := entry.Name()
|
||||
pid, err := strconv.Atoi(pidStr)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
statusPath := filepath.Join("/proc", pidStr, "status")
|
||||
data, err := os.ReadFile(statusPath)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, line := range strings.Split(string(data), "\n") {
|
||||
if strings.HasPrefix(line, "PPid:") {
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) == 2 {
|
||||
ppid, _ := strconv.Atoi(fields[1])
|
||||
pidToPpid[pid] = ppid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var walk func(int)
|
||||
walk = func(current int) {
|
||||
for pid, ppid := range pidToPpid {
|
||||
if ppid == current {
|
||||
descendants = append(descendants, pid)
|
||||
walk(pid)
|
||||
}
|
||||
}
|
||||
}
|
||||
walk(rootPID)
|
||||
return descendants, nil
|
||||
}
|
||||
|
||||
type MemStats struct {
|
||||
RSS int64
|
||||
Swap int64
|
||||
}
|
||||
|
||||
func getMemoryStats(pid int) (MemStats, error) {
|
||||
statusPath := fmt.Sprintf("/proc/%d/status", pid)
|
||||
data, err := os.ReadFile(statusPath)
|
||||
if err != nil {
|
||||
return MemStats{}, err
|
||||
}
|
||||
|
||||
stats := MemStats{}
|
||||
for _, line := range strings.Split(string(data), "\n") {
|
||||
if strings.HasPrefix(line, "VmRSS:") {
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) >= 2 {
|
||||
kb, _ := strconv.ParseInt(fields[1], 10, 64)
|
||||
stats.RSS = kb
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(line, "VmSwap:") {
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) >= 2 {
|
||||
kb, _ := strconv.ParseInt(fields[1], 10, 64)
|
||||
stats.Swap = kb
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stats, nil
|
||||
}
|
||||
|
||||
func pollMemoryUsage(pid int, interval time.Duration, done chan bool, result chan int64) {
|
||||
var totalMemory int64
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-done:
|
||||
result <- totalMemory
|
||||
return
|
||||
default:
|
||||
var totalRSS, totalSwap int64
|
||||
|
||||
rootStats, err := getMemoryStats(pid)
|
||||
if err == nil {
|
||||
totalRSS += rootStats.RSS
|
||||
totalSwap += rootStats.Swap
|
||||
} else {
|
||||
log.Errorf("failed to get memory stats for root process: %v", err)
|
||||
}
|
||||
|
||||
descendants, err := getDescendantPIDs(pid)
|
||||
if err != nil {
|
||||
log.Errorf("failed to get descendants: %v", err)
|
||||
}
|
||||
|
||||
for _, dpid := range descendants {
|
||||
stats, err := getMemoryStats(dpid)
|
||||
if err == nil {
|
||||
totalRSS += stats.RSS
|
||||
totalSwap += stats.Swap
|
||||
}
|
||||
}
|
||||
|
||||
newMemory := totalRSS + totalSwap
|
||||
if newMemory > totalMemory {
|
||||
totalMemory = newMemory
|
||||
}
|
||||
|
||||
time.Sleep(interval)
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user