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
14 changes: 11 additions & 3 deletions bazel_migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ OpenBSW Bazel migration
├── docker/ ⬛
├── executables/
│ ├── referenceApp/ 🔲
│ │ ├── application (application_headers stub) ✅
│ │ ├── asyncBinding ✅
│ │ ├── asyncCoreConfiguration ✅
│ │ ├── configuration ✅
│ │ ├── lwipConfiguration ✅
│ │ └── platforms/
│ │ ├── posix/ ✅ (freeRtosCoreConfiguration, osHooks)
│ │ └── s32k148evb/ ✅ (freeRtosCoreConfiguration, osHooks)
Expand All @@ -50,7 +52,9 @@ OpenBSW Bazel migration
│ ├── 3rdparty/
│ │ ├── cmsis ✅
│ │ ├── etl ✅
│ │ └── freeRtos ✅
│ │ ├── freeRtos ✅
│ │ ├── lwip ✅
│ │ └── printf ✅
│ │ └── printf ✅
│ ├── bsp/
│ │ └── bspInterrupts ✅
Expand All @@ -64,6 +68,8 @@ OpenBSW Bazel migration
│ │ ├── io ✅
│ │ ├── lifecycle ✅
│ │ ├── logger ✅
│ │ ├── loggerIntegration ✅
│ │ ├── lwipSocket ✅
│ │ ├── middleware ✅
│ │ ├── bsp ✅
│ │ ├── common ✅
Expand All @@ -74,8 +80,8 @@ OpenBSW Bazel migration
│ │ ├── util ✅
│ └── (remaining) 🔲
├── platforms/
│ ├── posix/ ✅ (freeRtosPosix, bspInterruptsImpl)
│ └── s32k1xx/ ✅ (freertos_cm4_sysTick, bspMcu, bspInterruptsImpl)
│ ├── posix/ ✅ (freeRtosPosix, bspInterruptsImpl, etlImpl, lwipSysArch)
│ └── s32k1xx/ ✅ (freertos_cm4_sysTick, bspMcu, bspInterruptsImpl, etlImpl, lwipSysArch)
├── test/ Scope of Bazel support TBD
└── tools/ Scope of Bazel support TBD

Expand Down Expand Up @@ -104,6 +110,8 @@ Implemented config points:
| [`platform`](../bazel/platform/BUILD) | Selects toolchain based on target platform | `--config=s32k148` | `platform` | `//bazel/platform:s32k148`, `@platforms//host` | `@platforms//host` |
| [`executable_config`](../bazel/config/executable_config/BUILD) | Controls executable config; `unit_test` is incompatible with baremetal platforms (e.g `s32k148`) | `--//bazel/config/executable_config` | `string_flag` | `reference_app`, `unit_test` | `reference_app`, `unit_test` (bazel test invocations) |
| [`etl_profile`](../libs/3rdparty/etl/BUILD) | Injects custom ETL profile; otherwise use default based on executable_config | `--//libs/3rdparty/etl:etl_profile` | `label_flag` | any `cc_library` label | `//executables/referenceApp/etl_profile` (`executable_config:reference_app`), `//executables/unitTest/etl_profile` (`executable_config:unit_test`) |
| [`etl_impl`](../libs/bsw/loggerIntegration/BUILD.bazel) | Injects custom ETL implementation for loggerIntegration; otherwise selects based on platform | `--//libs/bsw/loggerIntegration:etl_impl` | `label_flag` | any `cc_library` label | `//platforms/s32k1xx/etlImpl:etl_impl` (s32k148), `//platforms/posix/etlImpl:etl_impl` (posix) |
| [`lwip_configuration`](../libs/3rdparty/lwip/BUILD.bazel) | Injects custom lwIP configuration (lwipopts.h + sys_arch port); otherwise uses referenceApp default | `--//libs/3rdparty/lwip:lwip_configuration` | `label_flag` | any `cc_library` label | `//executables/referenceApp/lwipConfiguration:lwip_configuration` |

