Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bazel_migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,18 @@ OpenBSW Bazel migration
│ │ ├── cmsis ✅
│ │ ├── etl ✅
│ │ └── freeRtos ✅
│ │ └── printf ✅
│ ├── bsp/
│ │ └── bspInterrupts ✅
│ ├── bsw/
│ │ ├── async ✅
│ │ ├── asyncConsole ✅
│ │ ├── asyncFreeRtos ✅
│ │ ├── asyncImpl ✅
│ │ ├── cpp2can ✅
│ │ ├── cpp2ethernet ✅
│ │ ├── io ✅
│ │ ├── lifecycle ✅
│ │ ├── logger ✅
│ │ ├── middleware ✅
│ │ ├── bsp ✅
Expand Down
4 changes: 2 additions & 2 deletions libs/3rdparty/printf/.riminfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
e28bd7bd1c45852561a3b76fb4f8a76902b9dd95
022ef680ff54d2ab6a201c762bb6167b5c77cef0

RIM Info file. You're welcome to read but don't write it.
Instead, use RIM commands to do the things you want to do.
Expand All @@ -7,7 +7,7 @@ BEWARE: Any manual modification will invalidate the file!
remote_url : https://github.com/eyalroz/printf.git
revision_sha1 : 5f2d0585a4d5a6117002d8296e68b68232a549f8
target_revision: v5.2.0
ignores : benchmark/*,fuzz/*,test/gtest/*,Project.meta
ignores : benchmark/*,BUILD.bazel,fuzz/*,test/gtest/*,Project.meta
checksum : 067b8567ea0c739e8ef11396335129519f8def2e
subdir :

Expand Down
50 changes: 50 additions & 0 deletions libs/3rdparty/printf/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# *******************************************************************************
# Copyright (c) 2026 Accenture
#
# 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("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@rules_cc//cc:cc_library.bzl", "cc_library")

expand_template(
name = "printf_config_h",
out = "include/printf_config.h",
substitutions = {
"@PRINTF_SUPPORT_DECIMAL_SPECIFIERS@": "0",
"@PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS@": "0",
"@PRINTF_SUPPORT_WRITEBACK_SPECIFIER@": "1",
"@PRINTF_SUPPORT_LONG_LONG@": "1",
"@PRINTF_ALIAS_STANDARD_FUNCTION_NAMES@": "0",
"@PRINTF_INTEGER_BUFFER_SIZE@": "32",
"@PRINTF_DECIMAL_BUFFER_SIZE@": "32",
"@DEFAULT_FLOAT_PRECISION@": "6",
"@MAX_INTEGRAL_DIGITS_FOR_DECIMAL@": "9",
},
template = "printf_config.h.in",
)

cc_library(
name = "printf",
srcs = [
"src/printf/printf.c",
":printf_config_h",
],
hdrs = [
"src/printf/printf.h",
],
copts = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How does the copts interact with the options of depending libraries? Let's say we have a cc_library printf_user and it uses a deps = ["//libs/3rdparty/printf"], then all files within printf_user will be compiled with these additional flags, right? What in case we compile globally with a different -stc? Or with differend error flags?

Is there at all a reason that we need to put these extra warning flags and the std in the first place?

The -I is just there to allow the printf_config.h generated by the expand_template above to be in the include path, right? The strip_include_prefix does not help for it and includes would lead to system includes, right? Or do we even want this to be a system include?

@DominikAFischer DominikAFischer Jun 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How does the copts interact with the options of depending libraries? Let's say we have a cc_library printf_user and it uses a deps = ["//libs/3rdparty/printf"], then all files within printf_user will be compiled with these additional flags, right? What in case we compile globally with a different -stc? Or with differend error flags?

The copts flags are not propagated to consumers t all and should only affect printf itself.

Is there at all a reason that we need to put these extra warning flags and the std in the first place?

These flags are applied like this also on the Cmake side:


The -I is just there to allow the printf_config.h generated by the expand_template above to be in the include path, right? The strip_include_prefix does not help for it and includes would lead to system includes, right? Or do we even want this to be a system include?

Correct: strip_include_prefix doesn't cover generated files.
includes would cause -iSystem, which might be fine but currently would be a deviation from the Cmake side

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

okay, then let's leave it like this, but still something like -std might also affect the header files which we include somewhere. Since it is like this im CMake as well we can take it over and later adapt it on both sides.

"-std=c99",
"-pedantic",
"-Wall",
"-Wextra",
"-I$(GENDIR)/libs/3rdparty/printf/include",
],
local_defines = ["PRINTF_INCLUDE_CONFIG_H"],
strip_include_prefix = "src",
visibility = ["//visibility:public"],
)
33 changes: 33 additions & 0 deletions libs/bsw/asyncConsole/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# *******************************************************************************
# Copyright (c) 2026 Accenture
#
# 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_cc//cc:cc_library.bzl", "cc_library")

cc_library(
name = "async_console",
srcs = [
"src/console/AsyncCommandWrapper.cpp",
"src/console/AsyncConsole.cpp",
"src/console/SyncCommandWrapper.cpp",
"src/logger/ConsoleLogger.cpp",
],
hdrs = [
"include/console/AsyncCommandWrapper.h",
"include/console/AsyncConsole.h",
"include/console/SyncCommandWrapper.h",
"include/logger/ConsoleLogger.h",
],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//libs/bsw/async",
"//libs/bsw/util",
],
)
35 changes: 35 additions & 0 deletions libs/bsw/cpp2can/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# *******************************************************************************
# Copyright (c) 2026 Accenture
#
# 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_cc//cc:cc_library.bzl", "cc_library")

cc_library(
name = "cpp2can",
srcs = [
"src/can/CanLogger.cpp",
"src/can/canframes/CANFrame.cpp",
"src/can/filter/AbstractStaticBitFieldFilter.cpp",
"src/can/filter/BitFieldFilter.cpp",
"src/can/filter/IntervalFilter.cpp",
"src/can/transceiver/AbstractCANTransceiver.cpp",
],
hdrs = glob(["include/**/*.h"]),
implementation_deps = [
"//libs/bsp/bspInterrupts:bsp_interrupts",
"//libs/bsw/bsp",
],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//libs/3rdparty/etl",
"//libs/bsw/common",
"//libs/bsw/util",
],
)
26 changes: 26 additions & 0 deletions libs/bsw/cpp2ethernet/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# *******************************************************************************
# Copyright (c) 2026 Accenture
#
# 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_cc//cc:cc_library.bzl", "cc_library")

cc_library(
name = "cpp2ethernet",
srcs = glob(["src/**/*.cpp"]),
hdrs = glob(["include/**/*.h"]),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//libs/3rdparty/etl",
"//libs/bsw/async",
"//libs/bsw/bsp",
"//libs/bsw/common",
"//libs/bsw/util",
],
)
32 changes: 32 additions & 0 deletions libs/bsw/lifecycle/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# *******************************************************************************
# Copyright (c) 2026 Accenture
#
# 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_cc//cc:cc_library.bzl", "cc_library")

cc_library(
name = "lifecycle",
srcs = [
"src/lifecycle/AsyncLifecycleComponent.cpp",
"src/lifecycle/LifecycleComponent.cpp",
"src/lifecycle/LifecycleLogger.cpp",
"src/lifecycle/LifecycleManager.cpp",
"src/lifecycle/LifecycleManagerForwarder.cpp",
"src/lifecycle/SimpleLifecycleComponent.cpp",
"src/lifecycle/SingleContextLifecycleComponent.cpp",
],
hdrs = glob(["include/**/*.h"]),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//libs/3rdparty/etl",
"//libs/bsw/async",
"//libs/bsw/util",
],
)
Loading