added debuginfod support

This commit is contained in:
2022-02-13 22:33:57 +01:00
parent 45672e3459
commit c7ba7340a5
13 changed files with 372 additions and 22 deletions

View File

@@ -27,7 +27,8 @@ db:
basedir: basedir:
repo: /var/lib/alhp/repo/ repo: /var/lib/alhp/repo/
work: /var/lib/alhp/chroot/ work: /var/lib/alhp/workspace/
debug: /var/lib/alhp/debug/
march: march:
- x86-64-v3 - x86-64-v3

View File

@@ -47,6 +47,8 @@ type DbPackage struct {
LastVersionBuild string `json:"last_version_build,omitempty"` LastVersionBuild string `json:"last_version_build,omitempty"`
// LastVerified holds the value of the "last_verified" field. // LastVerified holds the value of the "last_verified" field.
LastVerified time.Time `json:"last_verified,omitempty"` LastVerified time.Time `json:"last_verified,omitempty"`
// DebugSymbols holds the value of the "debug_symbols" field.
DebugSymbols dbpackage.DebugSymbols `json:"debug_symbols,omitempty"`
} }
// scanValues returns the types for scanning values from sql.Rows. // scanValues returns the types for scanning values from sql.Rows.
@@ -58,7 +60,7 @@ func (*DbPackage) scanValues(columns []string) ([]interface{}, error) {
values[i] = new([]byte) values[i] = new([]byte)
case dbpackage.FieldID: case dbpackage.FieldID:
values[i] = new(sql.NullInt64) values[i] = new(sql.NullInt64)
case dbpackage.FieldPkgbase, dbpackage.FieldStatus, dbpackage.FieldSkipReason, dbpackage.FieldRepository, dbpackage.FieldMarch, dbpackage.FieldVersion, dbpackage.FieldRepoVersion, dbpackage.FieldHash, dbpackage.FieldLto, dbpackage.FieldLastVersionBuild: case dbpackage.FieldPkgbase, dbpackage.FieldStatus, dbpackage.FieldSkipReason, dbpackage.FieldRepository, dbpackage.FieldMarch, dbpackage.FieldVersion, dbpackage.FieldRepoVersion, dbpackage.FieldHash, dbpackage.FieldLto, dbpackage.FieldLastVersionBuild, dbpackage.FieldDebugSymbols:
values[i] = new(sql.NullString) values[i] = new(sql.NullString)
case dbpackage.FieldBuildTimeStart, dbpackage.FieldBuildTimeEnd, dbpackage.FieldUpdated, dbpackage.FieldLastVerified: case dbpackage.FieldBuildTimeStart, dbpackage.FieldBuildTimeEnd, dbpackage.FieldUpdated, dbpackage.FieldLastVerified:
values[i] = new(sql.NullTime) values[i] = new(sql.NullTime)
@@ -175,6 +177,12 @@ func (dp *DbPackage) assignValues(columns []string, values []interface{}) error
} else if value.Valid { } else if value.Valid {
dp.LastVerified = value.Time dp.LastVerified = value.Time
} }
case dbpackage.FieldDebugSymbols:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field debug_symbols", values[i])
} else if value.Valid {
dp.DebugSymbols = dbpackage.DebugSymbols(value.String)
}
} }
} }
return nil return nil
@@ -233,6 +241,8 @@ func (dp *DbPackage) String() string {
builder.WriteString(dp.LastVersionBuild) builder.WriteString(dp.LastVersionBuild)
builder.WriteString(", last_verified=") builder.WriteString(", last_verified=")
builder.WriteString(dp.LastVerified.Format(time.ANSIC)) builder.WriteString(dp.LastVerified.Format(time.ANSIC))
builder.WriteString(", debug_symbols=")
builder.WriteString(fmt.Sprintf("%v", dp.DebugSymbols))
builder.WriteByte(')') builder.WriteByte(')')
return builder.String() return builder.String()
} }

View File

@@ -41,6 +41,8 @@ const (
FieldLastVersionBuild = "last_version_build" FieldLastVersionBuild = "last_version_build"
// FieldLastVerified holds the string denoting the last_verified field in the database. // FieldLastVerified holds the string denoting the last_verified field in the database.
FieldLastVerified = "last_verified" FieldLastVerified = "last_verified"
// FieldDebugSymbols holds the string denoting the debug_symbols field in the database.
FieldDebugSymbols = "debug_symbols"
// Table holds the table name of the dbpackage in the database. // Table holds the table name of the dbpackage in the database.
Table = "db_packages" Table = "db_packages"
) )
@@ -63,6 +65,7 @@ var Columns = []string{
FieldLto, FieldLto,
FieldLastVersionBuild, FieldLastVersionBuild,
FieldLastVerified, FieldLastVerified,
FieldDebugSymbols,
} }
// ValidColumn reports if the column name is valid (part of the table columns). // ValidColumn reports if the column name is valid (part of the table columns).
@@ -165,3 +168,30 @@ func LtoValidator(l Lto) error {
return fmt.Errorf("dbpackage: invalid enum value for lto field: %q", l) return fmt.Errorf("dbpackage: invalid enum value for lto field: %q", l)
} }
} }
// DebugSymbols defines the type for the "debug_symbols" enum field.
type DebugSymbols string
// DebugSymbolsUnknown is the default value of the DebugSymbols enum.
const DefaultDebugSymbols = DebugSymbolsUnknown
// DebugSymbols values.
const (
DebugSymbolsAvailable DebugSymbols = "available"
DebugSymbolsUnknown DebugSymbols = "unknown"
DebugSymbolsNotAvailable DebugSymbols = "not_available"
)
func (ds DebugSymbols) String() string {
return string(ds)
}
// DebugSymbolsValidator is a validator for the "debug_symbols" field enum values. It is called by the builders before save.
func DebugSymbolsValidator(ds DebugSymbols) error {
switch ds {
case DebugSymbolsAvailable, DebugSymbolsUnknown, DebugSymbolsNotAvailable:
return nil
default:
return fmt.Errorf("dbpackage: invalid enum value for debug_symbols field: %q", ds)
}
}

View File

@@ -1562,6 +1562,68 @@ func LastVerifiedNotNil() predicate.DbPackage {
}) })
} }
// DebugSymbolsEQ applies the EQ predicate on the "debug_symbols" field.
func DebugSymbolsEQ(v DebugSymbols) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldDebugSymbols), v))
})
}
// DebugSymbolsNEQ applies the NEQ predicate on the "debug_symbols" field.
func DebugSymbolsNEQ(v DebugSymbols) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldDebugSymbols), v))
})
}
// DebugSymbolsIn applies the In predicate on the "debug_symbols" field.
func DebugSymbolsIn(vs ...DebugSymbols) 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(FieldDebugSymbols), v...))
})
}
// DebugSymbolsNotIn applies the NotIn predicate on the "debug_symbols" field.
func DebugSymbolsNotIn(vs ...DebugSymbols) 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(FieldDebugSymbols), v...))
})
}
// DebugSymbolsIsNil applies the IsNil predicate on the "debug_symbols" field.
func DebugSymbolsIsNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldDebugSymbols)))
})
}
// DebugSymbolsNotNil applies the NotNil predicate on the "debug_symbols" field.
func DebugSymbolsNotNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldDebugSymbols)))
})
}
// And groups predicates with the AND operator between them. // And groups predicates with the AND operator between them.
func And(predicates ...predicate.DbPackage) predicate.DbPackage { func And(predicates ...predicate.DbPackage) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) { return predicate.DbPackage(func(s *sql.Selector) {

View File

@@ -198,6 +198,20 @@ func (dpc *DbPackageCreate) SetNillableLastVerified(t *time.Time) *DbPackageCrea
return dpc return dpc
} }
// SetDebugSymbols sets the "debug_symbols" field.
func (dpc *DbPackageCreate) SetDebugSymbols(ds dbpackage.DebugSymbols) *DbPackageCreate {
dpc.mutation.SetDebugSymbols(ds)
return dpc
}
// SetNillableDebugSymbols sets the "debug_symbols" field if the given value is not nil.
func (dpc *DbPackageCreate) SetNillableDebugSymbols(ds *dbpackage.DebugSymbols) *DbPackageCreate {
if ds != nil {
dpc.SetDebugSymbols(*ds)
}
return dpc
}
// Mutation returns the DbPackageMutation object of the builder. // Mutation returns the DbPackageMutation object of the builder.
func (dpc *DbPackageCreate) Mutation() *DbPackageMutation { func (dpc *DbPackageCreate) Mutation() *DbPackageMutation {
return dpc.mutation return dpc.mutation
@@ -277,6 +291,10 @@ func (dpc *DbPackageCreate) defaults() {
v := dbpackage.DefaultLto v := dbpackage.DefaultLto
dpc.mutation.SetLto(v) dpc.mutation.SetLto(v)
} }
if _, ok := dpc.mutation.DebugSymbols(); !ok {
v := dbpackage.DefaultDebugSymbols
dpc.mutation.SetDebugSymbols(v)
}
} }
// check runs all checks and user-defined validators on the builder. // check runs all checks and user-defined validators on the builder.
@@ -315,6 +333,11 @@ func (dpc *DbPackageCreate) check() error {
return &ValidationError{Name: "lto", err: fmt.Errorf(`ent: validator failed for field "DbPackage.lto": %w`, err)} return &ValidationError{Name: "lto", err: fmt.Errorf(`ent: validator failed for field "DbPackage.lto": %w`, err)}
} }
} }
if v, ok := dpc.mutation.DebugSymbols(); ok {
if err := dbpackage.DebugSymbolsValidator(v); err != nil {
return &ValidationError{Name: "debug_symbols", err: fmt.Errorf(`ent: validator failed for field "DbPackage.debug_symbols": %w`, err)}
}
}
return nil return nil
} }
@@ -462,6 +485,14 @@ func (dpc *DbPackageCreate) createSpec() (*DbPackage, *sqlgraph.CreateSpec) {
}) })
_node.LastVerified = value _node.LastVerified = value
} }
if value, ok := dpc.mutation.DebugSymbols(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Value: value,
Column: dbpackage.FieldDebugSymbols,
})
_node.DebugSymbols = value
}
return _node, _spec return _node, _spec
} }

View File

