Skip to content

Commit 30d9f41

Browse files
nradakovicltekieli
andauthored
Add new QNX package into matrix (#49)
* Add new QNX package into matrix The new QNX package version 8.0.3 is added. Currently we do not support this version constraint on platform side so the constraint will still point 8.0.0. * 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. --------- Co-authored-by: Lukasz Tekieli <lukasz.tekieli@bmw.de>
1 parent e338375 commit 30d9f41

5 files changed

Lines changed: 34 additions & 8 deletions

File tree

examples/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ gcc.toolchain(
116116
# *******************************************************************************
117117
gcc.toolchain(
118118
name = "score_qcc_toolchain",
119-
sdp_version = "8.0.0",
119+
sdp_version = "8.0.3",
120120
target_cpu = "x86_64",
121121
target_os = "qnx",
122122
use_default_package = True,

examples/MODULE.bazel.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/gcc.bzl

Lines changed: 14 additions & 2 deletions
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]
@@ -260,7 +272,7 @@ def _resolve_identifier(toolchain_info):
260272
version = toolchain_info["sdk_version"]
261273
elif toolchain_info["sdp_version"] != "":
262274
identifier = "sdp"
263-
version = toolchain_info["sdp_version"]
275+
version = "8.0.0" if toolchain_info["sdp_version"] == "8.0.3" else toolchain_info["sdp_version"] # FIXME: currently we do not support constraint "8.0.3".
264276

265277
return "{}_{}".format(identifier, version)
266278

packages/version_matrix.bzl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ VERSION_MATRIX = {
7373
"url": "https://www.qnx.com/download/download/79858/installation.tgz",
7474
"gcc_version": "12.2.0",
7575
},
76+
"aarch64-qnx-sdp_8.0.3": {
77+
"build_file": "@score_bazel_cpp_toolchains//packages/qnx/aarch64/sdp/8.0.0:sdp.BUILD",
78+
"sha256": "9039fd6a4a639f06ea977afb93963a6fe8f8c46db727066709370d999c7232e0",
79+
"strip_prefix": "",
80+
"url": "https://www.qnx.com/download/download/87174/installation_qnx_803_260305.tar.xz",
81+
"gcc_version": "12.2.0",
82+
},
7683
"x86_64-linux-gcc_12.2.0": {
7784
"build_file": "@score_bazel_cpp_toolchains//packages/linux/x86_64/gcc/12.2.0:gcc.BUILD",
7885
"sha256": "e9b9a7a63a5f8271b76d6e2057906b95c7a244e4931a8e10edeaa241e9f7c11e",
@@ -193,4 +200,11 @@ VERSION_MATRIX = {
193200
"url": "https://www.qnx.com/download/download/79858/installation.tgz",
194201
"gcc_version": "12.2.0",
195202
},
203+
"x86_64-qnx-sdp_8.0.3": {
204+
"build_file": "@score_bazel_cpp_toolchains//packages/qnx/x86_64/sdp/8.0.0:sdp.BUILD",
205+
"sha256": "9039fd6a4a639f06ea977afb93963a6fe8f8c46db727066709370d999c7232e0",
206+
"strip_prefix": "",
207+
"url": "https://www.qnx.com/download/download/87174/installation_qnx_803_260305.tar.xz",
208+
"gcc_version": "12.2.0",
209+
},
196210
}

rules/gcc.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _impl(rctx):
180180
"%{license_info_value}": rctx.attr.license_info_value,
181181
"%{license_info_variable}": rctx.attr.license_info_variable,
182182
"%{license_path}": rctx.attr.license_path,
183-
"%{sdp_version}": rctx.attr.sdp_version,
183+
"%{sdp_version}": "8.0.0" if rctx.attr.sdp_version == "8.0.3" else rctx.attr.sdp_version, # FIXME: currently we do not support constraint "8.0.3".
184184
"%{tc_cpu_cxx}": "aarch64le" if rctx.attr.tc_cpu == "aarch64" else rctx.attr.tc_cpu,
185185
"%{use_license_info}": "False" if rctx.attr.license_info_value == "" else "True",
186186
}

0 commit comments

Comments
 (0)