Skip to content

Commit f782186

Browse files
authored
Merge pull request #688 from gazebosim/scpeters/merge_6_main
Merge gz-common6 ➡️ main
2 parents 88464ce + df48f9e commit f782186

31 files changed

+867
-385
lines changed

.bazelrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
common --enable_bzlmod
2+
common --lockfile_mode=off
3+
4+
# Add C++17 compiler flags.
5+
build --cxxopt=-std=c++17
6+
build --host_cxxopt=-std=c++17
7+
8+
build --force_pic
9+
build --strip=never
10+
build --strict_system_includes
11+
build --fission=dbg
12+
build --features=per_object_debug_info
13+
14+
# Enable header processing, required for layering checks with parse_header.
15+
build --process_headers_in_dependencies

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.3.1

.github/workflows/bazel.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Bazel CI
2+
on:
3+
push:
4+
branches: [gz-common6, main]
5+
pull_request:
6+
branches: [gz-common6, main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
uses: bazel-contrib/.github/.github/workflows/[email protected]
15+
with:
16+
folders: |
17+
[
18+
".",
19+
]
20+
exclude: |
21+
[
22+
{"folder": ".", "bzlmodEnabled": false},
23+
]

.github/workflows/ci.bazelrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file contains Bazel settings to apply on CI only.
2+
# It is referenced with a --bazelrc option in the call to bazel in ci.yaml
3+
4+
# Debug where options came from
5+
build --announce_rc
6+
# This directory is configured in GitHub actions to be persisted between runs.
7+
# We do not enable the repository cache to cache downloaded external artifacts
8+
# as these are generally faster to download again than to fetch them from the
9+
# GitHub actions cache.
10+
build --disk_cache=~/.cache/bazel
11+
# Don't rely on test logs being easily accessible from the test runner,
12+
# though it makes the log noisier.
13+
test --test_output=errors
14+
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
15+
test --test_env=XDG_CACHE_HOME

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ build
22
build_*
33
.DS_Store
44
*.swp
5+
6+
# Bazel generated files
7+
bazel-*

BUILD.bazel

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
1-
load(
2-
"@gz//bazel/skylark:build_defs.bzl",
3-
"GZ_FEATURES",
4-
"GZ_ROOT",
5-
"GZ_VISIBILITY",
6-
"gz_configure_header",
7-
"gz_export_header",
8-
"gz_include_header",
9-
)
10-
load(
11-
"@gz//bazel/lint:lint.bzl",
12-
"add_lint_tests",
13-
)
1+
load("@rules_gazebo//gazebo:headers.bzl", "gz_configure_header", "gz_export_header")
142
load("@rules_license//rules:license.bzl", "license")
153

164
package(
17-
default_applicable_licenses = [GZ_ROOT + "common:license"],
18-
default_visibility = GZ_VISIBILITY,
19-
features = GZ_FEATURES,
5+
default_applicable_licenses = [":license"],
6+
features = [
7+
"layering_check",
8+
"parse_headers",
9+
],
2010
)
2111

2212
license(
@@ -26,67 +16,70 @@ license(
2616

2717
licenses(["notice"])
2818

29-
exports_files(["LICENSE"])
19+
exports_files([
20+
"package.xml",
21+
"LICENSE",
22+
"MODULE.bazel",
23+
])
3024

3125
gz_configure_header(
32-
name = "config",
26+
name = "Config",
3327
src = "include/gz/common/config.hh.in",
34-
cmakelists = ["CMakeLists.txt"],
35-
package = "common",
28+
package_xml = "package.xml",
3629
)
3730

3831
gz_export_header(
39-
name = "include/gz/common/Export.hh",
32+
name = "Export",
33+
out = "include/gz/common/Export.hh",
4034
export_base = "GZ_COMMON",
4135
lib_name = "gz-common",
42-
visibility = ["//visibility:private"],
4336
)
4437

4538
public_headers_no_gen = glob([
4639
"include/gz/common/*.hh",
4740
"include/gz/common/detail/*.hh",
48-
"include/gz/common/graph/*.hh",
4941
])
5042

51-
private_headers = glob(["src/*.hh"])
43+
private_headers = glob(
44+
include = [
45+
"src/*.hh",
46+
],
47+
)
5248

5349
sources = glob(
54-
["src/*.cc"],
50+
include = [
51+
"src/*.cc",
52+
],
5553
exclude = [
5654
"src/Plugin.cc",
5755
"src/PluginLoader.cc",
5856
"src/*_TEST.cc",
5957
],
6058
)
6159

62-
gz_include_header(
63-
name = "commonhh_genrule",
64-
out = "include/gz/common.hh",
65-
hdrs = public_headers_no_gen + [
66-
"include/gz/common/config.hh",
67-
"include/gz/common/Export.hh",
68-
],
69-
)
70-
7160
public_headers = public_headers_no_gen + [
7261
"include/gz/common/config.hh",
7362
"include/gz/common/Export.hh",
74-
"include/gz/common.hh",
7563
]
7664

7765
cc_library(
78-
name = "common",
66+
name = "gz-common",
7967
srcs = sources + private_headers,
8068
hdrs = public_headers,
8169
copts = [
8270
"-fexceptions",
8371
"-Wno-unused-value",
8472
],
8573
includes = ["include"],
74+
visibility = ["//visibility:public"],
8675
deps = [
87-
GZ_ROOT + "utils",
88-
GZ_ROOT + "math",
89-
"@uuid",
76+
"@gz-math",
77+
"@gz-utils//:ImplPtr",
78+
"@gz-utils//:NeverDestroyed",
79+
"@gz-utils//:SuppressWarning",
80+
"@gz-utils//log:Logger",
81+
"@libuuid",
82+
"@spdlog",
9083
],
9184
)
9285

@@ -103,11 +96,11 @@ test_sources = glob(
10396
srcs = [src],
10497
copts = ["-fexceptions"],
10598
deps = [
106-
":common",
107-
GZ_ROOT + "common/testing",
108-
"@gtest",
109-
"@gtest//:gtest_main",
99+
":gz-common",
100+
"//testing",
101+
"@googletest//:gtest",
102+
"@googletest//:gtest_main",
103+
"@gz-math",
104+
"@gz-utils//:ExtraTestMacros",
110105
],
111106
) for src in test_sources]
112-
113-
add_lint_tests()

Changelog.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@
44

55
## Gazebo Common 6.x
66

7+
### Gazebo Common 6.1.0 (2025-05-28)
8+
9+
1. Add support for custom profiler
10+
* [Pull request #682](https://github.com/gazebosim/gz-common/pull/682)
11+
12+
1. Migrate bazel build setup to use bzlmod
13+
* [Pull request #679](https://github.com/gazebosim/gz-common/pull/679)
14+
* [Pull request #681](https://github.com/gazebosim/gz-common/pull/681)
15+
* [Pull request #683](https://github.com/gazebosim/gz-common/pull/683)
16+
* [Pull request #684](https://github.com/gazebosim/gz-common/pull/684)
17+
18+
1. Add Heightmap utility functions
19+
* [Pull request #680](https://github.com/gazebosim/gz-common/pull/680)
20+
21+
1. Check valid indices before doing convex decomposition
22+
* [Pull request #677](https://github.com/gazebosim/gz-common/pull/677)
23+
24+
1. ci: run cppcheck, cpplint on noble
25+
* [Pull request #669](https://github.com/gazebosim/gz-common/pull/669)
26+
27+
1. Added missing includes
28+
* [Pull request #672](https://github.com/gazebosim/gz-common/pull/672)
29+
30+
1. Add check for valid indices in submesh
31+
* [Pull request #667](https://github.com/gazebosim/gz-common/pull/667)
32+
33+
1. Fix C4305 double truncated to float warnings (#666)
34+
* [Pull request #668](https://github.com/gazebosim/gz-common/pull/668)
35+
36+
1. Add missing include chrono in Event.hh header
37+
* [Pull request #664](https://github.com/gazebosim/gz-common/pull/664)
38+
739
### Gazebo Common 6.0.2 (2025-02-12)
840

941
1. Add missing includes

MODULE.bazel

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## MODULE.bazel
2+
module(
3+
name = "gz-common",
4+
repo_name = "org_gazebosim_gz-common",
5+
)
6+
7+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
8+
bazel_dep(name = "assimp", version = "5.4.3.bcr.3")
9+
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
10+
bazel_dep(name = "cdt", version = "1.4.0")
11+
bazel_dep(name = "freeimage", version = "3.19.10")
12+
bazel_dep(name = "googletest", version = "1.14.0")
13+
bazel_dep(name = "remotery", version = "1.0.0")
14+
bazel_dep(name = "rules_license", version = "1.0.0")
15+
bazel_dep(name = "spdlog", version = "1.12.0")
16+
bazel_dep(name = "tinyxml2", version = "10.0.0")
17+
bazel_dep(name = "libuuid", version = "2.39.3.bcr.1")
18+
19+
# Gazebo Dependencies
20+
bazel_dep(name = "rules_gazebo", version = "0.0.2")
21+
bazel_dep(name = "gz-utils")
22+
bazel_dep(name = "gz-math")
23+
24+
archive_override(
25+
module_name = "gz-utils",
26+
strip_prefix = "gz-utils-main",
27+
urls = ["https://github.com/gazebosim/gz-utils/archive/refs/heads/main.tar.gz"],
28+
)
29+
30+
archive_override(
31+
module_name = "gz-math",
32+
strip_prefix = "gz-math-main",
33+
urls = ["https://github.com/gazebosim/gz-math/archive/refs/heads/main.tar.gz"],
34+
)

av/BUILD.bazel

Lines changed: 41 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
load(
2-
"@gz//bazel/skylark:build_defs.bzl",
3-
"GZ_FEATURES",
4-
"GZ_ROOT",
5-
"GZ_VISIBILITY",
6-
"gz_export_header",
7-
"gz_include_header",
8-
)
9-
load(
10-
"@gz//bazel/lint:lint.bzl",
11-
"add_lint_tests",
12-
)
1+
load("@rules_gazebo//gazebo:headers.bzl", "gz_export_header")
132

143
package(
15-
default_applicable_licenses = [GZ_ROOT + "common:license"],
16-
features = GZ_FEATURES,
4+
default_applicable_licenses = ["//:license"],
5+
features = [
6+
"layering_check",
7+
"parse_headers",
8+
],
179
)
1810

1911
public_headers_no_gen = glob([
@@ -29,54 +21,46 @@ sources = glob(
2921
test_sources = glob(["src/*_TEST.cc"])
3022

3123
gz_export_header(
32-
name = "include/gz/common/av/Export.hh",
24+
name = "Export",
25+
out = "include/gz/common/av/Export.hh",
3326
export_base = "GZ_COMMON_AV",
3427
lib_name = "gz-common-av",
35-
visibility = ["//visibility:private"],
36-
)
37-
38-
gz_include_header(
39-
name = "av_hh_genrule",
40-
out = "include/gz/common/av.hh",
41-
hdrs = public_headers_no_gen + [
42-
"include/gz/common/av/Export.hh",
43-
],
4428
)
4529

4630
public_headers = public_headers_no_gen + [
4731
"include/gz/common/av/Export.hh",
48-
"include/gz/common/av.hh",
4932
]
5033

51-
cc_library(
52-
name = "av",
53-
srcs = sources,
54-
hdrs = public_headers,
55-
includes = ["include"],
56-
visibility = GZ_VISIBILITY,
57-
deps = [
58-
GZ_ROOT + "common",
59-
GZ_ROOT + "utils",
60-
"@ffmpeg//:libavcodec",
61-
"@ffmpeg//:libavformat",
62-
"@ffmpeg//:libavutil",
63-
"@ffmpeg//:libswscale",
64-
],
65-
)
66-
67-
[cc_test(
68-
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
69-
srcs = [src],
70-
data = [GZ_ROOT + "common/test:data"],
71-
env = {
72-
"GZ_BAZEL": "1",
73-
"GZ_BAZEL_PATH": "common",
74-
},
75-
deps = [
76-
":av",
77-
GZ_ROOT + "common/testing",
78-
"@gtest//:gtest_main",
79-
],
80-
) for src in test_sources]
81-
82-
add_lint_tests()
34+
# \todo(iche033) Add av component once ffmpeg dep is available in BCR
35+
# cc_library(
36+
# name = "av",
37+
# srcs = sources,
38+
# hdrs = public_headers,
39+
# includes = ["include"],
40+
# visibility = ["//visibility:public"],
41+
# deps = [
42+
# "//:gz-common",
43+
# "@gz-utils//:ImplPtr",
44+
# "@gz-utils//:ExtraTestMacros",
45+
# "@ffmpeg//:libavcodec",
46+
# "@ffmpeg//:libavformat",
47+
# "@ffmpeg//:libavutil",
48+
# "@ffmpeg//:libswscale",
49+
# ],
50+
# )
51+
#
52+
# [cc_test(
53+
# name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
54+
# srcs = [src],
55+
# data = ["//test:data"],
56+
# env = {
57+
# "GZ_BAZEL": "1",
58+
# },
59+
# deps = [
60+
# ":av",
61+
# "//testing:testing",
62+
# "@googletest//:gtest",
63+
# "@googletest//:gtest_main",
64+
#
65+
# ],
66+
# ) for src in test_sources]

0 commit comments

Comments
 (0)