From 9687891347ec1ca02058bf65c0557bb8309099f7 Mon Sep 17 00:00:00 2001 From: Valters Jansons Date: Sun, 12 Mar 2023 17:23:35 +0200 Subject: [PATCH] Consistently generate build tags metadata Dockerfile receives a minor tweak for proper output. BuildTags value is expected as a plain `netgo,ledger,muslc` string, however the current approach wraps quotes inside of quotes, and the resulting string is `'netgo,ledger,muslc'` which gets escaped a few more times (unnecessarily). Additionally, Makefile receives a minor tweak for everyone who builds directly. With Make 4.3+, the empty whitespace does not seem to work as originally intended. This causes build tags to be `netgo ledger,` on Ubuntu 22.04 and other systems that include the newer Make version. The build tags were intended as `netgo,ledger` which can be observed on Make 4.2 (shipped with Ubuntu 20.04). This change swaps out the `+=` use in favor of an explicit `:=`. Ref: https://www.gnu.org/software/make/manual/html_node/Appending.html Upstream: https://github.com/cosmos/gaia/commit/297cdb95709fdf534ce148d49dea4d7bda1f7173 --- CHANGELOG.md | 6 ++++++ Dockerfile | 2 +- Makefile | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fe6ad48753..4f29b283b2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Misc Improvements + + * [#4582](https://github.com/osmosis-labs/osmosis/pull/4582) Consistently generate build tags metadata, to return a comma-separated list without stray quotes. This affects the output from `version` CLI subcommand and server info API calls. + ## v15.0.0 This release containts the following new modules: diff --git a/Dockerfile b/Dockerfile index e2de25d8c23..eb0b2c575b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ -X github.com/cosmos/cosmos-sdk/version.AppName="osmosisd" \ -X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \ -X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \ - -X github.com/cosmos/cosmos-sdk/version.BuildTags='netgo,ledger,muslc' \ + -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \ -w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \ -trimpath \ -o /osmosis/build/osmosisd \ diff --git a/Makefile b/Makefile index 933e2b33c55..d8d13d86be2 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ build_tags += $(BUILD_TAGS) build_tags := $(strip $(build_tags)) whitespace := -whitespace += $(whitespace) +whitespace := $(whitespace) $(whitespace) comma := , build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))