Examples:
```bash
Expand Down
39 changes: 39 additions & 0 deletions executables/referenceApp/lwipConfiguration/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# *******************************************************************************
# 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 = "lwip_sys_arch_default",
actual = select(
{
"//bazel/platform/constraints/soc:s32k148": "//platforms/s32k1xx/lwipSysArch:lwip_sys_arch",
"@platforms//os:linux": "//platforms/posix/lwipSysArch:lwip_sys_arch",
},
no_match_error = "No lwip sys_arch for this platform. Override --//libs/3rdparty/lwip:lwip_configuration with your own implementation.",
),
visibility = ["//visibility:public"],
)

cc_library(
name = "lwip_configuration",
srcs = ["src/rng.cpp"],
hdrs = [
"include/lwipopts.h",
"include/rng.h",
],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
":lwip_sys_arch_default",
"//libs/3rdparty/etl",
"//libs/bsw/platform",
],
)
4 changes: 2 additions & 2 deletions libs/3rdparty/lwip/.riminfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fb7b6b88c102aada3af57fbb5b649d7af271fd44
e26ace8f8ce559a2e625e181286217e54bd67854

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/lwip-tcpip/lwip.git
revision_sha1 : 009c2256469004009488b3385ba269461e8eb616
target_revision: STABLE-2_2_1_RELEASE
ignores :
ignores : BUILD.bazel
checksum : 07f96577ede325cf117d934bd0229a5e0f0b3187
subdir :

Expand Down
42 changes: 42 additions & 0 deletions libs/3rdparty/lwip/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# *******************************************************************************
# 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 = "lwip_configuration_default",
actual = "//executables/referenceApp/lwipConfiguration:lwip_configuration",
visibility = ["//visibility:public"],
)

# Default: //executables/referenceApp/lwipConfiguration:lwip_configuration
# Override: --//libs/3rdparty/lwip:lwip_configuration=//path/to:your_lwip_config
label_flag(
name = "lwip_configuration",
build_setting_default = ":lwip_configuration_default",
visibility = ["//visibility:public"],
)

cc_library(
name = "lwip_core",
srcs = glob([
"src/core/*.c",
"src/core/ipv4/*.c",
"src/core/ipv6/*.c",
"src/api/*.c",
"src/netif/*.c",
"src/netif/ppp/*.c",
"src/netif/ppp/polarssl/*.c",
]),
hdrs = glob(["src/include/**/*.h"]),
strip_include_prefix = "src/include",
visibility = ["//visibility:public"],
deps = [":lwip_configuration"],
)
42 changes: 42 additions & 0 deletions libs/bsw/lwipSocket/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# *******************************************************************************
# 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 = "lwip_socket",
srcs = [
"src/lwipSocket/netif/LwipNetworkInterface.cpp",
"src/lwipSocket/tcp/LwipServerSocket.cpp",
"src/lwipSocket/tcp/LwipSocket.cpp",
"src/lwipSocket/udp/LwipDatagramSocket.cpp",
"src/lwipSocket/utils/FilterFrame.cpp",
"src/lwipSocket/utils/TaskAssert.cpp",
],
hdrs = [
"include/lwipSocket/netif/LwipNetworkInterface.h",
"include/lwipSocket/tcp/LwipServerSocket.h",
"include/lwipSocket/tcp/LwipSocket.h",
"include/lwipSocket/udp/LwipDatagramSocket.h",
"include/lwipSocket/utils/LwipHelper.h",
"include/lwipSocket/utils/LwipLogger.h",
"include/lwipSocket/utils/TaskAssert.h",
],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//libs/3rdparty/etl",
"//libs/3rdparty/lwip:lwip_core",
"//libs/bsw/async",
"//libs/bsw/common",
"//libs/bsw/cpp2ethernet",
"//libs/bsw/util",
],
)
24 changes: 24 additions & 0 deletions platforms/posix/lwipSysArch/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# *******************************************************************************
# 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 = "lwip_sys_arch",
srcs = ["src/arch/sys_arch.cpp"],
hdrs = [
"include/arch/cc.h",
"include/arch/sys_arch.h",
],
implementation_deps = ["//libs/bsw/bsp"],
strip_include_prefix = "include",
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
)
28 changes: 28 additions & 0 deletions platforms/s32k1xx/lwipSysArch/BUILD.bazel
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 = "lwip_sys_arch",
srcs = ["src/arch/sys_arch.cpp"],
hdrs = [
"include/arch/cc.h",
"include/arch/sys_arch.h",
],
implementation_deps = [
"//libs/bsp/bspInterrupts:bsp_interrupts",
"//libs/bsw/bsp",
"//libs/bsw/platform",
],
strip_include_prefix = "include",
target_compatible_with = ["//bazel/platform/constraints/soc:s32k148"],
visibility = ["//visibility:public"],
)
Loading