Skip to content

add generic bazel toolchain job#94

Open
odra wants to merge 1 commit into
eclipse-score:mainfrom
odra:generic-bazel-ci
Open

add generic bazel toolchain job#94
odra wants to merge 1 commit into
eclipse-score:mainfrom
odra:generic-bazel-ci

Conversation

@odra
Copy link
Copy Markdown

@odra odra commented Apr 14, 2026

Changes

  • adds an autosd workflow to build a Bazel target with a specific config (I think we can be turned in a generic "platform build" job)

Sample Usage

name: AutoSD Build
on:
 workflow_dispatch:
 pull_request_target:
   types: [opened, reopened, synchronize]
 merge_group:
   types: [checks_requested]
jobs:
 autosd-build:
   uses: odra/cicd-workflows/.github/workflows/autosd-build.yml@autosd-bazel-ci
   permissions:
     contents: read
     pull-requests: read
   strategy:
     matrix:
       config:
         - autosd-x86_64
   with:
     bazel-target: '//score/...'
     bazel-config: ${{ matrix.config }}
     bazel-disk-cache: ${{ github.workflow }}-${{ github.job }}-${{ matrix.config }}

It still requires modules to register toolchains as:

module(name = "mymodule")

bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.5.1")

bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "score_bazel_platforms", version = "0.1.2")

gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc")

gcc.toolchain(
    name = "score_autosd10_x86_64_toolchain",
    runtime_ecosystem = "autosd10",
    target_cpu = "x86_64",
    target_os = "linux",
    use_default_package = True,
)

use_repo(
    gcc,
    "score_autosd10_x86_64_toolchain"
)

@AlexanderLanin
Copy link
Copy Markdown
Member

I'm not sure what this is? Maybe this should be setup-bazel? As wrapping a simple bazel run doesnt seem worth it. It adds more complexity than just running it on command line.

@odra
Copy link
Copy Markdown
Author

odra commented Apr 14, 2026

I started working on an autosd one but It felt to simple to be autosd specific. I could still try to force a config or container image to be autosd specific, instead of the generic one, if that makes sense.

@AlexanderLanin
Copy link
Copy Markdown
Member

Where would you like to use this? Sorry, I dont get it yet. Workflow is called toolchain test. It sets up qemu. And the name is target-build. Thats three mismatching things :D

@AlexanderLanin
Copy link
Copy Markdown
Member

@odra sorry this was stuck so long.

Should we merge this with https://github.com/eclipse-score/cicd-workflows/blob/main/.github/workflows/qnx-build.yml?
My idea would be adding flags like "qemu" and "qnx", which will run the respective step on demand.

@odra
Copy link
Copy Markdown
Author

odra commented May 13, 2026

so was trying to create a job to run builds that use autosd's toolchain for different modules to use, let me update this patch with a new proposal (which I have conflicting opinions about its implementation)

@odra odra force-pushed the generic-bazel-ci branch from ecfdb97 to 4e70f36 Compare May 14, 2026 13:40
@odra
Copy link
Copy Markdown
Author

odra commented May 14, 2026

@AlexanderLanin I created a new "autosd-build.yml" workflow, which was my original intention. An example of the workflow usage can be found here: https://github.com/eclipse-score-fork-rh/rh-sample-autosd-toolchain/blob/main/.github/workflows/build-autosd.yml.

It still requires modules to setup the toolchain in their MODULE.bazel files but it "injects" a bazelrc file with a specific config.

My motivation is that I wanted to add autosd toolchain usage to N modules but I didn't want to "copy and paste" the same source code everywhere.

@odra odra force-pushed the generic-bazel-ci branch from 4e70f36 to fe7c18b Compare May 14, 2026 13:44
Signed-off-by: Leonardo Rossetti <lrossett@redhat.com>
@odra odra force-pushed the generic-bazel-ci branch from fe7c18b to ce0ee51 Compare May 14, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants