Skip to content

Commit

Permalink
bugfix: fixing how previous versions are parsed for the symbols map g…
Browse files Browse the repository at this point in the history
…enerator (#3498)
  • Loading branch information
mattkae authored Jul 19, 2024
2 parents 6842d73 + 645c887 commit cb2e06a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tools/symbols_map_generator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@ class LibraryInfo(TypedDict):
header_directories: list[HeaderDirectory]
map_file: str

def get_version_from_library_version_str(version: str) -> str:
"""
Given a string like MIR_SERVER_INTERNAL_5.0.0, returns the version
string (e.g. 5.0.0)
"""
return version.split("_")[-1]


def get_major_version_from_str(version: str) -> int:
"""
Given a string like 5.0.0, returns the major version (e.g. 5).
"""
return int(version.split('.')[0])


Expand Down Expand Up @@ -482,7 +492,7 @@ def main():

# Remake the stanzas for the previous symbols
for symbol in previous_symbols:
major = get_major_version_from_str(symbol.version)
major = get_major_version_from_str(get_version_from_library_version_str(symbol.version))

# If we are going up by a major version, then we should add
# all existing symbols to the new stanza
Expand Down

0 comments on commit cb2e06a

Please sign in to comment.