Skip to content

Commit

Permalink
Fix: CI (#17)
Browse files Browse the repository at this point in the history
# Description
- Update zenohc and zenohcxx to the version that fixes the cmake istall
- Fix some clang-tidy warning

## Type of change
- Bug fix (non-breaking change which fixes an issue)\

## Checklist before requesting a review
- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] If this is a new component I have added examples.
- [ ] I updated the README and related documentation.
  • Loading branch information
filippobrizzi authored Feb 2, 2024
1 parent 9e73fb9 commit 7a18aae
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 30 deletions.
19 changes: 16 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 7,
"configurePresets": [
{
"name": "preferred",
"name": "default",
"description": "Configuration setting for all modules with preferred toolchain",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
Expand All @@ -12,6 +12,19 @@
"BUILD_MODULES": "all"
}
},
{
"name": "fast",
"description": "Configuration setting for all modules with preferred toolchain",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"installDir": "/install",
"toolchainFile": "${sourceDir}/toolchains/toolchain_clang.cmake",
"cacheVariables": {
"BUILD_MODULES": "all",
"ENABLE_LINTER": "OFF",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "deps-docker",
"description": "Configuration setting for all modules with preferred toolchain",
Expand Down Expand Up @@ -42,9 +55,9 @@
],
"buildPresets": [
{
"name": "preferred",
"name": "default",
"description": "Preferred build settings",
"configurePreset": "preferred"
"configurePreset": "default"
}
]
}
2 changes: 1 addition & 1 deletion cmake/06_packager_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${EOLO_VERSION})
set(CPACK_PACKAGE_VENDOR "Vilas Kumar Chitrakaran")
set(CPACK_PACKAGE_VENDOR "Filippo Brizzi")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")

set(CPACK_GENERATOR "DEB")
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile_deps
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN . "$HOME/.cargo/env" && cmake ../ --preset deps-docker
RUN ninja all && \
ninja install

RUN cd / && rm -rf /tmp/eolo
# Remove all eolo install
RUN cd / && rm -rf /tmp/eolo && rm -rf /install/include/eolo && rm -rf /install/lib/libeolo* && rm -rf /install/lib/cmake/eolo* && rm -rf /install/share/eolo*

WORKDIR /
2 changes: 1 addition & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi

ncores=$(cat /proc/cpuinfo | grep processor | wc -l)

IMAGE_NAME="ghcr.io/filippobrizzi/${ARCH}/${IMAGE}"
IMAGE_NAME="${HOST}/${ARCH}/${IMAGE}"

function docker_tag_exists() {
docker manifest inspect ${IMAGE_NAME}:${VERSION} > /dev/null
Expand Down
6 changes: 3 additions & 3 deletions docker/build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ if [ "${ARCH}" == "aarch64" ]; then
ARCH = "arm64"
fi

BASE_IMAGE=ghcr.io/filippobrizzi/${ARCH}/${IMAGE}:${VERSION}
BASE_IMAGE=${HOST}/${ARCH}/${IMAGE}:${VERSION}
docker pull ${BASE_IMAGE}

SUFFIX=deps
IMAGE_NAME="ghcr.io/filippobrizzi/${ARCH}/${IMAGE}_${SUFFIX}"
IMAGE_NAME="${HOST}/${ARCH}/${IMAGE}_${SUFFIX}"

function docker_tag_exists() {
docker manifest inspect ${IMAGE_NAME}:${VERSION} > /dev/null
docker manifest inspect ${IMAGE_NAME}:${DEPS_VERSION} > /dev/null
}

if docker_tag_exists; then
Expand Down
4 changes: 2 additions & 2 deletions docker/version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

HOST=ghcr.io/filippobrizzi
VERSION=1.0.2
IMAGE=eolo-dev

# This is the version of the dep image. Increase this number everytime you change `external/CMakeLists.txt`
DEPS_VERSION=1.0.2
DEPS_VERSION=1.0.3
12 changes: 8 additions & 4 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ if(zenohcxx IN_LIST EXTERNAL_PROJECTS_LIST)
ExternalProject_Add(
zenohc
DEPENDS zenohd
GIT_REPOSITORY "https://github.com/eclipse-zenoh/zenoh-c.git"
GIT_TAG d1ec83dee421054bed034e0e60abc98a526bae0a # v${zenohc_VERION_REQUIRED}
GIT_REPOSITORY https://github.com/filippobrizzi/zenoh-c.git
GIT_TAG df4682bd397723a62853dae62cdf65305c08958d
# GIT_REPOSITORY "https://github.com/eclipse-zenoh/zenoh-c.git"
# GIT_TAG d1ec83dee421054bed034e0e60abc98a526bae0a # v${zenohc_VERION_REQUIRED}
GIT_SHALLOW true
CMAKE_ARGS ${EP_CMAKE_EXTRA_ARGS} -DCMAKE_VERBOSE_MAKEFILE=ON)
endif()
Expand All @@ -110,8 +112,10 @@ if(zenohcxx IN_LIST EXTERNAL_PROJECTS_LIST)
ExternalProject_Add(
zenohcxx
DEPENDS zenohc
GIT_REPOSITORY "https://github.com/eclipse-zenoh/zenoh-cpp.git"
GIT_TAG 10ced293dd72ed5ec55c36b57672e0cc21932761 # v${zenohcxx_VERION_REQUIRED}
GIT_REPOSITORY "https://github.com/filippobrizzi/zenoh-cpp.git"
GIT_TAG 457775eecc2b4fab15349464c373e59127896c28
# GIT_REPOSITORY "https://github.com/eclipse-zenoh/zenoh-cpp.git"
# GIT_TAG 10ced293dd72ed5ec55c36b57672e0cc21932761 # v${zenohcxx_VERION_REQUIRED}
GIT_SHALLOW true
SOURCE_SUBDIR install # configure the 'install' sub-project to avoid
# building zenoh-c again
Expand Down
10 changes: 5 additions & 5 deletions modules/cli/include/eolo/cli/program_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ constexpr auto ProgramDescription::defineOption(const std::string& key, char sho
}

template <StringStreamable T>
inline constexpr auto ProgramDescription::defineOption(const std::string& key, const std::string& description,
const T& default_value) -> ProgramDescription& {
constexpr auto ProgramDescription::defineOption(const std::string& key, const std::string& description,
const T& default_value) -> ProgramDescription& {
return defineOption<T>(key, '\0', description, default_value);
}

template <StringStreamable T>
inline constexpr auto ProgramDescription::defineOption(const std::string& key, char short_key,
const std::string& description,
const T& default_value) -> ProgramDescription& {
constexpr auto ProgramDescription::defineOption(const std::string& key, char short_key,
const std::string& description,
const T& default_value) -> ProgramDescription& {
checkOptionAlreadyExists(key, short_key);

options_.emplace_back(key, short_key, description, utils::getTypeName<T>(),
Expand Down
1 change: 1 addition & 0 deletions modules/ipc/examples/zenoh_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ auto main(int argc, const char* argv[]) -> int {
};
auto subscriber = eolo::ipc::subscribe<eolo::ipc::zenoh::Subscriber, eolo::types::Pose>(
session, std::move(config), std::move(cb));
(void)subscriber;

while (true) {
std::this_thread::sleep_for(std::chrono::seconds{ 1 });
Expand Down
16 changes: 8 additions & 8 deletions modules/ipc/include/eolo/ipc/zenoh/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#include "eolo/ipc/common.h"
namespace eolo::ipc::zenoh {

[[nodiscard]] inline static constexpr auto messageCounterKey() -> const char* {
[[nodiscard]] static constexpr auto messageCounterKey() -> const char* {
return "msg_counter";
}

[[nodiscard]] inline static constexpr auto sessionIdKey() -> const char* {
[[nodiscard]] static constexpr auto sessionIdKey() -> const char* {
return "session_id";
}

Expand All @@ -28,7 +28,7 @@ inline auto toString(const zenohc::Id& id) -> std::string {
[](const std::string& s, uint8_t v) { return std::format("{:02x}", v) + s; });
}

inline constexpr auto toString(const zenohc::WhatAmI& me) -> std::string_view {
constexpr auto toString(const zenohc::WhatAmI& me) -> std::string_view {
switch (me) {
case zenohc::WhatAmI::Z_WHATAMI_ROUTER:
return "Router";
Expand All @@ -39,7 +39,7 @@ inline constexpr auto toString(const zenohc::WhatAmI& me) -> std::string_view {
}
}

inline constexpr auto toString(const Mode& mode) -> std::string_view {
constexpr auto toString(const Mode& mode) -> std::string_view {
switch (mode) {
case Mode::ROUTER:
return "Router";
Expand All @@ -50,7 +50,7 @@ inline constexpr auto toString(const Mode& mode) -> std::string_view {
}
}

inline constexpr auto toMode(const zenohc::WhatAmI& me) -> Mode {
constexpr auto toMode(const zenohc::WhatAmI& me) -> Mode {
switch (me) {
case zenohc::WhatAmI::Z_WHATAMI_ROUTER:
return Mode::ROUTER;
Expand Down Expand Up @@ -95,7 +95,7 @@ inline auto toChrono(const zenohc::Timestamp& ts) -> std::chrono::nanoseconds {
}

template <typename T>
inline constexpr auto expect(std::variant<T, zenohc::ErrorMessage>&& v) -> T {
constexpr auto expect(std::variant<T, zenohc::ErrorMessage>&& v) -> T {
if (std::holds_alternative<zenohc::ErrorMessage>(v)) {
const auto msg = std::get<zenohc::ErrorMessage>(v).as_string_view();
throwException<InvalidOperationException>(std::format("zenoh error: {}", msg));
Expand All @@ -105,7 +105,7 @@ inline constexpr auto expect(std::variant<T, zenohc::ErrorMessage>&& v) -> T {
}

template <typename T>
inline constexpr auto expectAsSharedPtr(std::variant<T, zenohc::ErrorMessage>&& v) -> std::shared_ptr<T> {
constexpr auto expectAsSharedPtr(std::variant<T, zenohc::ErrorMessage>&& v) -> std::shared_ptr<T> {
if (std::holds_alternative<zenohc::ErrorMessage>(v)) {
const auto msg = std::get<zenohc::ErrorMessage>(v).as_string_view();
throwException<InvalidOperationException>(std::format("zenoh error: {}", msg));
Expand All @@ -115,7 +115,7 @@ inline constexpr auto expectAsSharedPtr(std::variant<T, zenohc::ErrorMessage>&&
}

template <typename T>
inline constexpr auto expectAsUniquePtr(std::variant<T, zenohc::ErrorMessage>&& v) -> std::unique_ptr<T> {
constexpr auto expectAsUniquePtr(std::variant<T, zenohc::ErrorMessage>&& v) -> std::unique_ptr<T> {
if (std::holds_alternative<zenohc::ErrorMessage>(v)) {
const auto msg = std::get<zenohc::ErrorMessage>(v).as_string_view();
throwException<InvalidOperationException>(std::format("zenoh error: {}", msg));
Expand Down
4 changes: 2 additions & 2 deletions modules/utils/src/version_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ static constexpr std::uint8_t VERSION_MAJOR = 0;
static constexpr std::uint8_t VERSION_MINOR = 0;
static constexpr std::uint16_t VERSION_PATCH = 0;

static constexpr std::string_view REPO_BRANCH = "github_actions";
static constexpr std::string_view REPO_BRANCH = "fix_ci";
static constexpr std::string_view BUILD_PROFILE = "Release";
static constexpr std::string_view REPO_HASH = "54ca190";
static constexpr std::string_view REPO_HASH = "b858d03";

} // namespace eolo::utils

0 comments on commit 7a18aae

Please sign in to comment.