Skip to content

Commit

Permalink
Don't embed build info (#180)
Browse files Browse the repository at this point in the history
This information isn't useful and makes it hard to reproducibly build the same output. If it was still useful then we could add it to the manifest, but it isn't, and so it is being removed. The build epcoh that is merged into CI builds will also need consideration, but is a separate PR.
  • Loading branch information
mhutchinson authored Dec 13, 2023
1 parent fd2b2d3 commit 50bc5ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

BUILD_USER ?= $(shell whoami)
BUILD_HOST ?= $(shell hostname)
BUILD_DATE ?= $(shell /bin/date -u "+%Y-%m-%d %H:%M:%S")
BUILD_EPOCH := $(shell /bin/date -u "+%s")
BUILD_TAGS = linkramsize,linkramstart,disable_fr_auth,linkprintk,nostatfs
BUILD = ${BUILD_USER}@${BUILD_HOST} on ${BUILD_DATE}
REV = $(shell git rev-parse --short HEAD 2> /dev/null)
GIT_SEMVER_TAG ?= $(shell (git describe --tags --exact-match --match 'v*.*.*' 2>/dev/null || git describe --match 'v*.*.*' --tags 2>/dev/null || git describe --tags 2>/dev/null || echo -n v0.0.${BUILD_EPOCH}+`git rev-parse HEAD`) | tail -c +2 )
FT_BIN_URL ?= "http://$(shell hostname --fqdn):9944/artefacts/"
Expand All @@ -44,7 +40,7 @@ ARCH = "arm"

GOFLAGS = -tags ${BUILD_TAGS} -trimpath \
-ldflags "-T ${TEXT_START} -E ${ENTRY_POINT} -R 0x1000 \
-X 'main.Build=${BUILD}' -X 'main.Revision=${REV}' -X 'main.Version=${GIT_SEMVER_TAG}' \
-X 'main.Revision=${REV}' -X 'main.Version=${GIT_SEMVER_TAG}' \
-X 'main.RestDistributorBaseURL=${REST_DISTRIBUTOR_BASE_URL}' \
-X 'main.updateBinariesURL=${FT_BIN_URL}' \
-X 'main.updateLogURL=${FT_LOG_URL}' \
Expand Down
5 changes: 2 additions & 3 deletions trusted_applet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const (
)

var (
Build string
Revision string
Version string

Expand Down Expand Up @@ -96,9 +95,9 @@ func main() {
}
monitoring.SetMetricFactory(mf)

log.Printf("%s/%s (%s) • TEE user applet • %s %s",
log.Printf("%s/%s (%s) • TEE user applet • %s",
runtime.GOOS, runtime.GOARCH, runtime.Version(),
Revision, Build)
Revision)

// Verify if we are allowed to run on this unit by sending version
// information for rollback protection check.
Expand Down

0 comments on commit 50bc5ae

Please sign in to comment.