@@ -266,6 +266,26 @@ func (dpu *DbPackageUpdate) ClearLastVerified() *DbPackageUpdate {
return dpu return dpu
} }
// SetDebugSymbols sets the "debug_symbols" field.
func (dpu *DbPackageUpdate) SetDebugSymbols(ds dbpackage.DebugSymbols) *DbPackageUpdate {
dpu.mutation.SetDebugSymbols(ds)
return dpu
}
// SetNillableDebugSymbols sets the "debug_symbols" field if the given value is not nil.
func (dpu *DbPackageUpdate) SetNillableDebugSymbols(ds *dbpackage.DebugSymbols) *DbPackageUpdate {
if ds != nil {
dpu.SetDebugSymbols(*ds)
}
return dpu
}
// ClearDebugSymbols clears the value of the "debug_symbols" field.
func (dpu *DbPackageUpdate) ClearDebugSymbols() *DbPackageUpdate {
dpu.mutation.ClearDebugSymbols()
return dpu
}
// Mutation returns the DbPackageMutation object of the builder. // Mutation returns the DbPackageMutation object of the builder.
func (dpu *DbPackageUpdate) Mutation() *DbPackageMutation { func (dpu *DbPackageUpdate) Mutation() *DbPackageMutation {
return dpu.mutation return dpu.mutation
@@ -348,6 +368,11 @@ func (dpu *DbPackageUpdate) check() error {
return &ValidationError{Name: "lto", err: fmt.Errorf(`ent: validator failed for field "DbPackage.lto": %w`, err)} return &ValidationError{Name: "lto", err: fmt.Errorf(`ent: validator failed for field "DbPackage.lto": %w`, err)}
} }
} }
if v, ok := dpu.mutation.DebugSymbols(); ok {
if err := dbpackage.DebugSymbolsValidator(v); err != nil {
return &ValidationError{Name: "debug_symbols", err: fmt.Errorf(`ent: validator failed for field "DbPackage.debug_symbols": %w`, err)}
}
}
return nil return nil
} }
@@ -532,6 +557,19 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
Column: dbpackage.FieldLastVerified, Column: dbpackage.FieldLastVerified,
}) })
} }
if value, ok := dpu.mutation.DebugSymbols(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Value: value,
Column: dbpackage.FieldDebugSymbols,
})
}
if dpu.mutation.DebugSymbolsCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Column: dbpackage.FieldDebugSymbols,
})
}
if n, err = sqlgraph.UpdateNodes(ctx, dpu.driver, _spec); err != nil { if n, err = sqlgraph.UpdateNodes(ctx, dpu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok { if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{dbpackage.Label} err = &NotFoundError{dbpackage.Label}
@@ -789,6 +827,26 @@ func (dpuo *DbPackageUpdateOne) ClearLastVerified() *DbPackageUpdateOne {
return dpuo return dpuo
} }
// SetDebugSymbols sets the "debug_symbols" field.
func (dpuo *DbPackageUpdateOne) SetDebugSymbols(ds dbpackage.DebugSymbols) *DbPackageUpdateOne {
dpuo.mutation.SetDebugSymbols(ds)
return dpuo
}
// SetNillableDebugSymbols sets the "debug_symbols" field if the given value is not nil.
func (dpuo *DbPackageUpdateOne) SetNillableDebugSymbols(ds *dbpackage.DebugSymbols) *DbPackageUpdateOne {
if ds != nil {
dpuo.SetDebugSymbols(*ds)
}
return dpuo
}
// ClearDebugSymbols clears the value of the "debug_symbols" field.
func (dpuo *DbPackageUpdateOne) ClearDebugSymbols() *DbPackageUpdateOne {
dpuo.mutation.ClearDebugSymbols()
return dpuo
}
// Mutation returns the DbPackageMutation object of the builder. // Mutation returns the DbPackageMutation object of the builder.
func (dpuo *DbPackageUpdateOne) Mutation() *DbPackageMutation { func (dpuo *DbPackageUpdateOne) Mutation() *DbPackageMutation {
return dpuo.mutation return dpuo.mutation
@@ -878,6 +936,11 @@ func (dpuo *DbPackageUpdateOne) check() error {
return &ValidationError{Name: "lto", err: fmt.Errorf(`ent: validator failed for field "DbPackage.lto": %w`, err)} return &ValidationError{Name: "lto", err: fmt.Errorf(`ent: validator failed for field "DbPackage.lto": %w`, err)}
} }
} }
if v, ok := dpuo.mutation.DebugSymbols(); ok {
if err := dbpackage.DebugSymbolsValidator(v); err != nil {
return &ValidationError{Name: "debug_symbols", err: fmt.Errorf(`ent: validator failed for field "DbPackage.debug_symbols": %w`, err)}
}
}
return nil return nil
} }
@@ -1079,6 +1142,19 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
Column: dbpackage.FieldLastVerified, Column: dbpackage.FieldLastVerified,
}) })
} }
if value, ok := dpuo.mutation.DebugSymbols(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Value: value,
Column: dbpackage.FieldDebugSymbols,
})
}
if dpuo.mutation.DebugSymbolsCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeEnum,
Column: dbpackage.FieldDebugSymbols,
})
}
_node = &DbPackage{config: dpuo.config} _node = &DbPackage{config: dpuo.config}
_spec.Assign = _node.assignValues _spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues _spec.ScanValues = _node.scanValues

