diff --git a/.bazelrc b/.bazelrc index 6683d3e..310e991 100644 --- a/.bazelrc +++ b/.bazelrc @@ -9,11 +9,25 @@ common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry common --registry=https://bcr.bazel.build common --credential_helper=*.qnx.com=%workspace%/scripts/internal/qnx_creds.py -build:build_qnx8 --platforms=@score_bazel_platforms//:arm64-qnx8_0 -build:build_qnx8 --extra_toolchains=@toolchains_qnx_qcc//:qcc_aarch64 -build:build_qnx8 --extra_toolchains=@score_toolchains_rust//toolchains/aarch64-unknown-qnx8_0:toolchain_aarch64_qnx8_0 -build:build_qnx8 --extra_toolchains=@score_toolchains_rust//toolchains/x86_64-unknown-linux-gnu:toolchain_x86_64_linux -build:build_qnx8 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64 -build:build_qnx8 --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64 - -common --extra_toolchains=@gcc_toolchain//:host_gcc_12 +# Ferrocene must be common compiler for HOST. To ensure metadata compatibility for proc macro crates! +build:_common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu + +build:arm64-qnx --config=_common +build:arm64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix +build:arm64-qnx --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0-posix +build:arm64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800 + +build:x86_64-qnx --config=_common +build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix +build:x86_64-qnx --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0-posix +build:x86_64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800 + +# TODO arm64 when rust support is there + +build:x86_64-linux --config=_common +build:x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix +build:x86_64-linux --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix +build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu + +# to be removed +build:build_qnx8 --config=arm64-qnx diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08cd040..7590ab5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,4 +55,4 @@ jobs: - name: Build with Bazel run: | - bazel build //... + bazel build --config x86_64-linux //... diff --git a/.github/workflows/build_qnx8.yml b/.github/workflows/build_qnx8.yml index fbadd94..66b578c 100644 --- a/.github/workflows/build_qnx8.yml +++ b/.github/workflows/build_qnx8.yml @@ -18,14 +18,28 @@ on: merge_group: types: [checks_requested] jobs: - qnx-build: + qnx-build-arm64: uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@main permissions: contents: read pull-requests: read with: bazel-target: '//src/...' - bazel-config: 'build_qnx8' + bazel-config: 'arm64-qnx8' + credential-helper: 'scripts/internal/qnx_creds.py' + environment-name: 'workflow-approval' + secrets: + score-qnx-license: ${{ secrets.SCORE_QNX_LICENSE }} + score-qnx-user: ${{ secrets.SCORE_QNX_USER }} + score-qnx-password: ${{ secrets.SCORE_QNX_PASSWORD }} + qnx-build-x86_64: + uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@main + permissions: + contents: read + pull-requests: read + with: + bazel-target: '//src/...' + bazel-config: 'x86_64-qnx8' credential-helper: 'scripts/internal/qnx_creds.py' environment-name: 'workflow-approval' secrets: diff --git a/.github/workflows/component_integration_tests_bazel.yml b/.github/workflows/component_integration_tests_bazel.yml index 77704cf..a7ddee2 100644 --- a/.github/workflows/component_integration_tests_bazel.yml +++ b/.github/workflows/component_integration_tests_bazel.yml @@ -61,16 +61,16 @@ jobs: - name: Build Test Scenarios with Bazel run: | - bazel build //tests/test_scenarios/rust:test_scenarios + bazel build --config x86_64-linux //tests/test_scenarios/rust:test_scenarios - name: Build Test Scenarios with Bazel (PR) if: github.event_name == 'pull_request' || github.event_name == 'push' run: | - bazel test //tests/test_cases:cit + bazel test --config x86_64-linux //tests/test_cases:cit - name: Build Test Scenarios with Bazel (Nightly) if: github.event_name == 'schedule' env: NIGHTLY: TRUE run: | - bazel test //tests/test_cases:cit_repeat --test_timeout=1200 + bazel test --config x86_64-linux //tests/test_cases:cit_repeat --test_timeout=1200 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2bef1ca..99fe639 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,4 +55,4 @@ jobs: - name: Run Tests via Bazel run: | echo "Running: bazel test //src/..." - bazel test //src/... + bazel test --config x86_64-linux //src/... diff --git a/MODULE.bazel b/MODULE.bazel index c2a4e20..125121c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -20,13 +20,19 @@ module( bazel_dep(name = "rules_python", version = "1.4.1") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "rules_rust", version = "0.61.0") +git_override( + module_name = "rules_rust", + commit = "d655071dfc8783bbdad4e27db349abd221ba170c", + remote = "https://github.com/pawelrutkaq/rules_rust.git", # To be fixed once rule_rust is in score bazel registry +) + bazel_dep(name = "rules_cc", version = "0.1.1") bazel_dep(name = "aspect_rules_lint", version = "1.0.3") bazel_dep(name = "buildifier_prebuilt", version = "7.3.1") bazel_dep(name = "platforms", version = "1.0.0") # S-CORE process rules -bazel_dep(name = "score_bazel_platforms", version = "0.0.3") +bazel_dep(name = "score_bazel_platforms", version = "0.0.4") bazel_dep(name = "score_docs_as_code", version = "2.2.0") bazel_dep(name = "score_tooling", version = "1.0.4") @@ -35,10 +41,8 @@ bazel_dep(name = "score_platform", version = "0.4.2", dev_dependency = True) # bazel_dep(name = "score_virtualization", version = "0.0.1", dev_dependency = True) # Toolchains and extensions -bazel_dep(name = "score_toolchains_gcc", version = "0.5", dev_dependency = True) -bazel_dep(name = "score_toolchains_qnx", version = "0.0.6", dev_dependency = True) -bazel_dep(name = "rust_qnx8_toolchain", version = "1.2.0", dev_dependency = True) -bazel_dep(name = "score_toolchains_rust", version = "0.1.1", dev_dependency = True) +bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2", dev_dependency = True) +bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True) # Others bazel_dep(name = "custom_qemu", version = "1.0.0", dev_dependency = True) @@ -54,20 +58,6 @@ git_override( remote = "https://github.com/qorix-group/score_virtualization.git", ) -git_override( - module_name = "score_toolchains_rust", - commit = "bcf8e5364f72cf136ec81960350a82e2b5c45449", - remote = "https://github.com/eclipse-score/toolchains_rust.git", -) - -archive_override( - module_name = "rust_qnx8_toolchain", - strip_prefix = "qnx8", - urls = [ - "https://github.com/qorix-group/rust-lang-qnx8/releases/download/1.2.0/qnx8_rust_toolchain.tar.gz", - ], -) - archive_override( module_name = "custom_qemu", integrity = "sha256-3V2d+p7nP0tsbrVWOPYUSJogLNal43CIAHEto6Vjdfg=", @@ -77,21 +67,43 @@ archive_override( ], ) -# Extensions - -gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency = True) +gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True) gcc.toolchain( - sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600", - strip_prefix = "x86_64-unknown-linux-gnu", - url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz", + name = "score_gcc_x86_64_toolchain", + target_cpu = "x86_64", + target_os = "linux", + use_default_package = True, + version = "12.2.0", ) -use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") - -toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency = True) -toolchains_qnx.sdp( - sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", - strip_prefix = "installation", - url = "https://www.qnx.com/download/download/79858/installation.tgz", +gcc.toolchain( + name = "score_gcc_aarch64_toolchain", + target_cpu = "aarch64", + target_os = "linux", + use_default_package = True, + version = "12.2.0", +) +gcc.toolchain( + name = "score_qcc_x86_64_toolchain", + sdp_version = "8.0.0", + target_cpu = "x86_64", + target_os = "qnx", + use_default_package = True, + version = "12.2.0", +) +gcc.toolchain( + name = "score_qcc_aarch64_toolchain", + sdp_version = "8.0.0", + target_cpu = "aarch64", + target_os = "qnx", + use_default_package = True, + version = "12.2.0", +) +use_repo( + gcc, + "score_gcc_aarch64_toolchain", + "score_gcc_x86_64_toolchain", + "score_qcc_aarch64_toolchain", + "score_qcc_x86_64_toolchain", ) PYTHON_VERSION = "3.12" @@ -113,9 +125,5 @@ use_repo(python) use_repo(pip, "pip_score_venv_test") -use_repo(toolchains_qnx, "toolchains_qnx_sdp") -use_repo(toolchains_qnx, "toolchains_qnx_qcc") -use_repo(toolchains_qnx, "toolchains_qnx_ifs") - # S-CORE crates -bazel_dep(name = "score_crates", version = "0.0.5") +bazel_dep(name = "score_crates", version = "0.0.7")