Skip to content

Commit 05de2a7

Browse files
committed
Resolve package identifier from original version fields
Use sdk_version/sdp_version instead of tc_identifier for the VERSION_MATRIX lookup, since tc_identifier may be remapped for platform constraint compatibility and differ from the real version.
1 parent 56041d1 commit 05de2a7

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

extensions/gcc.bzl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,22 @@ def _create_and_link_sdp(toolchain_info):
215215
"""
216216
pkg_name = "{}_pkg".format(toolchain_info["name"])
217217

218+
# Resolve package identifier from original version fields, not the
219+
# constraint-remapped tc_identifier. tc_identifier may differ from
220+
# the actual version (e.g., sdp 8.0.3 is remapped to 8.0.0 for
221+
# platform constraint compatibility), but the version matrix uses
222+
# the real version.
223+
if toolchain_info["sdk_version"] != "":
224+
pkg_identifier = "sdk_{}".format(toolchain_info["sdk_version"])
225+
elif toolchain_info["sdp_version"] != "":
226+
pkg_identifier = "sdp_{}".format(toolchain_info["sdp_version"])
227+
else:
228+
pkg_identifier = toolchain_info["tc_identifier"]
229+
218230
matrix_key = "{cpu}-{os}{identifier}{runtime_es}".format(
219231
cpu = toolchain_info["tc_cpu"],
220232
os = toolchain_info["tc_os"],
221-
identifier = "-{}".format(toolchain_info["tc_identifier"]) if toolchain_info["tc_identifier"] != "" else "",
233+
identifier = "-{}".format(pkg_identifier) if pkg_identifier != "" else "",
222234
runtime_es = "-{}".format(toolchain_info["tc_runtime_ecosystem"]) if toolchain_info["tc_runtime_ecosystem"] != "" else "",
223235
)
224236
matrix = VERSION_MATRIX[matrix_key]

0 commit comments

Comments
 (0)