-
Notifications
You must be signed in to change notification settings - Fork 66
Migration of bsw libs docan, doip, logger_integration #491
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = "docan", | ||
| srcs = [ | ||
| "src/docan/common/DoCanLogger.cpp", | ||
| "src/docan/datalink/DoCanFrameCodecConfigPresets.cpp", | ||
| ], | ||
| hdrs = glob(["include/**/*.h"]), | ||
| strip_include_prefix = "include", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "//libs/3rdparty/etl", | ||
| "//libs/bsp/bspInterrupts:bsp_interrupts", | ||
| "//libs/bsw/async", | ||
| "//libs/bsw/common", | ||
| "//libs/bsw/cpp2can", | ||
| "//libs/bsw/platform", | ||
| "//libs/bsw/transport", | ||
| "//libs/bsw/util", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # ******************************************************************************* | ||
| # 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 = "doip", | ||
| srcs = glob(["src/**/*.cpp"]), | ||
| hdrs = glob(["include/**/*.h"]), | ||
| strip_include_prefix = "include", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "//libs/3rdparty/etl", | ||
| "//libs/bsw/async", | ||
| "//libs/bsw/common", | ||
| "//libs/bsw/cpp2ethernet", | ||
| "//libs/bsw/platform", | ||
| "//libs/bsw/transport", | ||
| "//libs/bsw/util", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # ******************************************************************************* | ||
| # 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") | ||
|
|
||
| alias( | ||
| name = "etl_impl_default", | ||
| actual = select( | ||
| { | ||
| "//bazel/platform/constraints/soc:s32k148": "//platforms/s32k1xx/etlImpl:etl_impl", | ||
| "@platforms//os:linux": "//platforms/posix/etlImpl:etl_impl", | ||
| }, | ||
| no_match_error = "No default etl_impl for this platform. Override --//libs/bsw/loggerIntegration:etl_impl with your own ETL implementation target.", | ||
| ), | ||
| ) | ||
|
|
||
| # Default: select based on the target platform via etl_impl_default (S32K148, POSIX) | ||
| # Override: --//libs/bsw/loggerIntegration:etl_impl=//path/to:your_impl | ||
| label_flag( | ||
| name = "etl_impl", | ||
| build_setting_default = ":etl_impl_default", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "logger_integration", | ||
| srcs = [ | ||
| "src/logger/LoggerComposition.cpp", | ||
| "src/logger/LoggerTime.cpp", | ||
| ], | ||
| hdrs = [ | ||
| "include/logger/Config.h", | ||
| "include/logger/ConsoleEntryFormatter.h", | ||
| "include/logger/LoggerComposition.h", | ||
| "include/logger/LoggerTime.h", | ||
| ], | ||
| implementation_deps = [ | ||
| ":etl_impl", | ||
| "//libs/3rdparty/etl", | ||
| "//libs/bsp/bspInterrupts:bsp_interrupts", | ||
| "//libs/bsw/logger", | ||
| ], | ||
| strip_include_prefix = "include", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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("@rules_cc//cc:cc_library.bzl", "cc_library") | ||
|
|
||
| # TODO: Add asyncThreadXImpl branch once ThreadX has been migrated. | ||
| alias( | ||
| name = "storage_rtos_impl", | ||
| actual = select( | ||
| { | ||
| "//bazel/config/rtos:support_freertos": "//libs/bsw/asyncFreeRtos:async_freertos_impl", | ||
| }, | ||
| no_match_error = "storage: asyncFreeRtosImpl only migrated for FreeRTOS; build with --//bazel/config/rtos=freertos (ThreadX deferred).", | ||
| ), | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "storage", | ||
| srcs = [ | ||
| "src/storage/EepStorage.cpp", | ||
| "src/storage/MappingStorage.cpp", | ||
| "src/storage/QueuingStorage.cpp", | ||
| "src/storage/StorageTester.cpp", | ||
| ], | ||
| hdrs = [ | ||
| "include/storage/EepStorage.h", | ||
| "include/storage/FeeStorage.h", | ||
| "include/storage/IStorage.h", | ||
| "include/storage/MappingStorage.h", | ||
| "include/storage/QueuingStorage.h", | ||
| "include/storage/StorageJob.h", | ||
| "include/storage/StorageTester.h", | ||
| ], | ||
| strip_include_prefix = "include", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| ":storage_rtos_impl", | ||
| "//libs/3rdparty/etl", | ||
| "//libs/bsw/async", | ||
| "//libs/bsw/bsp", | ||
| "//libs/bsw/util", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = "etl_impl", | ||
| srcs = [ | ||
| "src/clocks.cpp", | ||
| "src/print.cpp", | ||
| ], | ||
| implementation_deps = [ | ||
| "//libs/3rdparty/etl", | ||
| "//libs/bsw/bsp", | ||
| "//libs/bsw/util", | ||
| ], | ||
| target_compatible_with = ["@platforms//os:linux"], | ||
| visibility = ["//visibility:public"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = "etl_impl", | ||
| srcs = [ | ||
| "src/clocks.cpp", | ||
| "src/print.cpp", | ||
| ], | ||
| implementation_deps = [ | ||
| "//libs/3rdparty/etl", | ||
| "//libs/bsw/bsp", | ||
| "//libs/bsw/util", | ||
| ], | ||
| target_compatible_with = ["//bazel/platform/constraints/soc:s32k148"], | ||
| visibility = ["//visibility:public"], | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I wonder how this scales? Many libraries will use etl, I think it does not make sense that each library specifies it's own label flag? Shouldn't we have a more generic one at a higher level every library can then depend on?
The
etl_profilecomes in already via the dependency of//libs/3rdparty/etlto the label flag//libs/3rdparty/etl:etl_profile.In total we have three things to consider, the etl implemenation itself, the
etl_profile.hand the integration specific implementations likeprint.cpp.In our project it is currently handled in a way the both
etl_profile.hand the implementations are handled via a singlecc_library(without dependencies, so no cycle) configured as a label flag calledetl_profile. Then there is a centraletllibrary which takes the etl sources and has theetl_profilelabel flag as a dependency. All users of etl can then simply refer to this library, the fact that it requires a label flag is hiddne.Uh oh!
There was an error while loading. Please reload this page.
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.
That's definitely a valid concern and would make things easier as far as I can see.
It also would be a departure from the current CMake implementation and might even need changes to source code if I'm correct. So, I would suggest that we add this to the list of design discussions and handle it separately?
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.
Fine for me, we can do it like this, but we should keep track of this to refactor :)