From 7bc8e0a0ee329b3d3ea468fb6a950edaea91bc30 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Thu, 26 Dec 2024 07:21:10 -0800 Subject: [PATCH 01/20] Add lanelet2 module Closes https://github.com/bazelbuild/bazel-central-registry/issues/3487 --- modules/lanelet2/1.2.1/MODULE.bazel | 29 +++ modules/lanelet2/1.2.1/overlay/BUILD.bazel | 232 ++++++++++++++++++ modules/lanelet2/1.2.1/overlay/MODULE.bazel | 1 + .../1.2.1/patches/bazel_test_paths.patch | 48 ++++ .../patches/fix_test_include_paths.patch | 26 ++ modules/lanelet2/1.2.1/source.json | 14 ++ modules/lanelet2/metadata.json | 17 ++ 7 files changed, 367 insertions(+) create mode 100644 modules/lanelet2/1.2.1/MODULE.bazel create mode 100644 modules/lanelet2/1.2.1/overlay/BUILD.bazel create mode 120000 modules/lanelet2/1.2.1/overlay/MODULE.bazel create mode 100644 modules/lanelet2/1.2.1/patches/bazel_test_paths.patch create mode 100644 modules/lanelet2/1.2.1/patches/fix_test_include_paths.patch create mode 100644 modules/lanelet2/1.2.1/source.json create mode 100644 modules/lanelet2/metadata.json diff --git a/modules/lanelet2/1.2.1/MODULE.bazel b/modules/lanelet2/1.2.1/MODULE.bazel new file mode 100644 index 00000000000..c9b7fdf45e6 --- /dev/null +++ b/modules/lanelet2/1.2.1/MODULE.bazel @@ -0,0 +1,29 @@ +module( + name = "lanelet2", + version = "1.2.1", +) + +BOOST_VERSION = "1.83.0" + +bazel_dep(name = "boost.config", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.core", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.filesystem", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.format", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.geometry", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.graph", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.iterator", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.lexical_cast", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.optional", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.polygon", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.program_options", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.property_map", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.serialization", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.type_traits", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "boost.units", version = BOOST_VERSION) +bazel_dep(name = "boost.variant", version = BOOST_VERSION + ".bcr.1") +bazel_dep(name = "eigen", version = "3.4.0.bcr.1") +bazel_dep(name = "geographiclib", version = "2.4.0") +bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest") +bazel_dep(name = "pugixml", version = "1.14.bcr.1") +bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "rules_license", version = "1.0.0") diff --git a/modules/lanelet2/1.2.1/overlay/BUILD.bazel b/modules/lanelet2/1.2.1/overlay/BUILD.bazel new file mode 100644 index 00000000000..b79f87efe3c --- /dev/null +++ b/modules/lanelet2/1.2.1/overlay/BUILD.bazel @@ -0,0 +1,232 @@ +"""Bazel build file for lanelet2 libraries""" + +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") +load("@rules_license//rules:license.bzl", "license") + +package(default_applicable_licenses = [":license"]) + +license( + name = "license", + license_kinds = ["@rules_license//licenses/spdx:BSD-3-Clause"], + license_text = "LICENSE", +) + +cc_library( + name = "lanelet2_core", + srcs = glob(["lanelet2_core/src/**/*.cpp"]), + hdrs = glob(["lanelet2_core/include/**/*.h"]), + copts = [ + "-Wno-sign-compare", + "-Wno-unused-function", + "-Wno-unused-local-typedefs", + ], + includes = ["lanelet2_core/include"], + visibility = ["//visibility:public"], + deps = [ + "@boost.config", + "@boost.core", + "@boost.geometry", + "@boost.iterator", + "@boost.lexical_cast", + "@boost.optional", + "@boost.polygon", + "@boost.type_traits", + "@boost.units", + "@boost.variant", + "@eigen", + ], +) + +cc_library( + name = "lanelet2_io", + srcs = glob(["lanelet2_io/src/**/*.cpp"]), + hdrs = glob(["lanelet2_io/include/**/*.h"]), + includes = ["lanelet2_io/include"], + visibility = ["//visibility:public"], + deps = [ + ":lanelet2_core", + "@boost.filesystem", + "@boost.format", + "@boost.geometry", + "@boost.serialization", + "@pugixml", + ], +) + +filegroup( + name = "lanelet2_maps_osm_files", + srcs = glob(["lanelet2_maps/res/*.osm"]), +) + +cc_library( + name = "lanelet2_matching", + srcs = glob(["lanelet2_matching/src/**/*.cpp"]), + hdrs = glob(["lanelet2_matching/include/**/*.h"]), + includes = [ + "lanelet2_matching/include", + # This has to be exposed as a public include because the headers include other headers using + # the local path. + "lanelet2_matching/include/lanelet2_matching", + ], + visibility = ["//visibility:public"], + deps = [ + ":lanelet2_core", + ":lanelet2_traffic_rules", + "@eigen", + ], +) + +cc_library( + name = "lanelet2_projection", + srcs = glob(["lanelet2_projection/src/**/*.cpp"]), + hdrs = glob(["lanelet2_projection/include/**/*.h"]), + includes = ["lanelet2_projection/include"], + visibility = ["//visibility:public"], + deps = [ + ":lanelet2_core", + ":lanelet2_io", + "@geographiclib", + ], +) + +cc_library( + name = "lanelet2_routing", + srcs = glob(["lanelet2_routing/src/**/*.cpp"]), + hdrs = glob(["lanelet2_routing/include/**/*.h"]), + includes = ["lanelet2_routing/include"], + visibility = ["//visibility:public"], + deps = [ + ":lanelet2_core", + ":lanelet2_traffic_rules", + "@boost.geometry", + "@boost.graph", + "@boost.property_map", + ], +) + +cc_library( + name = "lanelet2_traffic_rules", + srcs = glob(["lanelet2_traffic_rules/src/**/*.cpp"]), + hdrs = glob(["lanelet2_traffic_rules/include/**/*.h"]), + includes = ["lanelet2_traffic_rules/include"], + visibility = ["//visibility:public"], + deps = [":lanelet2_core"], +) + +cc_library( + name = "lanelet2_validation", + srcs = glob(["lanelet2_validation/src/**/*.cpp"]), + hdrs = glob(["lanelet2_validation/include/**/*.h"]), + includes = ["lanelet2_validation/include"], + visibility = ["//visibility:public"], + deps = [ + ":lanelet2_core", + ":lanelet2_io", + ":lanelet2_projection", + ":lanelet2_routing", + ":lanelet2_traffic_rules", + "@boost.program_options", + ], +) + +################################################################################# +# Tests +################################################################################# +cc_test( + name = "lanelet2_core_test", + size = "small", + srcs = glob([ + "lanelet2_core/test/*.cpp", + "lanelet2_core/test/*.h", + ]), + copts = ["-Wno-sign-compare"], + deps = [ + ":lanelet2_core", + "@boost.geometry", + "@boost.optional", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "lanelet2_io_test", + size = "small", + srcs = glob([ + "lanelet2_io/test/*.cpp", + "lanelet2_io/test/*.h", + ]), + data = [":lanelet2_maps_osm_files"], + deps = [ + ":lanelet2_core", + ":lanelet2_io", + "@boost.filesystem", + "@boost.serialization", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "lanelet2_matching_test", + size = "small", + srcs = glob(["lanelet2_matching/test/*.cpp"]), + deps = [ + ":lanelet2_io", + ":lanelet2_matching", + ":lanelet2_projection", + ":lanelet2_traffic_rules", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "lanelet2_projection_test", + size = "small", + srcs = glob(["lanelet2_projection/test/*.cpp"]), + deps = [ + ":lanelet2_projection", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "lanelet2_routing_test", + size = "small", + srcs = glob([ + "lanelet2_routing/test/*.cpp", + "lanelet2_routing/test/*.h", + ]), + deps = [ + ":lanelet2_core", + ":lanelet2_routing", + ":lanelet2_traffic_rules", + "@boost.filesystem", + "@boost.geometry", + "@boost.optional", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "lanelet2_traffic_rules_test", + size = "small", + srcs = glob(["lanelet2_traffic_rules/test/*.cpp"]), + deps = [ + ":lanelet2_core", + ":lanelet2_traffic_rules", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "lanelet2_validation_test", + size = "small", + srcs = glob(["lanelet2_validation/test/*.cpp"]), + data = [":lanelet2_maps_osm_files"], + deps = [ + ":lanelet2_core", + ":lanelet2_io", + ":lanelet2_projection", + ":lanelet2_validation", + "@com_google_googletest//:gtest_main", + ], +) diff --git a/modules/lanelet2/1.2.1/overlay/MODULE.bazel b/modules/lanelet2/1.2.1/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/lanelet2/1.2.1/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/lanelet2/1.2.1/patches/bazel_test_paths.patch b/modules/lanelet2/1.2.1/patches/bazel_test_paths.patch new file mode 100644 index 00000000000..5008b73093e --- /dev/null +++ b/modules/lanelet2/1.2.1/patches/bazel_test_paths.patch @@ -0,0 +1,48 @@ +diff --git a/lanelet2_io/test/TestBinHandler.cpp b/lanelet2_io/test/TestBinHandler.cpp +index c9868ab..a2c1b75 100644 +--- a/lanelet2_io/test/TestBinHandler.cpp ++++ b/lanelet2_io/test/TestBinHandler.cpp +@@ -115,7 +115,7 @@ TEST(BinHandler, explicitIO) { // NOLINT + + TEST(BinHandler, fullMap) { + Origin origin({49, 8.4, 0}); +- std::string filenameIn = "../../lanelet2_maps/res/mapping_example.osm"; ++ std::string filenameIn = "../lanelet2~/lanelet2_maps/res/mapping_example.osm"; + auto map = lanelet::load(filenameIn, origin); + auto llt = map->laneletLayer.find(44968); + writeAndLoad(*llt); +diff --git a/lanelet2_io/test/TestSimpleUsage.cpp b/lanelet2_io/test/TestSimpleUsage.cpp +index 792f69d..a21fa86 100644 +--- a/lanelet2_io/test/TestSimpleUsage.cpp ++++ b/lanelet2_io/test/TestSimpleUsage.cpp +@@ -5,7 +5,7 @@ + TEST(lanelet2_io, exampleUsage) { // NOLINT + using namespace lanelet; + Origin origin({49, 8.4, 0}); +- std::string filenameIn = "../../lanelet2_maps/res/mapping_example.osm"; ++ std::string filenameIn = "../lanelet2~/lanelet2_maps/res/mapping_example.osm"; + LaneletMapPtr laneletMap = lanelet::load(filenameIn, origin); + + lanelet::test_setup::Tempfile file("file.osm"); +diff --git a/lanelet2_validation/test/lanelet2_validation.cpp b/lanelet2_validation/test/lanelet2_validation.cpp +index 3e30df4..47d4c83 100644 +--- a/lanelet2_validation/test/lanelet2_validation.cpp ++++ b/lanelet2_validation/test/lanelet2_validation.cpp +@@ -9,7 +9,7 @@ + #include "lanelet2_validation/Validation.h" + + TEST(TestAllValidators, onExampleMap) { // NOLINT +- const char* args[] = {"validator", "../../lanelet2_maps/res/mapping_example.osm", ++ const char* args[] = {"validator", "../lanelet2~/lanelet2_maps/res/mapping_example.osm", + "--participants", "vehicle", + "--participants", "pedestrian", + "--lat", "49", +@@ -32,7 +32,7 @@ TEST(Validator, pointsTooClose) { // NOLINT + } + + TEST(Validator, curvatureTooBig) { // NOLINT +- std::string exampleMapPath = "../../lanelet2_maps/res/mapping_example.osm"; ++ std::string exampleMapPath = "../lanelet2~/lanelet2_maps/res/mapping_example.osm"; + using namespace lanelet; + projection::UtmProjector projector(Origin({49, 8.4})); + LaneletMapPtr map = load(exampleMapPath, projector); diff --git a/modules/lanelet2/1.2.1/patches/fix_test_include_paths.patch b/modules/lanelet2/1.2.1/patches/fix_test_include_paths.patch new file mode 100644 index 00000000000..dacbe168446 --- /dev/null +++ b/modules/lanelet2/1.2.1/patches/fix_test_include_paths.patch @@ -0,0 +1,26 @@ +diff --git a/lanelet2_core/test/test_linestring.cpp b/lanelet2_core/test/test_linestring.cpp +index b8242ee..e002787 100644 +--- a/lanelet2_core/test/test_linestring.cpp ++++ b/lanelet2_core/test/test_linestring.cpp +@@ -5,7 +5,7 @@ + + #include "lanelet2_core/geometry/LineString.h" + #include "lanelet2_core/primitives/LineString.h" +-#include "primitives/Traits.h" ++#include "lanelet2_core/primitives/Traits.h" + using namespace lanelet; + + class LineStringPoints : public ::testing::Test { +diff --git a/lanelet2_matching/test/lanelet2_matching.cpp b/lanelet2_matching/test/lanelet2_matching.cpp +index c47194e..5b84b54 100644 +--- a/lanelet2_matching/test/lanelet2_matching.cpp ++++ b/lanelet2_matching/test/lanelet2_matching.cpp +@@ -33,7 +33,7 @@ + #include + #include + +-#include "LaneletMatching.h" ++#include "lanelet2_matching/LaneletMatching.h" + #include "gtest/gtest.h" + + using namespace lanelet; diff --git a/modules/lanelet2/1.2.1/source.json b/modules/lanelet2/1.2.1/source.json new file mode 100644 index 00000000000..0193ba48f5a --- /dev/null +++ b/modules/lanelet2/1.2.1/source.json @@ -0,0 +1,14 @@ +{ + "url": "https://github.com/fzi-forschungszentrum-informatik/Lanelet2/archive/refs/tags/1.2.1.tar.gz", + "integrity": "sha256-7fjbxyE5hUBZ8jddMj5bBwSLeGdlj/9fMSlGnVDYJes=", + "strip_prefix": "Lanelet2-1.2.1", + "patches": { + "bazel_test_paths.patch": "sha256-8snNURNG2CCMOzecFPYHtdEAq5cGRwslAAYe9lShJCo=", + "fix_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" + }, + "overlay": { + "BUILD.bazel": "sha256-ILVS6eeAAv/vUWj6So2Iy85YUi/80d3eBpgSqA1SPU0=", + "MODULE.bazel": "sha256-lj6BzIv7yZmtEd+TQBI82tSzxaoIT/JzvfOjZYAn6Yo=" + }, + "patch_strip": 1 +} diff --git a/modules/lanelet2/metadata.json b/modules/lanelet2/metadata.json new file mode 100644 index 00000000000..c5ef712b612 --- /dev/null +++ b/modules/lanelet2/metadata.json @@ -0,0 +1,17 @@ +{ + "homepage": "https://github.com/fzi-forschungszentrum-informatik/Lanelet2", + "maintainers": [ + { + "email": "kgreenek@gmail.com", + "github": "kgreenek", + "name": "Kevin Greene" + } + ], + "repository": [ + "github:fzi-forschungszentrum-informatik/Lanelet2" + ], + "versions": [ + "1.2.1", + ], + "yanked_versions": {} +} From bf371764fb14fbfa72a9b7527a5c493eccf5312c Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Thu, 26 Dec 2024 09:04:17 -0800 Subject: [PATCH 02/20] Add presubmit.yml --- modules/lanelet2/1.2.1/presubmit.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/lanelet2/1.2.1/presubmit.yml diff --git a/modules/lanelet2/1.2.1/presubmit.yml b/modules/lanelet2/1.2.1/presubmit.yml new file mode 100644 index 00000000000..9e84d7def8c --- /dev/null +++ b/modules/lanelet2/1.2.1/presubmit.yml @@ -0,0 +1,19 @@ +matrix: + platform: + - debian10 + - debian11 + - macos + - macos_arm64 + - ubuntu2004 + - ubuntu2204 + - ubuntu2404 + - windows + bazel: [7.x, 8.x, rolling] +tasks: + verify_targets: + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - '@lanelet2' + test_targets: + - '@lanelet2//...' From 6f37fee9cb00ea43db1bdc2480cf072e52390ab1 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Thu, 26 Dec 2024 09:13:37 -0800 Subject: [PATCH 03/20] Fix build_targets --- modules/lanelet2/1.2.1/presubmit.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/lanelet2/1.2.1/presubmit.yml b/modules/lanelet2/1.2.1/presubmit.yml index 9e84d7def8c..7acb1d621be 100644 --- a/modules/lanelet2/1.2.1/presubmit.yml +++ b/modules/lanelet2/1.2.1/presubmit.yml @@ -8,12 +8,21 @@ matrix: - ubuntu2204 - ubuntu2404 - windows - bazel: [7.x, 8.x, rolling] + bazel: + - 7.x + - 8.x + - rolling tasks: verify_targets: platform: ${{ platform }} bazel: ${{ bazel }} build_targets: - - '@lanelet2' + - '@lanelet2//:lanelet2_core' + - '@lanelet2//:lanelet2_io' + - '@lanelet2//:lanelet2_matching' + - '@lanelet2//:lanelet2_projection' + - '@lanelet2//:lanelet2_routing' + - '@lanelet2//:lanelet2_traffic_rules' + - '@lanelet2//:lanelet2_validation' test_targets: - '@lanelet2//...' From f8265a02ed1a264b2a14d3828f60012903118544 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Thu, 26 Dec 2024 09:17:26 -0800 Subject: [PATCH 04/20] Fix metadata json trailing comma --- modules/lanelet2/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lanelet2/metadata.json b/modules/lanelet2/metadata.json index c5ef712b612..af12d119feb 100644 --- a/modules/lanelet2/metadata.json +++ b/modules/lanelet2/metadata.json @@ -11,7 +11,7 @@ "github:fzi-forschungszentrum-informatik/Lanelet2" ], "versions": [ - "1.2.1", + "1.2.1" ], "yanked_versions": {} } From f0b7eb8bfa58543b801d85e0ef67f33b7344e5e5 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Thu, 26 Dec 2024 09:19:47 -0800 Subject: [PATCH 05/20] Fix MODULE.bazel hash --- modules/lanelet2/1.2.1/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lanelet2/1.2.1/source.json b/modules/lanelet2/1.2.1/source.json index 0193ba48f5a..0b9e90c0e19 100644 --- a/modules/lanelet2/1.2.1/source.json +++ b/modules/lanelet2/1.2.1/source.json @@ -8,7 +8,7 @@ }, "overlay": { "BUILD.bazel": "sha256-ILVS6eeAAv/vUWj6So2Iy85YUi/80d3eBpgSqA1SPU0=", - "MODULE.bazel": "sha256-lj6BzIv7yZmtEd+TQBI82tSzxaoIT/JzvfOjZYAn6Yo=" + "MODULE.bazel": "sha256-I//fv4pg5F5VMWjdafxsokVgSnj4YGXBsGQJoV1Pumk=" }, "patch_strip": 1 } From 45003737ebb98d1208a48e7ab433b3d9bea65cd3 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Thu, 26 Dec 2024 09:24:26 -0800 Subject: [PATCH 06/20] Actually fix MODULE.bazel --- modules/lanelet2/1.2.1/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lanelet2/1.2.1/source.json b/modules/lanelet2/1.2.1/source.json index 0b9e90c0e19..ddec16660cb 100644 --- a/modules/lanelet2/1.2.1/source.json +++ b/modules/lanelet2/1.2.1/source.json @@ -8,7 +8,7 @@ }, "overlay": { "BUILD.bazel": "sha256-ILVS6eeAAv/vUWj6So2Iy85YUi/80d3eBpgSqA1SPU0=", - "MODULE.bazel": "sha256-I//fv4pg5F5VMWjdafxsokVgSnj4YGXBsGQJoV1Pumk=" + "MODULE.bazel": "sha256-QboL8r6ln2z0tWrYXxiIYETKSn/iR4l1CB7ctaSiK8Y=" }, "patch_strip": 1 } From 54eda8547b4c2acdbf7e09d025cdf6935fbc8441 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Fri, 27 Dec 2024 06:35:03 -0800 Subject: [PATCH 07/20] Add c++20 compiler flags --- modules/lanelet2/1.2.1/presubmit.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/lanelet2/1.2.1/presubmit.yml b/modules/lanelet2/1.2.1/presubmit.yml index 7acb1d621be..4e5cc87c62d 100644 --- a/modules/lanelet2/1.2.1/presubmit.yml +++ b/modules/lanelet2/1.2.1/presubmit.yml @@ -16,6 +16,9 @@ tasks: verify_targets: platform: ${{ platform }} bazel: ${{ bazel }} + build_flags: + - '--cxxopt=-std=c++20' + - '--host_cxxopt=-std=c++20' build_targets: - '@lanelet2//:lanelet2_core' - '@lanelet2//:lanelet2_io' From a30769db41f8f82bd7dfa5fa59738a9704af88fc Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Fri, 27 Dec 2024 06:36:57 -0800 Subject: [PATCH 08/20] Use c++17 instead of c++20 --- modules/lanelet2/1.2.1/presubmit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/lanelet2/1.2.1/presubmit.yml b/modules/lanelet2/1.2.1/presubmit.yml index 4e5cc87c62d..1f94ac87034 100644 --- a/modules/lanelet2/1.2.1/presubmit.yml +++ b/modules/lanelet2/1.2.1/presubmit.yml @@ -17,8 +17,8 @@ tasks: platform: ${{ platform }} bazel: ${{ bazel }} build_flags: - - '--cxxopt=-std=c++20' - - '--host_cxxopt=-std=c++20' + - '--cxxopt=-std=c++17' + - '--host_cxxopt=-std=c++17' build_targets: - '@lanelet2//:lanelet2_core' - '@lanelet2//:lanelet2_io' From 3046579493c670eb72cf907e61963de805ac6e64 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 06:12:38 -0800 Subject: [PATCH 09/20] Update deps versions --- modules/lanelet2/1.2.1/MODULE.bazel | 4 ++-- modules/lanelet2/1.2.1/source.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/lanelet2/1.2.1/MODULE.bazel b/modules/lanelet2/1.2.1/MODULE.bazel index c9b7fdf45e6..329a69b169c 100644 --- a/modules/lanelet2/1.2.1/MODULE.bazel +++ b/modules/lanelet2/1.2.1/MODULE.bazel @@ -22,8 +22,8 @@ bazel_dep(name = "boost.type_traits", version = BOOST_VERSION + ".bcr.1") bazel_dep(name = "boost.units", version = BOOST_VERSION) bazel_dep(name = "boost.variant", version = BOOST_VERSION + ".bcr.1") bazel_dep(name = "eigen", version = "3.4.0.bcr.1") -bazel_dep(name = "geographiclib", version = "2.4.0") +bazel_dep(name = "geographiclib", version = "2.4.0.bcr.1") bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest") bazel_dep(name = "pugixml", version = "1.14.bcr.1") -bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "rules_cc", version = "0.1.0") bazel_dep(name = "rules_license", version = "1.0.0") diff --git a/modules/lanelet2/1.2.1/source.json b/modules/lanelet2/1.2.1/source.json index ddec16660cb..cf6586d4416 100644 --- a/modules/lanelet2/1.2.1/source.json +++ b/modules/lanelet2/1.2.1/source.json @@ -8,7 +8,7 @@ }, "overlay": { "BUILD.bazel": "sha256-ILVS6eeAAv/vUWj6So2Iy85YUi/80d3eBpgSqA1SPU0=", - "MODULE.bazel": "sha256-QboL8r6ln2z0tWrYXxiIYETKSn/iR4l1CB7ctaSiK8Y=" + "MODULE.bazel": "sha256-Z9RaDOa/2W2NU+4mIlQtL5MduCMtVhcpzMbIIROpHJU=" }, "patch_strip": 1 } From 9ba0516e7fd3082e7f353178da88be807f40b09a Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 10:00:35 -0800 Subject: [PATCH 10/20] Fix rlocation paths in tests --- modules/lanelet2/1.2.1/overlay/BUILD.bazel | 2 + .../1.2.1/patches/bazel_test_data_paths.patch | 135 ++++++++++++++++++ ...s.patch => bazel_test_include_paths.patch} | 0 .../1.2.1/patches/bazel_test_paths.patch | 48 ------- modules/lanelet2/1.2.1/source.json | 6 +- 5 files changed, 140 insertions(+), 51 deletions(-) create mode 100644 modules/lanelet2/1.2.1/patches/bazel_test_data_paths.patch rename modules/lanelet2/1.2.1/patches/{fix_test_include_paths.patch => bazel_test_include_paths.patch} (100%) delete mode 100644 modules/lanelet2/1.2.1/patches/bazel_test_paths.patch diff --git a/modules/lanelet2/1.2.1/overlay/BUILD.bazel b/modules/lanelet2/1.2.1/overlay/BUILD.bazel index b79f87efe3c..479d3a14295 100644 --- a/modules/lanelet2/1.2.1/overlay/BUILD.bazel +++ b/modules/lanelet2/1.2.1/overlay/BUILD.bazel @@ -159,6 +159,7 @@ cc_test( deps = [ ":lanelet2_core", ":lanelet2_io", + "@bazel_tools//tools/cpp/runfiles", "@boost.filesystem", "@boost.serialization", "@com_google_googletest//:gtest_main", @@ -227,6 +228,7 @@ cc_test( ":lanelet2_io", ":lanelet2_projection", ":lanelet2_validation", + "@bazel_tools//tools/cpp/runfiles", "@com_google_googletest//:gtest_main", ], ) diff --git a/modules/lanelet2/1.2.1/patches/bazel_test_data_paths.patch b/modules/lanelet2/1.2.1/patches/bazel_test_data_paths.patch new file mode 100644 index 00000000000..e80276ac824 --- /dev/null +++ b/modules/lanelet2/1.2.1/patches/bazel_test_data_paths.patch @@ -0,0 +1,135 @@ +diff --git a/lanelet2_io/test/TestBinHandler.cpp b/lanelet2_io/test/TestBinHandler.cpp +index c9868ab..2d13a34 100644 +--- a/lanelet2_io/test/TestBinHandler.cpp ++++ b/lanelet2_io/test/TestBinHandler.cpp +@@ -2,11 +2,15 @@ + #include + #include + #include ++#include + + #include "TestSetup.h" + #include "gtest/gtest.h" + #include "lanelet2_io/Io.h" + #include "lanelet2_io/io_handlers/Serialize.h" ++#include "tools/cpp/runfiles/runfiles.h" ++ ++using bazel::tools::cpp::runfiles::Runfiles; + + using namespace lanelet; + +@@ -114,8 +118,9 @@ TEST(BinHandler, explicitIO) { // NOLINT + } + + TEST(BinHandler, fullMap) { ++ std::unique_ptr runfiles = test_setup::CreateRunfilesOrDie(); + Origin origin({49, 8.4, 0}); +- std::string filenameIn = "../../lanelet2_maps/res/mapping_example.osm"; ++ std::string filenameIn = runfiles->Rlocation("lanelet2/lanelet2_maps/res/mapping_example.osm"); + auto map = lanelet::load(filenameIn, origin); + auto llt = map->laneletLayer.find(44968); + writeAndLoad(*llt); +diff --git a/lanelet2_io/test/TestSetup.h b/lanelet2_io/test/TestSetup.h +index 67652af..ad02019 100644 +--- a/lanelet2_io/test/TestSetup.h ++++ b/lanelet2_io/test/TestSetup.h +@@ -6,6 +6,9 @@ + #include + #include + ++#include "gtest/gtest.h" ++#include "tools/cpp/runfiles/runfiles.h" ++ + namespace fs = boost::filesystem; + + namespace lanelet { +@@ -52,8 +55,8 @@ inline bool operator==(const PrimitiveLayer& rhs, const PrimitiveLayer& lh + } + + template <> +-inline bool operator==(const PrimitiveLayer& rhs, +- const PrimitiveLayer& lhs) { ++inline bool operator== (const PrimitiveLayer& rhs, ++ const PrimitiveLayer& lhs) { + return rhs.size() == lhs.size() && std::all_of(rhs.begin(), rhs.end(), [&lhs](auto& v1) { + return *v1->constData() == *(*lhs.find(v1->id()))->constData(); + }); +@@ -121,6 +124,17 @@ inline Area setUpArea(int& num, const std::string& type = AttributeValueString:: + AttributeMap{{AttributeNamesString::Subtype, type}}, {regelem}); + } + ++using bazel::tools::cpp::runfiles::Runfiles; ++ ++inline std::unique_ptr CreateRunfilesOrDie() { ++ std::string error; ++ std::unique_ptr runfiles{Runfiles::Create("TestBinHandler", BAZEL_CURRENT_REPOSITORY, &error)}; ++ if (runfiles == nullptr) { ++ throw std::runtime_error{"Error creating runfiles: " + error}; ++ } ++ return runfiles; ++} ++ + class Tempfile { + public: + explicit Tempfile(std::string name) { +diff --git a/lanelet2_io/test/TestSimpleUsage.cpp b/lanelet2_io/test/TestSimpleUsage.cpp +index 792f69d..54713da 100644 +--- a/lanelet2_io/test/TestSimpleUsage.cpp ++++ b/lanelet2_io/test/TestSimpleUsage.cpp +@@ -1,11 +1,15 @@ + #include "TestSetup.h" + #include "gtest/gtest.h" + #include "lanelet2_io/Io.h" ++#include "tools/cpp/runfiles/runfiles.h" ++ ++using bazel::tools::cpp::runfiles::Runfiles; + + TEST(lanelet2_io, exampleUsage) { // NOLINT + using namespace lanelet; ++ std::unique_ptr runfiles = lanelet::test_setup::CreateRunfilesOrDie(); + Origin origin({49, 8.4, 0}); +- std::string filenameIn = "../../lanelet2_maps/res/mapping_example.osm"; ++ std::string filenameIn = runfiles->Rlocation("lanelet2/lanelet2_maps/res/mapping_example.osm"); + LaneletMapPtr laneletMap = lanelet::load(filenameIn, origin); + + lanelet::test_setup::Tempfile file("file.osm"); +diff --git a/lanelet2_validation/test/lanelet2_validation.cpp b/lanelet2_validation/test/lanelet2_validation.cpp +index 3e30df4..6f66cd4 100644 +--- a/lanelet2_validation/test/lanelet2_validation.cpp ++++ b/lanelet2_validation/test/lanelet2_validation.cpp +@@ -7,9 +7,23 @@ + + #include "lanelet2_validation/Cli.h" + #include "lanelet2_validation/Validation.h" ++#include "tools/cpp/runfiles/runfiles.h" ++ ++using bazel::tools::cpp::runfiles::Runfiles; ++ ++std::unique_ptr CreateRunfilesOrDie() { ++ std::string error; ++ std::unique_ptr runfiles{Runfiles::Create("TestBinHandler", BAZEL_CURRENT_REPOSITORY, &error)}; ++ if (runfiles == nullptr) { ++ throw std::runtime_error{"Error creating runfiles: " + error}; ++ } ++ return runfiles; ++} + + TEST(TestAllValidators, onExampleMap) { // NOLINT +- const char* args[] = {"validator", "../../lanelet2_maps/res/mapping_example.osm", ++ std::unique_ptr runfiles = CreateRunfilesOrDie(); ++ const std::string osm_file = runfiles->Rlocation("lanelet2/lanelet2_maps/res/mapping_example.osm"); ++ const char* args[] = {"validator", osm_file.c_str(), + "--participants", "vehicle", + "--participants", "pedestrian", + "--lat", "49", +@@ -32,8 +46,9 @@ TEST(Validator, pointsTooClose) { // NOLINT + } + + TEST(Validator, curvatureTooBig) { // NOLINT +- std::string exampleMapPath = "../../lanelet2_maps/res/mapping_example.osm"; + using namespace lanelet; ++ std::unique_ptr runfiles = CreateRunfilesOrDie(); ++ std::string exampleMapPath = runfiles->Rlocation("lanelet2/lanelet2_maps/res/mapping_example.osm"); + projection::UtmProjector projector(Origin({49, 8.4})); + LaneletMapPtr map = load(exampleMapPath, projector); + lanelet::validation::ValidationConfig config; diff --git a/modules/lanelet2/1.2.1/patches/fix_test_include_paths.patch b/modules/lanelet2/1.2.1/patches/bazel_test_include_paths.patch similarity index 100% rename from modules/lanelet2/1.2.1/patches/fix_test_include_paths.patch rename to modules/lanelet2/1.2.1/patches/bazel_test_include_paths.patch diff --git a/modules/lanelet2/1.2.1/patches/bazel_test_paths.patch b/modules/lanelet2/1.2.1/patches/bazel_test_paths.patch deleted file mode 100644 index 5008b73093e..00000000000 --- a/modules/lanelet2/1.2.1/patches/bazel_test_paths.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/lanelet2_io/test/TestBinHandler.cpp b/lanelet2_io/test/TestBinHandler.cpp -index c9868ab..a2c1b75 100644 ---- a/lanelet2_io/test/TestBinHandler.cpp -+++ b/lanelet2_io/test/TestBinHandler.cpp -@@ -115,7 +115,7 @@ TEST(BinHandler, explicitIO) { // NOLINT - - TEST(BinHandler, fullMap) { - Origin origin({49, 8.4, 0}); -- std::string filenameIn = "../../lanelet2_maps/res/mapping_example.osm"; -+ std::string filenameIn = "../lanelet2~/lanelet2_maps/res/mapping_example.osm"; - auto map = lanelet::load(filenameIn, origin); - auto llt = map->laneletLayer.find(44968); - writeAndLoad(*llt); -diff --git a/lanelet2_io/test/TestSimpleUsage.cpp b/lanelet2_io/test/TestSimpleUsage.cpp -index 792f69d..a21fa86 100644 ---- a/lanelet2_io/test/TestSimpleUsage.cpp -+++ b/lanelet2_io/test/TestSimpleUsage.cpp -@@ -5,7 +5,7 @@ - TEST(lanelet2_io, exampleUsage) { // NOLINT - using namespace lanelet; - Origin origin({49, 8.4, 0}); -- std::string filenameIn = "../../lanelet2_maps/res/mapping_example.osm"; -+ std::string filenameIn = "../lanelet2~/lanelet2_maps/res/mapping_example.osm"; - LaneletMapPtr laneletMap = lanelet::load(filenameIn, origin); - - lanelet::test_setup::Tempfile file("file.osm"); -diff --git a/lanelet2_validation/test/lanelet2_validation.cpp b/lanelet2_validation/test/lanelet2_validation.cpp -index 3e30df4..47d4c83 100644 ---- a/lanelet2_validation/test/lanelet2_validation.cpp -+++ b/lanelet2_validation/test/lanelet2_validation.cpp -@@ -9,7 +9,7 @@ - #include "lanelet2_validation/Validation.h" - - TEST(TestAllValidators, onExampleMap) { // NOLINT -- const char* args[] = {"validator", "../../lanelet2_maps/res/mapping_example.osm", -+ const char* args[] = {"validator", "../lanelet2~/lanelet2_maps/res/mapping_example.osm", - "--participants", "vehicle", - "--participants", "pedestrian", - "--lat", "49", -@@ -32,7 +32,7 @@ TEST(Validator, pointsTooClose) { // NOLINT - } - - TEST(Validator, curvatureTooBig) { // NOLINT -- std::string exampleMapPath = "../../lanelet2_maps/res/mapping_example.osm"; -+ std::string exampleMapPath = "../lanelet2~/lanelet2_maps/res/mapping_example.osm"; - using namespace lanelet; - projection::UtmProjector projector(Origin({49, 8.4})); - LaneletMapPtr map = load(exampleMapPath, projector); diff --git a/modules/lanelet2/1.2.1/source.json b/modules/lanelet2/1.2.1/source.json index cf6586d4416..25f58052384 100644 --- a/modules/lanelet2/1.2.1/source.json +++ b/modules/lanelet2/1.2.1/source.json @@ -3,11 +3,11 @@ "integrity": "sha256-7fjbxyE5hUBZ8jddMj5bBwSLeGdlj/9fMSlGnVDYJes=", "strip_prefix": "Lanelet2-1.2.1", "patches": { - "bazel_test_paths.patch": "sha256-8snNURNG2CCMOzecFPYHtdEAq5cGRwslAAYe9lShJCo=", - "fix_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" + "bazel_test_data_paths.patch": "sha256-lRfoCSWA3FfEMYD8MWWOln4Hs6hep0h/l7lMrExFlzQ=", + "bazel_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" }, "overlay": { - "BUILD.bazel": "sha256-ILVS6eeAAv/vUWj6So2Iy85YUi/80d3eBpgSqA1SPU0=", + "BUILD.bazel": "sha256-62QrcwPf4aRfmfb0ctGfP//6OMuoTugsHCDb77Da8Sg=", "MODULE.bazel": "sha256-Z9RaDOa/2W2NU+4mIlQtL5MduCMtVhcpzMbIIROpHJU=" }, "patch_strip": 1 From f09367ca8aaa19d896980e4dc603bb0d1049634c Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 10:06:00 -0800 Subject: [PATCH 11/20] Fix BUILD.bazel hash --- modules/lanelet2/1.2.1/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lanelet2/1.2.1/source.json b/modules/lanelet2/1.2.1/source.json index 25f58052384..700643fd400 100644 --- a/modules/lanelet2/1.2.1/source.json +++ b/modules/lanelet2/1.2.1/source.json @@ -7,7 +7,7 @@ "bazel_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" }, "overlay": { - "BUILD.bazel": "sha256-62QrcwPf4aRfmfb0ctGfP//6OMuoTugsHCDb77Da8Sg=", + "BUILD.bazel": "sha256-e4afW8f/YrF4e1xbfHq41uInTyrWvXTVQB4J+H/3y3U=", "MODULE.bazel": "sha256-Z9RaDOa/2W2NU+4mIlQtL5MduCMtVhcpzMbIIROpHJU=" }, "patch_strip": 1 From b27de542a2fdce8c7948e7fca5bca6611fe76cb4 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 10:18:26 -0800 Subject: [PATCH 12/20] Bump lanelet2 version to 1.2.2 for bugfix --- modules/lanelet2/{1.2.1 => 1.2.2}/MODULE.bazel | 2 +- modules/lanelet2/{1.2.1 => 1.2.2}/overlay/BUILD.bazel | 0 modules/lanelet2/{1.2.1 => 1.2.2}/overlay/MODULE.bazel | 0 .../{1.2.1 => 1.2.2}/patches/bazel_test_data_paths.patch | 0 .../patches/bazel_test_include_paths.patch | 0 modules/lanelet2/{1.2.1 => 1.2.2}/presubmit.yml | 0 modules/lanelet2/{1.2.1 => 1.2.2}/source.json | 8 ++++---- modules/lanelet2/metadata.json | 2 +- 8 files changed, 6 insertions(+), 6 deletions(-) rename modules/lanelet2/{1.2.1 => 1.2.2}/MODULE.bazel (98%) rename modules/lanelet2/{1.2.1 => 1.2.2}/overlay/BUILD.bazel (100%) rename modules/lanelet2/{1.2.1 => 1.2.2}/overlay/MODULE.bazel (100%) rename modules/lanelet2/{1.2.1 => 1.2.2}/patches/bazel_test_data_paths.patch (100%) rename modules/lanelet2/{1.2.1 => 1.2.2}/patches/bazel_test_include_paths.patch (100%) rename modules/lanelet2/{1.2.1 => 1.2.2}/presubmit.yml (100%) rename modules/lanelet2/{1.2.1 => 1.2.2}/source.json (63%) diff --git a/modules/lanelet2/1.2.1/MODULE.bazel b/modules/lanelet2/1.2.2/MODULE.bazel similarity index 98% rename from modules/lanelet2/1.2.1/MODULE.bazel rename to modules/lanelet2/1.2.2/MODULE.bazel index 329a69b169c..bc92d46dc1c 100644 --- a/modules/lanelet2/1.2.1/MODULE.bazel +++ b/modules/lanelet2/1.2.2/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "lanelet2", - version = "1.2.1", + version = "1.2.2", ) BOOST_VERSION = "1.83.0" diff --git a/modules/lanelet2/1.2.1/overlay/BUILD.bazel b/modules/lanelet2/1.2.2/overlay/BUILD.bazel similarity index 100% rename from modules/lanelet2/1.2.1/overlay/BUILD.bazel rename to modules/lanelet2/1.2.2/overlay/BUILD.bazel diff --git a/modules/lanelet2/1.2.1/overlay/MODULE.bazel b/modules/lanelet2/1.2.2/overlay/MODULE.bazel similarity index 100% rename from modules/lanelet2/1.2.1/overlay/MODULE.bazel rename to modules/lanelet2/1.2.2/overlay/MODULE.bazel diff --git a/modules/lanelet2/1.2.1/patches/bazel_test_data_paths.patch b/modules/lanelet2/1.2.2/patches/bazel_test_data_paths.patch similarity index 100% rename from modules/lanelet2/1.2.1/patches/bazel_test_data_paths.patch rename to modules/lanelet2/1.2.2/patches/bazel_test_data_paths.patch diff --git a/modules/lanelet2/1.2.1/patches/bazel_test_include_paths.patch b/modules/lanelet2/1.2.2/patches/bazel_test_include_paths.patch similarity index 100% rename from modules/lanelet2/1.2.1/patches/bazel_test_include_paths.patch rename to modules/lanelet2/1.2.2/patches/bazel_test_include_paths.patch diff --git a/modules/lanelet2/1.2.1/presubmit.yml b/modules/lanelet2/1.2.2/presubmit.yml similarity index 100% rename from modules/lanelet2/1.2.1/presubmit.yml rename to modules/lanelet2/1.2.2/presubmit.yml diff --git a/modules/lanelet2/1.2.1/source.json b/modules/lanelet2/1.2.2/source.json similarity index 63% rename from modules/lanelet2/1.2.1/source.json rename to modules/lanelet2/1.2.2/source.json index 700643fd400..962f767108d 100644 --- a/modules/lanelet2/1.2.1/source.json +++ b/modules/lanelet2/1.2.2/source.json @@ -1,14 +1,14 @@ { - "url": "https://github.com/fzi-forschungszentrum-informatik/Lanelet2/archive/refs/tags/1.2.1.tar.gz", - "integrity": "sha256-7fjbxyE5hUBZ8jddMj5bBwSLeGdlj/9fMSlGnVDYJes=", - "strip_prefix": "Lanelet2-1.2.1", + "url": "https://github.com/fzi-forschungszentrum-informatik/Lanelet2/archive/refs/tags/1.2.2.tar.gz", + "integrity": "sha256-jSM48W6PEydBJTwrKYxKJbu6Gpqi+/zpPqr11aj+U5Y=", + "strip_prefix": "Lanelet2-1.2.2", "patches": { "bazel_test_data_paths.patch": "sha256-lRfoCSWA3FfEMYD8MWWOln4Hs6hep0h/l7lMrExFlzQ=", "bazel_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" }, "overlay": { "BUILD.bazel": "sha256-e4afW8f/YrF4e1xbfHq41uInTyrWvXTVQB4J+H/3y3U=", - "MODULE.bazel": "sha256-Z9RaDOa/2W2NU+4mIlQtL5MduCMtVhcpzMbIIROpHJU=" + "MODULE.bazel": "sha256-wygLikJrkYvZi6muWOYyYH9v3RqW3viszRPZkLIbTnw=" }, "patch_strip": 1 } diff --git a/modules/lanelet2/metadata.json b/modules/lanelet2/metadata.json index af12d119feb..ff1efd9931d 100644 --- a/modules/lanelet2/metadata.json +++ b/modules/lanelet2/metadata.json @@ -11,7 +11,7 @@ "github:fzi-forschungszentrum-informatik/Lanelet2" ], "versions": [ - "1.2.1" + "1.2.2" ], "yanked_versions": {} } From 7fcebd1575fb4725f458434343cea52198fb08d0 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 10:21:44 -0800 Subject: [PATCH 13/20] Remove non-compatible compiler flags --- modules/lanelet2/1.2.2/overlay/BUILD.bazel | 2 -- modules/lanelet2/1.2.2/source.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/lanelet2/1.2.2/overlay/BUILD.bazel b/modules/lanelet2/1.2.2/overlay/BUILD.bazel index 479d3a14295..db179844087 100644 --- a/modules/lanelet2/1.2.2/overlay/BUILD.bazel +++ b/modules/lanelet2/1.2.2/overlay/BUILD.bazel @@ -16,7 +16,6 @@ cc_library( srcs = glob(["lanelet2_core/src/**/*.cpp"]), hdrs = glob(["lanelet2_core/include/**/*.h"]), copts = [ - "-Wno-sign-compare", "-Wno-unused-function", "-Wno-unused-local-typedefs", ], @@ -139,7 +138,6 @@ cc_test( "lanelet2_core/test/*.cpp", "lanelet2_core/test/*.h", ]), - copts = ["-Wno-sign-compare"], deps = [ ":lanelet2_core", "@boost.geometry", diff --git a/modules/lanelet2/1.2.2/source.json b/modules/lanelet2/1.2.2/source.json index 962f767108d..99a990bdc30 100644 --- a/modules/lanelet2/1.2.2/source.json +++ b/modules/lanelet2/1.2.2/source.json @@ -7,7 +7,7 @@ "bazel_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" }, "overlay": { - "BUILD.bazel": "sha256-e4afW8f/YrF4e1xbfHq41uInTyrWvXTVQB4J+H/3y3U=", + "BUILD.bazel": "sha256-jcz7XOcRC2GuSZjByLg60EBUwEq0IFXHiy17/SPIRDs=", "MODULE.bazel": "sha256-wygLikJrkYvZi6muWOYyYH9v3RqW3viszRPZkLIbTnw=" }, "patch_strip": 1 From b1ad8f3113a46f94c66fbff2c0328047c97c5779 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 10:25:42 -0800 Subject: [PATCH 14/20] Add select for windows flags --- modules/lanelet2/1.2.2/overlay/BUILD.bazel | 16 ++++++++++++---- modules/lanelet2/1.2.2/source.json | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/lanelet2/1.2.2/overlay/BUILD.bazel b/modules/lanelet2/1.2.2/overlay/BUILD.bazel index db179844087..1574a48f215 100644 --- a/modules/lanelet2/1.2.2/overlay/BUILD.bazel +++ b/modules/lanelet2/1.2.2/overlay/BUILD.bazel @@ -15,10 +15,14 @@ cc_library( name = "lanelet2_core", srcs = glob(["lanelet2_core/src/**/*.cpp"]), hdrs = glob(["lanelet2_core/include/**/*.h"]), - copts = [ - "-Wno-unused-function", - "-Wno-unused-local-typedefs", - ], + copts = select({ + "@platforms//os:windows": [], + "//conditions:default": [ + "-Wno-sign-compare", + "-Wno-unused-function", + "-Wno-unused-local-typedefs", + ], + }), includes = ["lanelet2_core/include"], visibility = ["//visibility:public"], deps = [ @@ -138,6 +142,10 @@ cc_test( "lanelet2_core/test/*.cpp", "lanelet2_core/test/*.h", ]), + copts = select({ + "@platforms//os:windows": [], + "//conditions:default": ["-Wno-sign-compare"], + }), deps = [ ":lanelet2_core", "@boost.geometry", diff --git a/modules/lanelet2/1.2.2/source.json b/modules/lanelet2/1.2.2/source.json index 99a990bdc30..94670c722bb 100644 --- a/modules/lanelet2/1.2.2/source.json +++ b/modules/lanelet2/1.2.2/source.json @@ -7,7 +7,7 @@ "bazel_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" }, "overlay": { - "BUILD.bazel": "sha256-jcz7XOcRC2GuSZjByLg60EBUwEq0IFXHiy17/SPIRDs=", + "BUILD.bazel": "sha256-5HC7IaQ5kQH6gVDxBrdNixqdJSQI1FaQCrS6zcoOdGA=", "MODULE.bazel": "sha256-wygLikJrkYvZi6muWOYyYH9v3RqW3viszRPZkLIbTnw=" }, "patch_strip": 1 From ebf58a7b208ad3067700ca281cf599fa43a5b2e3 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 10:28:05 -0800 Subject: [PATCH 15/20] Add platforms to bazel_deps --- modules/lanelet2/1.2.2/MODULE.bazel | 1 + modules/lanelet2/1.2.2/source.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/lanelet2/1.2.2/MODULE.bazel b/modules/lanelet2/1.2.2/MODULE.bazel index bc92d46dc1c..240fe8b54e6 100644 --- a/modules/lanelet2/1.2.2/MODULE.bazel +++ b/modules/lanelet2/1.2.2/MODULE.bazel @@ -24,6 +24,7 @@ bazel_dep(name = "boost.variant", version = BOOST_VERSION + ".bcr.1") bazel_dep(name = "eigen", version = "3.4.0.bcr.1") bazel_dep(name = "geographiclib", version = "2.4.0.bcr.1") bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest") +bazel_dep(name = "platforms", version = "0.0.9") bazel_dep(name = "pugixml", version = "1.14.bcr.1") bazel_dep(name = "rules_cc", version = "0.1.0") bazel_dep(name = "rules_license", version = "1.0.0") diff --git a/modules/lanelet2/1.2.2/source.json b/modules/lanelet2/1.2.2/source.json index 94670c722bb..c8effabedcc 100644 --- a/modules/lanelet2/1.2.2/source.json +++ b/modules/lanelet2/1.2.2/source.json @@ -8,7 +8,7 @@ }, "overlay": { "BUILD.bazel": "sha256-5HC7IaQ5kQH6gVDxBrdNixqdJSQI1FaQCrS6zcoOdGA=", - "MODULE.bazel": "sha256-wygLikJrkYvZi6muWOYyYH9v3RqW3viszRPZkLIbTnw=" + "MODULE.bazel": "sha256-zPCZnuediXqru+a8IRQ1TYsLRw0km2QZ69714zSJqvA=" }, "patch_strip": 1 } From 558e58adca22cac6cd3926f61d4bf40cd3ba312c Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 16:43:34 -0800 Subject: [PATCH 16/20] Pass correct c++17 flags to windows CI --- modules/lanelet2/1.2.2/presubmit.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/lanelet2/1.2.2/presubmit.yml b/modules/lanelet2/1.2.2/presubmit.yml index 1f94ac87034..3abd5096264 100644 --- a/modules/lanelet2/1.2.2/presubmit.yml +++ b/modules/lanelet2/1.2.2/presubmit.yml @@ -1,5 +1,5 @@ matrix: - platform: + unix_platform: - debian10 - debian11 - macos @@ -7,14 +7,13 @@ matrix: - ubuntu2004 - ubuntu2204 - ubuntu2404 - - windows bazel: - 7.x - 8.x - rolling tasks: - verify_targets: - platform: ${{ platform }} + unix_test: + platform: ${{ unix_platform }} bazel: ${{ bazel }} build_flags: - '--cxxopt=-std=c++17' @@ -29,3 +28,19 @@ tasks: - '@lanelet2//:lanelet2_validation' test_targets: - '@lanelet2//...' + windows_test: + platform: "windows" + bazel: ${{ bazel }} + build_flags: + - '--cxxopt=/std:c++17' + - '--host_cxxopt=/std:c++17' + build_targets: + - '@lanelet2//:lanelet2_core' + - '@lanelet2//:lanelet2_io' + - '@lanelet2//:lanelet2_matching' + - '@lanelet2//:lanelet2_projection' + - '@lanelet2//:lanelet2_routing' + - '@lanelet2//:lanelet2_traffic_rules' + - '@lanelet2//:lanelet2_validation' + test_targets: + - '@lanelet2//...' From d68b80076484d95e6e4becba770a67dd35e8b9be Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Sat, 28 Dec 2024 16:46:30 -0800 Subject: [PATCH 17/20] Disable support for windows. Would require work upstream --- modules/lanelet2/1.2.2/presubmit.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/lanelet2/1.2.2/presubmit.yml b/modules/lanelet2/1.2.2/presubmit.yml index 3abd5096264..739642745ec 100644 --- a/modules/lanelet2/1.2.2/presubmit.yml +++ b/modules/lanelet2/1.2.2/presubmit.yml @@ -7,6 +7,8 @@ matrix: - ubuntu2004 - ubuntu2204 - ubuntu2404 + # Windows is not supported by lanelet2. + # - windows bazel: - 7.x - 8.x @@ -28,19 +30,3 @@ tasks: - '@lanelet2//:lanelet2_validation' test_targets: - '@lanelet2//...' - windows_test: - platform: "windows" - bazel: ${{ bazel }} - build_flags: - - '--cxxopt=/std:c++17' - - '--host_cxxopt=/std:c++17' - build_targets: - - '@lanelet2//:lanelet2_core' - - '@lanelet2//:lanelet2_io' - - '@lanelet2//:lanelet2_matching' - - '@lanelet2//:lanelet2_projection' - - '@lanelet2//:lanelet2_routing' - - '@lanelet2//:lanelet2_traffic_rules' - - '@lanelet2//:lanelet2_validation' - test_targets: - - '@lanelet2//...' From cc8e2b3400c5a2328dea2b95e0c92f4f8958bd30 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Mon, 30 Dec 2024 23:06:57 -0800 Subject: [PATCH 18/20] Fix lanelet2_routing_test --- modules/lanelet2/1.2.2/overlay/BUILD.bazel | 2 ++ modules/lanelet2/1.2.2/source.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/lanelet2/1.2.2/overlay/BUILD.bazel b/modules/lanelet2/1.2.2/overlay/BUILD.bazel index 1574a48f215..fa74dc3f489 100644 --- a/modules/lanelet2/1.2.2/overlay/BUILD.bazel +++ b/modules/lanelet2/1.2.2/overlay/BUILD.bazel @@ -202,6 +202,8 @@ cc_test( "lanelet2_routing/test/*.cpp", "lanelet2_routing/test/*.h", ]), + # For some unknown reason, this test fails without optimization enabled. + copts = ["-O3"], deps = [ ":lanelet2_core", ":lanelet2_routing", diff --git a/modules/lanelet2/1.2.2/source.json b/modules/lanelet2/1.2.2/source.json index c8effabedcc..e7c4f18856a 100644 --- a/modules/lanelet2/1.2.2/source.json +++ b/modules/lanelet2/1.2.2/source.json @@ -7,7 +7,7 @@ "bazel_test_include_paths.patch": "sha256-iaAuQFKvVknHYUzSmFpsnXx5auhE1RqpXIKS9qK+C2E=" }, "overlay": { - "BUILD.bazel": "sha256-5HC7IaQ5kQH6gVDxBrdNixqdJSQI1FaQCrS6zcoOdGA=", + "BUILD.bazel": "sha256-XP8SspStSOBTBt/Wz1FSL67NXaxGqu0H+3l3E5wvFmg=", "MODULE.bazel": "sha256-zPCZnuediXqru+a8IRQ1TYsLRw0km2QZ69714zSJqvA=" }, "patch_strip": 1 From b0b0308b451d70148e144e86acc1ef57a37848b7 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Mon, 30 Dec 2024 23:43:10 -0800 Subject: [PATCH 19/20] Disabl mac support --- modules/lanelet2/1.2.2/presubmit.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/lanelet2/1.2.2/presubmit.yml b/modules/lanelet2/1.2.2/presubmit.yml index 739642745ec..fc31c22874a 100644 --- a/modules/lanelet2/1.2.2/presubmit.yml +++ b/modules/lanelet2/1.2.2/presubmit.yml @@ -1,9 +1,10 @@ matrix: - unix_platform: + platform: - debian10 - debian11 - - macos - - macos_arm64 + # MacOS is not supported by lanelet2. + # - macos + # - macos_arm64 - ubuntu2004 - ubuntu2204 - ubuntu2404 @@ -15,7 +16,7 @@ matrix: - rolling tasks: unix_test: - platform: ${{ unix_platform }} + platform: ${{ platform }} bazel: ${{ bazel }} build_flags: - '--cxxopt=-std=c++17' From dfbd31c9556dae30783c2fb184d68a7fb826531b Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Tue, 31 Dec 2024 00:10:50 -0800 Subject: [PATCH 20/20] Update modules/lanelet2/1.2.2/presubmit.yml Co-authored-by: Fabian Meumertzheim --- modules/lanelet2/1.2.2/presubmit.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/lanelet2/1.2.2/presubmit.yml b/modules/lanelet2/1.2.2/presubmit.yml index fc31c22874a..7a8ecae88af 100644 --- a/modules/lanelet2/1.2.2/presubmit.yml +++ b/modules/lanelet2/1.2.2/presubmit.yml @@ -13,7 +13,6 @@ matrix: bazel: - 7.x - 8.x - - rolling tasks: unix_test: platform: ${{ platform }}