Skip to content

bundling: cleanup revisionfunc from buidlkitd.go #3249

Closed

Description

@grouville

As we are bundling daggerd, we cannot rely on the go mod version to estimate daggerd's version. The current strategy is to rely on the vcs hash.

We already have a function for that:

// Revision returns the VCS revision being used to build or empty string
// if none.
func Revision() string {
bi, ok := debug.ReadBuildInfo()
if !ok {
return ""
}
for _, s := range bi.Settings {
if s.Key == "vcs.revision" {
return s.Value[:9]
}
}
return ""
}
, but it doesn't contain the proper error return.

I had to copy and tweak it lightly: https://github.com/dagger/dagger/blob/0ee91518c60cd66a3e42d1646e516a1c045e0f20/internal/buildkitd/buildkitd.go#L199-L213

A cleaner implementation might be possible

Activity

  1. self-assigned this
    on Oct 4, 2022
  2. grouville commented on Oct 27, 2022

    @grouville
    MemberAuthor

    Closing, as it was cleaned inside the PR. And the PR has been closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions