Skip to content

build(toolchain): integrate S-CORE global toolchain configuration - #503

Open
srinivasugithub wants to merge 14 commits into
eclipse-score:mainfrom
bgsw-contrib:feature/S-CORE_global_toolchain_configuration
Open

srinivasugithub wants to merge 14 commits into
eclipse-score:mainfrom
bgsw-contrib:feature/S-CORE_global_toolchain_configuration

Conversation

@srinivasugithub

Copy link
Copy Markdown
Contributor

S-CORE Toolchain Integration

This PR integrates the central S-CORE toolchain configuration from the module_template repository unchanged, as defined in MODULE.bazel and score.bazelrc/score_toolchain.bazelrc.

Report of Changes and Differences

1. What Works As-Is with the Central Configuration

  • Linux x86_64: Building and running test suites with --config=bl-x86_64-linux works flawlessly by leveraging --config=score-linux-x86_64 from score_toolchain.bazelrc. All 120+ C++ unit tests execute and pass successfully.
  • QNX x86_64: Compiles correctly with --config=bl-x86_64-qnx leveraging --config=score-qnx-x86_64 from the central configuration.
  • Import Mechanism: Importing the central configuration via try-import %workspace%/score.bazelrc/score_toolchain.bazelrc in .bazelrc works without issues.

2. What is Missing from the Central Configuration

  • Standard Linux GCC aarch64 Toolchain: The central configuration only includes Elektobit (score_ebclfsa_toolchain) and AutoSD10 (score_autosd10_aarch64_toolchain) toolchains, leaving out a general Linux GCC aarch64 cross-compiler.
  • QNX aarch64 Target Sysroot Package: In MODULE.bazel, the central use_repo block for qcc imports score_qcc_aarch64_toolchain but omits score_qcc_aarch64_toolchain_pkg (the target sysroot), which is required to link and compile ARM64 QNX targets.
  • aarch64 target configs in score_toolchain.bazelrc: There are no pre-defined configurations for standard Linux ARM64 cross-compiling or QNX ARM64 in score_toolchain.bazelrc.

3. What Differs Between the Central Configuration and this Repository

  • This repository supports builds and unit testing for aarch64-linux and aarch64-qnx architectures as first-class configurations.
  • Due to the missing generic ARM64 toolchains in the central configuration, we must declare and maintain them as separate repository-specific extensions.

4. What Repository-Specific Configuration Had to be Added, and Why

  • In MODULE.bazel (placed cleanly under "Repository-specific toolchain additions"):
    • Declared score_gcc_aarch64_toolchain to compile and link standard Linux ARM64 targets.
    • Added use_repo(qcc, \"score_qcc_aarch64_toolchain_pkg\") to import the QNX aarch64 SDP package (sysroot) necessary for building QNX aarch64 targets.
  • In .bazelrc:
    • Retained build:bl-aarch64-linux and build:bl-aarch64-qnx because they are not provided by score_toolchain.bazelrc.

5. Configurations That Were Safely Removed

  • From .bazelrc:
    • Removed common/global extra_toolchains for score_gcc_x86_64_toolchain and score_toolchains_rust//toolchains/ferrocene.
    • Removed global/common host_platform.
    • Simplified the bl-x86_64-linux target configuration to simply use --config=score-linux-x86_64.
    • Simplified the bl-x86_64-qnx target configuration to simply use --config=score-qnx-x86_64.

6. Candidates/Improvements for module_template

  1. Add score_qcc_aarch64_toolchain_pkg to use_repo:
    In the central MODULE.bazel, add "score_qcc_aarch64_toolchain_pkg" to the use_repo(qcc, ...) block. This is generally required for any S-CORE module compiling for QNX aarch64.
  2. Add Standard GCC Linux aarch64 Toolchain:
    Standard GCC aarch64-linux should be part of the central S-CORE configurations since ARM64 Linux cross-compiling is universally applicable across S-CORE modules.

@github-project-automation github-project-automation Bot moved this to In Progress in BAS - Baselibs FT Aug 24, 2026
@github-actions github-actions Bot added the bazel Bazel and Starlark build files label Aug 24, 2026
@srinivasugithub
srinivasugithub deployed to workflow-approval August 24, 2026 06:57 — with GitHub Actions Active
@srinivasugithub
srinivasugithub deployed to workflow-approval August 24, 2026 06:57 — with GitHub Actions Active
@srinivasugithub
srinivasugithub deployed to workflow-approval August 24, 2026 06:57 — with GitHub Actions Active
@srinivasugithub
srinivasugithub deployed to workflow-approval August 24, 2026 06:57 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-503: https://eclipse-score.github.io/baselibs/pr-503/

@github-actions github-actions Bot added the comp-scope_exit Related to score/scope_exit component label Aug 26, 2026
Adopts the central S-CORE toolchain configuration from module_template,
including `score.bazelrc/score_toolchain.bazelrc` and the central
S-CORE toolchain block in `MODULE.bazel`.

- Imports `score_toolchain.bazelrc` via `.bazelrc`.
- Replaces custom x86_64 target configurations with central ones.
- Keeps repository-specific additions (aarch64 tools and configs) separate.
…ation toolchain registration

- Marks the `gcc` and `ferrocene` extensions in the parent `MODULE.bazel` with `dev_dependency = True` to prevent downstream workspaces (like `examples/integration`) from transitive resolution crashes.
- Registers `build --config=_score_common` globally in `.bazelrc` so that host toolchains are properly configured for generic and cross-compilation builds (e.g., `bl-aarch64-linux`, `docs_check`, `copyright-fix`).
@srinivasugithub
srinivasugithub force-pushed the feature/S-CORE_global_toolchain_configuration branch from cbac4cd to 115aac6 Compare August 26, 2026 08:39
@github-actions github-actions Bot removed documentation Improvements or additions to documentation comp-flatbuffers Related to score/flatbuffers component comp-json Related to score/json component comp-osal Related to score/os component comp-logging Related to score/mw/log component and rust frontend comp-hash Related to score/hash component comp-result Related to score/result component comp-utils Related to score/utils labels Aug 26, 2026
srinivasugithub and others added 6 commits August 26, 2026 14:24
…re-autosd-x86_64 config

- Regenerates examples/integration/MODULE.bazel.lock against the merged main branch dependencies.
- Corrects a copy-paste typo in score.bazelrc/score_toolchain.bazelrc where build:score-autosd-aarch64 was mistakenly used instead of build:score-autosd-x86_64 for registration of the x86_64 AutoSD toolchain and platform.
…te module templates

- Update MODULE.bazel to adopt the central S-CORE Toolchains (DO NOT MODIFY) section from module_template.
- Prune all redundant repository-specific toolchain additions from MODULE.bazel now that they are natively covered by the central configuration.
- Update rules_rust version to 0.68.2-score to utilize local cache and platforms to 1.1.0 to match central transitive requirements.
- Overwrite score.bazelrc/score_toolchain.bazelrc with the central, corrected definition from module_template.
- Refactor build:bl-aarch64-linux in .bazelrc to inherit the central build:score-linux-aarch64 configuration.
- Update MODULE.bazel.lock with correct version mappings and hashes.
Signed-off-by: srinivasugithub <skd1cob@bosch.com>
- Add dev_dependency = True to both the 'gcc' and 'ferrocene' use_extension declarations in root MODULE.bazel.
- This prevents downstream workspaces (like examples/integration) from transitively evaluating these extensions, avoiding repository visibility and root-module validation crashes during downstream builds.
- Update both root and examples/integration MODULE.bazel.lock files to synchronize the dependency graphs.
- Revert the sdp_version of QNX imagefs toolchains in root MODULE.bazel to "8.0.0".
  This resolves a mismatch where score_rules_imagefs attempted to resolve a non-existent
  "sdp_8.0.4" platform target from score_bazel_platforms@1.1.0, and restores alignment
  with the "8.0.0" toolchain configurations registered in .bazelrc.
- Synchronize root MODULE.bazel.lock.
@RamakrishnanPK

Copy link
Copy Markdown

Fixes #455

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The protected toolchain block diverges from its central reference, and _score_common is expanded twice.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Integrates shared S-CORE toolchain configuration while retaining repository-specific build aliases.

Changes:

  • Imports central Bazel toolchain profiles.
  • Updates C++, Rust, Linux, and QNX toolchain declarations.
  • Regenerates Bzlmod lockfiles.
File summaries
File Description
.bazelrc Imports and aliases shared profiles.
MODULE.bazel Updates toolchain dependencies and declarations.
MODULE.bazel.lock Records updated dependency resolution.
examples/integration/MODULE.bazel.lock Updates integration dependency resolution.
score.bazelrc/score_toolchain.bazelrc Adds shared platform profiles.
Review details
  • Files reviewed: 3/5 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .bazelrc Outdated
Comment thread MODULE.bazel
Comment thread .bazelrc Outdated
Comment thread MODULE.bazel
srinivasugithub and others added 4 commits September 8, 2026 16:20
…ate comments

- Disable the global _score_common expansion in .bazelrc to avoid duplicate option expansion warnings during builds.
- Explicitly add --config=_score_common to the bl-aarch64-qnx profile to ensure it continues to inherit host settings properly.
- Update the bl-aarch64-linux configuration comment to accurately state it leverages the central S-CORE definition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bazel Bazel and Starlark build files comp-safecpp Related to score/language/safecpp

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants