Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/extension_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ attributes are:
- `url`: url of the archive,
- `sha256`: sha256 of the archive
- `strip_prefix`: extraction prefix for packaged archives
- `patches`: list of patch labels applied to the archive after extraction

## Feature Injection

Expand Down
3 changes: 2 additions & 1 deletion docs/generation_flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ toolchain repository through these steps:
`packages/version_matrix.bzl`

Defines the supported package matrix. Each entry maps a logical toolchain key
to download metadata and, when needed, extra compiler or linker flags.
to download metadata and, when needed, extra compiler or linker flags and
archive patches.

`rules/common.bzl`

Expand Down
2 changes: 1 addition & 1 deletion docs/repository_layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Contains the repository rules that materialize a toolchain repository.

Stores package metadata and BUILD descriptors for supported toolchain
archives. The most important file is `packages/version_matrix.bzl`, which maps
logical toolchain identifiers to URLs, checksums, build files, and any
logical toolchain identifiers to URLs, checksums, build files, patches, and any
required extra flags.

`templates/`
Expand Down
16 changes: 16 additions & 0 deletions extensions/gcc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ _attrs_sdp = {
default = "",
doc = "Url to the toolchain archive.",
),
"patches": attr.label_list(
mandatory = False,
default = [],
doc = "List of patches to apply to the archive.",
),
"files": attr.string_keyed_label_dict(
mandatory = False,
default = {},
doc = "A map of relative paths (key) to a file label (value) that overlaid on the repo as a symlink.",
),
}

# GCC interface API for toolchain tag class
Expand Down Expand Up @@ -188,6 +198,8 @@ def _get_packages(tags):
"sha256": tag.sha256,
"strip_prefix": tag.strip_prefix,
"url": tag.url,
"patches": tag.patches,
"files": tag.files,
})
return packages

Expand Down Expand Up @@ -304,6 +316,8 @@ def _create_and_link_sdp(toolchain_info):
"sha256": matrix["sha256"],
"strip_prefix": matrix["strip_prefix"],
"url": matrix["url"],
"patches": matrix.get("patches"),
"files": matrix.get("files"),
}

def _resolve_identifier(toolchain_info):
Expand Down Expand Up @@ -391,6 +405,8 @@ def _impl(mctx):
build_file = archive_info["build_file"],
sha256 = archive_info["sha256"],
strip_prefix = archive_info["strip_prefix"],
patches = archive_info.get("patches"),
files = archive_info.get("files"),
)

for toolchain_info in toolchains:
Expand Down
9 changes: 9 additions & 0 deletions packages/qnx/aarch64/sdp/8.0.0/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package(
default_visibility = ["//visibility:public"],
)

exports_files(
[
"patches/fsevmgr.patch",
],
)
Binary file added packages/qnx/patches/qnx_805_patch.7z
Binary file not shown.
9 changes: 9 additions & 0 deletions packages/qnx/x86_64/sdp/8.0.0/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package(
default_visibility = ["//visibility:public"],
)

