Skip to content

Commit

Permalink
[eclipse-iceoryx#349] Mitigate issue where Bazel sets the env variabl…
Browse files Browse the repository at this point in the history
…es CARGO_PKG_VERSION_{MAJOR|MINOR|PATCH} all to 0 by setting them to u16::MAX
  • Loading branch information
elfenpiff committed Oct 16, 2024
1 parent 80237bc commit 7f662b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 11 additions & 4 deletions iceoryx2-bb/elementary/src/package_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,17 @@ impl PackageVersion {
.and_then(|s| s.parse::<u16>().ok())
.unwrap_or(u16::MAX);

PACKAGE_VERSION.store(
PackageVersion::from_version(major, minor, patch).0,
Ordering::Relaxed,
);
if major == 0 && minor == 0 && patch == 0 {
PACKAGE_VERSION.store(
PackageVersion::from_version(u16::MAX, u16::MAX, u16::MAX).0,
Ordering::Relaxed,
);
} else {
PACKAGE_VERSION.store(
PackageVersion::from_version(major, minor, patch).0,
Ordering::Relaxed,
);
}
}

PackageVersion::from_u64(PACKAGE_VERSION.load(Ordering::Relaxed))
Expand Down
2 changes: 0 additions & 2 deletions iceoryx2-ffi/cxx/tests/src/service_event_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <cstdlib>

#include "iox2/log.hpp"
#include "iox2/node.hpp"
#include "iox2/node_name.hpp"
#include "iox2/service.hpp"
Expand Down Expand Up @@ -138,7 +137,6 @@ TYPED_TEST(ServiceEventTest, open_fails_with_incompatible_max_listeners_requirem
}

TYPED_TEST(ServiceEventTest, open_or_create_service_does_exist) {
iox2::set_log_level(LogLevel::TRACE);
constexpr ServiceType SERVICE_TYPE = TestFixture::TYPE;

const auto service_name = iox2_testing::generate_service_name();
Expand Down

0 comments on commit 7f662b9

Please sign in to comment.