1
0
forked from ALHP/ALHP.GO

added LTO status to db and status page

This commit is contained in:
2021-11-16 23:30:31 +01:00
parent e6ac0a1a6e
commit c77ec6d140
12 changed files with 320 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ To enable these complement repos you need to add them above the regular repos in
### Choose a mirror (optional)
You can choose from different available mirrors.
> Note: Only `alhp.harting.dev` is hosted by ALHP directly.
> Note: Only `alhp.harting.dev` is hosted by ALHP directly. Make sure you use an up-to-date mirror.
- `alhp.harting.dev` (Tier 0, Central Europe)
- `www.gardling.com/alhp` (Tier 1, North America, provided by @titaniumtown)
@@ -56,13 +56,14 @@ Include = /etc/pacman.d/mirrorlist
Include = /etc/pacman.d/mirrorlist
```
Replace `x86-64-v3` with your cpu-set. More information about all available options on [this gcc page](https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html).
Currently, alhp.harting.dev only builds for `x86-64-v3` (list is subject to change).
You can see all available repositories [here](https://alhp.harting.dev/).
Replace `x86-64-v3` with your cpu-set. More information about all available options
on [this gcc page](https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html). Currently, alhp.harting.dev only builds
for `x86-64-v3` (list is subject to change). You can see all available repositories [here](https://alhp.harting.dev/).
After finished adding the repos to `pacman.conf` you need to import and sign the used pgp key:
Import:
```
pacman-key --keyserver keyserver.ubuntu.com --recv-keys 0D4D2FDAF45468F3DDF59BEDE3D0D2CD3952E298
```
@@ -101,6 +102,7 @@ Also [package status page](https://alhp.anonfunc.dev/packages.html).
Enabled for all packages build after 04 Nov 2021 12:07:00
UTC. [More details.](https://git.harting.dev/anonfunc/ALHP.GO/issues/52)
LTO status visible per package on the package status page.
### error: *-x86-64-v3: signature from "Archlinux CIE Repos (Build 2020/2021) <cie@harting.dev>" is unknown trust

View File

@@ -41,6 +41,8 @@ type DbPackage struct {
Updated time.Time `json:"updated,omitempty"`
// Hash holds the value of the "hash" field.
Hash string `json:"hash,omitempty"`
// Lto holds the value of the "lto" field.
Lto dbpackage.Lto `json:"lto,omitempty"`
}
// scanValues returns the types for scanning values from sql.Rows.
@@ -52,7 +54,7 @@ func (*DbPackage) scanValues(columns []string) ([]interface{}, error) {
values[i] = new([]byte)
case dbpackage.FieldID:
values[i] = new(sql.NullInt64)
case dbpackage.FieldPkgbase, dbpackage.FieldStatus, dbpackage.FieldSkipReason, dbpackage.FieldRepository, dbpackage.FieldMarch, dbpackage.FieldVersion, dbpackage.FieldRepoVersion, dbpackage.FieldHash:
case dbpackage.FieldPkgbase, dbpackage.FieldStatus, dbpackage.FieldSkipReason, dbpackage.FieldRepository, dbpackage.FieldMarch, dbpackage.FieldVersion, dbpackage.FieldRepoVersion, dbpackage.FieldHash, dbpackage.FieldLto:
values[i] = new(sql.NullString)
case dbpackage.FieldBuildTimeStart, dbpackage.FieldBuildTimeEnd, dbpackage.FieldUpdated:
values[i] = new(sql.NullTime)
@@ -151,6 +153,12 @@ func (dp *DbPackage) assignValues(columns []string, values []interface{}) error
} else if value.Valid {
dp.Hash = value.String
}
case dbpackage.FieldLto:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field lto", values[i])
} else if value.Valid {
dp.Lto = dbpackage.Lto(value.String)
}
}
}
return nil
@@ -203,6 +211,8 @@ func (dp *DbPackage) String() string {
builder.WriteString(dp.Updated.Format(time.ANSIC))
builder.WriteString(", hash=")
builder.WriteString(dp.Hash)
builder.WriteString(", lto=")
builder.WriteString(fmt.Sprintf("%v", dp.Lto))
builder.WriteByte(')')
return builder.String()
}

View File

@@ -35,6 +35,8 @@ const (
FieldUpdated = "updated"
// FieldHash holds the string denoting the hash field in the database.
FieldHash = "hash"
// FieldLto holds the string denoting the lto field in the database.
FieldLto = "lto"
// Table holds the table name of the dbpackage in the database.
Table = "db_packages"
)
@@ -54,6 +56,7 @@ var Columns = []string{
FieldBuildTimeEnd,
FieldUpdated,
FieldHash,
FieldLto,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -128,3 +131,30 @@ func RepositoryValidator(r Repository) error {
return fmt.Errorf("dbpackage: invalid enum value for repository field: %q", r)
}
}
// Lto defines the type for the "lto" enum field.
type Lto string
// LtoUnknown is the default value of the Lto enum.
const DefaultLto = LtoUnknown
// Lto values.
const (
LtoEnabled Lto = "enabled"
LtoUnknown Lto = "unknown"
LtoDisabled Lto = "disabled"
)
func (l Lto) String() string {
return string(l)
}
// LtoValidator is a validator for the "lto" field enum values. It is called by the builders before save.
func LtoValidator(l Lto) error {
switch l {
case LtoEnabled, LtoUnknown, LtoDisabled:
return nil
default:
return fmt.Errorf("dbpackage: invalid enum value for lto field: %q", l)
}
}

View File

@@ -1271,6 +1271,68 @@ func HashContainsFold(v string) predicate.DbPackage {
})
}
// LtoEQ applies the EQ predicate on the "lto" field.
func LtoEQ(v Lto) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldLto), v))
})
}
// LtoNEQ applies the NEQ predicate on the "lto" field.
func LtoNEQ(v Lto) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldLto), v))
})
}
// LtoIn applies the In predicate on the "lto" field.
func LtoIn(vs ...Lto) predicate.DbPackage {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.DbPackage(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldLto), v...))
})
}
// LtoNotIn applies the NotIn predicate on the "lto" field.
func LtoNotIn(vs ...Lto) predicate.DbPackage {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.DbPackage(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldLto), v...))
})
}
// LtoIsNil applies the IsNil predicate on the "lto" field.
func LtoIsNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldLto)))
})
}
// LtoNotNil applies the NotNil predicate on the "lto" field.
func LtoNotNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldLto)))
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.DbPackage) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {

View File

@@ -156,6 +156,20 @@ func (dpc *DbPackageCreate) SetNillableHash(s *string) *DbPackageCreate {
return dpc
}
// SetLto sets the "lto" field.
func (dpc *DbPackageCreate) SetLto(d dbpackage.Lto) *DbPackageCreate {
dpc.mutation.SetLto(d)
return dpc
}
// SetNillableLto sets the "lto" field if the given value is not nil.
func (dpc *DbPackageCreate) SetNillableLto(d *dbpackage.Lto) *DbPackageCreate {
if d != nil {
dpc.SetLto(*d)
}
return dpc
}
// Mutation returns the DbPackageMutation object of the builder.
func (dpc *DbPackageCreate) Mutation() *DbPackageMutation {
return dpc.mutation
@@ -231,6 +245,10 @@ func (dpc *DbPackageCreate) defaults() {
v := dbpackage.DefaultStatus
dpc.mutation.SetStatus(v)
}
if _, ok := dpc.mutation.Lto(); !ok {
v := dbpackage.DefaultLto
dpc.mutation.SetLto(v)
}
}
// check runs all checks and user-defined validators on the builder.
@@ -264,6 +282,11 @@ func (dpc *DbPackageCreate) check() error {
return &ValidationError{Name: "march", err: fmt.Errorf(`ent: validator failed for field "march": %w`, err)}
}
}
if v, ok := dpc.mutation.Lto(); ok {
if err := dbpackage.LtoValidator(v); err != nil {
return &ValidationError{Name: "lto", err: fmt.Errorf(`ent: validator failed for field "lto": %w`, err)}
}
}
return nil
}
@@ -387,6 +410,14 @@ func (dpc *DbPackageCreate) createSpec() (*DbPackage, *sqlgraph.CreateSpec) {
})
_node.Hash = value
}
if value, ok := dpc.mutation.Lto(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Value: value,
Column: dbpackage.FieldLto,
})
_node.Lto = value
}
return _node, _spec
}

View File

@@ -211,6 +211,26 @@ func (dpu *DbPackageUpdate) ClearHash() *DbPackageUpdate {
return dpu
}
// SetLto sets the "lto" field.
func (dpu *DbPackageUpdate) SetLto(d dbpackage.Lto) *DbPackageUpdate {
dpu.mutation.SetLto(d)
return dpu
}
// SetNillableLto sets the "lto" field if the given value is not nil.
func (dpu *DbPackageUpdate) SetNillableLto(d *dbpackage.Lto) *DbPackageUpdate {
if d != nil {
dpu.SetLto(*d)
}
return dpu
}
// ClearLto clears the value of the "lto" field.
func (dpu *DbPackageUpdate) ClearLto() *DbPackageUpdate {
dpu.mutation.ClearLto()
return dpu
}
// Mutation returns the DbPackageMutation object of the builder.
func (dpu *DbPackageUpdate) Mutation() *DbPackageMutation {
return dpu.mutation
@@ -293,6 +313,11 @@ func (dpu *DbPackageUpdate) check() error {
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
}
}
if v, ok := dpu.mutation.Lto(); ok {
if err := dbpackage.LtoValidator(v); err != nil {
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
}
}
return nil
}
@@ -445,6 +470,19 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
Column: dbpackage.FieldHash,
})
}
if value, ok := dpu.mutation.Lto(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Value: value,
Column: dbpackage.FieldLto,
})
}
if dpu.mutation.LtoCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Column: dbpackage.FieldLto,
})
}
if n, err = sqlgraph.UpdateNodes(ctx, dpu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{dbpackage.Label}
@@ -648,6 +686,26 @@ func (dpuo *DbPackageUpdateOne) ClearHash() *DbPackageUpdateOne {
return dpuo
}
// SetLto sets the "lto" field.
func (dpuo *DbPackageUpdateOne) SetLto(d dbpackage.Lto) *DbPackageUpdateOne {
dpuo.mutation.SetLto(d)
return dpuo
}
// SetNillableLto sets the "lto" field if the given value is not nil.
func (dpuo *DbPackageUpdateOne) SetNillableLto(d *dbpackage.Lto) *DbPackageUpdateOne {
if d != nil {
dpuo.SetLto(*d)
}
return dpuo
}
// ClearLto clears the value of the "lto" field.
func (dpuo *DbPackageUpdateOne) ClearLto() *DbPackageUpdateOne {
dpuo.mutation.ClearLto()
return dpuo
}
// Mutation returns the DbPackageMutation object of the builder.
func (dpuo *DbPackageUpdateOne) Mutation() *DbPackageMutation {
return dpuo.mutation
@@ -737,6 +795,11 @@ func (dpuo *DbPackageUpdateOne) check() error {
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
}
}
if v, ok := dpuo.mutation.Lto(); ok {
if err := dbpackage.LtoValidator(v); err != nil {
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
}
}
return nil
}
@@ -906,6 +969,19 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
Column: dbpackage.FieldHash,
})
}
if value, ok := dpuo.mutation.Lto(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Value: value,
Column: dbpackage.FieldLto,
})
}
if dpuo.mutation.LtoCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Column: dbpackage.FieldLto,
})
}
_node = &DbPackage{config: dpuo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues

View File

@@ -23,6 +23,7 @@ var (
{Name: "build_time_end", Type: field.TypeTime, Nullable: true},
{Name: "updated", Type: field.TypeTime, Nullable: true},
{Name: "hash", Type: field.TypeString, Nullable: true},
{Name: "lto", Type: field.TypeEnum, Nullable: true, Enums: []string{"enabled", "unknown", "disabled"}, Default: "unknown"},
}
// DbPackagesTable holds the schema information for the "db_packages" table.
DbPackagesTable = &schema.Table{

View File

@@ -44,6 +44,7 @@ type DbPackageMutation struct {
build_time_end *time.Time
updated *time.Time
hash *string
lto *dbpackage.Lto
clearedFields map[string]struct{}
done bool
oldValue func(context.Context) (*DbPackage, error)
@@ -678,6 +679,55 @@ func (m *DbPackageMutation) ResetHash() {
delete(m.clearedFields, dbpackage.FieldHash)
}
// SetLto sets the "lto" field.
func (m *DbPackageMutation) SetLto(d dbpackage.Lto) {
m.lto = &d
}
// Lto returns the value of the "lto" field in the mutation.
func (m *DbPackageMutation) Lto() (r dbpackage.Lto, exists bool) {
v := m.lto
if v == nil {
return
}
return *v, true
}
// OldLto returns the old "lto" field's value of the DbPackage entity.
// If the DbPackage object wasn't provided to the builder, the object is fetched from the database.
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (m *DbPackageMutation) OldLto(ctx context.Context) (v dbpackage.Lto, err error) {
if !m.op.Is(OpUpdateOne) {
return v, fmt.Errorf("OldLto is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, fmt.Errorf("OldLto requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldLto: %w", err)
}
return oldValue.Lto, nil
}
// ClearLto clears the value of the "lto" field.
func (m *DbPackageMutation) ClearLto() {
m.lto = nil
m.clearedFields[dbpackage.FieldLto] = struct{}{}
}
// LtoCleared returns if the "lto" field was cleared in this mutation.
func (m *DbPackageMutation) LtoCleared() bool {
_, ok := m.clearedFields[dbpackage.FieldLto]
return ok
}
// ResetLto resets all changes to the "lto" field.
func (m *DbPackageMutation) ResetLto() {
m.lto = nil
delete(m.clearedFields, dbpackage.FieldLto)
}
// Where appends a list predicates to the DbPackageMutation builder.
func (m *DbPackageMutation) Where(ps ...predicate.DbPackage) {
m.predicates = append(m.predicates, ps...)
@@ -697,7 +747,7 @@ func (m *DbPackageMutation) Type() string {
// order to get all numeric fields that were incremented/decremented, call
// AddedFields().
func (m *DbPackageMutation) Fields() []string {
fields := make([]string, 0, 12)
fields := make([]string, 0, 13)
if m.pkgbase != nil {
fields = append(fields, dbpackage.FieldPkgbase)
}
@@ -734,6 +784,9 @@ func (m *DbPackageMutation) Fields() []string {
if m.hash != nil {
fields = append(fields, dbpackage.FieldHash)
}
if m.lto != nil {
fields = append(fields, dbpackage.FieldLto)
}
return fields
}
@@ -766,6 +819,8 @@ func (m *DbPackageMutation) Field(name string) (ent.Value, bool) {
return m.Updated()
case dbpackage.FieldHash:
return m.Hash()
case dbpackage.FieldLto:
return m.Lto()
}
return nil, false
}
@@ -799,6 +854,8 @@ func (m *DbPackageMutation) OldField(ctx context.Context, name string) (ent.Valu
return m.OldUpdated(ctx)
case dbpackage.FieldHash:
return m.OldHash(ctx)
case dbpackage.FieldLto:
return m.OldLto(ctx)
}
return nil, fmt.Errorf("unknown DbPackage field %s", name)
}
@@ -892,6 +949,13 @@ func (m *DbPackageMutation) SetField(name string, value ent.Value) error {
}
m.SetHash(v)
return nil
case dbpackage.FieldLto:
v, ok := value.(dbpackage.Lto)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetLto(v)
return nil
}
return fmt.Errorf("unknown DbPackage field %s", name)
}
@@ -949,6 +1013,9 @@ func (m *DbPackageMutation) ClearedFields() []string {
if m.FieldCleared(dbpackage.FieldHash) {
fields = append(fields, dbpackage.FieldHash)
}
if m.FieldCleared(dbpackage.FieldLto) {
fields = append(fields, dbpackage.FieldLto)
}
return fields
}
@@ -990,6 +1057,9 @@ func (m *DbPackageMutation) ClearField(name string) error {
case dbpackage.FieldHash:
m.ClearHash()
return nil
case dbpackage.FieldLto:
m.ClearLto()
return nil
}
return fmt.Errorf("unknown DbPackage nullable field %s", name)
}
@@ -1034,6 +1104,9 @@ func (m *DbPackageMutation) ResetField(name string) error {
case dbpackage.FieldHash:
m.ResetHash()
return nil
case dbpackage.FieldLto:
m.ResetLto()
return nil
}
return fmt.Errorf("unknown DbPackage field %s", name)
}

View File

@@ -25,6 +25,7 @@ func (DbPackage) Fields() []ent.Field {
field.Time("build_time_end").Optional(),
field.Time("updated").Optional(),
field.String("hash").Optional(),
field.Enum("lto").Values("enabled", "unknown", "disabled").Default("unknown").Optional(),
}
}

8
go.sum
View File

@@ -70,6 +70,7 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
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.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
github.com/go-sql-driver/mysql v1.5.1-0.20200311113236-681ffa848bae/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
@@ -218,6 +219,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx
github.com/mattn/go-isatty v0.0.5/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-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
@@ -237,6 +239,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
@@ -280,9 +283,11 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -349,6 +354,7 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -441,12 +447,14 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/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.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=

19
main.go
View File

@@ -76,12 +76,15 @@ func (b *BuildManager) buildWorker(id int) {
continue
}
pkg.PkgFiles = []string{}
ltoDisabled := false
// default to LTO
makepkgFile := "makepkg-%s-lto.conf"
if contains(conf.Blacklist.LTO, pkg.Pkgbase) {
// use non-lto makepkg.conf if LTO is blacklisted for this package
makepkgFile = "makepkg-%s.conf"
ltoDisabled = true
dbPkg.Update().SetLto(dbpackage.LtoDisabled).ExecX(context.Background())
}
cmd := exec.Command("sh", "-c",
"cd "+filepath.Dir(pkg.Pkgbuild)+"&&makechrootpkg -c -D "+conf.Basedir.Makepkg+" -l worker-"+strconv.Itoa(id)+" -r "+conf.Basedir.Chroot+" -- "+
@@ -181,7 +184,11 @@ func (b *BuildManager) buildWorker(id int) {
check(os.Remove(filepath.Join(conf.Basedir.Repo, "logs", pkg.Pkgbase+".log")))
}
dbPkg.Update().SetStatus(dbpackage.StatusBuild).SetBuildTimeEnd(time.Now().UTC()).ExecX(context.Background())
if !ltoDisabled {
dbPkg.Update().SetStatus(dbpackage.StatusBuild).SetLto(dbpackage.LtoEnabled).SetBuildTimeEnd(time.Now().UTC()).ExecX(context.Background())
} else {
dbPkg.Update().SetStatus(dbpackage.StatusBuild).SetLto(dbpackage.LtoDisabled).SetBuildTimeEnd(time.Now().UTC()).ExecX(context.Background())
}
log.Infof("[%s/%s] Build successful (%s)", pkg.FullRepo, pkg.Pkgbase, time.Now().Sub(start))
b.repoAdd[pkg.FullRepo] <- pkg
@@ -310,6 +317,7 @@ func (b *BuildManager) htmlWorker() {
BuildDuration time.Duration
Checked string
Log string
LTO string
}
type Repo struct {
@@ -370,6 +378,15 @@ func (b *BuildManager) htmlWorker() {
addPkg.Log = fmt.Sprintf("logs/%s.log", pkg.Pkgbase)
}
switch pkg.Lto {
case dbpackage.LtoUnknown:
addPkg.LTO = "<i class=\"bi bi-question-lg\" style=\"color: var(--bs-warning);\" title=\"LTO Status Unknown\"></i>"
case dbpackage.LtoEnabled:
addPkg.LTO = "<i class=\"bi bi-check-lg\" style=\"color: var(--bs-success);\" title=\"LTO Enabled\"></i>"
case dbpackage.LtoDisabled:
addPkg.LTO = "<i class=\"bi bi-x-lg\" style=\"color: var(--bs-danger);\" title=\"LTO Disabled\"></i>"
}
addRepo.Packages = append(addRepo.Packages, addPkg)
}
addMarch.Repos = append(addMarch.Repos, addRepo)

View File

@@ -58,6 +58,7 @@
<th scope="col">Pkgbase</th>
<th scope="col">Status</th>
<th scope="col">Reason</th>
<th scope="col" title="link time optimization">LTO</th>
<th scope="col">SVN2GIT Version</th>
<th scope="col">{{$repo.Name}}-{{$march.Name}} Version</th>
<th scope="col">Info</th>
@@ -69,6 +70,7 @@
<td>{{$pkg.Pkgbase}}</td>
<td>{{$pkg.Status}}</td>
<td>{{$pkg.Skip}}</td>
<td>{{$pkg.LTO}}</td>
<td>{{$pkg.Svn2GitVersion}}</td>
<td>{{$pkg.Version}}</td>
<td class="text-center">