View File

@@ -26,6 +26,7 @@ var (
{Name: "lto", Type: field.TypeEnum, Nullable: true, Enums: []string{"enabled", "unknown", "disabled", "auto_disabled"}, Default: "unknown"}, {Name: "lto", Type: field.TypeEnum, Nullable: true, Enums: []string{"enabled", "unknown", "disabled", "auto_disabled"}, Default: "unknown"},
{Name: "last_version_build", Type: field.TypeString, Nullable: true}, {Name: "last_version_build", Type: field.TypeString, Nullable: true},
{Name: "last_verified", Type: field.TypeTime, Nullable: true}, {Name: "last_verified", Type: field.TypeTime, Nullable: true},
{Name: "debug_symbols", Type: field.TypeEnum, Nullable: true, Enums: []string{"available", "unknown", "not_available"}, Default: "unknown"},
} }
// DbPackagesTable holds the schema information for the "db_packages" table. // DbPackagesTable holds the schema information for the "db_packages" table.
DbPackagesTable = &schema.Table{ DbPackagesTable = &schema.Table{

View File

@@ -48,6 +48,7 @@ type DbPackageMutation struct {
lto *dbpackage.Lto lto *dbpackage.Lto
last_version_build *string last_version_build *string
last_verified *time.Time last_verified *time.Time
debug_symbols *dbpackage.DebugSymbols
clearedFields map[string]struct{} clearedFields map[string]struct{}
done bool done bool
oldValue func(context.Context) (*DbPackage, error) oldValue func(context.Context) (*DbPackage, error)
@@ -848,6 +849,55 @@ func (m *DbPackageMutation) ResetLastVerified() {
delete(m.clearedFields, dbpackage.FieldLastVerified) delete(m.clearedFields, dbpackage.FieldLastVerified)
} }
// SetDebugSymbols sets the "debug_symbols" field.
func (m *DbPackageMutation) SetDebugSymbols(ds dbpackage.DebugSymbols) {
m.debug_symbols = &ds
}
// DebugSymbols returns the value of the "debug_symbols" field in the mutation.
func (m *DbPackageMutation) DebugSymbols() (r dbpackage.DebugSymbols, exists bool) {
v := m.debug_symbols
if v == nil {
return
}
return *v, true
}
// OldDebugSymbols returns the old "debug_symbols" 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) OldDebugSymbols(ctx context.Context) (v dbpackage.DebugSymbols, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldDebugSymbols is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldDebugSymbols requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldDebugSymbols: %w", err)
}
return oldValue.DebugSymbols, nil
}
// ClearDebugSymbols clears the value of the "debug_symbols" field.
func (m *DbPackageMutation) ClearDebugSymbols() {
m.debug_symbols = nil
m.clearedFields[dbpackage.FieldDebugSymbols] = struct{}{}
}
// DebugSymbolsCleared returns if the "debug_symbols" field was cleared in this mutation.
func (m *DbPackageMutation) DebugSymbolsCleared() bool {
_, ok := m.clearedFields[dbpackage.FieldDebugSymbols]
return ok
}
// ResetDebugSymbols resets all changes to the "debug_symbols" field.
func (m *DbPackageMutation) ResetDebugSymbols() {
m.debug_symbols = nil
delete(m.clearedFields, dbpackage.FieldDebugSymbols)
}
// Where appends a list predicates to the DbPackageMutation builder. // Where appends a list predicates to the DbPackageMutation builder.
func (m *DbPackageMutation) Where(ps ...predicate.DbPackage) { func (m *DbPackageMutation) Where(ps ...predicate.DbPackage) {
m.predicates = append(m.predicates, ps...) m.predicates = append(m.predicates, ps...)
@@ -867,7 +917,7 @@ func (m *DbPackageMutation) Type() string {
// order to get all numeric fields that were incremented/decremented, call // order to get all numeric fields that were incremented/decremented, call
// AddedFields(). // AddedFields().
func (m *DbPackageMutation) Fields() []string { func (m *DbPackageMutation) Fields() []string {
fields := make([]string, 0, 15) fields := make([]string, 0, 16)
if m.pkgbase != nil { if m.pkgbase != nil {
fields = append(fields, dbpackage.FieldPkgbase) fields = append(fields, dbpackage.FieldPkgbase)
} }
@@ -913,6 +963,9 @@ func (m *DbPackageMutation) Fields() []string {
if m.last_verified != nil { if m.last_verified != nil {
fields = append(fields, dbpackage.FieldLastVerified) fields = append(fields, dbpackage.FieldLastVerified)
} }
if m.debug_symbols != nil {
fields = append(fields, dbpackage.FieldDebugSymbols)
}
return fields return fields
} }
@@ -951,6 +1004,8 @@ func (m *DbPackageMutation) Field(name string) (ent.Value, bool) {
return m.LastVersionBuild() return m.LastVersionBuild()
case dbpackage.FieldLastVerified: case dbpackage.FieldLastVerified:
return m.LastVerified() return m.LastVerified()
case dbpackage.FieldDebugSymbols:
return m.DebugSymbols()
} }
return nil, false return nil, false
} }
@@ -990,6 +1045,8 @@ func (m *DbPackageMutation) OldField(ctx context.Context, name string) (ent.Valu
return m.OldLastVersionBuild(ctx) return m.OldLastVersionBuild(ctx)
case dbpackage.FieldLastVerified: case dbpackage.FieldLastVerified:
return m.OldLastVerified(ctx) return m.OldLastVerified(ctx)
case dbpackage.FieldDebugSymbols:
return m.OldDebugSymbols(ctx)
} }
return nil, fmt.Errorf("unknown DbPackage field %s", name) return nil, fmt.Errorf("unknown DbPackage field %s", name)
} }
@@ -1104,6 +1161,13 @@ func (m *DbPackageMutation) SetField(name string, value ent.Value) error {
} }
m.SetLastVerified(v) m.SetLastVerified(v)
return nil return nil
case dbpackage.FieldDebugSymbols:
v, ok := value.(dbpackage.DebugSymbols)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetDebugSymbols(v)
return nil
} }
return fmt.Errorf("unknown DbPackage field %s", name) return fmt.Errorf("unknown DbPackage field %s", name)
} }
@@ -1170,6 +1234,9 @@ func (m *DbPackageMutation) ClearedFields() []string {
if m.FieldCleared(dbpackage.FieldLastVerified) { if m.FieldCleared(dbpackage.FieldLastVerified) {
fields = append(fields, dbpackage.FieldLastVerified) fields = append(fields, dbpackage.FieldLastVerified)
} }
if m.FieldCleared(dbpackage.FieldDebugSymbols) {
fields = append(fields, dbpackage.FieldDebugSymbols)
}
return fields return fields
} }
@@ -1220,6 +1287,9 @@ func (m *DbPackageMutation) ClearField(name string) error {
case dbpackage.FieldLastVerified: case dbpackage.FieldLastVerified:
m.ClearLastVerified() m.ClearLastVerified()
return nil return nil
case dbpackage.FieldDebugSymbols:
m.ClearDebugSymbols()
return nil
} }
return fmt.Errorf("unknown DbPackage nullable field %s", name) return fmt.Errorf("unknown DbPackage nullable field %s", name)
} }
@@ -1273,6 +1343,9 @@ func (m *DbPackageMutation) ResetField(name string) error {
case dbpackage.FieldLastVerified: case dbpackage.FieldLastVerified:
m.ResetLastVerified() m.ResetLastVerified()
return nil return nil
case dbpackage.FieldDebugSymbols:
m.ResetDebugSymbols()
return nil
} }
return fmt.Errorf("unknown DbPackage field %s", name) return fmt.Errorf("unknown DbPackage field %s", name)
} }

