Skip to content

Commit d6d7e3c

Browse files
committed
Merge pull request #111918 from WhenToBen/fix-vsinsiders-bug
MSVC: Check `catalog_productSemanticVersion` instead of `catalog_productDisplayVersion`
2 parents d23cd1b + 6cfaee0 commit d6d7e3c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

methods.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,14 @@ def get_compiler_version(env):
729729
version = subprocess.check_output(args, encoding="utf-8").strip()
730730
for line in version.splitlines():
731731
split = line.split(":", 1)
732-
if split[0] == "catalog_productDisplayVersion":
733-
sem_ver = split[1].split(".")
734-
ret["major"] = int(sem_ver[0])
735-
ret["minor"] = int(sem_ver[1])
736-
ret["patch"] = int(sem_ver[2].split()[0])
732+
if split[0] == "catalog_productSemanticVersion":
733+
match = re.match(r" ([0-9]*).([0-9]*).([0-9]*)-?([a-z0-9.+]*)", split[1])
734+
if match is not None:
735+
ret["major"] = int(match.group(1))
736+
ret["minor"] = int(match.group(2))
737+
ret["patch"] = int(match.group(3))
738+
# Semantic suffix (i.e. insiders+11116.177)
739+
ret["metadata2"] = match.group(4)
737740
# Could potentially add section for determining preview version, but
738741
# that can wait until metadata is actually used for something.
739742
if split[0] == "catalog_buildVersion":

0 commit comments

Comments
 (0)