exports_files(
[
"patches/fsevmgr.patch",
],
)
22 changes: 21 additions & 1 deletion packages/version_matrix.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ VERSION_MATRIX = {
"sha256": "7279b1adb50361b21f5266b001980b6febb35fa8d83170901196b9edae3f06d9",
"strip_prefix": "aarch64-unknown-linux-gnu",
"url": "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/v0.0.4/aarch64-unknown-linux-gnu_gcc12.tar.gz",
"patches": [],
},
"aarch64-linux-autosd10": {
"build_file": "@score_bazel_cpp_toolchains//packages/linux/aarch64/autosd/10.0:autosd.BUILD",
Expand Down Expand Up @@ -65,26 +66,31 @@ VERSION_MATRIX = {
"sha256": "11274fcd6be01ef9190a315f7efc04fb9bf63d47302a255216c00ac2eb0a7103",
"strip_prefix": "sysroot",
"url": "https://github.com/eclipse-score/inc_os_autosd/releases/download/continuous/autosd-toolchain-aarch64.tar.gz",
"patches": [],
},
"aarch64-qnx-sdp_8.0.0": {
"build_file": "@score_bazel_cpp_toolchains//packages/qnx/aarch64/sdp/8.0.0:sdp.BUILD",
"sha256": "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63",
"strip_prefix": "installation",
"url": "https://www.qnx.com/download/download/79858/installation.tgz",
"gcc_version": "12.2.0",
"patches": [],
},
"aarch64-qnx-sdp_8.0.4": {
"build_file": "@score_bazel_cpp_toolchains//packages/qnx/aarch64/sdp/8.0.0:sdp.BUILD",
"sha256": "146312c0bf22aab66e8294a06403f2ec6cfeeb074d8fa11549faffd84b7fe778",
"strip_prefix": "",
"url": "https://www.qnx.com/download/download/88447/installation_qnx_804_260520.tar.xz",
"gcc_version": "12.2.0",
"files": {
},
},
"x86_64-linux-gcc_12.2.0": {
"build_file": "@score_bazel_cpp_toolchains//packages/linux/x86_64/gcc/12.2.0:gcc.BUILD",
"sha256": "e9b9a7a63a5f8271b76d6e2057906b95c7a244e4931a8e10edeaa241e9f7c11e",
"strip_prefix": "x86_64-unknown-linux-gnu",
"url": "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/v0.0.4/x86_64-unknown-linux-gnu_gcc12.tar.gz",
"patches": [],
},
"x86_64-linux-autosd10": {
"build_file": "@score_bazel_cpp_toolchains//packages/linux/x86_64/autosd/10.0:autosd.BUILD",
Expand Down Expand Up @@ -130,6 +136,7 @@ VERSION_MATRIX = {
"sha256": "39091c500a31bc58d5934cc9c27f5fec4326f30d8bff88fe67737c86385bf39f",
"strip_prefix": "sysroot",
"url": "https://github.com/eclipse-score/inc_os_autosd/releases/download/continuous/autosd-toolchain-x86_64.tar.gz",
"patches": [],
},
"aarch64-linux-sdk_0.1.0-ebclfsa": {
"build_file": "@score_bazel_cpp_toolchains//packages/linux/aarch64/ebclfsa/0.1.0:ebclfsa.BUILD",
Expand Down Expand Up @@ -192,19 +199,32 @@ VERSION_MATRIX = {
"strip_prefix": "fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64",
"sha256": "f44286c28d831dc40acdac08ef49f38a2e9cbb057bea38c25834964693785287",
"url": "https://github.com/Elektrobit/eb_corbos_toolkit/releases/download/v2.0.0-beta1/fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64.tar.gz",
"patches": [],
},
"x86_64-qnx-sdp_8.0.0": {
"build_file": "@score_bazel_cpp_toolchains//packages/qnx/x86_64/sdp/8.0.0:sdp.BUILD",
"sha256": "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63",
"strip_prefix": "installation",
"url": "https://www.qnx.com/download/download/79858/installation.tgz",
"gcc_version": "12.2.0",
"patches": [],
},
"x86_64-qnx-sdp_8.0.4": {
"x86_64-qnx-sdp_8.0.5": {
"build_file": "@score_bazel_cpp_toolchains//packages/qnx/x86_64/sdp/8.0.0:sdp.BUILD",
"sha256": "146312c0bf22aab66e8294a06403f2ec6cfeeb074d8fa11549faffd84b7fe778",
"strip_prefix": "",
"url": "https://www.qnx.com/download/download/88447/installation_qnx_804_260520.tar.xz",
"gcc_version": "12.2.0",
"patches": [],
"files": {
"target/qnx/usr/include/sys/fsnotify.h": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/usr/include/sys/fsnotify.h",
"target/qnx/usr/include/sys/fsnotify_impl.h": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/usr/include/sys/inotify_ext.h",
"target/qnx/usr/include/sys/fsnotify_impl_private.h": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/usr/include/sys/inotify.h",
"x86_64/lib/libfsnotify.so": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/x86_64/lib/libfsnotify.so",
"x86_64/lib/libfsnotify.so.1": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/x86_64/lib/libfsnotify.so.1",
"x86_64/lib/libfsnotify.so.1.sym": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/x86_64/lib/libfsnotify.so.1.sym",
"x86_64/sbin/fsevmgr": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/x86_64/sbin/fsevmgr",
"x86_64/sbin/fsevmgr.sym": "@score_bazel_cpp_toolchains//packages/qnx/patches/805_fsnotify:target/qnx/x86_64/sbin/fsevmgr.sym",
},
},
}
5 changes: 4 additions & 1 deletion rules/common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", "flag_group")
# Certain SDP versions are mapped to canonical versions used in platform constraints.
# For example, SDP 8.0.4 is mapped to 8.0.0 because platform constraint support
# uses the older identifier.
SDP_VERSION_MAPPING = {"8.0.4": "8.0.0"}
SDP_VERSION_MAPPING = {
"8.0.4": "8.0.0",
"8.0.5": "8.0.0",
}

def get_flag_groups(flags):
"""Converts a list of warning flags into a Bazel flag group representation.
Expand Down
2 changes: 1 addition & 1 deletion tests/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.4.2
8.7.0
17 changes: 14 additions & 3 deletions tests/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,29 @@ gcc.toolchain(
)

# *******************************************************************************
# Setting GCC (CPU:x86_64|OS:QNX|version(sdp):8.0.0|ES:posix)
# Setting GCC (CPU:x86_64|OS:QNX|version(sdp):8.0.4|ES:posix)
# *******************************************************************************
# gcc.toolchain(
# name = "score_qcc_toolchain",
# sdp_version = "8.0.4",
# target_cpu = "x86_64",
# target_os = "qnx",
# use_default_package = True,
# )

# *******************************************************************************
# Setting GCC (CPU:x86_64|OS:QNX|version(sdp):8.0.5|ES:posix)
# *******************************************************************************
gcc.toolchain(
name = "score_qcc_toolchain",
sdp_version = "8.0.4",
sdp_version = "8.0.5",
target_cpu = "x86_64",
target_os = "qnx",
use_default_package = True,
)

# *******************************************************************************
# Setting GCC (CPU:aarch64|OS:QNX|version(sdp):8.0.0|ES:posix)
# Setting GCC (CPU:aarch64|OS:QNX|version(sdp):8.0.4|ES:posix)
# *******************************************************************************
gcc.toolchain(
name = "score_qcc_arm_toolchain",
Expand Down
Loading