Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently generate build tags metadata #4582

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

sigv
Copy link
Contributor

@sigv sigv commented Mar 12, 2023

References: cosmos/gaia#2017

What is the purpose of the change

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 :=. Reference

Brief Changelog

  • 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.

Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.

The difference in build_tags output can be observed:

# pre-built (v14.0.1)
$ osmosisd-14.0.1-linux-amd64 version --long 2>&1 | head -n5
name: osmosis
server_name: osmosisd
version: 14.0.1
commit: 0a4b5bed878af2ea2167749f937e7cdde21f9031
build_tags: '''netgo,ledger,muslc'''
# `docker build -t osmosis .` (PR branch)
$ docker run --rm -it osmosis version --long | head -n5
name: osmosis
server_name: osmosisd
version: ""
commit: ""
build_tags: netgo,ledger,muslc

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? (yes) If someone is actually parsing these programmatically, then it's a user-facing behavior changes.
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? (yes)
  • How is the feature or change documented? (not applicable) The behavior change is implementing the originally intended BuildTags behavior by Cosmoshub/Gaia and all derivatives. A changelog warning is in place, but further documentation is not beneficial here.

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: cosmos/gaia@297cdb9
Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK, thank you for the through breakdown and references!

@p0mvn p0mvn added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v15.x backport patches to v15.x branch labels Mar 13, 2023
@p0mvn p0mvn merged commit 9d01b70 into osmosis-labs:main Mar 13, 2023
mergify bot pushed a commit that referenced this pull request Mar 13, 2023
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: cosmos/gaia@297cdb9
(cherry picked from commit 9d01b70)
p0mvn pushed a commit that referenced this pull request Mar 13, 2023
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: cosmos/gaia@297cdb9
(cherry picked from commit 9d01b70)

Co-authored-by: Valters Jansons <[email protected]>
@sigv sigv deleted the build_tags_make_4_3 branch March 13, 2023 23:50
pysel pushed a commit that referenced this pull request Mar 14, 2023
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: cosmos/gaia@297cdb9
@github-actions github-actions bot mentioned this pull request Jan 15, 2024
@github-actions github-actions bot mentioned this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v15.x backport patches to v15.x branch T:build V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants