Skip to content

Commit 97c3fe4

Browse files
authored
Merge pull request eclipse-score#241 from eclipse-score/vinod_adapt_new_toolchain
Update Toolchain
2 parents 9c1f0c1 + ae01176 commit 97c3fe4

File tree

5 files changed

+82
-75
lines changed

5 files changed

+82
-75
lines changed

.bazelrc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ build --tool_java_runtime_version=remotejdk_17
2828
build --@score_baselibs//score/json:base_library=nlohmann
2929
build --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
3030

31-
common --extra_toolchains=@gcc_toolchain//:host_gcc_12
32-
3331
# Clippy linting (enabled by default)
3432
build --aspects=@score_rust_policies//clippy:linters.bzl%clippy_strict
3533
build --output_groups=+rules_lint_human
@@ -48,25 +46,23 @@ build:per_shared --host_platform=@score_bazel_platforms//:x86_64-linux
4846
# Config dedicated to host platform CPU:x86_64 and OS:Linux
4947
# -------------------------------------------------------------------------------
5048
build:per-x86_64-linux --config=per_shared
51-
build:per-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux
52-
build:per-x86_64-linux --extra_toolchains=@gcc_toolchain//:host_gcc_12
49+
build:per-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
50+
build:per-x86_64-linux --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix
5351
build:per-x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
5452
# -------------------------------------------------------------------------------
5553
# Config dedicated to target platform CPU:x86_64 and OS:QNX
5654
# -------------------------------------------------------------------------------
5755
build:per-x86_64-qnx --config=per_shared
58-
build:per-x86_64-qnx --platforms=@score_toolchains_qnx//platforms:x86_64-qnx
59-
build:per-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64
60-
build:per-x86_64-qnx --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64
56+
build:per-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix
57+
build:per-x86_64-qnx --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0-posix
6158
build:per-x86_64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800
6259

6360
# -------------------------------------------------------------------------------
6461
# Config dedicated to target platform CPU:arm64 and OS:QNX
6562
# -------------------------------------------------------------------------------
6663
build:per-arm64-qnx --config=per_shared
67-
build:per-arm64-qnx --platforms=@score_toolchains_qnx//platforms:aarch64-qnx8_0
68-
build:per-arm64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_aarch64
69-
build:per-arm64-qnx --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64
64+
build:per-arm64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
65+
build:per-arm64-qnx --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0-posix
7066
build:per-arm64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800
7167

7268

@@ -88,3 +84,9 @@ test:ferrocene-coverage --run_under=@score_tooling//coverage:llvm_profile_wrappe
8884
# Import local user workspace file, if exists
8985
# -------------------------------------------------------------------------------
9086
try-import %workspace%/user.bazelrc
87+
88+
89+
# Coverage configuration for C++
90+
coverage --features=coverage
91+
coverage --combined_report=lcov
92+
coverage --cache_test_results=no

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }}
3939
run: |
4040
bazel build \
41+
--config=per-arm64-qnx \
4142
//src/rust/rust_kvs:rust_kvs \
4243
//src/rust/rust_kvs_tool:kvs_tool \
43-
--platforms=@score_toolchains_rust//platforms:aarch64-unknown-qnx8_0 \
4444
--features=-dependency_file \
4545
--credential_helper=*.qnx.com=${{ github.workspace }}/tools/qnx_credential_helper.py
4646

.github/workflows/check.yml

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -95,34 +95,13 @@ jobs:
9595
- name: Bazel Build
9696
run: |
9797
bazel build \
98+
--config=per-x86_64-linux \
9899
//src/rust/rust_kvs:rust_kvs \
99100
//src/rust/rust_kvs_tool:kvs_tool
100101
101102
- name: Bazel Unit Tests
102103
run: |
103-
bazel test //src/rust/rust_kvs:tests
104-
105-
- name: Bazel Unit Test with Coverage
106-
run: |
107-
bazel coverage //src/rust/rust_kvs:tests \
108-
--collect_code_coverage \
109-
--combined_report=lcov \
110-
--experimental_generate_llvm_lcov \
111-
--nocache_test_results \
112-
--nostamp
113-
114-
- name: Install lcov
115-
run: |
116-
sudo apt-get update
117-
sudo apt-get install -y lcov
118-
119-
- name: Extract Coverage for Rust Files
120-
run: |
121-
REPORT=$(find "$(bazel info output_path)" -type f -path '*/rust/*/coverage.dat' | head -n1)
122-
lcov \
123-
--rc branch_coverage=1 \
124-
--extract "$REPORT" '*.rs' -o "${REPORT}.rs" \
125-
--output-file kvs_coverage.info
104+
bazel test --config=per-x86_64-linux //src/rust/rust_kvs:tests
126105
127106
cpp-bazel:
128107
runs-on: ubuntu-latest
@@ -156,24 +135,19 @@ jobs:
156135
157136
- name: Extract Coverage for CPP Files
158137
run: |
159-
# ToDo: should work out of the box with bazel coverage (https://github.com/eclipse-score/toolchains_gcc/issues/21)
160-
# run test binary to generate coverage data (*.gcda files). Manually
161-
# since it is build already with the correct flags and the gcda ends
162-
# up in a proper location
163-
./bazel-bin/src/cpp/tests/test_kvs_cpp
164-
165-
# define some variables for easier usage
166-
BASE_DIR="$(pwd)"
167-
GCOV_TOOL="./bazel-persistency/external/score_toolchains_gcc++gcc+gcc_toolchain_gcc/bin/x86_64-unknown-linux-gnu-gcov"
168-
BIN_DIR="./bazel-bin/src/cpp/"
169-
OUT_FILE="lcov_coverage.info"
170-
# capture coverage info
171-
lcov --capture --directory "$BIN_DIR" --output-file "$OUT_FILE" --gcov-tool "$GCOV_TOOL" --base-directory "$BASE_DIR" --branch-coverage --ignore-errors mismatch --exclude "*/external/*"
172-
# display summary
173-
lcov --summary --rc branch_coverage=1 "$OUT_FILE"
174-
# generate html report (for local inspection if needed)
175-
# genhtml "$OUT_FILE" -o coverage_html --show-details --legend --function-coverage --branch-coverage
176-
rm ${OUT_FILE}
138+
genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \
139+
-o=cpp_coverage \
140+
--show-details \
141+
--legend \
142+
--function-coverage \
143+
--branch-coverage
144+
shell: bash
145+
- name: Upload Coverage Artifacts
146+
uses: actions/upload-artifact@v6
147+
with:
148+
name: ${{ github.event.repository.name }}_cpp_coverage_report
149+
path: cpp_coverage/
150+
retention-days: 10
177151

178152
- name: Bazel Benchmark
179153
run: bazel run --config=per-x86_64-linux -c opt //:bm_kvs_cpp

.github/workflows/component_integration_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
6060
- name: Build Rust test scenarios with Bazel
6161
run: |
62-
bazel build //tests/test_scenarios/rust:test_scenarios
62+
bazel build --config=per-x86_64-linux //tests/test_scenarios/rust:test_scenarios
6363
6464
- name: Set up Python 3
6565
uses: actions/setup-python@v5
@@ -79,7 +79,7 @@ jobs:
7979
8080
- name: Run Python tests with bazel
8181
run: |
82-
bazel test //tests/test_cases:cit
82+
bazel test --config=per-x86_64-linux //tests/test_cases:cit
8383
8484
- name: Prepare test reports
8585
if: always()

MODULE.bazel

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,22 @@ pip.parse(
3838
use_repo(pip, "pip_score_venv_test")
3939

4040
# rust
41-
bazel_dep(name = "rules_rust", version = "0.61.0")
41+
bazel_dep(name = "rules_rust", version = "0.67.0")
42+
git_override(
43+
module_name = "rules_rust",
44+
commit = "2b171a7376e69cb1207eced1f66904ce4ae0c819",
45+
remote = "https://github.com/pawelrutkaq/rules_rust.git", # To be fixed once rule_rust is in score bazel registry
46+
)
4247

4348
# Shared Rust policies (Clippy config, etc.), overridden locally during development.
4449
bazel_dep(name = "score_rust_policies", version = "0.0.4", dev_dependency = True)
4550

4651
# bazel cc rules
4752
bazel_dep(name = "rules_cc", version = "0.1.2")
4853

49-
#score gcc toolchain
50-
bazel_dep(name = "score_toolchains_gcc", version = "0.5", dev_dependency = True)
51-
52-
gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency = True)
53-
gcc.toolchain(
54-
sha256 = "8fa85c2a93a6bef1cf866fa658495a2416dfeec692e4246063b791abf18da083",
55-
strip_prefix = "x86_64-unknown-linux-gnu",
56-
url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/v0.0.3/x86_64-unknown-linux-gnu_gcc12.tar.gz",
57-
)
58-
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")
54+
# Toolchains and extensions
55+
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2", dev_dependency = True)
56+
bazel_dep(name = "score_toolchains_rust", version = "0.7.0", dev_dependency = True)
5957

6058
# score qnx (qcc) toolchain.
6159
bazel_dep(name = "score_toolchains_qnx", version = "0.0.5", dev_dependency = True)
@@ -80,17 +78,12 @@ bazel_dep(name = "platforms", version = "1.0.0")
8078

8179
## S-CORE bazel registry
8280
bazel_dep(name = "score_baselibs", version = "0.1.2")
83-
bazel_dep(name = "score_bazel_platforms", version = "0.0.3")
81+
bazel_dep(name = "score_bazel_platforms", version = "0.0.4")
8482

85-
bazel_dep(name = "score_docs_as_code", version = "3.0.0", dev_dependency = True)
83+
bazel_dep(name = "score_docs_as_code", version = "2.3.0", dev_dependency = True)
8684
bazel_dep(name = "score_platform", version = "0.5.2", dev_dependency = True)
87-
git_override(
88-
module_name = "score_platform",
89-
commit = "7d252e75b733b09225f1a383bb00d5d7d79fa5ae", # override with main until next release
90-
remote = "https://github.com/eclipse-score/score.git",
91-
)
85+
bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True)
9286

93-
bazel_dep(name = "score_process", version = "1.4.3")
9487
bazel_dep(name = "score_python_basics", version = "0.3.4")
9588
bazel_dep(name = "score_tooling", version = "1.1.0")
9689

@@ -116,7 +109,6 @@ git_override(
116109
remote = "https://github.com/eclipse-score/baselibs.git",
117110
)
118111

119-
bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True)
120112
bazel_dep(name = "custom_qemu", version = "1.0.0", dev_dependency = True)
121113
archive_override(
122114
module_name = "custom_qemu",
@@ -127,5 +119,44 @@ archive_override(
127119
],
128120
)
129121

122+
gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True)
123+
gcc.toolchain(
124+
name = "score_gcc_x86_64_toolchain",
125+
target_cpu = "x86_64",
126+
target_os = "linux",
127+
use_default_package = True,
128+
version = "12.2.0",
129+
)
130+
gcc.toolchain(
131+
name = "score_gcc_aarch64_toolchain",
132+
target_cpu = "aarch64",
133+
target_os = "linux",
134+
use_default_package = True,
135+
version = "12.2.0",
136+
)
137+
gcc.toolchain(
138+
name = "score_qcc_x86_64_toolchain",
139+
sdp_version = "8.0.0",
140+
target_cpu = "x86_64",
141+
target_os = "qnx",
142+
use_default_package = True,
143+
version = "12.2.0",
144+
)
145+
gcc.toolchain(
146+
name = "score_qcc_aarch64_toolchain",
147+
sdp_version = "8.0.0",
148+
target_cpu = "aarch64",
149+
target_os = "qnx",
150+
use_default_package = True,
151+
version = "12.2.0",
152+
)
153+
use_repo(
154+
gcc,
155+
"score_gcc_aarch64_toolchain",
156+
"score_gcc_x86_64_toolchain",
157+
"score_qcc_aarch64_toolchain",
158+
"score_qcc_x86_64_toolchain",
159+
)
160+
130161
# S-CORE crates
131-
bazel_dep(name = "score_crates", version = "0.0.6")
162+
bazel_dep(name = "score_crates", version = "0.0.7")

0 commit comments

Comments
 (0)