View File

@@ -28,6 +28,7 @@ func (DbPackage) Fields() []ent.Field {
field.Enum("lto").Values("enabled", "unknown", "disabled", "auto_disabled").Default("unknown").Optional(), field.Enum("lto").Values("enabled", "unknown", "disabled", "auto_disabled").Default("unknown").Optional(),
field.String("last_version_build").Optional(), field.String("last_version_build").Optional(),
field.Time("last_verified").Optional(), field.Time("last_verified").Optional(),
field.Enum("debug_symbols").Values("available", "unknown", "not_available").Default("unknown").Optional(),
} }
} }

5
go.sum
View File

@@ -120,9 +120,11 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 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.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-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
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/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
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=
@@ -141,7 +143,9 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0=
github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
@@ -233,6 +237,7 @@ golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/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.9-0.20211216111533-8d383106f7e7 h1:M1gcVrIb2lSn2FIL19DG0+/b8nNVKJ7W7b4WcAGZAYM=
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=

32
main.go
View File

@@ -408,6 +408,9 @@ func (b *BuildManager) htmlWorker() {
LTOUnknown bool LTOUnknown bool
LTODisabled bool LTODisabled bool
LTOAutoDisabled bool LTOAutoDisabled bool
DebugSym bool
DebugSymNotAvailable bool
DebugSymUnknown bool
} }
type Repo struct { type Repo struct {
@@ -487,6 +490,17 @@ func (b *BuildManager) htmlWorker() {
addPkg.LTOAutoDisabled = true 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) addRepo.Packages = append(addRepo.Packages, addPkg)
} }
addMarch.Repos = append(addMarch.Repos, addRepo) addMarch.Repos = append(addMarch.Repos, addRepo)
@@ -565,7 +579,23 @@ func (b *BuildManager) repoWorker(repo string) {
for _, pkg := range pkgL { for _, pkg := range pkgL {
pkg.toDbPackage(true) pkg.toDbPackage(true)
pkg.DbPackage = pkg.DbPackage.Update().SetStatus(dbpackage.StatusLatest).ClearSkipReason().SetRepoVersion(pkg.Version).SetHash(pkg.Hash).SaveX(context.Background()) if _, err := os.Stat(filepath.Join(conf.Basedir.Debug, pkg.March, pkg.DbPackage.Packages[0]+"-debug-"+pkg.Version+"-"+conf.Arch+".pkg.tar.zst")); err == nil {
pkg.DbPackage = pkg.DbPackage.Update().
SetStatus(dbpackage.StatusLatest).
ClearSkipReason().
SetDebugSymbols(dbpackage.DebugSymbolsAvailable).
SetRepoVersion(pkg.Version).
SetHash(pkg.Hash).
SaveX(context.Background())
} else {
pkg.DbPackage = pkg.DbPackage.Update().
SetStatus(dbpackage.StatusLatest).
ClearSkipReason().
SetDebugSymbols(dbpackage.DebugSymbolsNotAvailable).
SetRepoVersion(pkg.Version).
SetHash(pkg.Hash).
SaveX(context.Background())
}
} }
cmd = exec.Command("paccache", "-rc", filepath.Join(conf.Basedir.Repo, repo, "os", conf.Arch), "-k", "1") cmd = exec.Command("paccache", "-rc", filepath.Join(conf.Basedir.Repo, repo, "os", conf.Arch), "-k", "1")

View File

@@ -68,6 +68,8 @@
title="link time optimization
does not guarantee that package is actually build with LTO"> title="link time optimization
does not guarantee that package is actually build with LTO">
LTO LTO
</th> </th>
<th class="text-center" scope="col" title="Debugsymbols available via debuginfod">DgbSym
</th>
<th scope="col">Archlinux Version</th> <th scope="col">Archlinux Version</th>
<th scope="col">{{$repo.Name}}-{{$march.Name}} Version</th> <th scope="col">{{$repo.Name}}-{{$march.Name}} Version</th>
<th class="text-end" scope="col">Info</th> <th class="text-end" scope="col">Info</th>
@@ -91,6 +93,15 @@
{{if $pkg.LTOUnknown}}<i class="fa fa-hourglass-o fa-lg" {{if $pkg.LTOUnknown}}<i class="fa fa-hourglass-o fa-lg"
title="not build with LTO yet"></i>{{end}} title="not build with LTO yet"></i>{{end}}
</td> </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.Svn2GitVersion}}</td>
<td>{{$pkg.Version}}</td> <td>{{$pkg.Version}}</td>
<td class="text-end info-box"> <td class="text-end info-box">

