Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: INFENG-926: Fix version.sh version string output (#10085)
This fixes a bug in version.sh that would cause an invalid local version string to be output under certain circumstances; specifically, if a tag were made on a commit that was not on the current branch (i.e. reachable with git-describe). This took a code path in version.sh that did not properly remove any existing tag +metadata with grep, leading to version strings like 0.751.0+dryrun+27a014b44. Note the extra plus sign (+). This causes downstream tools, like helm, to fail. Now, we remove any existing version metadata from the final for all code paths. This also changes all instances of \d character classes to [0-9]. This fixes a cross-platform issue where BSD grep's -E includes \d classes, while GNU grep's -E does not. This means the script worked fine on macOS, but broke subtly in CI (and I suppose on anyone's work machine that uses Linux). We avoid this entirely by falling back to standard character sets.
- Loading branch information