diff --git a/.bazelrc b/.bazelrc index a47392fb22..12de17b7cc 100644 --- a/.bazelrc +++ b/.bazelrc @@ -20,7 +20,7 @@ build:_common --@score_communication//score/mw/com/flags:tracing_library=stub build:_common --cxxopt=-Wno-error=mismatched-new-delete build:_common --host_platform=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix build:_common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu -build:_common --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix +build:_common --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0 build:qnx-x86_64 --config=_common build:qnx-x86_64 --noexperimental_merged_skyframe_analysis_execution @@ -40,14 +40,13 @@ build:itf-qnx-x86_64 --test_arg="--os=qnx" build:linux-x86_64 --config=_common -build:linux-x86_64 --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix +build:linux-x86_64 --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0 build:linux-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix build:eb-aarch64 --config=_common -build:eb-aarch64 --extra_toolchains=@gcc_toolchain//:aarch64_gcc_13 -build:eb-aarch64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux -build:eb-aarch64 --spawn_strategy=local - +build:eb-aarch64 --extra_toolchains=@score_ebclfsa_toolchain//:aarch64-linux-sdk_0.1.0-ebclfsa +build:eb-aarch64 --extra_toolchains=@ferrocene_aarch64_ebclfsa//:rust_ferrocene_toolchain +build:eb-aarch64 --platforms=@score_bazel_platforms//:aarch64-linux-sdk_0.1.0-ebclfsa build:autosd-x86_64 --config=_common build:autosd-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 789f1e5090..d5acb80502 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "eclipse-s-core", - "image": "ghcr.io/eclipse-score/devcontainer:v1.1.0", + "image": "ghcr.io/eclipse-score/devcontainer:v1.2.0", "postCreateCommand": "bash .devcontainer/prepare_workspace.sh", "postStartCommand": "ssh-keygen -f '/home/vscode/.ssh/known_hosts' -R '[localhost]:2222' || true" } diff --git a/.gitignore b/.gitignore index 9d2f3dfcea..68006b7106 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,6 @@ __pycache__/ /.gita/ /.gita-workspace.csv build +!images/ebclfsa_aarch64/build/ !images/autosd_x86_64/build/ artifacts diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f67340a34d..251772455b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -17,7 +17,9 @@ "args": [ "scripts/known_good/update_module_from_known_good.py", "--override-type", - "local_path" + "local_path", + "--output-dir", + "bazel_common/" ], "problemMatcher": [] }, @@ -28,8 +30,11 @@ "args": [ "scripts/known_good/update_module_from_known_good.py", "--override-type", - "git" - ] + "git", + "--output-dir", + "bazel_common/" + ], + "problemMatcher": [] }, { "label": "Gita: Generate workspace", diff --git a/bazel_common/score_basic_bazel.MODULE.bazel b/bazel_common/score_basic_bazel.MODULE.bazel index d7f3c8088f..fbc133ba1d 100644 --- a/bazel_common/score_basic_bazel.MODULE.bazel +++ b/bazel_common/score_basic_bazel.MODULE.bazel @@ -1,5 +1,5 @@ bazel_dep(name = "rules_shell", version = "0.6.0") -bazel_dep(name = "rules_cc", version = "0.1.1") +bazel_dep(name = "rules_cc", version = "0.2.16") bazel_dep(name = "rules_pkg", version = "1.2.0") bazel_dep(name = "rules_rpm", version = "0.1.0") diff --git a/bazel_common/score_gcc_toolchains.MODULE.bazel b/bazel_common/score_gcc_toolchains.MODULE.bazel index 1a44306269..fa36cb6c8a 100644 --- a/bazel_common/score_gcc_toolchains.MODULE.bazel +++ b/bazel_common/score_gcc_toolchains.MODULE.bazel @@ -13,6 +13,11 @@ bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2") +git_override( + module_name = "score_bazel_cpp_toolchains", + remote = "https://github.com/elektrobit-contrib/eclipse-score_bazel_cpp_toolchains.git", + commit = "b102789c80334c76ce683f870a4245427ec3c3df", # EBcLfSA toolchain update + LD_LIBRARY_PATH fix +) gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True) gcc.toolchain( @@ -23,40 +28,15 @@ gcc.toolchain( version = "12.2.0", ) -# This is how new gcc more or less shall be registered: TBD by EB -# gcc.sdp( -# name = "fastdev_sdk", -# url = "https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/download/0.5.0-beta/fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64.tar.gz", -# strip_prefix = "fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64", -# sha256 = "05b57bbc8d99d46df6b57f774c39a5a2664964ea7eb94147cbece08508c1f121", -# build_file = "//ebclfsa_aarch64/toolchain:gcc.BUILD", -# ) -# gcc.toolchain( -# name = "score_ebclfsa_aarch64_toolchain", -# sdp_to_link = "fastdev_sdk", -# target_os = "linux", -# target_cpu = "aarch64", -# version = "12.2.0", -# extra_link_flags = [ -# "-lpthread", -# ] -# ) - -# Workaround until above is fixed -bazel_dep(name = "score_toolchains_gcc", dev_dependency=True) -git_override( # Elektrobit corbos Linux for Safety Applications needs a specific toolchain - module_name = "score_toolchains_gcc", - remote = "https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc.git", - tag = "0.5.0-beta" # corresponds to git sha 158921ffd9aabef41a2a03bca5baeaa9f4aa9d33 -) -eb = use_extension("@score_toolchains_gcc//extensions:gcc.bzl", "gcc", dev_dependency=True) -eb.toolchain( - url = "https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/download/0.5.0-beta/fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64.tar.gz", - sha256 = "05b57bbc8d99d46df6b57f774c39a5a2664964ea7eb94147cbece08508c1f121", - strip_prefix = "fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64", +gcc.toolchain( + name = "score_ebclfsa_toolchain", + target_os = "linux", + target_cpu = "aarch64", + runtime_ecosystem = "ebclfsa", + sdk_version = "0.1.0", + use_default_package = True, ) - bazel_dep(name = "os_autosd_toolchain", version = "0.0.1") # override with git git_override( @@ -72,8 +52,8 @@ use_repo(autosd_10_gcc, "autosd_10_gcc_repo") rpm_toolchain = use_extension("@rules_rpm//toolchain:extensions.bzl", "rpm_toolchain") use_repo(rpm_toolchain, "rpm_toolchain") -use_repo(eb, "gcc_toolchain", "gcc_toolchain_gcc") use_repo( gcc, "score_gcc_x86_64_toolchain", + "score_ebclfsa_toolchain", ) diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel index b35cb7467d..a5feb70ce3 100644 --- a/bazel_common/score_modules_target_sw.MODULE.bazel +++ b/bazel_common/score_modules_target_sw.MODULE.bazel @@ -73,6 +73,10 @@ git_override( module_name = "score_lifecycle_health", remote = "https://github.com/eclipse-score/lifecycle.git", commit = "14ee704eeac03e03ca10bece5de8b694d3c5e2dd", + patches = [ + "//patches/lifecycle_health:0001-fix-acl-for-arm64.patch", + ], + patch_strip = 1, ) bazel_dep(name = "score_logging") diff --git a/bazel_common/score_modules_tooling.MODULE.bazel b/bazel_common/score_modules_tooling.MODULE.bazel index 8d907db7eb..c7d8ba6e2c 100644 --- a/bazel_common/score_modules_tooling.MODULE.bazel +++ b/bazel_common/score_modules_tooling.MODULE.bazel @@ -15,9 +15,10 @@ # Do not edit manually - use scripts/known_good/update_module_from_known_good.py bazel_dep(name = "score_crates") -single_version_override( +git_override( module_name = "score_crates", - version = "0.0.7", + remote = "https://github.com/eclipse-score/score-crates.git", + commit = "492e701cb6414d8ac318c32884addd761bb6dbd4", # https://github.com/eclipse-score/score-crates/pull/25 ) bazel_dep(name = "score_itf") @@ -42,7 +43,7 @@ git_override( bazel_dep(name = "score_bazel_platforms") single_version_override( module_name = "score_bazel_platforms", - version = "0.0.4", + version = "0.1.1", ) bazel_dep(name = "score_test_scenarios") diff --git a/bazel_common/score_rust_toolchains.MODULE.bazel b/bazel_common/score_rust_toolchains.MODULE.bazel index 4ade3bd300..7841797eec 100644 --- a/bazel_common/score_rust_toolchains.MODULE.bazel +++ b/bazel_common/score_rust_toolchains.MODULE.bazel @@ -1,7 +1,41 @@ bazel_dep(name = "rules_rust", version = "0.61.0") -bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True) +bazel_dep(name = "score_toolchains_rust", version = "0.7.0", dev_dependency = True) git_override( module_name = "rules_rust", remote = "https://github.com/pawelrutkaq/rules_rust.git", # To be fixed once rule_rust is in score bazel registry commit = "293337fd6402ec3dfbeb8f2d589f38ad9124dadd", +) + + +ferrocene = use_extension( + "@score_toolchains_rust//extensions:ferrocene_toolchain_ext.bzl", + "ferrocene_toolchain_ext", +) + +ferrocene.toolchain( + name = "ferrocene_aarch64_ebclfsa", + url = "https://github.com/eclipse-score/ferrocene_toolchain_builder/releases/download/1.0.1/ferrocene-779fbed05ae9e9fe2a04137929d99cc9b3d516fd-aarch64-unknown-linux-gnu.tar.gz", + sha256 = "b1f1eb1146bf595fe1f4a65d5793b7039b37d2cb6d395d1c3100fa7d0377b6c9", + coverage_tools_url = "https://github.com/eclipse-score/ferrocene_toolchain_builder/releases/download/1.0.1/coverage-tools-779fbed05ae9e9fe2a04137929d99cc9b3d516fd-x86_64-unknown-linux-gnu.tar.gz", + coverage_tools_sha256 = "497958e925bc94833ea226d68f6d5ba38bd890f571c73e230141d2923e30dd94", + coverage_tools_strip_prefix = "779fbed05ae9e9fe2a04137929d99cc9b3d516fd/x86_64-unknown-linux-gnu", + target_triple = "aarch64-unknown-linux-gnu", + exec_triple = "x86_64-unknown-linux-gnu", + extra_rustc_flags = [ + "-Clink-arg=-Wl,--no-as-needed", + "-Clink-arg=-lstdc++", # this is what changed + "-Clink-arg=-static-libstdc++", # this is what changed + "-Clink-arg=-static", + "-Clink-arg=-lm", + "-Clink-arg=-lc", + ], + target_compatible_with = [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], +) + +use_repo( + ferrocene, + "ferrocene_aarch64_ebclfsa", ) \ No newline at end of file diff --git a/images/ebclfsa_aarch64/BUILD b/images/ebclfsa_aarch64/BUILD index df35a19965..bebca19d7d 100644 --- a/images/ebclfsa_aarch64/BUILD +++ b/images/ebclfsa_aarch64/BUILD @@ -9,5 +9,27 @@ # https://www.apache.org/licenses/LICENSE-2.0 # # SPDX-License-Identifier: Apache-2.0 - # ******************************************************************************* +load("@rules_shell//shell:sh_binary.bzl", "sh_binary") + +alias( + name = "image", + actual = "//images/ebclfsa_aarch64/build:fastdev-image", + visibility = ["//visibility:public"], +) + +sh_binary( + name = "run", + srcs = [ + "//runners/qemu_ebclfsa_aarch64/scripts:run_qemu.sh" + ], + + env = {"RUNFILES_LIB_DEBUG": "1"}, + args = [ + "$(locations :image)", + ], + data = [ + ":image", + ], + use_bash_launcher = True, +) diff --git a/images/ebclfsa_aarch64/build/BUILD b/images/ebclfsa_aarch64/build/BUILD new file mode 100644 index 0000000000..6725604cfa --- /dev/null +++ b/images/ebclfsa_aarch64/build/BUILD @@ -0,0 +1,62 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +genrule( + name = "fetch-fastdev-archive", + srcs = [], + outs = ["fastdev-archive.tgz"], + cmd = "wget -O $@ https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/download/0.5.0-beta/fastdev-ubuntu-ebcl-deb-qemu-arm64.tgz" +) + +genrule( + name = "extract-fastdev-image", + srcs = [":fetch-fastdev-archive"], + outs = [ + "ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic", + "ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64-vmlinux" + ], + cmd = "tar xzf $(location :fetch-fastdev-archive) -C $(RULEDIR) && chmod +w $(RULEDIR)/ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic && ls -lah $(RULEDIR)/ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic > /tmp/foo", + visibility = [ + "//visibility:public", + ], +) + +genrule( + name = "fastdev-image", + srcs = [ + "//showcases:showcases_all", + "//feature_integration_tests/configs:etc_configs", + ":extract-fastdev-image", + ":config-overlay", + "run_qemu.sh", + ], + cmd = " \ + mkdir -p $(RULEDIR)/ebcl-qemuarm64-deployed &&\ + cp $(RULEDIR)/ebcl-qemuarm64/* $(RULEDIR)/ebcl-qemuarm64-deployed/ &&\ + $(location run_qemu.sh) $(RULEDIR)/ebcl-qemuarm64-deployed -pidfile $(RULEDIR)/qemu.pid > $(RULEDIR)/qemu_deployment.log &\ + sleep 30 ; \ + sshpass -p linux scp -rp -o StrictHostKeyChecking=no -P 2222 $(location //showcases:showcases_all) root@localhost:/showcases &&\ + sshpass -p linux scp -rp -o StrictHostKeyChecking=no -P 2222 $(location :config-overlay)/* root@localhost:/ &&\ + sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost sync &&\ + sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost crinit-ctl poweroff || true \ + sleep 5 \ + ", + outs = [ + "ebcl-qemuarm64-deployed/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic", + "ebcl-qemuarm64-deployed/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64-vmlinux", + "qemu_deployment.log", + ], + visibility = [ + "//visibility:public", + ], +) diff --git a/images/ebclfsa_aarch64/build/config-overlay/BUILD b/images/ebclfsa_aarch64/build/config-overlay/BUILD new file mode 100644 index 0000000000..7537b967a0 --- /dev/null +++ b/images/ebclfsa_aarch64/build/config-overlay/BUILD @@ -0,0 +1,6 @@ +exports_files( + [ + "usr/bin/delayed-start.sh", + "etc/crinit/crinit.d/getty-console.crinit" + ] +) diff --git a/images/ebclfsa_aarch64/build/config-overlay/etc/crinit/crinit.d/getty-console.crinit b/images/ebclfsa_aarch64/build/config-overlay/etc/crinit/crinit.d/getty-console.crinit new file mode 100644 index 0000000000..8dcdda7e87 --- /dev/null +++ b/images/ebclfsa_aarch64/build/config-overlay/etc/crinit/crinit.d/getty-console.crinit @@ -0,0 +1,7 @@ +NAME = getty-console + +COMMAND = /usr/bin/setsid /sbin/getty --login-program /usr/bin/delayed-start.sh --autologin root 115200 console + +RESPAWN = YES +DEPENDS = "" +RESPAWN_RETRIES = 3 diff --git a/images/ebclfsa_aarch64/build/config-overlay/usr/bin/delayed-start.sh b/images/ebclfsa_aarch64/build/config-overlay/usr/bin/delayed-start.sh new file mode 100755 index 0000000000..c0a64921ee --- /dev/null +++ b/images/ebclfsa_aarch64/build/config-overlay/usr/bin/delayed-start.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sleep 2 +/showcases/bin/cli diff --git a/images/ebclfsa_aarch64/scrample_integration/run_qemu.sh b/images/ebclfsa_aarch64/build/run_qemu.sh similarity index 100% rename from images/ebclfsa_aarch64/scrample_integration/run_qemu.sh rename to images/ebclfsa_aarch64/build/run_qemu.sh diff --git a/images/ebclfsa_aarch64/persistency_integration/BUILD b/images/ebclfsa_aarch64/persistency_integration/BUILD deleted file mode 100644 index fdb5c75f0a..0000000000 --- a/images/ebclfsa_aarch64/persistency_integration/BUILD +++ /dev/null @@ -1,76 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* -load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES") - -genrule( - name = "fetch-fastdev-archive", - srcs = [], - outs = ["fastdev-archive.tgz"], - cmd = "wget -O $@ https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/download/0.5.0-beta/fastdev-ubuntu-ebcl-deb-qemu-arm64.tgz" -) - -genrule( - name = "fastdev-image", - srcs = [":fetch-fastdev-archive"], - outs = [ - "ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic", - "ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64-vmlinux" - ], - cmd = "tar xzf $(location :fetch-fastdev-archive) -C $(RULEDIR)", -) - -genrule( - name = "upload", - srcs = [ - "@score_persistency//tests/test_scenarios/cpp:test_scenarios", - ":fastdev-image", - "scripts/cpp_tests_persistency.sh", - "run_qemu.sh", - ], - cmd = " \ - mkdir -p $(RULEDIR)/ebcl-qemuarm64-modified &&\ - cp $(RULEDIR)/ebcl-qemuarm64/* $(RULEDIR)/ebcl-qemuarm64-modified/ &&\ - $(location run_qemu.sh) $(RULEDIR)/ebcl-qemuarm64-modified -pidfile $(RULEDIR)/qemu.pid > $(RULEDIR)/qemu_upload.log &\ - sleep 30 ; \ - sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location @score_persistency//tests/test_scenarios/cpp:test_scenarios) root@localhost:/usr/bin/cpp_tests_persistency &&\ - sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location scripts/cpp_tests_persistency.sh) root@localhost:/usr/bin/cpp_tests_persistency.sh &&\ - sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost sync &&\ - sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost crinit-ctl poweroff || true \ - sleep 5 \ - ", - outs = [ - "qemu_upload.log", - "ebcl-qemuarm64-modified/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic", - "ebcl-qemuarm64-modified/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64-vmlinux" - ], -) - -genrule( - name = "run", - srcs = [ - "ebcl-qemuarm64-modified/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic", - "ebcl-qemuarm64-modified/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64-vmlinux", - "run_qemu.sh" - ], - cmd = " \ - $(location run_qemu.sh) $(RULEDIR)/ebcl-qemuarm64-modified -pidfile $(RULEDIR)/qemu.pid > $(RULEDIR)/qemu_run.log &\ - sleep 10 ; \ - sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost cpp_tests_persistency.sh > $(RULEDIR)/ssh_persistency_test_scenarios_run.log && \ - sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost crinit-ctl poweroff || true \ - sleep 5 \ - ", - outs = [ - "qemu_run.log", - "ssh_persistency_test_scenarios_run.log", - ], -) diff --git a/images/ebclfsa_aarch64/persistency_integration/scripts/BUILD b/images/ebclfsa_aarch64/persistency_integration/scripts/BUILD new file mode 100644 index 0000000000..e69de29bb2 diff --git a/images/ebclfsa_aarch64/persistency_integration/scripts/cpp_tests_persistency.sh b/images/ebclfsa_aarch64/persistency_integration/scripts/cpp_tests_persistency.sh deleted file mode 100755 index 0dd092d139..0000000000 --- a/images/ebclfsa_aarch64/persistency_integration/scripts/cpp_tests_persistency.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# Script to run C++ persistency tests inside the QEMU environment -# Wrapper due to quoting issues when calling directly from Bazel -cpp_tests_persistency --name basic.basic --input '{"kvs_parameters":{"instance_id":0}}' diff --git a/images/ebclfsa_aarch64/scrample_integration/etc/logging.json b/images/ebclfsa_aarch64/scrample_integration/etc/logging.json deleted file mode 100644 index 8b3d1eacc8..0000000000 --- a/images/ebclfsa_aarch64/scrample_integration/etc/logging.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "appId": "IPBR", - "appDesc": "ipc_bridge", - "logLevel": "kDebug", - "logLevelThresholdConsole": "kInfo", - "logMode": "kConsole", - "dynamicDatarouterIdentifiers" : true -} diff --git a/known_good.json b/known_good.json index a10dd355c6..f2a53dbc5b 100644 --- a/known_good.json +++ b/known_good.json @@ -88,6 +88,9 @@ "score_lifecycle_health": { "repo": "https://github.com/eclipse-score/lifecycle.git", "hash": "14ee704eeac03e03ca10bece5de8b694d3c5e2dd", + "bazel_patches": [ + "//patches/lifecycle_health:0001-fix-acl-for-arm64.patch" + ], "metadata": { "code_root_path": "//src/..." } @@ -153,4 +156,4 @@ } }, "timestamp": "2026-02-10T21:12:42+00:00Z" -} \ No newline at end of file +} diff --git a/patches/lifecycle_health/0001-fix-acl-for-arm64.patch b/patches/lifecycle_health/0001-fix-acl-for-arm64.patch new file mode 100644 index 0000000000..d28b2ddcb6 --- /dev/null +++ b/patches/lifecycle_health/0001-fix-acl-for-arm64.patch @@ -0,0 +1,63 @@ +From b46b18e88c8a7687135a9a5c1eb434d153664490 Mon Sep 17 00:00:00 2001 +From: Oliver Pajonk +Date: Fri, 20 Feb 2026 10:26:42 +0100 +Subject: [PATCH] fix acl for arm64 + +--- + MODULE.bazel | 7 +++++++ + externals/acl/BUILD | 5 ++++- + externals/acl/acl.BUILD | 7 ++++--- + 3 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/MODULE.bazel b/MODULE.bazel +index 6c09448..a9bf113 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -104,6 +104,13 @@ deb( + visibility = ["//visibility:public"], + ) + ++deb( ++ name = "acl-deb-aarch64", ++ build = "//externals/acl:acl.BUILD", ++ urls = ["https://launchpadlibrarian.net/581258948/libacl1-dev_2.3.1-1_arm64.deb"], ++ visibility = ["//visibility:public"], ++) ++ + PYTHON_VERSION = "3.12" + + python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True) +diff --git a/externals/acl/BUILD b/externals/acl/BUILD +index b71d5df..da07995 100644 +--- a/externals/acl/BUILD ++++ b/externals/acl/BUILD +@@ -1,5 +1,8 @@ + alias( + name = "acl", +- actual = "@acl-deb//:acl", ++ actual = select({ ++ "@platforms//cpu:aarch64": "@acl-deb-aarch64//:acl", ++ "//conditions:default": "@acl-deb//:acl", ++ }), + visibility = ["//visibility:public"], + ) +diff --git a/externals/acl/acl.BUILD b/externals/acl/acl.BUILD +index 718726c..b695a6a 100644 +--- a/externals/acl/acl.BUILD ++++ b/externals/acl/acl.BUILD +@@ -1,8 +1,9 @@ + cc_library( + name = "acl", +- srcs = [ +- "usr/lib/libacl.a", +- ], ++ srcs = select({ ++ "@platforms//cpu:aarch64": ["usr/lib/aarch64-linux-gnu/libacl.a"], ++ "//conditions:default": ["usr/lib/libacl.a"], ++ }), + hdrs = [ + "usr/include/acl/libacl.h", + "usr/include/sys/acl.h", +-- +2.43.0 + diff --git a/patches/lifecycle_health/BUILD b/patches/lifecycle_health/BUILD new file mode 100644 index 0000000000..e69de29bb2 diff --git a/runners/qemu_ebclfsa_aarch64/BUILD b/runners/qemu_ebclfsa_aarch64/BUILD new file mode 100644 index 0000000000..52ddaba0f2 --- /dev/null +++ b/runners/qemu_ebclfsa_aarch64/BUILD @@ -0,0 +1,29 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +load("@rules_shell//shell:sh_binary.bzl", "sh_binary") +load("@score_itf//:defs.bzl", "py_itf_test") + + +# sh_binary( +# name = "qemu_x86_64", +# srcs = ["scripts/run_qemu.sh"], +# args = [ +# "$(location @toolchains_qnx_sdp//:host_dir)", +# "$(location //:image)", +# ], +# data = [ +# "//:image", +# "@toolchains_qnx_sdp//:host_all", +# "@toolchains_qnx_sdp//:host_dir", +# ], +# ) diff --git a/runners/qemu_ebclfsa_aarch64/scripts/BUILD b/runners/qemu_ebclfsa_aarch64/scripts/BUILD new file mode 100644 index 0000000000..1ba1d2b847 --- /dev/null +++ b/runners/qemu_ebclfsa_aarch64/scripts/BUILD @@ -0,0 +1 @@ +exports_files(["run_qemu.sh"]) \ No newline at end of file diff --git a/runners/qemu_ebclfsa_aarch64/scripts/run_qemu.sh b/runners/qemu_ebclfsa_aarch64/scripts/run_qemu.sh new file mode 100755 index 0000000000..2883b1fd7b --- /dev/null +++ b/runners/qemu_ebclfsa_aarch64/scripts/run_qemu.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +# # --- begin runfiles.bash initialization v3 --- +# # Copy-pasted from the Bazel Bash runfiles library v3. +# set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash +# # shellcheck disable=SC1090 +# source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ +# source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ +# source "$0.runfiles/$f" 2>/dev/null || \ +# source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ +# source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ +# { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e +# # --- end runfiles.bash initialization v3 --- + +set -euox pipefail + +#BASEFOLDER=$1 + +echo "Image: ${2}" +echo "Kernel: ${1}" + +IMAGE="$(rlocation _main/$2)" +KERNEL="$(rlocation _main/$1)" + +echo "Image: ${IMAGE}" +echo "Kernel: ${KERNEL}" + +# Make the image file writable, as QEMU needs to write to it. +find -L "$(dirname "${IMAGE}")" -samefile "${IMAGE}" -exec chmod +w {} \; + +MACHINE="virt,virtualization=true,gic-version=3" +CPU="cortex-a53" +SMP="8" +MEM="4G" +KERNEL_ARGS=("-append" "root=/dev/vda1 sdk_enable lisa_syscall_whitelist=2026 rw sharedmem.enable_sharedmem=0 init=/usr/bin/ebclfsa-cflinit") +DISK_ARGS="-device virtio-blk-device,drive=vd0 -drive if=none,format=raw,file=${IMAGE},id=vd0" +NETWORK_ARGS="-netdev user,id=net0,net=192.168.7.0/24,dhcpstart=192.168.7.2,dns=192.168.7.3,host=192.168.7.5,hostfwd=tcp::2222-:22,hostfwd=tcp::3333-:3333 -device virtio-net-device,netdev=net0 " + +if ! command -v qemu-system-aarch64 > /dev/null; then + echo "Please install qemu-system-aarch64" + exit 1 +fi + +echo "pwd=$(pwd)" + +qemu-system-aarch64 \ + -m "${MEM}" \ + -machine "${MACHINE}" \ + -cpu "${CPU}" \ + -smp "${SMP}" \ + -kernel "${KERNEL}" \ + "${KERNEL_ARGS[@]}" \ + ${DISK_ARGS} \ + ${NETWORK_ARGS} \ + -nographic \ + -chardev stdio,id=char0,signal=on,mux=on \ + -mon chardev=char0,mode=readline \ + -serial chardev:char0 diff --git a/score_starter b/score_starter index 545b2187ae..2293693737 100755 --- a/score_starter +++ b/score_starter @@ -11,8 +11,8 @@ import argparse mEntries = [ ("Run QNX x86_64 QEMU", "bazel --output_base=build/qnx-x86_64 run --config qnx-x86_64 //images/qnx_x86_64:run", "qnx-x86_64"), ("Run Linux x86_64 Docker", "bazel --output_base=build/linux-x86_64 run --config linux-x86_64 //images/linux_x86_64:run", "linux-x86_64"), - ("Run Elektrobit Corbos aarch64 QEMU", - "bazel --output_base=build/eb-aarch64 build --config eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:run", "eb-aarch64"), + ("Run Elektrobit corbos Linux for Safety Applications aarch64 QEMU", + "bazel --output_base=build/eb-aarch64 run --config eb-aarch64 //images/ebclfsa_aarch64:run", "eb-aarch64"), ("Run Autosd x86_64 QEMU", "bazel --output_base=build/autosd-x86_64 run --config autosd-x86_64 //images/autosd_x86_64:run", "autosd-x86_64"), ("Exit", "exit 0", "exit"), diff --git a/scripts/known_good/known_good_to_workspace_metadata.py b/scripts/known_good/known_good_to_workspace_metadata.py index 6c4cb93cea..31003bc7d4 100644 --- a/scripts/known_good/known_good_to_workspace_metadata.py +++ b/scripts/known_good/known_good_to_workspace_metadata.py @@ -29,18 +29,33 @@ def main(): except ValueError as e: raise SystemExit(f"ERROR: {e}") - modules = list(known_good.modules.values()) + target_sw = list(known_good.modules["target_sw"].values()) + tooling = list(known_good.modules["tooling"].values()) gita_metadata = [] - for module in modules: - if not module.repo: + for module in target_sw: + if not hasattr(module, 'repo') or not module.repo: raise RuntimeError(f"Module {module.name}: repo must not be empty") # if no hash is given, use branch hash_value = module.hash if module.hash else module.branch # workspace_path is not available in known_good.json, default to name of repository - workspace_path = module.name + workspace_path = f"modules/{module.name}" + + # gita format: {url},{name},{path},{prop['type']},{repo_flags},{branch} + row = [module.repo, module.name, workspace_path, "", "", hash_value] + gita_metadata.append(row) + + for module in tooling: + if not hasattr(module, 'repo') or not module.repo: + raise RuntimeError(f"Module {module.name}: repo must not be empty") + + # if no hash is given, use branch + hash_value = module.hash if module.hash else module.branch + + # workspace_path is not available in known_good.json, default to name of repository + workspace_path = f"tooling/{module.name}" # gita format: {url},{name},{path},{prop['type']},{repo_flags},{branch} row = [module.repo, module.name, workspace_path, "", "", hash_value]