forked from ALHP/ALHP.GO
Compare commits
68 Commits
fix_firefo
...
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 | |||
38a7b6562c | |||
b510954115 | |||
e73be9c9c5 | |||
322652b510 | |||
7f2d7f6251 | |||
0ca90c55bf | |||
d9efab4d2a | |||
2f2f6e7d5b | |||
2ad5c57078 | |||
55cf1b7eb4 | |||
352ce97b88 | |||
1c1f1fba17 | |||
a834c7fb04 | |||
8d6eee6bf6 | |||
cbe667cb5d | |||
16fcf0117d | |||
8c148c6e89 | |||
36578d1dfb | |||
021520b39a | |||
9822c43cf1 | |||
e6dd3fd3ef | |||
9bff418ade | |||
ff26fb2b8b | |||
0c6a96db21 | |||
552382cc00 | |||
2bf9bd0621 |
@@ -14,7 +14,7 @@ linters-settings:
|
|||||||
disabled-checks:
|
disabled-checks:
|
||||||
- whyNoLint
|
- whyNoLint
|
||||||
- filepathJoin
|
- filepathJoin
|
||||||
gomnd:
|
mnd:
|
||||||
checks:
|
checks:
|
||||||
- argument
|
- argument
|
||||||
- case
|
- case
|
||||||
@@ -90,3 +90,5 @@ linters:
|
|||||||
# remove for new projects
|
# remove for new projects
|
||||||
- errname
|
- errname
|
||||||
- goerr113
|
- goerr113
|
||||||
|
- depguard
|
||||||
|
- noctx
|
||||||
|
105
README.md
105
README.md
@@ -1,50 +1,41 @@
|
|||||||
# ALHP
|
# ALHP
|
||||||
|
|
||||||
[](https://somegit.dev/anonfunc/ALHP.GO/src/branch/master/LICENSE)
|
[](https://status.alhp.dev)
|
||||||
[](https://alhp.dev/packages.html)
|
|
||||||
[](https://goreportcard.com/report/somegit.dev/ALHP/ALHP.GO)
|
[](https://goreportcard.com/report/somegit.dev/ALHP/ALHP.GO)
|
||||||
[](https://pkg.go.dev/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/)
|
[](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
|
[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).
|
[LTO](https://en.wikipedia.org/wiki/Interprocedural_optimization).
|
||||||
|
|
||||||
> ⚠️ NVIDIA graphic users using the **proprietary driver** is highly recommended reading the
|
> [!WARNING]
|
||||||
> [FAQ about Linux kernel modules](#directly-linked-kernel-modules) ⚠️
|
> 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 -->
|
<!-- TOC -->
|
||||||
|
* [Quick Start](#quick-start)
|
||||||
* [Quickstart](#quickstart)
|
|
||||||
* [FAQ](#faq)
|
* [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)
|
|
||||||
* [Matrix](#matrix)
|
* [Matrix](#matrix)
|
||||||
* [Donations](#donations)
|
* [Donations](#donations)
|
||||||
* [License and Legal](#license-and-legal)
|
* [License and Legal](#license-and-legal)
|
||||||
|
|
||||||
<!-- TOC -->
|
<!-- TOC -->
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Quickstart
|
## Quick Start
|
||||||
|
|
||||||
### 1. Check your system for support
|
### 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
|
> [!CAUTION]
|
||||||
> enable
|
> Before enabling any of these repos, make sure that your system supports the level of functionality you want to
|
||||||
(e.g. `x86-64-v3`).
|
> 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
|
> **If you don't check first, you may not be able to boot your system and will have to downgrade any packages you may
|
||||||
that you may have upgraded.**
|
have upgraded.**
|
||||||
|
|
||||||
Check which feature-levels your CPU supports with
|
Check which feature levels your CPU supports with
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/lib/ld-linux-x86-64.so.2 --help
|
/lib/ld-linux-x86-64.so.2 --help
|
||||||
@@ -59,10 +50,14 @@ Subdirectories of glibc-hwcaps directories, in priority order:
|
|||||||
x86-64-v2 (supported, searched)
|
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
|
### 2. Install keyring & mirrorlist
|
||||||
|
|
||||||
Install [alhp-keyring](https://aur.archlinux.org/packages/alhp-keyring/)
|
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`:
|
Example with `yay`:
|
||||||
|
|
||||||
@@ -74,15 +69,16 @@ yay -S alhp-keyring alhp-mirrorlist
|
|||||||
|
|
||||||
### 3. Choose a mirror (optional)
|
### 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
|
Edit `/etc/pacman.d/alhp-mirrorlist` and comment in/out the mirrors you want to enable/disable.
|
||||||
is a cloudflare-based mirror which
|
By default, a CDN mirror provided by ALHP is selected.
|
||||||
[*should* provide decent speed worldwide](https://somegit.dev/ALHP/ALHP.GO/issues/38#issuecomment-891).
|
> [!NOTE]
|
||||||
> Note: Only `alhp.dev` is hosted by ALHP directly. If you have problems with a mirror,
|
> `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).
|
> 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`:
|
Example for `x86-64-v3`:
|
||||||
|
|
||||||
@@ -90,12 +86,12 @@ Example for `x86-64-v3`:
|
|||||||
[core-x86-64-v3]
|
[core-x86-64-v3]
|
||||||
Include = /etc/pacman.d/alhp-mirrorlist
|
Include = /etc/pacman.d/alhp-mirrorlist
|
||||||
|
|
||||||
[extra-x86-64-v3]
|
|
||||||
Include = /etc/pacman.d/alhp-mirrorlist
|
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
Include = /etc/pacman.d/mirrorlist
|
Include = /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
[extra-x86-64-v3]
|
||||||
|
Include = /etc/pacman.d/alhp-mirrorlist
|
||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
Include = /etc/pacman.d/mirrorlist
|
Include = /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
@@ -108,11 +104,11 @@ Include = /etc/pacman.d/mirrorlist
|
|||||||
```
|
```
|
||||||
|
|
||||||
Replace `x86-64-v3` with the x86-64 feature level you want to enable.
|
Replace `x86-64-v3` with the x86-64 feature level you want to enable.
|
||||||
> ALHP only builds for `x86-64-v3` and `x86-64-v2` at the moment (list is subject to change). 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
|
pacman -Suy
|
||||||
@@ -122,9 +118,9 @@ pacman -Suy
|
|||||||
|
|
||||||
### Remove ALHP packages
|
### 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
|
pacman -Suuy
|
||||||
@@ -132,7 +128,7 @@ pacman -Suuy
|
|||||||
|
|
||||||
### LTO
|
### 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)
|
UTC. [More details.](https://somegit.dev/ALHP/ALHP.GO/issues/52)
|
||||||
LTO status is visible per package on the package status page.
|
LTO status is visible per package on the package status page.
|
||||||
|
|
||||||
@@ -142,7 +138,7 @@ LTO status is visible per package on the package status page.
|
|||||||
|
|
||||||
### Directly linked kernel modules
|
### 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 `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.
|
not affected**. This issue is being tracked in #68, a solution is being worked on.
|
||||||
|
|
||||||
@@ -154,19 +150,18 @@ so, [see alhp-mirrorlist for how to become one](https://somegit.dev/ALHP/alhp-mi
|
|||||||
### What packages are built
|
### 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)
|
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.
|
from building (besides all `any` architecture packages) are being listed in issue #16.
|
||||||
Also [package status page](https://alhp.dev/packages.html) (search for `blacklisted`).
|
See also [package status page](https://status.alhp.dev) (search for `blacklisted`).
|
||||||
|
|
||||||
### Why is package X not up-to-date
|
### 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**
|
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]`).
|
ALHP builds packages **after** they are released in the official Archlinux repos (excluding `[*-testing]`).
|
||||||
This leads to packages being delayed if the current batch contains many packages or packages which take a while to
|
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`).
|
build (e.g. `chromium`).
|
||||||
|
|
||||||
You can always check on the progress of the current build-cycle on
|
You can always check on the progress of the current build cycle on the [package status page](https://status.alhp.dev).
|
||||||
the [package status page](https://alhp.dev/packages.html).
|
|
||||||
Please refrain from opening issues caused by packages currently in queue/not yet build/not yet moved to the repo.
|
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
|
Please keep in mind that large rebuilds such as `openssl` or `python` can take days to complete on our current build
|
||||||
hardware.
|
hardware.
|
||||||
@@ -181,9 +176,19 @@ To use it, have `debuginfod` installed on your system and add it to your `DEBUGI
|
|||||||
echo "https://debuginfod.alhp.dev" > /etc/debuginfod/alhp.urls
|
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, and then enable your desired repos again.
|
||||||
|
|
||||||
|
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
|
## 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)
|
room [here](https://matrix.to/#/#alhp:ofsg.eu) (`#alhp@ofsg.eu`). You can also find me (@idlegandalf)
|
||||||
in `#archlinux:archlinux.org`.
|
in `#archlinux:archlinux.org`.
|
||||||
|
|
||||||
@@ -197,5 +202,5 @@ work ALHP would not be possible.
|
|||||||
|
|
||||||
## License and Legal
|
## License and Legal
|
||||||
|
|
||||||
This project including all of its source files is released under the terms of the GNU General Public License version 2
|
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.
|
or any later version. See [LICENSE](https://somegit.dev/ALHP/ALHP.GO/src/branch/master/LICENSE) for details.
|
||||||
|
298
buildmanager.go
298
buildmanager.go
@@ -5,13 +5,12 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/c2h5oh/datasize"
|
"github.com/c2h5oh/datasize"
|
||||||
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/sethvargo/go-retry"
|
"github.com/sethvargo/go-retry"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"html/template"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"somegit.dev/ALHP/ALHP.GO/ent"
|
|
||||||
"somegit.dev/ALHP/ALHP.GO/ent/dbpackage"
|
"somegit.dev/ALHP/ALHP.GO/ent/dbpackage"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -28,6 +27,9 @@ type BuildManager struct {
|
|||||||
building []*ProtoPackage
|
building []*ProtoPackage
|
||||||
buildingLock *sync.RWMutex
|
buildingLock *sync.RWMutex
|
||||||
queueSignal chan struct{}
|
queueSignal chan struct{}
|
||||||
|
metrics struct {
|
||||||
|
queueSize *prometheus.GaugeVec
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) error {
|
func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) error {
|
||||||
@@ -76,12 +78,13 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if package can be built with current memory limit
|
// 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,
|
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()
|
doneQLock.Lock()
|
||||||
doneQ = append(doneQ, pkg)
|
doneQ = append(doneQ, pkg)
|
||||||
doneQLock.Unlock()
|
doneQLock.Unlock()
|
||||||
|
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "queued").Dec()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,9 +93,9 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
|||||||
b.buildingLock.RUnlock()
|
b.buildingLock.RUnlock()
|
||||||
|
|
||||||
// check if package can be build right now
|
// check if package can be build right now
|
||||||
if !unknownBuilds && 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",
|
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
|
continue
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -108,14 +111,18 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
|||||||
b.building = append(b.building, pkg)
|
b.building = append(b.building, pkg)
|
||||||
b.buildingLock.Unlock()
|
b.buildingLock.Unlock()
|
||||||
queueNoMatch = false
|
queueNoMatch = false
|
||||||
|
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "queued").Dec()
|
||||||
|
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "building").Inc()
|
||||||
|
|
||||||
go func(pkg *ProtoPackage) {
|
go func(pkg *ProtoPackage) {
|
||||||
dur, err := pkg.build(ctx)
|
dur, err := pkg.build(ctx)
|
||||||
|
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "building").Dec()
|
||||||
if err != nil && !errors.Is(err, ErrorNotEligible) {
|
if err != nil && !errors.Is(err, ErrorNotEligible) {
|
||||||
log.Warningf("[Q] error building package %s->%s in %s: %s", pkg.FullRepo, pkg.Pkgbase, dur, err)
|
log.Warningf("[Q] error building package %s->%s in %s: %s", pkg.FullRepo, pkg.Pkgbase, dur, err)
|
||||||
b.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
b.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
||||||
} else if err == nil {
|
} else if err == nil {
|
||||||
log.Infof("[Q] build successful: %s->%s (%s)", pkg.FullRepo, pkg.Pkgbase, dur)
|
log.Infof("[Q] build successful: %s->%s (%s)", pkg.FullRepo, pkg.Pkgbase, dur)
|
||||||
|
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "built").Inc()
|
||||||
}
|
}
|
||||||
doneQLock.Lock()
|
doneQLock.Lock()
|
||||||
b.buildingLock.Lock()
|
b.buildingLock.Lock()
|
||||||
@@ -149,191 +156,7 @@ func (b *BuildManager) buildQueue(ctx context.Context, queue []*ProtoPackage) er
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BuildManager) htmlWorker(ctx context.Context) {
|
func (b *BuildManager) repoWorker(ctx context.Context, repo string) {
|
||||||
type Pkg struct {
|
|
||||||
Pkgbase string
|
|
||||||
Status string
|
|
||||||
Class string
|
|
||||||
Skip string
|
|
||||||
Version string
|
|
||||||
Svn2GitVersion string
|
|
||||||
BuildDate string
|
|
||||||
BuildDuration time.Duration
|
|
||||||
BuildMemory *string
|
|
||||||
Checked string
|
|
||||||
Log string
|
|
||||||
LTO bool
|
|
||||||
LTOUnknown bool
|
|
||||||
LTODisabled bool
|
|
||||||
LTOAutoDisabled bool
|
|
||||||
DebugSym bool
|
|
||||||
DebugSymNotAvailable bool
|
|
||||||
DebugSymUnknown bool
|
|
||||||
}
|
|
||||||
|
|
||||||
type Repo struct {
|
|
||||||
Name string
|
|
||||||
Packages []Pkg
|
|
||||||
}
|
|
||||||
|
|
||||||
type March struct {
|
|
||||||
Name string
|
|
||||||
Repos []Repo
|
|
||||||
}
|
|
||||||
|
|
||||||
type tpl struct {
|
|
||||||
March []March
|
|
||||||
Generated string
|
|
||||||
Latest int
|
|
||||||
Failed int
|
|
||||||
Skipped int
|
|
||||||
Queued int
|
|
||||||
LTOEnabled int
|
|
||||||
LTOUnknown int
|
|
||||||
LTODisabled int
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
gen := &tpl{}
|
|
||||||
|
|
||||||
for _, march := range conf.March {
|
|
||||||
addMarch := March{
|
|
||||||
Name: march,
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, repo := range conf.Repos {
|
|
||||||
addRepo := Repo{
|
|
||||||
Name: repo,
|
|
||||||
}
|
|
||||||
|
|
||||||
pkgs := db.DBPackage.Query().Order(ent.Asc(dbpackage.FieldPkgbase)).
|
|
||||||
Where(dbpackage.MarchEQ(march), dbpackage.RepositoryEQ(dbpackage.Repository(repo))).AllX(ctx)
|
|
||||||
|
|
||||||
for _, pkg := range pkgs {
|
|
||||||
addPkg := Pkg{
|
|
||||||
Pkgbase: pkg.Pkgbase,
|
|
||||||
Status: strings.ToUpper(pkg.Status.String()),
|
|
||||||
Class: statusID2string(pkg.Status),
|
|
||||||
Skip: pkg.SkipReason,
|
|
||||||
Version: pkg.RepoVersion,
|
|
||||||
Svn2GitVersion: pkg.Version,
|
|
||||||
}
|
|
||||||
|
|
||||||
if pkg.STime != nil && pkg.UTime != nil {
|
|
||||||
addPkg.BuildDuration = time.Duration(*pkg.STime+*pkg.UTime) * time.Second
|
|
||||||
}
|
|
||||||
|
|
||||||
if !pkg.BuildTimeStart.IsZero() {
|
|
||||||
addPkg.BuildDate = pkg.BuildTimeStart.UTC().Format(time.RFC1123)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !pkg.Updated.IsZero() {
|
|
||||||
addPkg.Checked = pkg.Updated.UTC().Format(time.RFC1123)
|
|
||||||
}
|
|
||||||
|
|
||||||
if pkg.Status == dbpackage.StatusFailed {
|
|
||||||
addPkg.Log = fmt.Sprintf("%s/%s/%s.log", logDir, pkg.March, pkg.Pkgbase)
|
|
||||||
}
|
|
||||||
|
|
||||||
if pkg.MaxRss != nil {
|
|
||||||
hrSize := (datasize.ByteSize(*pkg.MaxRss) * datasize.KB).HumanReadable()
|
|
||||||
addPkg.BuildMemory = &hrSize
|
|
||||||
}
|
|
||||||
|
|
||||||
switch pkg.Lto {
|
|
||||||
case dbpackage.LtoUnknown:
|
|
||||||
if pkg.Status != dbpackage.StatusSkipped && pkg.Status != dbpackage.StatusFailed {
|
|
||||||
addPkg.LTOUnknown = true
|
|
||||||
}
|
|
||||||
case dbpackage.LtoEnabled:
|
|
||||||
addPkg.LTO = true
|
|
||||||
case dbpackage.LtoDisabled:
|
|
||||||
addPkg.LTODisabled = true
|
|
||||||
case dbpackage.LtoAutoDisabled:
|
|
||||||
addPkg.LTOAutoDisabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
switch pkg.DebugSymbols {
|
|
||||||
case dbpackage.DebugSymbolsUnknown:
|
|
||||||
if pkg.Status != dbpackage.StatusSkipped && pkg.Status != dbpackage.StatusFailed {
|
|
||||||
addPkg.DebugSymUnknown = true
|
|
||||||
}
|
|
||||||
case dbpackage.DebugSymbolsAvailable:
|
|
||||||
addPkg.DebugSym = true
|
|
||||||
case dbpackage.DebugSymbolsNotAvailable:
|
|
||||||
addPkg.DebugSymNotAvailable = true
|
|
||||||
}
|
|
||||||
|
|
||||||
addRepo.Packages = append(addRepo.Packages, addPkg)
|
|
||||||
}
|
|
||||||
addMarch.Repos = append(addMarch.Repos, addRepo)
|
|
||||||
}
|
|
||||||
gen.March = append(gen.March, addMarch)
|
|
||||||
}
|
|
||||||
|
|
||||||
gen.Generated = time.Now().UTC().Format(time.RFC1123)
|
|
||||||
|
|
||||||
var v []struct {
|
|
||||||
Status dbpackage.Status `json:"status"`
|
|
||||||
Count int `json:"count"`
|
|
||||||
}
|
|
||||||
|
|
||||||
db.DBPackage.Query().GroupBy(dbpackage.FieldStatus).Aggregate(ent.Count()).ScanX(ctx, &v)
|
|
||||||
|
|
||||||
for _, c := range v {
|
|
||||||
switch c.Status { //nolint:exhaustive
|
|
||||||
case dbpackage.StatusFailed:
|
|
||||||
gen.Failed = c.Count
|
|
||||||
case dbpackage.StatusSkipped:
|
|
||||||
gen.Skipped = c.Count
|
|
||||||
case dbpackage.StatusLatest:
|
|
||||||
gen.Latest = c.Count
|
|
||||||
case dbpackage.StatusQueued:
|
|
||||||
gen.Queued = c.Count
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var v2 []struct {
|
|
||||||
Status dbpackage.Lto `json:"lto"` //nolint:tagliatelle
|
|
||||||
Count int `json:"count"`
|
|
||||||
}
|
|
||||||
|
|
||||||
db.DBPackage.Query().Where(dbpackage.StatusNEQ(dbpackage.StatusSkipped)).
|
|
||||||
GroupBy(dbpackage.FieldLto).Aggregate(ent.Count()).ScanX(ctx, &v2)
|
|
||||||
|
|
||||||
for _, c := range v2 {
|
|
||||||
switch c.Status {
|
|
||||||
case dbpackage.LtoUnknown:
|
|
||||||
gen.LTOUnknown = c.Count
|
|
||||||
case dbpackage.LtoDisabled, dbpackage.LtoAutoDisabled:
|
|
||||||
gen.LTODisabled += c.Count
|
|
||||||
case dbpackage.LtoEnabled:
|
|
||||||
gen.LTOEnabled = c.Count
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
statusTpl, err := template.ParseFiles("tpl/packages.html")
|
|
||||||
if err != nil {
|
|
||||||
log.Warningf("[HTML] error parsing template file: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
f, err := os.OpenFile(filepath.Join(conf.Basedir.Repo, "packages.html"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o644)
|
|
||||||
if err != nil {
|
|
||||||
log.Warningf("[HTML] error opening output file: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
err = statusTpl.Execute(f, gen)
|
|
||||||
if err != nil {
|
|
||||||
log.Warningf("[HTML] error filling template: %v", err)
|
|
||||||
}
|
|
||||||
_ = f.Close()
|
|
||||||
|
|
||||||
time.Sleep(time.Minute * 5)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BuildManager) repoWorker(repo string) {
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case pkgL := <-b.repoAdd[repo]:
|
case pkgL := <-b.repoAdd[repo]:
|
||||||
@@ -345,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 := []string{"-s", "-v", "-p", "-n", filepath.Join(conf.Basedir.Repo, repo, "os", conf.Arch, repo) + ".db.tar.xz"}
|
||||||
args = append(args, toAdd...)
|
args = append(args, toAdd...)
|
||||||
cmd := exec.Command("repo-add", args...)
|
cmd := exec.CommandContext(ctx, "repo-add", args...)
|
||||||
res, err := cmd.CombinedOutput()
|
res, err := cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
if err != nil && cmd.ProcessState.ExitCode() != 1 {
|
if err != nil && cmd.ProcessState.ExitCode() != 1 {
|
||||||
@@ -353,7 +176,7 @@ func (b *BuildManager) repoWorker(repo string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, pkg := range pkgL {
|
for _, pkg := range pkgL {
|
||||||
err = pkg.toDBPackage(true)
|
err = pkg.toDBPackage(ctx, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("error getting db entry for %s: %v", pkg.Pkgbase, err)
|
log.Warningf("error getting db entry for %s: %v", pkg.Pkgbase, err)
|
||||||
continue
|
continue
|
||||||
@@ -371,10 +194,12 @@ func (b *BuildManager) repoWorker(repo string) {
|
|||||||
} else {
|
} else {
|
||||||
pkgUpd = pkgUpd.SetDebugSymbols(dbpackage.DebugSymbolsNotAvailable)
|
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()
|
res, err = cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -396,6 +221,12 @@ func (b *BuildManager) repoWorker(repo string) {
|
|||||||
log.Warningf("[%s/%s] unable to find files: %v", pkg.FullRepo, pkg.Pkgbase, err)
|
log.Warningf("[%s/%s] unable to find files: %v", pkg.FullRepo, pkg.Pkgbase, err)
|
||||||
continue
|
continue
|
||||||
} else if len(pkg.PkgFiles) == 0 {
|
} 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
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -414,7 +245,7 @@ func (b *BuildManager) repoWorker(repo string) {
|
|||||||
b.repoWG.Add(1)
|
b.repoWG.Add(1)
|
||||||
args := []string{"-s", "-v", filepath.Join(conf.Basedir.Repo, pkg.FullRepo, "os", conf.Arch, pkg.FullRepo) + ".db.tar.xz"}
|
args := []string{"-s", "-v", filepath.Join(conf.Basedir.Repo, pkg.FullRepo, "os", conf.Arch, pkg.FullRepo) + ".db.tar.xz"}
|
||||||
args = append(args, realPkgs...)
|
args = append(args, realPkgs...)
|
||||||
cmd := exec.Command("repo-remove", args...)
|
cmd := exec.CommandContext(ctx, "repo-remove", args...)
|
||||||
res, err := cmd.CombinedOutput()
|
res, err := cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
if err != nil && cmd.ProcessState.ExitCode() == 1 {
|
if err != nil && cmd.ProcessState.ExitCode() == 1 {
|
||||||
@@ -422,7 +253,10 @@ func (b *BuildManager) repoWorker(repo string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pkg.DBPackage != nil {
|
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 {
|
for _, file := range pkg.PkgFiles {
|
||||||
@@ -445,18 +279,17 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
|||||||
log.Fatalf("error creating work dir %s: %v", conf.Basedir.Work, err)
|
log.Fatalf("error creating work dir %s: %v", conf.Basedir.Work, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gitPath := filepath.Join(conf.Basedir.Work, stateDir)
|
||||||
for {
|
for {
|
||||||
gitPath := filepath.Join(conf.Basedir.Work, stateDir)
|
|
||||||
|
|
||||||
if _, err := os.Stat(gitPath); os.IsNotExist(err) {
|
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()
|
res, err := cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("error cloning state repo: %v", err)
|
log.Fatalf("error cloning state repo: %v", err)
|
||||||
}
|
}
|
||||||
} else if err == nil {
|
} else if err == nil {
|
||||||
cmd := exec.Command("git", "reset", "--hard")
|
cmd := exec.CommandContext(ctx, "git", "reset", "--hard")
|
||||||
cmd.Dir = gitPath
|
cmd.Dir = gitPath
|
||||||
res, err := cmd.CombinedOutput()
|
res, err := cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
@@ -464,7 +297,7 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
|||||||
log.Fatalf("error reseting state repo: %v", err)
|
log.Fatalf("error reseting state repo: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = exec.Command("git", "pull")
|
cmd = exec.CommandContext(ctx, "git", "pull")
|
||||||
cmd.Dir = gitPath
|
cmd.Dir = gitPath
|
||||||
res, err = cmd.CombinedOutput()
|
res, err = cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
@@ -478,9 +311,8 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
|||||||
for _, repo := range repos {
|
for _, repo := range repos {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
splitRepo := strings.Split(repo, "-")
|
splitRepo := strings.Split(repo, "-")
|
||||||
repo := repo
|
|
||||||
go func() {
|
go func() {
|
||||||
err := housekeeping(splitRepo[0], strings.Join(splitRepo[1:], "-"), wg)
|
err := housekeeping(ctx, splitRepo[0], strings.Join(splitRepo[1:], "-"), wg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("[%s] housekeeping failed: %v", repo, err)
|
log.Warningf("[%s] housekeeping failed: %v", repo, err)
|
||||||
}
|
}
|
||||||
@@ -488,10 +320,11 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
err := logHK()
|
err := logHK(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("log-housekeeping failed: %v", err)
|
log.Warningf("log-housekeeping failed: %v", err)
|
||||||
}
|
}
|
||||||
|
debugHK()
|
||||||
|
|
||||||
// fetch updates between sync runs
|
// fetch updates between sync runs
|
||||||
b.alpmMutex.Lock()
|
b.alpmMutex.Lock()
|
||||||
@@ -500,8 +333,8 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
|||||||
log.Fatalf("error releasing ALPM handle: %v", err)
|
log.Fatalf("error releasing ALPM handle: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := retry.Fibonacci(ctx, 1*time.Second, func(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")
|
log.Warningf("unable to upgrade chroot, trying again later")
|
||||||
return retry.RetryableError(err)
|
return retry.RetryableError(err)
|
||||||
}
|
}
|
||||||
@@ -517,20 +350,21 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
b.alpmMutex.Unlock()
|
b.alpmMutex.Unlock()
|
||||||
|
|
||||||
queue, err := b.genQueue()
|
queue, err := b.genQueue(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("error building queue: %v", err)
|
log.Errorf("error building queue: %v", err)
|
||||||
} else {
|
return err
|
||||||
log.Debugf("build-queue with %d items", len(queue))
|
}
|
||||||
err = b.buildQueue(ctx, queue)
|
|
||||||
if err != nil {
|
log.Debugf("build-queue with %d items", len(queue))
|
||||||
return err
|
err = b.buildQueue(ctx, queue)
|
||||||
}
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.Err() == nil {
|
if ctx.Err() == nil {
|
||||||
for _, repo := range repos {
|
for _, repo := range repos {
|
||||||
err = movePackagesLive(repo)
|
err = movePackagesLive(ctx, repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("[%s] error moving packages live: %v", repo, err)
|
log.Errorf("[%s] error moving packages live: %v", repo, err)
|
||||||
}
|
}
|
||||||
@@ -539,12 +373,13 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
|||||||
return ctx.Err()
|
return ctx.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b.metrics.queueSize.Reset()
|
||||||
log.Debugf("build-cycle finished")
|
log.Debugf("build-cycle finished")
|
||||||
time.Sleep(time.Duration(*checkInterval) * time.Minute)
|
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, "**/*"))
|
stateFiles, err := Glob(filepath.Join(conf.Basedir.Work, stateDir, "**/*"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error scanning for state-files: %w", err)
|
return nil, fmt.Errorf("error scanning for state-files: %w", err)
|
||||||
@@ -553,7 +388,7 @@ func (b *BuildManager) genQueue() ([]*ProtoPackage, error) {
|
|||||||
var pkgbuilds []*ProtoPackage
|
var pkgbuilds []*ProtoPackage
|
||||||
for _, stateFile := range stateFiles {
|
for _, stateFile := range stateFiles {
|
||||||
stat, err := os.Stat(stateFile)
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -590,19 +425,28 @@ func (b *BuildManager) genQueue() ([]*ProtoPackage, error) {
|
|||||||
Arch: arch,
|
Arch: arch,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pkg.toDBPackage(false)
|
err = pkg.toDBPackage(ctx, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("[QG] error getting/creating dbpackage %s: %v", state.Pkgbase, err)
|
log.Warningf("[QG] error getting/creating dbpackage %s: %v", state.Pkgbase, err)
|
||||||
continue
|
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)
|
log.Debugf("[QG] %s->%s not available on mirror, skipping build", pkg.FullRepo, pkg.Pkgbase)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aBuild, err := pkg.IsBuilt()
|
||||||
|
if err != nil {
|
||||||
|
log.Warningf("[QG] %s->%s error determining built packages: %v", pkg.FullRepo, pkg.Pkgbase, err)
|
||||||
|
}
|
||||||
|
if aBuild {
|
||||||
|
log.Infof("[QG] %s->%s already built, skipping build", pkg.FullRepo, pkg.Pkgbase)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if pkg.DBPackage == nil {
|
if pkg.DBPackage == nil {
|
||||||
err = pkg.toDBPackage(true)
|
err = pkg.toDBPackage(ctx, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("[QG] error getting/creating dbpackage %s: %v", state.Pkgbase, err)
|
log.Warningf("[QG] error getting/creating dbpackage %s: %v", state.Pkgbase, err)
|
||||||
continue
|
continue
|
||||||
@@ -613,12 +457,22 @@ func (b *BuildManager) genQueue() ([]*ProtoPackage, error) {
|
|||||||
continue
|
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
|
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)
|
pkgbuilds = append(pkgbuilds, pkg)
|
||||||
|
b.metrics.queueSize.WithLabelValues(pkg.FullRepo, "queued").Inc()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,16 +33,6 @@ blacklist:
|
|||||||
- llvm
|
- llvm
|
||||||
- rust
|
- rust
|
||||||
|
|
||||||
status:
|
|
||||||
class:
|
|
||||||
skipped: "secondary"
|
|
||||||
queued: "warning"
|
|
||||||
latest: "primary"
|
|
||||||
failed: "danger"
|
|
||||||
signing: "success"
|
|
||||||
building: "info"
|
|
||||||
unknown: "dark"
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# number of workers total
|
# number of workers total
|
||||||
worker: 4
|
worker: 4
|
||||||
@@ -54,4 +44,7 @@ build:
|
|||||||
memory_limit: "16gb"
|
memory_limit: "16gb"
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
level: INFO
|
level: INFO
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
port: 9568
|
||||||
|
@@ -28,9 +28,7 @@ type Client struct {
|
|||||||
|
|
||||||
// NewClient creates a new client configured with the given options.
|
// NewClient creates a new client configured with the given options.
|
||||||
func NewClient(opts ...Option) *Client {
|
func NewClient(opts ...Option) *Client {
|
||||||
cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}}
|
client := &Client{config: newConfig(opts...)}
|
||||||
cfg.options(opts...)
|
|
||||||
client := &Client{config: cfg}
|
|
||||||
client.init()
|
client.init()
|
||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
@@ -58,6 +56,13 @@ type (
|
|||||||
Option func(*config)
|
Option func(*config)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// newConfig creates a new config for the client.
|
||||||
|
func newConfig(opts ...Option) config {
|
||||||
|
cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}}
|
||||||
|
cfg.options(opts...)
|
||||||
|
return cfg
|
||||||
|
}
|
||||||
|
|
||||||
// options applies the options on the config object.
|
// options applies the options on the config object.
|
||||||
func (c *config) options(opts ...Option) {
|
func (c *config) options(opts ...Option) {
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
|
@@ -109,7 +109,7 @@ const DefaultStatus = StatusUnknown
|
|||||||
const (
|
const (
|
||||||
StatusSkipped Status = "skipped"
|
StatusSkipped Status = "skipped"
|
||||||
StatusFailed Status = "failed"
|
StatusFailed Status = "failed"
|
||||||
StatusBuild Status = "build"
|
StatusBuilt Status = "built"
|
||||||
StatusQueued Status = "queued"
|
StatusQueued Status = "queued"
|
||||||
StatusDelayed Status = "delayed"
|
StatusDelayed Status = "delayed"
|
||||||
StatusBuilding Status = "building"
|
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.
|
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
|
||||||
func StatusValidator(s Status) error {
|
func StatusValidator(s Status) error {
|
||||||
switch s {
|
switch s {
|
||||||
case StatusSkipped, StatusFailed, StatusBuild, StatusQueued, StatusDelayed, StatusBuilding, StatusLatest, StatusSigning, StatusUnknown:
|
case StatusSkipped, StatusFailed, StatusBuilt, StatusQueued, StatusDelayed, StatusBuilding, StatusLatest, StatusSigning, StatusUnknown:
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("dbpackage: invalid enum value for status field: %q", s)
|
return fmt.Errorf("dbpackage: invalid enum value for status field: %q", s)
|
||||||
|
@@ -7,6 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
|
"entgo.io/ent"
|
||||||
"entgo.io/ent/dialect/sql"
|
"entgo.io/ent/dialect/sql"
|
||||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||||
"entgo.io/ent/schema/field"
|
"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.
|
// First returns the first DBPackage entity from the query.
|
||||||
// Returns a *NotFoundError when no DBPackage was found.
|
// Returns a *NotFoundError when no DBPackage was found.
|
||||||
func (dpq *DBPackageQuery) First(ctx context.Context) (*DBPackage, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -84,7 +85,7 @@ func (dpq *DBPackageQuery) FirstX(ctx context.Context) *DBPackage {
|
|||||||
// Returns a *NotFoundError when no DBPackage ID was found.
|
// Returns a *NotFoundError when no DBPackage ID was found.
|
||||||
func (dpq *DBPackageQuery) FirstID(ctx context.Context) (id int, err error) {
|
func (dpq *DBPackageQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||||
var ids []int
|
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
|
return
|
||||||
}
|
}
|
||||||
if len(ids) == 0 {
|
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 *NotSingularError when more than one DBPackage entity is found.
|
||||||
// Returns a *NotFoundError when no DBPackage entities are found.
|
// Returns a *NotFoundError when no DBPackage entities are found.
|
||||||
func (dpq *DBPackageQuery) Only(ctx context.Context) (*DBPackage, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -135,7 +136,7 @@ func (dpq *DBPackageQuery) OnlyX(ctx context.Context) *DBPackage {
|
|||||||
// Returns a *NotFoundError when no entities are found.
|
// Returns a *NotFoundError when no entities are found.
|
||||||
func (dpq *DBPackageQuery) OnlyID(ctx context.Context) (id int, err error) {
|
func (dpq *DBPackageQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||||
var ids []int
|
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
|
return
|
||||||
}
|
}
|
||||||
switch len(ids) {
|
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.
|
// All executes the query and returns a list of DBPackages.
|
||||||
func (dpq *DBPackageQuery) All(ctx context.Context) ([]*DBPackage, error) {
|
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 {
|
if err := dpq.prepareQuery(ctx); err != nil {
|
||||||
return nil, err
|
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 {
|
if dpq.ctx.Unique == nil && dpq.path != nil {
|
||||||
dpq.Unique(true)
|
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 {
|
if err = dpq.Select(dbpackage.FieldID).Scan(ctx, &ids); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -200,7 +201,7 @@ func (dpq *DBPackageQuery) IDsX(ctx context.Context) []int {
|
|||||||
|
|
||||||
// Count returns the count of the given query.
|
// Count returns the count of the given query.
|
||||||
func (dpq *DBPackageQuery) Count(ctx context.Context) (int, error) {
|
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 {
|
if err := dpq.prepareQuery(ctx); err != nil {
|
||||||
return 0, err
|
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.
|
// Exist returns true if the query has elements in the graph.
|
||||||
func (dpq *DBPackageQuery) Exist(ctx context.Context) (bool, error) {
|
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); {
|
switch _, err := dpq.FirstID(ctx); {
|
||||||
case IsNotFound(err):
|
case IsNotFound(err):
|
||||||
return false, nil
|
return false, nil
|
||||||
@@ -251,8 +252,9 @@ func (dpq *DBPackageQuery) Clone() *DBPackageQuery {
|
|||||||
inters: append([]Interceptor{}, dpq.inters...),
|
inters: append([]Interceptor{}, dpq.inters...),
|
||||||
predicates: append([]predicate.DBPackage{}, dpq.predicates...),
|
predicates: append([]predicate.DBPackage{}, dpq.predicates...),
|
||||||
// clone intermediate query.
|
// clone intermediate query.
|
||||||
sql: dpq.sql.Clone(),
|
sql: dpq.sql.Clone(),
|
||||||
path: dpq.path,
|
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.
|
// Scan applies the selector query and scans the result into the given value.
|
||||||
func (dpgb *DBPackageGroupBy) Scan(ctx context.Context, v any) error {
|
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 {
|
if err := dpgb.build.prepareQuery(ctx); err != nil {
|
||||||
return err
|
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.
|
// Scan applies the selector query and scans the result into the given value.
|
||||||
func (dps *DBPackageSelect) Scan(ctx context.Context, v any) error {
|
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 {
|
if err := dps.prepareQuery(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@@ -94,6 +94,14 @@ func (dpu *DBPackageUpdate) SetRepository(d dbpackage.Repository) *DBPackageUpda
|
|||||||
return dpu
|
return dpu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableRepository sets the "repository" field if the given value is not nil.
|
||||||
|
func (dpu *DBPackageUpdate) SetNillableRepository(d *dbpackage.Repository) *DBPackageUpdate {
|
||||||
|
if d != nil {
|
||||||
|
dpu.SetRepository(*d)
|
||||||
|
}
|
||||||
|
return dpu
|
||||||
|
}
|
||||||
|
|
||||||
// SetVersion sets the "version" field.
|
// SetVersion sets the "version" field.
|
||||||
func (dpu *DBPackageUpdate) SetVersion(s string) *DBPackageUpdate {
|
func (dpu *DBPackageUpdate) SetVersion(s string) *DBPackageUpdate {
|
||||||
dpu.mutation.SetVersion(s)
|
dpu.mutation.SetVersion(s)
|
||||||
@@ -695,6 +703,14 @@ func (dpuo *DBPackageUpdateOne) SetRepository(d dbpackage.Repository) *DBPackage
|
|||||||
return dpuo
|
return dpuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableRepository sets the "repository" field if the given value is not nil.
|
||||||
|
func (dpuo *DBPackageUpdateOne) SetNillableRepository(d *dbpackage.Repository) *DBPackageUpdateOne {
|
||||||
|
if d != nil {
|
||||||
|
dpuo.SetRepository(*d)
|
||||||
|
}
|
||||||
|
return dpuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetVersion sets the "version" field.
|
// SetVersion sets the "version" field.
|
||||||
func (dpuo *DBPackageUpdateOne) SetVersion(s string) *DBPackageUpdateOne {
|
func (dpuo *DBPackageUpdateOne) SetVersion(s string) *DBPackageUpdateOne {
|
||||||
dpuo.mutation.SetVersion(s)
|
dpuo.mutation.SetVersion(s)
|
||||||
|
@@ -69,7 +69,7 @@ var (
|
|||||||
columnCheck sql.ColumnCheck
|
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 {
|
func checkColumn(table, column string) error {
|
||||||
initCheck.Do(func() {
|
initCheck.Do(func() {
|
||||||
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
|
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
|
||||||
|
@@ -13,7 +13,7 @@ var (
|
|||||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||||
{Name: "pkgbase", Type: field.TypeString},
|
{Name: "pkgbase", Type: field.TypeString},
|
||||||
{Name: "packages", Type: field.TypeJSON, Nullable: true},
|
{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: "skip_reason", Type: field.TypeString, Nullable: true},
|
||||||
{Name: "repository", Type: field.TypeEnum, Enums: []string{"extra", "core", "multilib"}},
|
{Name: "repository", Type: field.TypeEnum, Enums: []string{"extra", "core", "multilib"}},
|
||||||
{Name: "march", Type: field.TypeString},
|
{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
|
// The schema-stitching logic is generated in somegit.dev/ALHP/ALHP.GO/ent/runtime.go
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "v0.12.4" // Version of ent codegen.
|
Version = "v0.14.2" // Version of ent codegen.
|
||||||
Sum = "h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8=" // Sum of ent codegen.
|
Sum = "h1:ywld/j2Rx4EmnIKs8eZ29cbFA1zpB+DA9TLL5l3rlq0=" // Sum of ent codegen.
|
||||||
)
|
)
|
||||||
|
@@ -15,7 +15,7 @@ func (DBPackage) Fields() []ent.Field {
|
|||||||
return []ent.Field{
|
return []ent.Field{
|
||||||
field.String("pkgbase").NotEmpty().Immutable(),
|
field.String("pkgbase").NotEmpty().Immutable(),
|
||||||
field.Strings("packages").Optional(),
|
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(),
|
"latest", "signing", "unknown").Default("unknown").Optional(),
|
||||||
field.String("skip_reason").Optional(),
|
field.String("skip_reason").Optional(),
|
||||||
field.Enum("repository").Values("extra", "core", "multilib"),
|
field.Enum("repository").Values("extra", "core", "multilib"),
|
||||||
|
16
flags.yaml
16
flags.yaml
@@ -20,15 +20,19 @@ common:
|
|||||||
packager: "ALHP $march$ <alhp@harting.dev>"
|
packager: "ALHP $march$ <alhp@harting.dev>"
|
||||||
makeflags: "-j$buildproc$"
|
makeflags: "-j$buildproc$"
|
||||||
# https://somegit.dev/ALHP/ALHP.GO/issues/110
|
# https://somegit.dev/ALHP/ALHP.GO/issues/110
|
||||||
rustflags: "-Copt-level=3 -Ctarget-cpu=$march$ -Clink-arg=-Wl,-z,pack-relative-relocs"
|
rustflags:
|
||||||
|
- "-Copt-level=3"
|
||||||
|
- "-Ctarget-cpu=$march$"
|
||||||
|
- "-Clink-arg=-z"
|
||||||
|
- "-Clink-arg=pack-relative-relocs"
|
||||||
ltoflags:
|
ltoflags:
|
||||||
- "-falign-functions=32" # https://github.com/InBetweenNames/gentooLTO/issues/164
|
- "-falign-functions=32" # https://github.com/InBetweenNames/gentooLTO/issues/164
|
||||||
kcflags: " -march=$march$ -O3"
|
kcflags: " -march=$march$ -O3"
|
||||||
kcppflags: " -march=$march$ -O3"
|
kcppflags: " -march=$march$ -O3"
|
||||||
fcflags: "$CFLAGS"
|
fcflags: "$FFLAGS"
|
||||||
fflags: "$CFLAGS"
|
fflags:
|
||||||
ldflags:
|
- "-O2": "-O3"
|
||||||
- "-z,pack-relative-relocs"
|
- "-march=$march$"
|
||||||
|
|
||||||
lto:
|
lto:
|
||||||
rustflags:
|
rustflags:
|
||||||
@@ -37,4 +41,4 @@ lto:
|
|||||||
options:
|
options:
|
||||||
- "!lto": "lto"
|
- "!lto": "lto"
|
||||||
|
|
||||||
cargo_profile_release_lto: "fat"
|
cargo_profile_release_lto: "fat"
|
||||||
|
60
go.mod
60
go.mod
@@ -1,42 +1,58 @@
|
|||||||
module somegit.dev/ALHP/ALHP.GO
|
module somegit.dev/ALHP/ALHP.GO
|
||||||
|
|
||||||
go 1.20
|
go 1.23.0
|
||||||
|
|
||||||
|
toolchain go1.23.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
entgo.io/ent v0.12.4
|
entgo.io/ent v0.14.3
|
||||||
github.com/Jguer/go-alpm/v2 v2.2.1
|
github.com/Jguer/go-alpm/v2 v2.2.2
|
||||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
|
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
|
||||||
github.com/Morganamilo/go-srcinfo v1.0.0
|
github.com/Morganamilo/go-srcinfo v1.0.0
|
||||||
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b
|
github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500
|
||||||
github.com/google/uuid v1.3.1
|
github.com/gobwas/glob v0.2.3
|
||||||
github.com/jackc/pgx/v4 v4.18.1
|
github.com/google/uuid v1.6.0
|
||||||
github.com/otiai10/copy v1.14.0
|
github.com/jackc/pgx/v4 v4.18.3
|
||||||
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/sirupsen/logrus v1.9.3
|
||||||
github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117
|
github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
ariga.io/atlas v0.14.2 // indirect
|
ariga.io/atlas v0.32.0 // indirect
|
||||||
github.com/agext/levenshtein v1.2.3 // indirect
|
github.com/agext/levenshtein v1.2.3 // indirect
|
||||||
github.com/apparentlymart/go-textseg/v15 v15.0.0 // 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/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
|
||||||
github.com/go-openapi/inflect v0.19.0 // indirect
|
github.com/go-openapi/inflect v0.21.1 // indirect
|
||||||
github.com/google/go-cmp v0.6.0 // indirect
|
github.com/google/go-cmp v0.7.0 // indirect
|
||||||
github.com/hashicorp/hcl/v2 v2.18.1 // indirect
|
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
|
||||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
||||||
github.com/jackc/pgconn v1.14.1 // indirect
|
github.com/jackc/pgconn v1.14.3 // indirect
|
||||||
github.com/jackc/pgio v1.0.0 // indirect
|
github.com/jackc/pgio v1.0.0 // indirect
|
||||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||||
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
|
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
|
||||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||||
github.com/jackc/pgtype v1.14.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/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||||
github.com/zclconf/go-cty v1.14.1 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
golang.org/x/crypto v0.14.0 // indirect
|
github.com/otiai10/mint v1.6.3 // indirect
|
||||||
golang.org/x/mod v0.13.0 // indirect
|
github.com/prometheus/client_model v0.6.1 // indirect
|
||||||
golang.org/x/sync v0.4.0 // indirect
|
github.com/prometheus/common v0.63.0 // indirect
|
||||||
golang.org/x/sys v0.13.0 // indirect
|
github.com/prometheus/procfs v0.15.1 // indirect
|
||||||
golang.org/x/text v0.13.0 // 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
|
||||||
)
|
)
|
||||||
|
178
go.sum
178
go.sum
@@ -1,11 +1,16 @@
|
|||||||
ariga.io/atlas v0.14.2 h1:efxCuSGnDuhx7xm4JaqImR6xd+PqyizgGy5u/XUEI/g=
|
ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83 h1:nX4HXncwIdvQ8/8sIUIf1nyCkK8qdBaHQ7EtzPpuiGE=
|
||||||
ariga.io/atlas v0.14.2/go.mod h1:isZrlzJ5cpoCoKFoY9knZug7Lq4pP1cm8g3XciLZ0Pw=
|
ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83/go.mod h1:Oe1xWPuu5q9LzyrWfbZmEZxFYeu4BHTyzfjeW2aZp/w=
|
||||||
entgo.io/ent v0.12.4 h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8=
|
ariga.io/atlas v0.32.0 h1:y+77nueMrExLiKlz1CcPKh/nU7VSlWfBbwCShsJyvCw=
|
||||||
entgo.io/ent v0.12.4/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q=
|
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/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 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||||
github.com/Jguer/go-alpm/v2 v2.2.1 h1:PMIRKo2lY0wfhN8W8Scc5v82zQeDsTv702CuDiz81sA=
|
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||||
github.com/Jguer/go-alpm/v2 v2.2.1/go.mod h1:lfe8gSe83F/KERaQvEfrSqQ4n+8bES+ZIyKWR/gm3MI=
|
github.com/Jguer/go-alpm/v2 v2.2.2 h1:sPwUoZp1X5Tw6K6Ba1lWvVJfcgVNEGVcxARLBttZnC0=
|
||||||
|
github.com/Jguer/go-alpm/v2 v2.2.2/go.mod h1:lfe8gSe83F/KERaQvEfrSqQ4n+8bES+ZIyKWR/gm3MI=
|
||||||
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
|
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
|
||||||
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
|
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
|
||||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5 h1:TMscPjkb1ThXN32LuFY5bEYIcXZx3YlwzhS1GxNpn/c=
|
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5 h1:TMscPjkb1ThXN32LuFY5bEYIcXZx3YlwzhS1GxNpn/c=
|
||||||
@@ -16,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/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 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
|
||||||
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
|
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
|
||||||
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b h1:6+ZFm0flnudZzdSE0JxlhR2hKnGPcNB35BjQf4RYQDY=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M=
|
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 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
|
||||||
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
|
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=
|
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
@@ -30,19 +41,25 @@ 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=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||||
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
|
github.com/go-openapi/inflect v0.21.0 h1:FoBjBTQEcbg2cJUWX6uwL9OyIW8eqc9k4KhN4lfbeYk=
|
||||||
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
|
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-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 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
|
||||||
|
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||||
|
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 h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
|
||||||
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
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.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
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/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/hashicorp/hcl/v2 v2.18.1 h1:6nxnOJFku1EuSawSD81fuviYUV8DxFr3fp2dUi3ZYSo=
|
github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos=
|
||||||
github.com/hashicorp/hcl/v2 v2.18.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE=
|
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 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.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
|
||||||
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
|
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
|
||||||
@@ -53,9 +70,8 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU
|
|||||||
github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o=
|
github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o=
|
||||||
github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY=
|
github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY=
|
||||||
github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI=
|
github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI=
|
||||||
github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E=
|
github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w=
|
||||||
github.com/jackc/pgconn v1.14.1 h1:smbxIaZA08n6YuxEX1sDyjV/qkbtUtkH20qLkR9MUR4=
|
github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM=
|
||||||
github.com/jackc/pgconn v1.14.1/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E=
|
|
||||||
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
|
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
|
||||||
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
|
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
|
||||||
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
|
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
|
||||||
@@ -64,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/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 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
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 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.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=
|
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
|
||||||
@@ -71,37 +88,49 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW
|
|||||||
github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
|
github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
|
||||||
github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
||||||
github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
||||||
github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0=
|
github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag=
|
||||||
github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
||||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
|
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
|
||||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
|
|
||||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||||
github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
|
github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
|
||||||
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
|
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
|
||||||
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
|
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.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM=
|
||||||
github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw=
|
|
||||||
github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
|
github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
|
||||||
|
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-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-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=
|
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
|
||||||
github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs=
|
github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs=
|
||||||
github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0=
|
github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw=
|
||||||
github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE=
|
github.com/jackc/pgx/v4 v4.18.3 h1:dE2/TrEsGX3RBprb3qryqSV9Y60iZN1C6i8IrmW9/BA=
|
||||||
|
github.com/jackc/pgx/v4 v4.18.3/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw=
|
||||||
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||||
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
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.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||||
github.com/jackc/puddle v1.3.0/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/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.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/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
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.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
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.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 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
|
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.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.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
@@ -113,23 +142,40 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
|
|||||||
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||||
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
|
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
|
||||||
|
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 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
|
||||||
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
|
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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||||
github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w=
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||||
github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks=
|
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 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
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.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
|
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/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.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
|
||||||
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
|
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/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||||
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
|
github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=
|
||||||
github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec=
|
github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas=
|
||||||
github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw=
|
|
||||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
|
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 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
|
||||||
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||||
@@ -150,12 +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.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.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.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
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 h1:67A5tweHp3C7osHjrYsy6pQZ00bYkTTttZ7kiOwwHeA=
|
||||||
github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117/go.mod h1:XCsSkdKK4gwBMNrOCZWww0pX6AOt+2gYc5Z6jBRrNVg=
|
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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
|
github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70=
|
||||||
github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
|
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=
|
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.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=
|
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||||
@@ -178,15 +229,21 @@ golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWP
|
|||||||
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||||
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
|
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
|
||||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
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/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.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.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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
|
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/mod v0.13.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-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-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
@@ -194,10 +251,15 @@ golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLL
|
|||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
|
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||||
|
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-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.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
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-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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@@ -214,12 +276,18 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.17.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-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-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||||
|
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||||
|
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
@@ -227,8 +295,12 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
|
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-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-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
@@ -239,14 +311,24 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn
|
|||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
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.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.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-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-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-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-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/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 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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-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/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/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=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
106
housekeeping.go
106
housekeeping.go
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"somegit.dev/ALHP/ALHP.GO/ent"
|
"somegit.dev/ALHP/ALHP.GO/ent"
|
||||||
"somegit.dev/ALHP/ALHP.GO/ent/dbpackage"
|
"somegit.dev/ALHP/ALHP.GO/ent/dbpackage"
|
||||||
@@ -12,7 +13,7 @@ import (
|
|||||||
"time"
|
"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()
|
defer wg.Done()
|
||||||
fullRepo := repo + "-" + march
|
fullRepo := repo + "-" + march
|
||||||
log.Debugf("[%s] start housekeeping", fullRepo)
|
log.Debugf("[%s] start housekeeping", fullRepo)
|
||||||
@@ -25,7 +26,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
for _, path := range packages {
|
for _, path := range packages {
|
||||||
mPackage := Package(path)
|
mPackage := Package(path)
|
||||||
|
|
||||||
dbPkg, err := mPackage.DBPackage(db)
|
dbPkg, err := mPackage.DBPackage(ctx, db)
|
||||||
if ent.IsNotFound(err) {
|
if ent.IsNotFound(err) {
|
||||||
log.Infof("[HK] removing orphan %s->%s", fullRepo, filepath.Base(path))
|
log.Infof("[HK] removing orphan %s->%s", fullRepo, filepath.Base(path))
|
||||||
pkg := &ProtoPackage{
|
pkg := &ProtoPackage{
|
||||||
@@ -57,16 +58,38 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
buildManager.alpmMutex.Lock()
|
buildManager.alpmMutex.Lock()
|
||||||
pkgResolved, err := dbs.FindSatisfier(mPackage.Name())
|
pkgResolved, err := dbs.FindSatisfier(mPackage.Name())
|
||||||
buildManager.alpmMutex.Unlock()
|
buildManager.alpmMutex.Unlock()
|
||||||
if err != nil || pkgResolved.DB().Name() != pkg.DBPackage.Repository.String() || pkgResolved.DB().Name() != pkg.Repo.String() ||
|
if err != nil ||
|
||||||
pkgResolved.Architecture() != pkg.Arch || pkgResolved.Name() != mPackage.Name() {
|
pkgResolved.DB().Name() != pkg.DBPackage.Repository.String() ||
|
||||||
|
pkgResolved.DB().Name() != pkg.Repo.String() ||
|
||||||
|
pkgResolved.Architecture() != pkg.Arch ||
|
||||||
|
pkgResolved.Name() != mPackage.Name() ||
|
||||||
|
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)
|
||||||
|
case pkgResolved.DB().Name() != pkg.DBPackage.Repository.String():
|
||||||
|
log.Infof("[HK] %s->%s not included in repo (repo mismatch: repo:%s != db:%s)", pkg.FullRepo,
|
||||||
|
mPackage.Name(), pkgResolved.DB().Name(), pkg.DBPackage.Repository.String())
|
||||||
|
case pkgResolved.DB().Name() != pkg.Repo.String():
|
||||||
|
log.Infof("[HK] %s->%s not included in repo (repo mismatch: repo:%s != pkg:%s)", pkg.FullRepo,
|
||||||
|
mPackage.Name(), pkgResolved.DB().Name(), pkg.Repo.String())
|
||||||
|
case pkgResolved.Architecture() != pkg.Arch:
|
||||||
|
log.Infof("[HK] %s->%s not included in repo (arch mismatch: repo:%s != pkg:%s)", pkg.FullRepo,
|
||||||
|
mPackage.Name(), pkgResolved.Architecture(), pkg.Arch)
|
||||||
|
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 MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages):
|
||||||
|
log.Infof("[HK] %s->%s not included in repo (blacklisted pkgbase %s)", pkg.FullRepo, mPackage.Name(), pkg.Pkgbase)
|
||||||
|
}
|
||||||
|
|
||||||
// package not found on mirror/db -> not part of any repo anymore
|
// package not found on mirror/db -> not part of any repo anymore
|
||||||
log.Infof("[HK] %s->%s not included in repo", pkg.FullRepo, mPackage.Name())
|
|
||||||
err = pkg.findPkgFiles()
|
err = pkg.findPkgFiles()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("[HK] %s->%s unable to get pkg-files: %v", pkg.FullRepo, mPackage.Name(), err)
|
log.Errorf("[HK] %s->%s unable to get pkg-files: %v", pkg.FullRepo, mPackage.Name(), err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err = db.DBPackage.DeleteOne(pkg.DBPackage).Exec(context.Background())
|
err = db.DBPackage.DeleteOne(pkg.DBPackage).Exec(ctx)
|
||||||
pkg.DBPackage = nil
|
pkg.DBPackage = nil
|
||||||
buildManager.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
buildManager.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -76,7 +99,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pkg.DBPackage.LastVerified.Before(pkg.DBPackage.BuildTimeStart) {
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -124,7 +147,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
DBPackage: dbPkg,
|
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)
|
log.Infof("[HK] %s->%s not found on mirror, removing", pkg.FullRepo, pkg.Pkgbase)
|
||||||
err = db.DBPackage.DeleteOne(dbPkg).Exec(context.Background())
|
err = db.DBPackage.DeleteOne(dbPkg).Exec(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -138,9 +161,11 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
// check lastVersionBuild
|
// check lastVersionBuild
|
||||||
if dbPkg.LastVersionBuild != dbPkg.RepoVersion {
|
if dbPkg.LastVersionBuild != dbPkg.RepoVersion {
|
||||||
log.Infof("[HK] %s->%s updating lastVersionBuild %s -> %s", fullRepo, dbPkg.Pkgbase, 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 {
|
if err != nil {
|
||||||
log.Warningf("[HK] error updating lastVersionBuild for %s->%s: %v", fullRepo, dbPkg.Pkgbase, err)
|
log.Warningf("[HK] error updating lastVersionBuild for %s->%s: %v", fullRepo, dbPkg.Pkgbase, err)
|
||||||
|
} else {
|
||||||
|
dbPkg = nDBPkg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +190,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
ClearRepoVersion().
|
ClearRepoVersion().
|
||||||
ClearTagRev().
|
ClearTagRev().
|
||||||
SetStatus(dbpackage.StatusQueued).
|
SetStatus(dbpackage.StatusQueued).
|
||||||
Save(context.Background())
|
Save(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -178,20 +203,54 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
}
|
}
|
||||||
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
|
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rawState, err := os.ReadFile(filepath.Join(conf.Basedir.Work, stateDir, dbPkg.Repository.String()+"-"+conf.Arch, dbPkg.Pkgbase))
|
||||||
|
if err != nil {
|
||||||
|
log.Infof("[HK] state not found for %s->%s: %v, removing package", fullRepo, dbPkg.Pkgbase, err)
|
||||||
|
pkg := &ProtoPackage{
|
||||||
|
FullRepo: fullRepo,
|
||||||
|
PkgFiles: existingSplits,
|
||||||
|
March: march,
|
||||||
|
DBPackage: dbPkg,
|
||||||
|
}
|
||||||
|
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
state, err := parseState(string(rawState))
|
||||||
|
if err != nil {
|
||||||
|
log.Warningf("[HK] error parsing state file for %s->%s: %v", fullRepo, dbPkg.Pkgbase, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
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(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
case dbPkg.Status == dbpackage.StatusLatest && dbPkg.RepoVersion == "":
|
case dbPkg.Status == dbpackage.StatusLatest && dbPkg.RepoVersion == "":
|
||||||
log.Infof("[HK] reseting missing package %s->%s with no repo version", fullRepo, dbPkg.Pkgbase)
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.RepoVersion != "" && strings.HasPrefix(dbPkg.SkipReason, "blacklisted"):
|
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.RepoVersion != "" && !strings.HasPrefix(dbPkg.SkipReason, "delayed"):
|
||||||
log.Infof("[HK] delete blacklisted package %s->%s", fullRepo, dbPkg.Pkgbase)
|
log.Infof("[HK] delete skipped package %s->%s", fullRepo, dbPkg.Pkgbase)
|
||||||
pkg := &ProtoPackage{
|
pkg := &ProtoPackage{
|
||||||
FullRepo: fullRepo,
|
FullRepo: fullRepo,
|
||||||
March: march,
|
March: march,
|
||||||
DBPackage: dbPkg,
|
DBPackage: dbPkg,
|
||||||
}
|
}
|
||||||
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
|
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 != "":
|
case dbPkg.Status == dbpackage.StatusFailed && dbPkg.RepoVersion != "":
|
||||||
log.Infof("[HK] package %s->%s failed but still present in repo, removing", fullRepo, dbPkg.Pkgbase)
|
log.Infof("[HK] package %s->%s failed but still present in repo, removing", fullRepo, dbPkg.Pkgbase)
|
||||||
pkg := &ProtoPackage{
|
pkg := &ProtoPackage{
|
||||||
@@ -207,7 +266,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
|||||||
return nil
|
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
|
// check if package for log exists and if error can be fixed by rebuild
|
||||||
logFiles, err := Glob(filepath.Join(conf.Basedir.Repo, logDir, "/**/*.log"))
|
logFiles, err := Glob(filepath.Join(conf.Basedir.Repo, logDir, "/**/*.log"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -236,7 +295,7 @@ func logHK() error {
|
|||||||
dbpackage.Pkgbase(pkg.Pkgbase),
|
dbpackage.Pkgbase(pkg.Pkgbase),
|
||||||
dbpackage.March(pkg.March),
|
dbpackage.March(pkg.March),
|
||||||
dbpackage.StatusEQ(dbpackage.StatusSkipped),
|
dbpackage.StatusEQ(dbpackage.StatusSkipped),
|
||||||
).Exist(context.Background())
|
).Exist(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -255,7 +314,7 @@ func logHK() error {
|
|||||||
if rePortError.MatchString(sLogContent) || reSigError.MatchString(sLogContent) || reDownloadError.MatchString(sLogContent) ||
|
if rePortError.MatchString(sLogContent) || reSigError.MatchString(sLogContent) || reDownloadError.MatchString(sLogContent) ||
|
||||||
reDownloadError2.MatchString(sLogContent) {
|
reDownloadError2.MatchString(sLogContent) {
|
||||||
rows, err := db.DBPackage.Update().Where(dbpackage.Pkgbase(pkg.Pkgbase), dbpackage.March(pkg.March),
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -269,7 +328,7 @@ func logHK() error {
|
|||||||
dbpackage.March(pkg.March),
|
dbpackage.March(pkg.March),
|
||||||
dbpackage.StatusEQ(dbpackage.StatusFailed),
|
dbpackage.StatusEQ(dbpackage.StatusFailed),
|
||||||
dbpackage.LtoNotIn(dbpackage.LtoAutoDisabled, dbpackage.LtoDisabled),
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -281,3 +340,16 @@ func logHK() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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")
|
||||||
|
res, err := cleanCmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
log.Warningf("[DHK/%s] cleanup debug packages failed: %v (%s)", march, err, string(res))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
17
main.go
17
main.go
@@ -27,6 +27,7 @@ var (
|
|||||||
db *ent.Client
|
db *ent.Client
|
||||||
journalLog = flag.Bool("journal", false, "Log to systemd journal instead of stdout")
|
journalLog = flag.Bool("journal", false, "Log to systemd journal instead of stdout")
|
||||||
checkInterval = flag.Int("interval", 5, "How often svn2git should be checked in minutes (default: 5)")
|
checkInterval = flag.Int("interval", 5, "How often svn2git should be checked in minutes (default: 5)")
|
||||||
|
configFile = flag.String("config", "config.yaml", "set config file name/path")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -38,7 +39,7 @@ func main() {
|
|||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
confStr, err := os.ReadFile("config.yaml")
|
confStr, err := os.ReadFile(*configFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("error reading config file: %v", err)
|
log.Fatalf("error reading config file: %v", err)
|
||||||
}
|
}
|
||||||
@@ -85,7 +86,8 @@ func main() {
|
|||||||
}(db)
|
}(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)
|
log.Panicf("automigrate failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,11 +101,13 @@ func main() {
|
|||||||
repoWG: new(sync.WaitGroup),
|
repoWG: new(sync.WaitGroup),
|
||||||
}
|
}
|
||||||
|
|
||||||
err = setupChroot()
|
buildManager.setupMetrics(conf.Metrics.Port)
|
||||||
|
|
||||||
|
err = setupChroot(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("unable to setup chroot: %v", err)
|
log.Panicf("unable to setup chroot: %v", err)
|
||||||
}
|
}
|
||||||
err = syncMarchs()
|
err = syncMarchs(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("error syncing marchs: %v", err)
|
log.Panicf("error syncing marchs: %v", err)
|
||||||
}
|
}
|
||||||
@@ -114,12 +118,9 @@ func main() {
|
|||||||
log.Panicf("error while ALPM-init: %v", err)
|
log.Panicf("error while ALPM-init: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
_ = buildManager.syncWorker(ctx)
|
_ = buildManager.syncWorker(ctx)
|
||||||
}()
|
}()
|
||||||
go buildManager.htmlWorker(ctx)
|
|
||||||
|
|
||||||
killLoop:
|
killLoop:
|
||||||
for {
|
for {
|
||||||
@@ -127,7 +128,7 @@ killLoop:
|
|||||||
case <-killSignals:
|
case <-killSignals:
|
||||||
break killLoop
|
break killLoop
|
||||||
case <-reloadSignals:
|
case <-reloadSignals:
|
||||||
confStr, err := os.ReadFile("config.yaml")
|
confStr, err := os.ReadFile(*configFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("unable to open config: %v", err)
|
log.Panicf("unable to open config: %v", err)
|
||||||
}
|
}
|
||||||
|
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
|
// DBPackage returns ent.DBPackage for package
|
||||||
func (pkg Package) DBPackage(db *ent.Client) (*ent.DBPackage, error) {
|
func (pkg Package) DBPackage(ctx context.Context, db *ent.Client) (*ent.DBPackage, error) {
|
||||||
return pkg.DBPackageIsolated(*pkg.MArch(), pkg.Repo(), db)
|
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
|
// 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) {
|
dbPkg, err := db.DBPackage.Query().Where(func(s *sql.Selector) {
|
||||||
s.Where(
|
s.Where(
|
||||||
sql.And(
|
sql.And(
|
||||||
@@ -83,7 +83,7 @@ func (pkg Package) DBPackageIsolated(march string, repo dbpackage.Repository, db
|
|||||||
sql.EQ(dbpackage.FieldMarch, march),
|
sql.EQ(dbpackage.FieldMarch, march),
|
||||||
sql.EQ(dbpackage.FieldRepository, repo)),
|
sql.EQ(dbpackage.FieldRepository, repo)),
|
||||||
)
|
)
|
||||||
}).Only(context.Background())
|
}).Only(ctx)
|
||||||
if ent.IsNotFound(err) {
|
if ent.IsNotFound(err) {
|
||||||
log.Debugf("not found in database: %s", pkg.Name())
|
log.Debugf("not found in database: %s", pkg.Name())
|
||||||
return nil, err
|
return nil, err
|
||||||
|
149
proto_package.go
149
proto_package.go
@@ -50,19 +50,28 @@ func (p *ProtoPackage) isEligible(ctx context.Context) bool {
|
|||||||
p.DBPackage.SkipReason = "arch = any"
|
p.DBPackage.SkipReason = "arch = any"
|
||||||
p.DBPackage.Status = dbpackage.StatusSkipped
|
p.DBPackage.Status = dbpackage.StatusSkipped
|
||||||
skipping = true
|
skipping = true
|
||||||
case Contains(conf.Blacklist.Packages, p.Pkgbase):
|
case MatchGlobList(p.Pkgbase, conf.Blacklist.Packages):
|
||||||
log.Debugf("skipped %s: blacklisted package", p.Pkgbase)
|
log.Debugf("skipped %s: package on no-build list", p.Pkgbase)
|
||||||
p.DBPackage.SkipReason = "blacklisted"
|
p.DBPackage.SkipReason = "blacklisted"
|
||||||
p.DBPackage.Status = dbpackage.StatusSkipped
|
p.DBPackage.Status = dbpackage.StatusSkipped
|
||||||
skipping = true
|
skipping = true
|
||||||
case p.DBPackage.MaxRss != nil && datasize.ByteSize(*p.DBPackage.MaxRss)*datasize.KB > conf.Build.MemoryLimit:
|
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)
|
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.SkipReason = "memory limit exceeded"
|
||||||
p.DBPackage.Status = dbpackage.StatusSkipped
|
p.DBPackage.Status = dbpackage.StatusSkipped
|
||||||
skipping = true
|
skipping = true
|
||||||
case p.isPkgFailed():
|
case p.isPkgFailed():
|
||||||
log.Debugf("skipped %s: failed build", p.Pkgbase)
|
log.Debugf("skipped %s: failed build", p.Pkgbase)
|
||||||
skipping = true
|
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 {
|
if skipping {
|
||||||
@@ -79,7 +88,7 @@ func (p *ProtoPackage) isEligible(ctx context.Context) bool {
|
|||||||
repoVer, err := p.repoVersion()
|
repoVer, err := p.repoVersion()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.DBPackage = p.DBPackage.Update().ClearRepoVersion().SaveX(ctx)
|
p.DBPackage = p.DBPackage.Update().ClearRepoVersion().SaveX(ctx)
|
||||||
} else if err == nil && alpm.VerCmp(repoVer, p.Version) > 0 {
|
} else if alpm.VerCmp(repoVer, p.Version) > 0 {
|
||||||
log.Debugf("skipped %s: version in repo higher than in PKGBUILD (%s < %s)", p.Pkgbase, p.Version, repoVer)
|
log.Debugf("skipped %s: version in repo higher than in PKGBUILD (%s < %s)", p.Pkgbase, p.Version, repoVer)
|
||||||
p.DBPackage = p.DBPackage.Update().SetStatus(dbpackage.StatusLatest).ClearSkipReason().SetTagRev(p.State.TagRev).SaveX(ctx)
|
p.DBPackage = p.DBPackage.Update().SetStatus(dbpackage.StatusLatest).ClearSkipReason().SetTagRev(p.State.TagRev).SaveX(ctx)
|
||||||
return false
|
return false
|
||||||
@@ -92,7 +101,7 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
|||||||
start := time.Now().UTC()
|
start := time.Now().UTC()
|
||||||
chroot := "build_" + uuid.New().String()
|
chroot := "build_" + uuid.New().String()
|
||||||
|
|
||||||
buildFolder, err := p.setupBuildDir()
|
buildFolder, err := p.setupBuildDir(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return time.Since(start), fmt.Errorf("error setting up build folder: %w", err)
|
return time.Since(start), fmt.Errorf("error setting up build folder: %w", err)
|
||||||
}
|
}
|
||||||
@@ -122,14 +131,16 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
|||||||
|
|
||||||
isLatest, local, syncVersion, err := p.isMirrorLatest(alpmHandle)
|
isLatest, local, syncVersion, err := p.isMirrorLatest(alpmHandle)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch err.(type) {
|
var multipleStateFilesError MultipleStateFilesError
|
||||||
|
var unableToSatisfyError UnableToSatisfyError
|
||||||
|
switch {
|
||||||
default:
|
default:
|
||||||
return time.Since(start), fmt.Errorf("error solving deps: %w", err)
|
return time.Since(start), fmt.Errorf("error solving deps: %w", err)
|
||||||
case MultipleStateFilesError:
|
case errors.As(err, &multipleStateFilesError):
|
||||||
log.Infof("skipped %s: multiple PKGBUILDs for dependency found: %v", p.Srcinfo.Pkgbase, err)
|
log.Infof("skipped %s: multiple PKGBUILDs for dependency found: %v", p.Srcinfo.Pkgbase, err)
|
||||||
p.DBPackage = p.DBPackage.Update().SetStatus(dbpackage.StatusSkipped).SetSkipReason("multiple PKGBUILD for dep. found").SaveX(ctx)
|
p.DBPackage = p.DBPackage.Update().SetStatus(dbpackage.StatusSkipped).SetSkipReason("multiple PKGBUILD for dep. found").SaveX(ctx)
|
||||||
return time.Since(start), err
|
return time.Since(start), err
|
||||||
case UnableToSatisfyError:
|
case errors.As(err, &unableToSatisfyError):
|
||||||
log.Infof("skipped %s: unable to resolve dependencies: %v", p.Srcinfo.Pkgbase, err)
|
log.Infof("skipped %s: unable to resolve dependencies: %v", p.Srcinfo.Pkgbase, err)
|
||||||
p.DBPackage = p.DBPackage.Update().SetStatus(dbpackage.StatusSkipped).SetSkipReason("unable to resolve dependencies").SaveX(ctx)
|
p.DBPackage = p.DBPackage.Update().SetStatus(dbpackage.StatusSkipped).SetSkipReason("unable to resolve dependencies").SaveX(ctx)
|
||||||
return time.Since(start), ErrorNotEligible
|
return time.Since(start), ErrorNotEligible
|
||||||
@@ -194,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
|
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",
|
"-l", chroot, "-r", filepath.Join(conf.Basedir.Work, chrootDir), "--", "-m", "--noprogressbar", "--config",
|
||||||
filepath.Join(conf.Basedir.Work, makepkgDir, fmt.Sprintf(makepkgFile, p.March)))
|
filepath.Join(conf.Basedir.Work, makepkgDir, fmt.Sprintf(makepkgFile, p.March)))
|
||||||
|
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||||
cmd.Dir = filepath.Dir(p.Pkgbuild)
|
cmd.Dir = filepath.Dir(p.Pkgbuild)
|
||||||
var out bytes.Buffer
|
var out bytes.Buffer
|
||||||
cmd.Stdout = &out
|
cmd.Stdout = &out
|
||||||
cmd.Stderr = &out
|
cmd.Stderr = &out
|
||||||
|
|
||||||
err = cmd.Start()
|
if err = cmd.Start(); err != nil {
|
||||||
if err != nil {
|
|
||||||
return time.Since(start), fmt.Errorf("error starting build: %w", err)
|
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()
|
err = cmd.Wait()
|
||||||
|
close(done)
|
||||||
|
peakMem := <-result
|
||||||
|
close(result)
|
||||||
|
|
||||||
Rusage, ok := cmd.ProcessState.SysUsage().(*syscall.Rusage)
|
Rusage, ok := cmd.ProcessState.SysUsage().(*syscall.Rusage)
|
||||||
if !ok {
|
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 {
|
if err != nil {
|
||||||
@@ -219,13 +242,13 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
|||||||
if p.DBPackage.Lto != dbpackage.LtoAutoDisabled && p.DBPackage.Lto != dbpackage.LtoDisabled &&
|
if p.DBPackage.Lto != dbpackage.LtoAutoDisabled && p.DBPackage.Lto != dbpackage.LtoDisabled &&
|
||||||
(reLdError.MatchString(out.String()) || reRustLTOError.MatchString(out.String())) {
|
(reLdError.MatchString(out.String()) || reRustLTOError.MatchString(out.String())) {
|
||||||
p.DBPackage.Update().SetStatus(dbpackage.StatusQueued).SetSkipReason("non-LTO rebuild").SetLto(dbpackage.LtoAutoDisabled).ExecX(ctx)
|
p.DBPackage.Update().SetStatus(dbpackage.StatusQueued).SetSkipReason("non-LTO rebuild").SetLto(dbpackage.LtoAutoDisabled).ExecX(ctx)
|
||||||
return time.Since(start), fmt.Errorf("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()) ||
|
if reDownloadError.MatchString(out.String()) || reDownloadError2.MatchString(out.String()) ||
|
||||||
rePortError.MatchString(out.String()) || reSigError.MatchString(out.String()) {
|
rePortError.MatchString(out.String()) || reSigError.MatchString(out.String()) {
|
||||||
p.DBPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(ctx)
|
p.DBPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(ctx)
|
||||||
return time.Since(start), fmt.Errorf("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)
|
err = os.MkdirAll(filepath.Join(conf.Basedir.Repo, logDir, p.March), 0o755)
|
||||||
@@ -259,7 +282,7 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(pkgFiles) == 0 {
|
if len(pkgFiles) == 0 {
|
||||||
return time.Since(start), fmt.Errorf("no build-artifacts found")
|
return time.Since(start), errors.New("no build-artifacts found")
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range pkgFiles {
|
for _, file := range pkgFiles {
|
||||||
@@ -299,12 +322,12 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updatePkg := p.DBPackage.Update().
|
updatePkg := p.DBPackage.Update().
|
||||||
SetStatus(dbpackage.StatusBuild).
|
SetStatus(dbpackage.StatusBuilt).
|
||||||
SetLto(dbpackage.LtoEnabled).
|
SetLto(dbpackage.LtoEnabled).
|
||||||
SetBuildTimeStart(start).
|
SetBuildTimeStart(start).
|
||||||
SetLastVersionBuild(p.Version).
|
SetLastVersionBuild(p.Version).
|
||||||
SetTagRev(p.State.TagRev).
|
SetTagRev(p.State.TagRev).
|
||||||
SetMaxRss(Rusage.Maxrss).
|
SetMaxRss(peakMem).
|
||||||
SetIoOut(Rusage.Oublock).
|
SetIoOut(Rusage.Oublock).
|
||||||
SetIoIn(Rusage.Inblock).
|
SetIoIn(Rusage.Inblock).
|
||||||
SetUTime(Rusage.Utime.Sec).
|
SetUTime(Rusage.Utime.Sec).
|
||||||
@@ -319,7 +342,7 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
|
|||||||
return time.Since(start), nil
|
return time.Since(start), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ProtoPackage) setupBuildDir() (string, error) {
|
func (p *ProtoPackage) setupBuildDir(ctx context.Context) (string, error) {
|
||||||
buildDir := filepath.Join(conf.Basedir.Work, buildDir, p.March, p.Pkgbase+"-"+p.Version)
|
buildDir := filepath.Join(conf.Basedir.Work, buildDir, p.March, p.Pkgbase+"-"+p.Version)
|
||||||
|
|
||||||
err := cleanBuildDir(buildDir, "")
|
err := cleanBuildDir(buildDir, "")
|
||||||
@@ -341,8 +364,8 @@ func (p *ProtoPackage) setupBuildDir() (string, error) {
|
|||||||
gr := retry.NewFibonacci(10 * time.Second)
|
gr := retry.NewFibonacci(10 * time.Second)
|
||||||
gr = retry.WithMaxRetries(conf.MaxCloneRetries, gr)
|
gr = retry.WithMaxRetries(conf.MaxCloneRetries, gr)
|
||||||
|
|
||||||
if err := retry.Do(context.Background(), gr, func(ctx context.Context) error {
|
if err := retry.Do(ctx, gr, func(ctx context.Context) error {
|
||||||
cmd := exec.Command("git", "clone", "--depth", "1", "--branch", p.State.TagVer, //nolint:gosec
|
cmd := exec.CommandContext(ctx, "git", "clone", "--depth", "1", "--branch", p.State.TagVer, //nolint:gosec
|
||||||
fmt.Sprintf("https://gitlab.archlinux.org/archlinux/packaging/packages/%s.git", gitlabPath), buildDir)
|
fmt.Sprintf("https://gitlab.archlinux.org/archlinux/packaging/packages/%s.git", gitlabPath), buildDir)
|
||||||
res, err := cmd.CombinedOutput()
|
res, err := cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
@@ -364,7 +387,7 @@ func (p *ProtoPackage) repoVersion() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(p.PkgFiles) == 0 {
|
if len(p.PkgFiles) == 0 {
|
||||||
return "", fmt.Errorf("not found")
|
return "", errors.New("not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
fNameSplit := strings.Split(p.PkgFiles[0], "-")
|
fNameSplit := strings.Split(p.PkgFiles[0], "-")
|
||||||
@@ -400,7 +423,24 @@ func (p *ProtoPackage) increasePkgRel(buildNo int) error {
|
|||||||
return err
|
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)
|
_, err = f.Seek(0, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -415,7 +455,6 @@ func (p *ProtoPackage) increasePkgRel(buildNo int) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Version += "." + strconv.Itoa(buildNo)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,7 +477,7 @@ func (p *ProtoPackage) importKeys() error {
|
|||||||
return nil
|
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()
|
dbs, err := h.SyncDBs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
@@ -454,7 +493,7 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
|||||||
case p.DBPackage != nil && len(p.DBPackage.Packages) > 0:
|
case p.DBPackage != nil && len(p.DBPackage.Packages) > 0:
|
||||||
pkg, err = dbs.FindSatisfier(p.DBPackage.Packages[0])
|
pkg, err = dbs.FindSatisfier(p.DBPackage.Packages[0])
|
||||||
default:
|
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))
|
"--sysroot="+filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot))
|
||||||
var res []byte
|
var res []byte
|
||||||
res, err = cmd.Output()
|
res, err = cmd.Output()
|
||||||
@@ -462,18 +501,12 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
|||||||
log.Warningf("error getting packages from pacsift for %s: %v", p.Pkgbase, err)
|
log.Warningf("error getting packages from pacsift for %s: %v", p.Pkgbase, err)
|
||||||
return false
|
return false
|
||||||
} else if len(res) == 0 {
|
} else if len(res) == 0 {
|
||||||
|
log.Warningf("error getting packages from pacsift for %s", p.Pkgbase)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// workaround for https://github.com/andrewgregory/pacutils/issues/66
|
if len(strings.Split(strings.TrimSpace(string(res)), "\n")) > 0 {
|
||||||
// TODO: remove once fixed
|
pacsiftLines := strings.Split(strings.TrimSpace(string(res)), "\n")
|
||||||
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")
|
|
||||||
|
|
||||||
var splitPkgs []string
|
var splitPkgs []string
|
||||||
for _, line := range pacsiftLines {
|
for _, line := range pacsiftLines {
|
||||||
@@ -481,7 +514,10 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if p.DBPackage != nil {
|
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])
|
pkg, err = dbs.FindSatisfier(splitPkgs[0])
|
||||||
} else {
|
} else {
|
||||||
@@ -510,7 +546,7 @@ func (p *ProtoPackage) isAvailable(h *alpm.Handle) bool {
|
|||||||
|
|
||||||
func (p *ProtoPackage) GitVersion(h *alpm.Handle) (string, error) {
|
func (p *ProtoPackage) GitVersion(h *alpm.Handle) (string, error) {
|
||||||
if p.Pkgbase == "" {
|
if p.Pkgbase == "" {
|
||||||
return "", fmt.Errorf("invalid arguments")
|
return "", errors.New("invalid arguments")
|
||||||
}
|
}
|
||||||
|
|
||||||
stateFiles, _ := Glob(filepath.Join(conf.Basedir.Work, stateDir, "**/"+p.Pkgbase))
|
stateFiles, _ := Glob(filepath.Join(conf.Basedir.Work, stateDir, "**/"+p.Pkgbase))
|
||||||
@@ -617,15 +653,15 @@ func (p *ProtoPackage) findPkgFiles() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if p.DBPackage == nil && p.Srcinfo == nil {
|
if p.DBPackage == nil && p.Srcinfo == nil {
|
||||||
return fmt.Errorf("unable to find pkgfiles without dbpkg or srcinfo present")
|
return errors.New("unable to find pkgfiles without dbpkg or srcinfo present")
|
||||||
}
|
}
|
||||||
|
|
||||||
var realPkgs []string
|
var realPkgs []string
|
||||||
if p.DBPackage != nil {
|
if p.DBPackage != nil {
|
||||||
realPkgs = append(realPkgs, p.DBPackage.Packages...)
|
realPkgs = append(realPkgs, p.DBPackage.Packages...)
|
||||||
} else {
|
} else {
|
||||||
for _, realPkg := range p.Srcinfo.Packages {
|
for i := range p.Srcinfo.Packages {
|
||||||
realPkgs = append(realPkgs, realPkg.Pkgname)
|
realPkgs = append(realPkgs, p.Srcinfo.Packages[i].Pkgname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,7 +680,7 @@ func (p *ProtoPackage) findPkgFiles() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ProtoPackage) toDBPackage(create bool) error {
|
func (p *ProtoPackage) toDBPackage(ctx context.Context, create bool) error {
|
||||||
if p.DBPackage != nil {
|
if p.DBPackage != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -653,13 +689,16 @@ func (p *ProtoPackage) toDBPackage(create bool) error {
|
|||||||
dbpackage.Pkgbase(p.Pkgbase),
|
dbpackage.Pkgbase(p.Pkgbase),
|
||||||
dbpackage.March(p.March),
|
dbpackage.March(p.March),
|
||||||
dbpackage.RepositoryEQ(p.Repo),
|
dbpackage.RepositoryEQ(p.Repo),
|
||||||
).Only(context.Background())
|
).Only(ctx)
|
||||||
if err != nil && ent.IsNotFound(err) && create {
|
if err != nil && ent.IsNotFound(err) && create {
|
||||||
dbPkg = db.DBPackage.Create().
|
dbPkg, err = db.DBPackage.Create().
|
||||||
SetPkgbase(p.Pkgbase).
|
SetPkgbase(p.Pkgbase).
|
||||||
SetMarch(p.March).
|
SetMarch(p.March).
|
||||||
SetRepository(p.Repo).
|
SetRepository(p.Repo).
|
||||||
SaveX(context.Background())
|
Save(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
} else if err != nil && !ent.IsNotFound(err) {
|
} else if err != nil && !ent.IsNotFound(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -677,7 +716,7 @@ func (p *ProtoPackage) exists() (bool, error) {
|
|||||||
return dbPkg, nil
|
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()
|
dbs, err := h.SyncDBs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, nil, "", err
|
return false, nil, "", err
|
||||||
@@ -707,11 +746,16 @@ func (p *ProtoPackage) isMirrorLatest(h *alpm.Handle) (latest bool, foundPkg alp
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false, nil, "", err
|
return false, nil, "", err
|
||||||
} else if svn2gitVer == "" {
|
} else if svn2gitVer == "" {
|
||||||
return false, nil, "", fmt.Errorf("no svn2git version")
|
return false, nil, "", errors.New("no svn2git version")
|
||||||
}
|
}
|
||||||
|
|
||||||
if alpm.VerCmp(svn2gitVer, pkg.Version()) > 0 {
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -721,3 +765,16 @@ func (p *ProtoPackage) isMirrorLatest(h *alpm.Handle) (latest bool, foundPkg alp
|
|||||||
func (p *ProtoPackage) PkgbaseEquals(p2 *ProtoPackage, marchSensitive bool) bool {
|
func (p *ProtoPackage) PkgbaseEquals(p2 *ProtoPackage, marchSensitive bool) bool {
|
||||||
return (marchSensitive && (p.Pkgbase == p2.Pkgbase && p.FullRepo == p2.FullRepo)) || (!marchSensitive && p.Pkgbase == p2.Pkgbase)
|
return (marchSensitive && (p.Pkgbase == p2.Pkgbase && p.FullRepo == p2.FullRepo)) || (!marchSensitive && p.Pkgbase == p2.Pkgbase)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *ProtoPackage) IsBuilt() (bool, error) {
|
||||||
|
if p.DBPackage == nil {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
matches, err := filepath.Glob(filepath.Join(conf.Basedir.Work, waitingDir, p.FullRepo, p.DBPackage.Packages[0]+"*-x86_64.pkg.tar.zst"))
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return len(matches) > 0, nil
|
||||||
|
}
|
||||||
|
@@ -51,10 +51,55 @@ package() {
|
|||||||
# vim:set sw=2 et:
|
# 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
|
func TestIncreasePkgRel(t *testing.T) { //nolint:paralleltest
|
||||||
pkgbuild, err := os.CreateTemp("", "")
|
pkgbuild, err := os.CreateTemp(t.TempDir(), "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("Unable to setup temp. PKGBUILD")
|
t.Fatal("unable to setup temp. PKGBUILD")
|
||||||
}
|
}
|
||||||
defer func(name string) {
|
defer func(name string) {
|
||||||
_ = os.Remove(name)
|
_ = os.Remove(name)
|
||||||
@@ -62,7 +107,7 @@ func TestIncreasePkgRel(t *testing.T) { //nolint:paralleltest
|
|||||||
|
|
||||||
_, err = pkgbuild.WriteString(PkgbuildTest)
|
_, err = pkgbuild.WriteString(PkgbuildTest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("Unable to write to temp. PKGBUILD")
|
t.Fatal("unable to write to temp. PKGBUILD")
|
||||||
}
|
}
|
||||||
_ = pkgbuild.Close()
|
_ = pkgbuild.Close()
|
||||||
|
|
||||||
@@ -95,3 +140,48 @@ func TestIncreasePkgRel(t *testing.T) { //nolint:paralleltest
|
|||||||
t.Fail()
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1,186 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta content="width=device-width, initial-scale=1" name="viewport">
|
|
||||||
|
|
||||||
<title>ALHP Status</title>
|
|
||||||
|
|
||||||
<meta content="dark light" name="color-scheme">
|
|
||||||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap-dark-5@1.1.3/dist/css/bootstrap-dark.css"
|
|
||||||
integrity="sha256-jtwIepgD1ro9ko1W5a6PAGr8IUIXA3FqBZPAXNYVREE=" rel="stylesheet">
|
|
||||||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css"
|
|
||||||
integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
.accordion:last-child {
|
|
||||||
padding-bottom: 8vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-box {
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body style="background: #111217 !important;">
|
|
||||||
<nav class="navbar navbar-expand-lg sticky-top navbar-light bg-info">
|
|
||||||
<div class="container">
|
|
||||||
<div class="d-flex justify-content-start">
|
|
||||||
<span class="navbar-brand align-middle">ALHP Status</span>
|
|
||||||
<span class="navbar-text">
|
|
||||||
<a class="align-middle" href="https://somegit.dev/ALHP/ALHP.GO"><i
|
|
||||||
class="fa fa-gitea fs-4"></i></a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="d-flex justify-content-end">
|
|
||||||
<input type="search" placeholder="Search for packages.." class="form-control" id="table-sort-input"
|
|
||||||
title="Search for package"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
|
|
||||||
<div class="pt-4 pb-4">
|
|
||||||
<h4>Buildserver Stats</h4>
|
|
||||||
<iframe allowtransparency="true" class="container-fluid rounded-1 overflow-hidden" height="400px"
|
|
||||||
src="https://stats.itsh.dev/public-dashboards/0fb04abb0c5e4b7390cf26a98e6dead1"></iframe>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{range $march := .March}}
|
|
||||||
<h3 class="mt-5">{{$march.Name}}</h3>
|
|
||||||
<div class="accordion" id="accordion-{{$march.Name}}">
|
|
||||||
{{range $repo := $march.Repos}}
|
|
||||||
<div class="accordion-item bg-opacity-25">
|
|
||||||
<h2 class="accordion-header" id="heading-{{$march.Name}}-{{$repo.Name}}">
|
|
||||||
<button aria-controls="collapse-{{$march.Name}}-{{$repo.Name}}" aria-expanded="false"
|
|
||||||
class="accordion-button"
|
|
||||||
data-bs-target="#collapse-{{$march.Name}}-{{$repo.Name}}"
|
|
||||||
data-bs-toggle="collapse"
|
|
||||||
type="button">{{$repo.Name}}-{{$march.Name}}
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
<div aria-labelledby="heading-{{$march.Name}}-{{$repo.Name}}"
|
|
||||||
class="accordion-collapse collapse show"
|
|
||||||
data-bs-parent="#accordion-{{$march.Name}}" id="collapse-{{$march.Name}}-{{$repo.Name}}">
|
|
||||||
<div class="accordion-body overflow-auto">
|
|
||||||
<table class="table table-sorted">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Pkgbase</th>
|
|
||||||
<th scope="col">Status</th>
|
|
||||||
<th scope="col">Reason</th>
|
|
||||||
<th class="text-center" scope="col"
|
|
||||||
title="link time optimization does not guarantee that package is actually build with LTO">
|
|
||||||
LTO
|
|
||||||
</th>
|
|
||||||
<th class="text-center" scope="col" title="Debug-symbols available via debuginfod">DS
|
|
||||||
</th>
|
|
||||||
<th scope="col">Archlinux Version</th>
|
|
||||||
<th scope="col">{{$repo.Name}}-{{$march.Name}} Version</th>
|
|
||||||
<th class="text-end" scope="col">Info</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{{range $pkg := $repo.Packages}}
|
|
||||||
<tr class="table-{{$pkg.Class}}"
|
|
||||||
id="{{$repo.Name}}-{{$march.Name}}-{{$pkg.Pkgbase}}">
|
|
||||||
<td>{{$pkg.Pkgbase}}</td>
|
|
||||||
<td>{{$pkg.Status}}</td>
|
|
||||||
<td>{{$pkg.Skip}}</td>
|
|
||||||
<td class="text-center fs-6">
|
|
||||||
{{if $pkg.LTO}}<i class="fa fa-check fa-lg" style="color: var(--bs-success)"
|
|
||||||
title="build with LTO"></i>{{end}}
|
|
||||||
{{if $pkg.LTODisabled}}<i class="fa fa-times fa-lg" style="color: var(--bs-danger)"
|
|
||||||
title="LTO explicitly disabled"></i>{{end}}
|
|
||||||
{{if $pkg.LTOAutoDisabled}}<i class="fa fa-times-circle-o fa-lg"
|
|
||||||
style="color: var(--bs-danger)"
|
|
||||||
title="LTO automatically disabled"></i>{{end}}
|
|
||||||
{{if $pkg.LTOUnknown}}<i class="fa fa-hourglass-o fa-lg"
|
|
||||||
title="not build with LTO yet"></i>{{end}}
|
|
||||||
</td>
|
|
||||||
<td class="text-center fs-6">
|
|
||||||
{{if $pkg.DebugSym}}<i class="fa fa-check fa-lg" style="color: var(--bs-success)"
|
|
||||||
title="Debug symbols available"></i>{{end}}
|
|
||||||
{{if $pkg.DebugSymNotAvailable}}<i class="fa fa-times fa-lg"
|
|
||||||
style="color: var(--bs-danger)"
|
|
||||||
title="Not build with debug symbols"></i>{{end}}
|
|
||||||
{{if $pkg.DebugSymUnknown}}<i class="fa fa-hourglass-o fa-lg"
|
|
||||||
title="Not build yet"></i>{{end}}
|
|
||||||
</td>
|
|
||||||
<td>{{$pkg.Svn2GitVersion}}</td>
|
|
||||||
<td>{{$pkg.Version}}</td>
|
|
||||||
<td class="text-end info-box">
|
|
||||||
{{with $pkg.Log}}<a href="{{.}}" title="build log"
|
|
||||||
><i class="fa fa-file-text fa-lg"></i></a
|
|
||||||
>{{end}}
|
|
||||||
<a class="text-decoration-none fw-bold"
|
|
||||||
href="https://archlinux.org/packages/?q={{$pkg.Pkgbase}}" title="ArchWeb">AW</a>
|
|
||||||
<a data-bs-html="true" data-bs-placement="bottom" data-bs-toggle="tooltip"
|
|
||||||
href="#{{$repo.Name}}-{{$march.Name}}-{{$pkg.Pkgbase}}"
|
|
||||||
title="{{if $pkg.BuildDate}}Build on {{$pkg.BuildDate}} {{end}}{{if $pkg.BuildDuration}}CPU-Time: {{$pkg.BuildDuration}} {{end}}{{if $pkg.BuildMemory}}Peak-Memory: {{$pkg.BuildMemory}} {{end}}Last checked on {{$pkg.Checked}}">
|
|
||||||
<i class="fa fa-info-circle fa-lg"></i></a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{end}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer class="text-center text-lg-start bg-dark mt-3 fixed-bottom">
|
|
||||||
<div class="p-2 text-center">
|
|
||||||
{{.Latest}} <span class="text-primary">build</span>
|
|
||||||
{{.Queued}} <span class="text-warning">queued</span>
|
|
||||||
{{.Skipped}} <span class="text-secondary">skipped</span>
|
|
||||||
{{.Failed}} <span class="text-danger">failed</span>
|
|
||||||
||
|
|
||||||
LTO: {{.LTOEnabled}} <span class="text-success">enabled</span>
|
|
||||||
{{.LTODisabled}} <span class="text-danger">disabled</span>
|
|
||||||
{{.LTOUnknown}} <span class="text-secondary">unknown</span>
|
|
||||||
||
|
|
||||||
<span class="text-muted">{{.Generated}}</span>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<script crossorigin="anonymous"
|
|
||||||
integrity="sha256-lSABj6XYH05NydBq+1dvkMu6uiCc/MbLYOFGRkf3iQs=" src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
<script>
|
|
||||||
let input = document.getElementById('table-sort-input');
|
|
||||||
let timeout = null;
|
|
||||||
|
|
||||||
input.addEventListener('input', function (e) {
|
|
||||||
clearTimeout(timeout);
|
|
||||||
|
|
||||||
timeout = setTimeout(searchFilter, 200);
|
|
||||||
});
|
|
||||||
|
|
||||||
function searchFilter() {
|
|
||||||
let input, filter, tr, td, i, txtValue;
|
|
||||||
input = document.getElementById('table-sort-input')
|
|
||||||
filter = input.value.toUpperCase()
|
|
||||||
const tables = document.getElementsByClassName('table-sorted');
|
|
||||||
for (let j = 0; j < tables.length; j++) {
|
|
||||||
tr = tables[j].getElementsByTagName('tr')
|
|
||||||
for (i = 0; i < tr.length; i++) {
|
|
||||||
td = tr[i].getElementsByTagName('td')[0]
|
|
||||||
if (td) {
|
|
||||||
txtValue = td.textContent || td.innerText
|
|
||||||
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
|
||||||
tr[i].style.display = ''
|
|
||||||
} else {
|
|
||||||
tr[i].style.display = 'none'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
320
utils.go
320
utils.go
@@ -1,14 +1,19 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/Jguer/go-alpm/v2"
|
"github.com/Jguer/go-alpm/v2"
|
||||||
paconf "github.com/Morganamilo/go-pacmanconf"
|
paconf "github.com/Morganamilo/go-pacmanconf"
|
||||||
"github.com/Morganamilo/go-srcinfo"
|
"github.com/Morganamilo/go-srcinfo"
|
||||||
"github.com/c2h5oh/datasize"
|
"github.com/c2h5oh/datasize"
|
||||||
|
"github.com/gobwas/glob"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -22,6 +27,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
pacmanConf = "/usr/share/devtools/pacman.conf.d/multilib.conf"
|
pacmanConf = "/usr/share/devtools/pacman.conf.d/multilib.conf"
|
||||||
makepkgConf = "/usr/share/devtools/makepkg.conf.d/x86_64.conf"
|
makepkgConf = "/usr/share/devtools/makepkg.conf.d/x86_64.conf"
|
||||||
|
makepkgConfExt = "/etc/makepkg.conf.d"
|
||||||
logDir = "logs"
|
logDir = "logs"
|
||||||
pristineChroot = "root"
|
pristineChroot = "root"
|
||||||
buildDir = "build"
|
buildDir = "build"
|
||||||
@@ -80,12 +86,10 @@ type Conf struct {
|
|||||||
Housekeeping struct {
|
Housekeeping struct {
|
||||||
Interval string
|
Interval string
|
||||||
}
|
}
|
||||||
Status struct {
|
|
||||||
Class struct {
|
|
||||||
Skipped, Queued, Latest, Failed, Signing, Building, Unknown string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MaxCloneRetries uint64 `yaml:"max_clone_retries"`
|
MaxCloneRetries uint64 `yaml:"max_clone_retries"`
|
||||||
|
Metrics struct {
|
||||||
|
Port uint32
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Globs []string
|
type Globs []string
|
||||||
@@ -112,25 +116,6 @@ func updateLastUpdated() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func statusID2string(s dbpackage.Status) string {
|
|
||||||
switch s { //nolint:exhaustive
|
|
||||||
case dbpackage.StatusSkipped:
|
|
||||||
return conf.Status.Class.Skipped
|
|
||||||
case dbpackage.StatusQueued:
|
|
||||||
return conf.Status.Class.Queued
|
|
||||||
case dbpackage.StatusLatest:
|
|
||||||
return conf.Status.Class.Latest
|
|
||||||
case dbpackage.StatusFailed:
|
|
||||||
return conf.Status.Class.Failed
|
|
||||||
case dbpackage.StatusSigning:
|
|
||||||
return conf.Status.Class.Signing
|
|
||||||
case dbpackage.StatusBuilding, dbpackage.StatusDelayed:
|
|
||||||
return conf.Status.Class.Building
|
|
||||||
default:
|
|
||||||
return conf.Status.Class.Unknown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func cleanBuildDir(dir, chrootDir string) error {
|
func cleanBuildDir(dir, chrootDir string) error {
|
||||||
if stat, err := os.Stat(dir); err == nil && stat.IsDir() {
|
if stat, err := os.Stat(dir); err == nil && stat.IsDir() {
|
||||||
rmCmd := exec.Command("sudo", "rm_chroot.py", dir)
|
rmCmd := exec.Command("sudo", "rm_chroot.py", dir)
|
||||||
@@ -160,7 +145,7 @@ func pkgList2MaxMem(pkgList []*ProtoPackage) datasize.ByteSize {
|
|||||||
var sum uint64
|
var sum uint64
|
||||||
for _, pkg := range pkgList {
|
for _, pkg := range pkgList {
|
||||||
if pkg.DBPackage.MaxRss != nil {
|
if pkg.DBPackage.MaxRss != nil {
|
||||||
sum += uint64(*pkg.DBPackage.MaxRss)
|
sum += uint64(*pkg.DBPackage.MaxRss) //nolint:gosec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +157,7 @@ func pkgList2MaxMem(pkgList []*ProtoPackage) datasize.ByteSize {
|
|||||||
func stateFileMeta(stateFile string) (repo string, subRepo *string, arch string, err error) {
|
func stateFileMeta(stateFile string) (repo string, subRepo *string, arch string, err error) {
|
||||||
nameSplit := strings.Split(filepath.Base(filepath.Dir(stateFile)), "-")
|
nameSplit := strings.Split(filepath.Base(filepath.Dir(stateFile)), "-")
|
||||||
if len(nameSplit) < 2 {
|
if len(nameSplit) < 2 {
|
||||||
err = fmt.Errorf("error getting metainfo")
|
err = errors.New("error getting metainfo")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +171,7 @@ func stateFileMeta(stateFile string) (repo string, subRepo *string, arch string,
|
|||||||
return
|
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) {
|
if _, err := os.Stat(filepath.Join(conf.Basedir.Work, waitingDir, fullRepo)); os.IsNotExist(err) {
|
||||||
return nil
|
return nil
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
@@ -206,7 +191,7 @@ func movePackagesLive(fullRepo string) error {
|
|||||||
|
|
||||||
for _, file := range pkgFiles {
|
for _, file := range pkgFiles {
|
||||||
pkg := Package(file)
|
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 err != nil {
|
||||||
if strings.HasSuffix(pkg.Name(), "-debug") {
|
if strings.HasSuffix(pkg.Name(), "-debug") {
|
||||||
mkErr := os.MkdirAll(filepath.Join(conf.Basedir.Debug, march), 0o755)
|
mkErr := os.MkdirAll(filepath.Join(conf.Basedir.Debug, march), 0o755)
|
||||||
@@ -222,10 +207,11 @@ func movePackagesLive(fullRepo string) error {
|
|||||||
filepath.Join(conf.Basedir.Debug, march, filepath.Base(file)))
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_ = os.Remove(file)
|
||||||
_ = os.Remove(file + ".sig")
|
_ = os.Remove(file + ".sig")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -252,14 +238,16 @@ func movePackagesLive(fullRepo string) error {
|
|||||||
continue
|
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 {
|
if err != nil {
|
||||||
return err
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_ = os.Remove(file + ".sig")
|
||||||
|
|
||||||
toAdd = append(toAdd, &ProtoPackage{
|
toAdd = append(toAdd, &ProtoPackage{
|
||||||
DBPackage: dbPkg,
|
DBPackage: dbPkg,
|
||||||
@@ -281,8 +269,8 @@ func packages2slice(pkgs any) []string {
|
|||||||
switch v := pkgs.(type) {
|
switch v := pkgs.(type) {
|
||||||
case []srcinfo.Package:
|
case []srcinfo.Package:
|
||||||
var sPkgs []string
|
var sPkgs []string
|
||||||
for _, p := range v {
|
for i := range v {
|
||||||
sPkgs = append(sPkgs, p.Pkgname)
|
sPkgs = append(sPkgs, v[i].Pkgname)
|
||||||
}
|
}
|
||||||
|
|
||||||
return sPkgs
|
return sPkgs
|
||||||
@@ -345,36 +333,46 @@ func initALPM(root, dbpath string) (*alpm.Handle, error) {
|
|||||||
return h, nil
|
return h, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupChroot() error {
|
func setupChroot(ctx context.Context) error {
|
||||||
_, err := os.Stat(filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot))
|
_, err := os.Stat(filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot))
|
||||||
switch {
|
switch {
|
||||||
case err == nil:
|
case err == nil:
|
||||||
cmd := exec.Command("arch-nspawn", "-C", pacmanConf, filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot), //nolint:gosec
|
cmd := exec.CommandContext(ctx, "arch-nspawn", "-C", pacmanConf, //nolint:gosec
|
||||||
"pacman", "-Syuu", "--noconfirm")
|
filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot), "pacman", "-Syuu", "--noconfirm")
|
||||||
res, err := cmd.CombinedOutput()
|
res, err := cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
if err != nil {
|
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):
|
case os.IsNotExist(err):
|
||||||
err = os.MkdirAll(filepath.Join(conf.Basedir.Work, chrootDir), 0o755)
|
err = os.MkdirAll(filepath.Join(conf.Basedir.Work, chrootDir), 0o755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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")
|
filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot), "base-devel", "multilib-devel")
|
||||||
res, err := cmd.CombinedOutput()
|
res, err := cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
if err != nil {
|
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"))
|
filepath.Join(conf.Basedir.Work, chrootDir, pristineChroot, "etc/pacman.conf"))
|
||||||
res, err = cmd.CombinedOutput()
|
res, err = cmd.CombinedOutput()
|
||||||
log.Debug(string(res))
|
log.Debug(string(res))
|
||||||
if err != nil {
|
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:
|
default:
|
||||||
return err
|
return err
|
||||||
@@ -382,7 +380,7 @@ func setupChroot() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func syncMarchs() error {
|
func syncMarchs(ctx context.Context) error {
|
||||||
files, err := os.ReadDir(conf.Basedir.Repo)
|
files, err := os.ReadDir(conf.Basedir.Repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -414,9 +412,9 @@ func syncMarchs() error {
|
|||||||
for _, repo := range conf.Repos {
|
for _, repo := range conf.Repos {
|
||||||
fRepo := fmt.Sprintf("%s-%s", repo, march)
|
fRepo := fmt.Sprintf("%s-%s", repo, march)
|
||||||
repos = append(repos, fRepo)
|
repos = append(repos, fRepo)
|
||||||
buildManager.repoAdd[fRepo] = make(chan []*ProtoPackage, 1000) //nolint:gomnd
|
buildManager.repoAdd[fRepo] = make(chan []*ProtoPackage, 1000)
|
||||||
buildManager.repoPurge[fRepo] = make(chan []*ProtoPackage, 1000) //nolint:gomnd
|
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) {
|
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))
|
log.Debugf("creating path %s", filepath.Join(conf.Basedir.Repo, fRepo, "os", conf.Arch))
|
||||||
@@ -482,7 +480,7 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) {
|
|||||||
for subSec, subMap := range ct {
|
for subSec, subMap := range ct {
|
||||||
varsReg := reVar.FindAllStringSubmatch(makepkgConf, -1)
|
varsReg := reVar.FindAllStringSubmatch(makepkgConf, -1)
|
||||||
if varsReg == nil {
|
if varsReg == nil {
|
||||||
return "", fmt.Errorf("no match in config found")
|
return "", errors.New("no match in config found")
|
||||||
}
|
}
|
||||||
|
|
||||||
var flags []string
|
var flags []string
|
||||||
@@ -499,6 +497,8 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := subMap.(string); ok && len(orgMatch) > 0 {
|
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",
|
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]))
|
strings.ToUpper(subSec.(string)), orgMatch[2], replaceStringsFromMap(subMap.(string), replaceMap), orgMatch[4]))
|
||||||
continue
|
continue
|
||||||
@@ -507,12 +507,18 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) {
|
|||||||
if len(orgMatch) == 0 {
|
if len(orgMatch) == 0 {
|
||||||
// no match found, assume env var and append it
|
// no match found, assume env var and append it
|
||||||
log.Debugf("no match found for %s:%v, appending", subSec, subMap)
|
log.Debugf("no match found for %s:%v, appending", subSec, subMap)
|
||||||
if strings.Contains(subMap.(string), " ") {
|
switch sm := subMap.(type) {
|
||||||
makepkgConf += fmt.Sprintf("\nexport %s=%q", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap))
|
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
|
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))
|
log.Debugf("original %s: %v (%d)", subSec, flags, len(flags))
|
||||||
@@ -545,7 +551,24 @@ func setupMakepkg(march string, flags map[string]any) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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)
|
makepkgStr, err = parseFlagSection(flags["common"], makepkgStr, march)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -575,7 +598,7 @@ func setupMakepkg(march string, flags map[string]any) error {
|
|||||||
func parseState(state string) (*StateInfo, error) {
|
func parseState(state string) (*StateInfo, error) {
|
||||||
ss := strings.Split(state, " ")
|
ss := strings.Split(state, " ")
|
||||||
if len(ss) != 4 {
|
if len(ss) != 4 {
|
||||||
return nil, fmt.Errorf("invalid state file")
|
return nil, errors.New("invalid state file")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &StateInfo{
|
return &StateInfo{
|
||||||
@@ -647,16 +670,16 @@ func Glob(pattern string) ([]string, error) {
|
|||||||
|
|
||||||
func (globs Globs) Expand() ([]string, error) {
|
func (globs Globs) Expand() ([]string, error) {
|
||||||
var matches = []string{""}
|
var matches = []string{""}
|
||||||
for _, glob := range globs {
|
for _, g := range globs {
|
||||||
var hits []string
|
var hits []string
|
||||||
var hitMap = map[string]bool{}
|
var hitMap = map[string]bool{}
|
||||||
for _, match := range matches {
|
for _, match := range matches {
|
||||||
paths, err := filepath.Glob(match + glob)
|
paths, err := filepath.Glob(match + g)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, path := range paths {
|
for _, path := range paths {
|
||||||
err = filepath.WalkDir(path, func(path string, d os.DirEntry, err error) error {
|
err = filepath.WalkDir(path, func(path string, _ os.DirEntry, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fs.SkipDir
|
return fs.SkipDir
|
||||||
}
|
}
|
||||||
@@ -680,3 +703,190 @@ func (globs Globs) Expand() ([]string, error) {
|
|||||||
|
|
||||||
return matches, nil
|
return matches, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func MatchGlobList(target string, globs []string) bool {
|
||||||
|
for _, lGlob := range globs {
|
||||||
|
tGlob, err := glob.Compile(lGlob)
|
||||||
|
if err != nil {
|
||||||
|
log.Warningf("failed to compile glob %s: %v", lGlob, err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if tGlob.Match(target) {
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user