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

[Feature]: support for esp32 / 32 bit applications #2419

Open
gb6881 opened this issue Dec 12, 2024 · 2 comments
Open

[Feature]: support for esp32 / 32 bit applications #2419

gb6881 opened this issue Dec 12, 2024 · 2 comments
Labels
enhancement New feature or request triage:todo Needs to be traiged.

Comments

@gb6881
Copy link

gb6881 commented Dec 12, 2024

Related Problems?

i wanted to use opentelemetry on a ESP32, but the sdk won't compile

  --> /Users/gb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opentelemetry_sdk-0.27.1/src/metrics/internal/mod.rs:12:37
   |
12 | use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, AtomicUsize, Ordering};
   |                                     ^^^^^^^^^  ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
   |                                     |
   |                                     no `AtomicI64` in `sync::atomic`
   |
help: a similar name exists in the module
   |
12 | use std::sync::atomic::{AtomicBool, AtomicI32, AtomicU64, AtomicUsize, Ordering};
   |                                     ~~~~~~~~~
help: a similar name exists in the module
   |
12 | use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU32, AtomicUsize, Ordering};

Describe the solution you'd like:

it would be great to be able to use it :)

Considered Alternatives

No response

Additional Context

No response

@gb6881 gb6881 added enhancement New feature or request triage:todo Needs to be traiged. labels Dec 12, 2024
@lalitb
Copy link
Member

lalitb commented Dec 12, 2024

@gb6881 Can you check if #2301 fixes the issue?

@gb6881
Copy link
Author

gb6881 commented Dec 12, 2024

that was quick :)

if i add target_arch = "xtensa" to the preprocesor instructions that seems to work for me

From d93d254dec0a4d2e83fab73819c1972df5f39eaf Mon Sep 17 00:00:00 2001
Date: Thu, 12 Dec 2024 11:02:44 +0100
Subject: [PATCH] support xtensa as well

---
 opentelemetry-sdk/Cargo.toml                  | 2 +-
 opentelemetry-sdk/src/metrics/internal/mod.rs | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/opentelemetry-sdk/Cargo.toml b/opentelemetry-sdk/Cargo.toml
index 602860e5..88345fb7 100644
--- a/opentelemetry-sdk/Cargo.toml
+++ b/opentelemetry-sdk/Cargo.toml
@@ -30,7 +30,7 @@ tokio-stream = { workspace = true, optional = true }
 http = { workspace = true, optional = true }
 tracing = {workspace = true, optional = true}

-[target.'cfg(any(target_arch = "powerpc", target_arch = "mips"))'.dependencies]
+[target.'cfg(any(target_arch = "powerpc", target_arch = "mips", target_arch = "xtensa"))'.dependencies]
 portable-atomic = {workspace = true}

 [package.metadata.docs.rs]
diff --git a/opentelemetry-sdk/src/metrics/internal/mod.rs b/opentelemetry-sdk/src/metrics/internal/mod.rs
index 1bc260f7..da0f66fb 100644
--- a/opentelemetry-sdk/src/metrics/internal/mod.rs
+++ b/opentelemetry-sdk/src/metrics/internal/mod.rs
@@ -18,10 +18,10 @@ pub(crate) use exponential_histogram::{EXPO_MAX_SCALE, EXPO_MIN_SCALE};
 use once_cell::sync::Lazy;
 use opentelemetry::{otel_warn, KeyValue};

-#[cfg(any(target_arch = "mips", target_arch = "powerpc"))]
+#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa"))]
 use portable_atomic::{AtomicBool, AtomicI64, AtomicU64, AtomicUsize};

-#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
+#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa")))]
 use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, AtomicUsize};

 use crate::metrics::AttributeSet;
--
2.47.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage:todo Needs to be traiged.
Projects
None yet
Development

No branches or pull requests

2 participants