From bf004248d9e23bef71eafe87a37b43a98dfc3646 Mon Sep 17 00:00:00 2001 From: Mateusz Krajewski Date: Wed, 28 May 2025 11:26:38 +0200 Subject: [PATCH 1/2] migrate to MODULE.bazel and remove unused files and submodules --- .github/CODEOWNERS | 6 +- .gitmodules | 3 - MODULE.bazel | 31 +++++++++ WORKSPACE | 63 +++---------------- bazel/libs/third_party_repositories.bzl | 37 ----------- libdoip | 1 - third_party/BUILD | 0 third_party/deps.bzl | 4 -- third_party/toolchains/BUILD | 0 ...rm-cortex_a8-linux-gnueabihf-sysroot.BUILD | 8 --- .../arm-cortex_a8-linux-gnueabihf.BUILD | 8 --- third_party/toolchains/toolchains.bzl | 18 ------ tools/desktop_gui | 1 - 13 files changed, 41 insertions(+), 139 deletions(-) delete mode 160000 libdoip delete mode 100644 third_party/BUILD delete mode 100644 third_party/deps.bzl delete mode 100644 third_party/toolchains/BUILD delete mode 100644 third_party/toolchains/arm-cortex_a8-linux-gnueabihf-sysroot.BUILD delete mode 100644 third_party/toolchains/arm-cortex_a8-linux-gnueabihf.BUILD delete mode 100644 third_party/toolchains/toolchains.bzl delete mode 160000 tools/desktop_gui diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0d9e6b56..8fcc7b15 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,3 @@ * @Simba-Avionic/avionic-admin -communication-core/someip @bartoszsnieg -communication-core/someip-controller @bartoszsnieg -communication-core/network-data @bartoszsnieg -communication-core/sockets @bartoszsnieg +communication-core/network-data @Simba-Avionic/avionic-admin +communication-core/sockets @Simba-Avionic/avionic-admin diff --git a/.gitmodules b/.gitmodules index 33981723..0031ebad 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "desktop_gui"] - path = tools/desktop_gui - url = git@github.com:Simba-Avionic/desktop_gui.git [submodule "deployment/system_definition"] path = deployment/system_definition url = git@github.com:Simba-Avionic/system_definition.git diff --git a/MODULE.bazel b/MODULE.bazel index 00bb1836..08f027ad 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,3 +4,34 @@ # # For more details, please check https://github.com/bazelbuild/bazel/issues/18958 ############################################################################### +module(name="srp") +bazel_dep(name = "platforms", version = "0.0.11") +bazel_dep(name = "bazel_skylib", version = "1.7.1") + +bazel_dep(name = "nlohmann_json", version = "3.12.0", repo_name = "com_json") +bazel_dep(name = "google_benchmark", version = "1.9.2", repo_name = "com_google_benchmark") +bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest") +bazel_dep(name = "rules_python", version = "1.4.1") + +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +srp_mavlink_version = "0.3" +http_archive( + name = "srp_mavlink", + strip_prefix = "simba_mavlink-"+srp_mavlink_version, + urls = ["https://github.com/Simba-Avionic/simba_mavlink/archive/refs/tags/"+srp_mavlink_version+".zip"], + type = "zip", +) + + + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.defaults( + # Use python.defaults if you have defined multiple toolchain versions. + python_version = "3.9", + python_version_env = "BAZEL_PYTHON_VERSION", +) +python.toolchain( + configure_coverage_tool = True, + python_version = "3.9", +) diff --git a/WORKSPACE b/WORKSPACE index a416e883..87b9cb6b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,14 +1,15 @@ workspace(name="srp") - load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("//bazel/toolchain:toolchain.bzl", "register_all_toolchains") -register_all_toolchains() -load("//third_party:deps.bzl", "deps") -deps() -load("//bazel/libs:third_party_repositories.bzl", "include_srp_platform", "include_srp_mavlink", "include_gtest_mock", "include_json") -include_srp_platform("0.0.6SQF") +srp_platform_version = "0.0.6SQF" +http_archive( + name = "srp_platform", + strip_prefix = "srp_platform-"+srp_platform_version, + urls = ["https://github.com/SRP-Platform/srp_platform/archive/refs/tags/"+srp_platform_version+".zip"], + type = "zip", +) + load("@srp_platform//:download.bzl", "download") download() @@ -20,51 +21,3 @@ install_python() load("@srp_platform//:pip_install.bzl", "pip_install") pip_install() - - - -include_srp_mavlink("0.3") -include_gtest_mock() -include_json("3.11.3") - -##### PYTHON - -http_archive( - name = "doipclient", - strip_prefix = "python-doipclient-1.1.1/doipclient", - build_file = "//bazel/libs:doipclient.BUILD", - urls = ["https://github.com/jacobschaer/python-doipclient/archive/refs/tags/v1.1.1.zip"], - type = "zip", -) - -http_archive( - name = "rules_python", - sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b", - strip_prefix = "rules_python-0.26.0", - url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz", -) -load("@rules_python//python:repositories.bzl", "py_repositories") - -py_repositories() - -load("@rules_python//python:repositories.bzl", "python_register_toolchains") - -python_register_toolchains( - name = "python_3_11", - # Available versions are listed in @rules_python//python:versions.bzl. - # We recommend using the same version your team is already standardized on. - python_version = "3.11", -) - -load("@python_3_11//:defs.bzl", "interpreter") - -load("@rules_python//python:pip.bzl", "pip_parse") - -pip_parse( - name = "pip_deps", - requirements_lock = "//third_party/python:requirements.txt", -) - -load("@pip_deps//:requirements.bzl", "install_deps") - -install_deps() diff --git a/bazel/libs/third_party_repositories.bzl b/bazel/libs/third_party_repositories.bzl index 9612d114..9c6460e8 100644 --- a/bazel/libs/third_party_repositories.bzl +++ b/bazel/libs/third_party_repositories.bzl @@ -2,40 +2,3 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])""" -def include_json(ver): - http_archive( - name = "com_json", - strip_prefix = "json-"+ver, - urls = ["https://github.com/nlohmann/json/archive/refs/tags/v"+ver+".zip"], - sha256 = "04022b05d806eb5ff73023c280b68697d12b93e1b7267a0b22a1a39ec7578069" - ) - -def include_srp_platform(ver): - http_archive( - name = "srp_platform", - strip_prefix = "srp_platform-"+ver, - urls = ["https://github.com/SRP-Platform/srp_platform/archive/refs/tags/"+ver+".zip"], - type = "zip", - ) - -def include_srp_mavlink(ver): - http_archive( - name = "srp_mavlink", - strip_prefix = "simba_mavlink-"+ver, - urls = ["https://github.com/Simba-Avionic/simba_mavlink/archive/refs/tags/"+ver+".zip"], - type = "zip", - ) -def include_gtest_mock(): - http_archive( - name = "com_google_benchmark", - sha256 = "bdefa4b03c32d1a27bd50e37ca466d8127c1688d834800c38f3c587a396188ee", - strip_prefix = "benchmark-1.5.3", - urls = ["https://github.com/google/benchmark/archive/v1.5.3.zip"], - ) - - http_archive( - name = "com_google_googletest", - strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015", - sha256 = "755f9a39bc7205f5a0c428e920ddad092c33c8a1b46997def3f1d4a82aded6e1", - urls = ["https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip"], - ) diff --git a/libdoip b/libdoip deleted file mode 160000 index 88921494..00000000 --- a/libdoip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 889214942e326026b02176330da887cbf6d851e6 diff --git a/third_party/BUILD b/third_party/BUILD deleted file mode 100644 index e69de29b..00000000 diff --git a/third_party/deps.bzl b/third_party/deps.bzl deleted file mode 100644 index d11823e1..00000000 --- a/third_party/deps.bzl +++ /dev/null @@ -1,4 +0,0 @@ -load("//third_party/toolchains:toolchains.bzl", "toolchains") - -def deps(): - toolchains() diff --git a/third_party/toolchains/BUILD b/third_party/toolchains/BUILD deleted file mode 100644 index e69de29b..00000000 diff --git a/third_party/toolchains/arm-cortex_a8-linux-gnueabihf-sysroot.BUILD b/third_party/toolchains/arm-cortex_a8-linux-gnueabihf-sysroot.BUILD deleted file mode 100644 index 6f42620e..00000000 --- a/third_party/toolchains/arm-cortex_a8-linux-gnueabihf-sysroot.BUILD +++ /dev/null @@ -1,8 +0,0 @@ -package(default_visibility = ['//visibility:public']) - -filegroup( - name = 'sysroot', - srcs = glob([ - '**', - ]), -) diff --git a/third_party/toolchains/arm-cortex_a8-linux-gnueabihf.BUILD b/third_party/toolchains/arm-cortex_a8-linux-gnueabihf.BUILD deleted file mode 100644 index 3d4d0e7c..00000000 --- a/third_party/toolchains/arm-cortex_a8-linux-gnueabihf.BUILD +++ /dev/null @@ -1,8 +0,0 @@ -package(default_visibility = ['//visibility:public']) - -filegroup( - name = 'toolchain', - srcs = glob([ - '**', - ]), -) diff --git a/third_party/toolchains/toolchains.bzl b/third_party/toolchains/toolchains.bzl deleted file mode 100644 index f063f9b6..00000000 --- a/third_party/toolchains/toolchains.bzl +++ /dev/null @@ -1,18 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def toolchains(): - if "arm-cortex_a8-linux-gnueabihf" not in native.existing_rules(): - http_archive( - name = "arm-cortex_a8-linux-gnueabihf", - build_file = Label("//third_party/toolchains:arm-cortex_a8-linux-gnueabihf.BUILD"), - url = "https://github.com/Simba-Avionic/fc_yocto/releases/download/v8.0/arm-cortex_a8-linux-gnueabihf.tar.gz", - sha256 = "f2b74022f80ed02253b302e993907b57b9d13107be55d08bdaaae637a6ebf749", - ) - - if "arm-cortex_a8-linux-gnueabihf-sysroot" not in native.existing_rules(): - http_archive( - name = "arm-cortex_a8-linux-gnueabihf-sysroot", - build_file = Label("//third_party/toolchains:arm-cortex_a8-linux-gnueabihf-sysroot.BUILD"), - url = "https://github.com/Simba-Avionic/fc_yocto/releases/download/v8.0/beaglebone.tar.gz", - sha256 = "324e5db4daea321fba5fc283a1375340570e3857ee70395ceba12e67c299cee5", - ) diff --git a/tools/desktop_gui b/tools/desktop_gui deleted file mode 160000 index fe4782e2..00000000 --- a/tools/desktop_gui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fe4782e2268cb79d8bcb191774d7262ea6cc3096 From a8589d1cf08c225c95608dfdb738b97a7aa17867 Mon Sep 17 00:00:00 2001 From: Mateusz Krajewski Date: Thu, 29 May 2025 06:49:36 +0200 Subject: [PATCH 2/2] . --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0031ebad..da54a434 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "third_party/python/someipy"] path = third_party/python/someipy url = git@github.com:Simba-Avionic/someipy.git -[submodule "libdoip"] - path = libdoip - url = https://github.com/Simba-Avionic/libdoip