Skip to content
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

Merge gz-transport13 ➡️ main #479

Merged
merged 29 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
69e9592
Prepare for 11.4.1 release (#436)
azeey Sep 1, 2023
da3094b
Adds the python tutorial for the bindings
Voldivh Oct 3, 2023
80212ae
Address review comments
Voldivh Oct 4, 2023
d1de32d
Adds the required snippet tags to the examples
Voldivh Oct 5, 2023
b774eb6
Shortens a couple of lines
Voldivh Oct 16, 2023
e407bf5
Uses capital P on Python
Voldivh Oct 16, 2023
46e050b
Fixes some grammar
Voldivh Oct 24, 2023
ce66a7c
Adds the subcommands for the log command (#451)
Voldivh Oct 31, 2023
c6be5a2
Remove duplicated functionality from test_config (#457)
mjcarroll Nov 2, 2023
6c4b1ec
Merge pull request #450 from gazebosim/voldivh/python_tutorial
Voldivh Nov 3, 2023
3d0cf67
Update github action workflows (#460)
azeey Nov 20, 2023
290055f
Use subprocess rather than custom code (#429)
mjcarroll Nov 28, 2023
1db0afe
Support for bazel on garden (#399)
mjcarroll Dec 8, 2023
764a04b
Update CI badges in README (#465)
iche033 Dec 21, 2023
db86f9b
🎈 8.5.0 (#466)
mjcarroll Jan 5, 2024
2bd21ff
Merge 8 to 11
azeey Jan 12, 2024
b0328a1
Merge pull request #469 from azeey/8_to_11
azeey Jan 12, 2024
ca954cb
Merge 11 into 12
azeey Jan 18, 2024
e7c3292
Merge pull request #471 from azeey/11_to_12
azeey Jan 19, 2024
92d02dc
Test refactoring part 2 (#463)
mjcarroll Jan 25, 2024
3a34f07
Fix issue #468 (#470)
caguero Feb 2, 2024
b4d6377
Merge branch 'gz-transport12' into 12_13
caguero Feb 3, 2024
157311e
Play with tests
caguero Feb 3, 2024
eac2e69
Fix test executable name
mjcarroll Feb 6, 2024
5ec65e2
Merge pull request #478 from gazebosim/12_13
scpeters Feb 6, 2024
502f519
Find Python3 directly, not with GzPython (#472)
scpeters Feb 6, 2024
4bf2998
Merge branch 'gz-transport13' into scpeters/merge_13_main
scpeters Feb 6, 2024
251b9bd
gz_TEST: more output when tests fail (#479)
scpeters Feb 7, 2024
9aaa434
Merge branch 'main' into scpeters/merge_13_main
iche033 Mar 14, 2024
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
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Ubuntu CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- 'ign-transport[0-9]?'
- 'gz-transport[0-9]?'
- 'main'

jobs:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

131 changes: 131 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
load(
"@gz//bazel/lint:lint.bzl",
"add_lint_tests",
)

package(
default_visibility = GZ_VISIBILITY,
features = GZ_FEATURES,
)

licenses(["notice"]) # Apache-2.0

exports_files(["LICENSE"])

gz_configure_header(
name = "transport_config_hh",
src = "include/gz/transport/config.hh.in",
cmakelists = ["CMakeLists.txt"],
package = "transport",
)

gz_export_header(
name = "include/gz/transport/Export.hh",
export_base = "GZ_TRANSPORT",
lib_name = "gz-transport",
visibility = ["//visibility:private"],
)

public_headers_no_gen = glob([
"include/gz/transport/*.h",
"include/gz/transport/*.hh",
"include/gz/transport/detail/*.hh",
])

private_headers = glob(["src/*.hh"])

sources = glob(
["src/*.cc"],
exclude = [
"src/*_TEST.cc",
],
)

gz_include_header(
name = "transport_hh_genrule",
out = "include/gz/transport.hh",
hdrs = public_headers_no_gen + [
"include/gz/transport/config.hh",
"include/gz/transport/Export.hh",
],
)

public_headers = public_headers_no_gen + [
"include/gz/transport/config.hh",
"include/gz/transport/Export.hh",
"include/gz/transport.hh",
]

cc_library(
name = "transport",
srcs = sources + private_headers,
hdrs = public_headers,
copts = [
"-Wno-deprecated-declarations",
],
includes = ["include"],
deps = [
GZ_ROOT + "msgs",
"@uuid",
"@zmq",
],
)

cc_binary(
name = "topic",
srcs = [
"src/cmd/gz.cc",
"src/cmd/gz.hh",
"src/cmd/topic_main.cc",
],
includes = ["src/cmd"],
deps = [
":transport",
GZ_ROOT + "utils/cli",
],
)

cc_binary(
name = "service",
srcs = [
"src/cmd/gz.cc",
"src/cmd/gz.hh",
"src/cmd/service_main.cc",
],
includes = ["src/cmd"],
deps = [
":transport",
GZ_ROOT + "utils/cli",
],
)

test_sources = glob(
include = ["src/*_TEST.cc"],
)

[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
env = {
"GZ_BAZEL": "1",
"GZ_BAZEL_PATH": "transport",
},
deps = [
":transport",
GZ_ROOT + "common/testing",
GZ_ROOT + "transport/test:utils",
"@gtest",
"@gtest//:gtest_main",
],
) for src in test_sources]

add_lint_tests()
55 changes: 55 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,33 @@

## Gazebo Transport 11.X

### Gazebo Transport 11.4.1 (2023-09-01)

1. Fix topic/service list inconsistency
* [Pull request #415](https://github.com/gazebosim/gz-transport/pull/415)

1. Backport Windows fix to ign-transport8
* [Pull request #406](https://github.com/gazebosim/gz-transport/pull/406)

1. Fix unused-result warning
* [Pull request #408](https://github.com/gazebosim/gz-transport/pull/408)

1. Fix compatibility with protobuf 22
* [Pull request #405](https://github.com/gazebosim/gz-transport/pull/405)

1. Fix compiler warning and signedness issue
* [Pull request #401](https://github.com/gazebosim/gz-transport/pull/401)

1. Rename COPYING to LICENSE
* [Pull request #392](https://github.com/gazebosim/gz-transport/pull/392)

1. Infrastructure
* [Pull request #391](https://github.com/gazebosim/gz-transport/pull/391)
* [Pull request #394](https://github.com/gazebosim/gz-transport/pull/394)

1. Support clang and std::filesystem
* [Pull request #390](https://github.com/gazebosim/gz-transport/pull/390)

### Gazebo Transport 11.4.0 (2023-03-08)

1. Added Node::RequestRaw
Expand Down Expand Up @@ -465,6 +492,34 @@
and publication, age, and reception statistics.
* [Pull request 205](https://github.com/gazebosim/gz-transport/pull/205)

### Gazebo Transport 8.5.0 (2024-01-05)

1. Update github action workflows
* [Pull request #460](https://github.com/gazebosim/gz-transport/pull/460)
* [Pull request #391](https://github.com/gazebosim/gz-transport/pull/391)
* [Pull request #392](https://github.com/gazebosim/gz-transport/pull/392)

1. Adds the subcommands for the log command
* [Pull request #451](https://github.com/gazebosim/gz-transport/pull/451)

1. Fix topic/service list inconsistency
* [Pull request #415](https://github.com/gazebosim/gz-transport/pull/415)

1. Backport Windows fix to ign-transport8
* [Pull request #406](https://github.com/gazebosim/gz-transport/pull/406)

1. Fix compatibility with protobuf 22
* [Pull request #405](https://github.com/gazebosim/gz-transport/pull/405)

1. Fix compiler warning and signedness issue
* [Pull request #401](https://github.com/gazebosim/gz-transport/pull/401)

1. Support clang and std::filesystem
* [Pull request #390](https://github.com/gazebosim/gz-transport/pull/390)

1. Pass std::function by value to Node::Subscribe
* [Pull request #382](https://github.com/gazebosim/gz-transport/pull/382)

### Gazebo Transport 8.4.0 (2022-11-17)

1. ign -> gz : Remove redundant namespace references.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

Build | Status
-- | --
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-transport/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-transport/branch/main)
Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_transport-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_transport-ci-main-focal-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_transport-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_transport-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ign_transport-ci-win)](https://build.osrfoundation.org/job/ign_transport-ci-win/)
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-transport/tree/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-transport/tree/main)
Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_transport-ci-main-jammy-amd64)](https://build.osrfoundation.org/job/gz_transport-ci-main-jammy-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_transport-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/gz_transport-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_transport-main-win)](https://build.osrfoundation.org/job/gz_transport-main-win/)

Gazebo Transport, a component of [Gazebo](https://gazebosim.org), provides fast and efficient asynchronous message passing, services, and data logging.

Expand Down
7 changes: 7 additions & 0 deletions include/gz/transport/Discovery.hh
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ namespace gz
/// (e.g. if the discovery has not been started).
public: bool Advertise(const Pub &_publisher)
{
DiscoveryCallback<Pub> cb;

{
std::lock_guard<std::mutex> lock(this->mutex);

Expand All @@ -315,8 +317,13 @@ namespace gz
// Add the addressing information (local publisher).
if (!this->info.AddPublisher(_publisher))
return false;

cb = this->connectionCb;
}

if (cb)
cb(_publisher);

// Only advertise a message outside this process if the scope
// is not 'Process'
if (_publisher.Options().Scope() != Scope_t::PROCESS)
Expand Down
91 changes: 91 additions & 0 deletions log/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"cmake_configure_file",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
load(
"@gz//bazel/lint:lint.bzl",
"add_lint_tests",
)

cmake_configure_file(
name = "build_config",
src = "src/build_config.hh.in",
out = "include/build_config.hh",
cmakelists = ["src/CMakeLists.txt"],
defines = [
"SCHEMA_INSTALL_PATH=transport/log/sql",
],
)

gz_export_header(
name = "include/gz/transport/log/Export.hh",
export_base = "GZ_TRANSPORT_LOG",
lib_name = "gz-transport-log",
visibility = ["//visibility:private"],
)

public_headers_no_gen = glob([
"include/gz/transport/log/*.hh",
"include/gz/transport/log/detail/*.hh",
])

private_headers = glob(["src/*.hh"])

sources = glob(
["src/*.cc"],
exclude = [
"src/*_TEST.cc",
],
)

public_headers = public_headers_no_gen + [
"include/gz/transport/log/Export.hh",
]

cc_library(
name = "log",
srcs = sources + private_headers + ["include/build_config.hh"],
hdrs = public_headers,
data = ["sql/0.1.0.sql"],
includes = ["include"],
deps = [
GZ_ROOT + "transport",
"@sqlite3",
],
)

test_sources = glob(
include = ["src/*_TEST.cc"],
exclude = ["src/LogCommandAPI_TEST.cc"],
)

[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
data = [
"test/data/state.tlog",
],
defines = [
'GZ_TRANSPORT_LOG_TEST_PATH=\\"transport/log/test\\"',
'CORRUPT_DB_TEST_PATH=\\"transport/log/test/data/state.tlog\\"',
],
env = {
"GZ_BAZEL": "1",
"GZ_BAZEL_PATH": "transport",
},
deps = [
":log",
GZ_ROOT + "common/testing",
GZ_ROOT + "transport/test:utils",
"@gtest",
"@gtest//:gtest_main",
],
) for src in test_sources]

add_lint_tests()
11 changes: 5 additions & 6 deletions log/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ endif()
gz_build_tests(
TYPE "UNIT"
SOURCES ${gtest_sources}
LIB_DEPS ${log_lib_target} ${EXTRA_TEST_LIB_DEPS}
LIB_DEPS ${log_lib_target} ${EXTRA_TEST_LIB_DEPS} test_config
TEST_LIST logging_tests
)

foreach(test_target ${logging_tests})

set_tests_properties(${logging_tests} PROPERTIES
set_tests_properties(${test_target} PROPERTIES
ENVIRONMENT GZ_TRANSPORT_LOG_SQL_PATH=${PROJECT_SOURCE_DIR}/log/sql)
target_compile_definitions(${test_target} PRIVATE
"CORRUPT_DB_TEST_PATH=\"${CMAKE_SOURCE_DIR}/log/test/data/state.tlog\""
)

endforeach()

Expand All @@ -46,9 +48,6 @@ install(DIRECTORY ../sql DESTINATION ${SCHEMA_INSTALL_BASE})
set(SCHEMA_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${SCHEMA_INSTALL_BASE}/sql)
configure_file(build_config.hh.in build_config.hh @ONLY)


message(STATUS "CMAKE_CURRENT_SOURCE_DIR:${CMAKE_CURRENT_SOURCE_DIR}")

target_include_directories(${log_lib_target}
PUBLIC
# Add this component's include directory to the build interface include
Expand Down
Loading