View File

@@ -87,7 +87,7 @@ type Conf struct {
Repos, March []string Repos, March []string
Svn2git map[string]string Svn2git map[string]string
Basedir struct { Basedir struct {
Repo, Work string Repo, Work, Debug string
} }
Db struct { Db struct {
Driver string Driver string
@@ -153,6 +153,7 @@ func updateLastUpdated() {
check(os.WriteFile(filepath.Join(conf.Basedir.Repo, lastUpdate), []byte(strconv.FormatInt(time.Now().Unix(), 10)), 0644)) check(os.WriteFile(filepath.Join(conf.Basedir.Repo, lastUpdate), []byte(strconv.FormatInt(time.Now().Unix(), 10)), 0644))
} }
// Name returns the name from Package
func (path Package) Name() string { func (path Package) Name() string {
fNameSplit := strings.Split(filepath.Base(string(path)), "-") fNameSplit := strings.Split(filepath.Base(string(path)), "-")
return strings.Join(fNameSplit[:len(fNameSplit)-3], "-") return strings.Join(fNameSplit[:len(fNameSplit)-3], "-")
@@ -453,8 +454,25 @@ 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)) dbPkg, err := pkg.DBPackageIsolated(march, dbpackage.Repository(repo))
if err != nil { if err != nil {
if strings.HasSuffix(pkg.Name(), "-debug") {
mkErr := os.MkdirAll(filepath.Join(conf.Basedir.Debug, march), 755)
if mkErr != nil {
return fmt.Errorf("unable to create folder for debug-packages: %w", mkErr)
}
forPackage := strings.TrimSuffix(pkg.Name(), "-debug")
log.Infof("[MOVE] Found debug package for package %s: %s", forPackage, pkg.Name())
if _, err := os.Stat(filepath.Join(conf.Basedir.Debug, march, filepath.Base(file))); err == nil {
log.Warningf("[MOVE] Existing debug infos for %s, skipping: %s", forPackage, filepath.Join(conf.Basedir.Debug, march, filepath.Base(file)))
} else {
err = os.Rename(file, filepath.Join(conf.Basedir.Debug, march, filepath.Base(file)))
_ = os.Remove(file + ".sig")
continue
}
}
log.Warningf("[MOVE] Deleting package %s: %v", pkg.Name(), err) log.Warningf("[MOVE] Deleting package %s: %v", pkg.Name(), err)
_ = os.Remove(file) _ = os.Remove(file)
_ = os.Remove(file + ".sig") _ = os.Remove(file + ".sig")
@@ -471,10 +489,11 @@ func movePackagesLive(fullRepo string) error {
} }
toAdd = append(toAdd, &BuildPackage{ toAdd = append(toAdd, &BuildPackage{
DbPackage: dbpkg, DbPackage: dbPkg,
Pkgbase: dbpkg.Pkgbase, Pkgbase: dbPkg.Pkgbase,
PkgFiles: []string{filepath.Join(conf.Basedir.Repo, fullRepo, "os", conf.Arch, filepath.Base(file))}, PkgFiles: []string{filepath.Join(conf.Basedir.Repo, fullRepo, "os", conf.Arch, filepath.Base(file))},
Version: pkg.Version(), Version: pkg.Version(),
March: march,
}) })
} }