-
Notifications
You must be signed in to change notification settings - Fork 60
Add DR-001-bzl-toolchains.md #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Draft for defining one single module which will hold all bazel_cpp_toolchains. Signed-off-by: Nikola Radakovic <nikola.ra.radakovic@bmw.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meeting notes (https://github.com/orgs/eclipse-score/discussions/236#discussioncomment-14403465):
(Please correct whatever is wrong here) |
I'm not sure if I need to publish this as document or not, so let's first have it as comment and then if needed I can move it to separate docs. Understanding Bazel ToolchainsIntroductionBazel’s toolchain mechanism is one of the areas where it differs most from other build systems such as Make, CMake, or Gradle. This document explains:
1. Traditional Build Systems: How They WorkIn most common build systems:
This approach is:
2. Bazel’s Approach with ToolchainsInstead of assuming tools from the environment, Bazel makes them first-class citizens in the build graph:
This feels unusual compared to traditional systems, but it has clear advantages. 3. Benefits of Bazel ToolchainsHermetic Builds
Cross-Compilation Support
Reproducibility
Scalability Across Teams
4. Trade-OffsUsing Bazel toolchains introduces some challenges:
5. When Are Toolchains Optimal?
ConclusionThe statement “Bazel toolchains are not how build systems usually work” is true — but that is intentional. For small projects, toolchains can feel heavy. But for large-scale, multi-platform, or long-lived codebases, Bazel’s toolchain mechanism provides a robust and future-proof foundation and that's the reason why we chose to use Bazel as main build system on S-CORE project. |
And that comment as an introduction to your DR? But it currently lacks a section which explains how to use other solutions like devcontainers (build-containers). |
This document is not about how to setup build without Bazel toolchains. We need to have separate document for that. I don't want to mix these 2 things because it will just bring more confusion. For system toolchains (TC installed on your host system which is also a target system) you don't care about this repository. |
Remove platform directory. We won't need it since we already have platform definitions on different place. Signed-off-by: Nikola Radakovic <nikola.ra.radakovic@bmw.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few typos, nothing more
bazel-toolchains/ | ||
├─ MODULE.bazel | ||
├─ README.md | ||
├─ extentions/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
├─ extentions/ | |
├─ extensions/ |
│ │ └─ x86_64.bzl # linux x86_64 specific bits | ||
│ └─ qnx/ | ||
│ ├─ common.bzl # QNX RTP specifics: qcc/q++, -V*, crt runtime, lib search | ||
│ ├─ aarch64.bzl # linux aarch64 specific bits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
│ ├─ aarch64.bzl # linux aarch64 specific bits | |
│ ├─ aarch64.bzl # qnx aarch64 specific bits |
│ └─ qnx/ | ||
│ ├─ common.bzl # QNX RTP specifics: qcc/q++, -V*, crt runtime, lib search | ||
│ ├─ aarch64.bzl # linux aarch64 specific bits | ||
│ └─ x86_64.bzl # linux x86_64 specific bits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
│ └─ x86_64.bzl # linux x86_64 specific bits | |
│ └─ x86_64.bzl # qnx x86_64 specific bits |
|
Draft for defining one single module which will hold all bazel_cpp_toolchains.