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

error[E0512]: cannot transmute #107

Closed
youngday opened this issue Mar 24, 2024 · 7 comments
Closed

error[E0512]: cannot transmute #107

youngday opened this issue Mar 24, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@youngday
Copy link

Describe the bug

Compiling zenoh-c v0.10.1-rc (/ /build/_deps/zenohc-build/release)
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> / /build/_deps/zenohc-src/src/lib.rs:80:26
|
80 | unsafe { std::mem::transmute::<$src_type, $dst_type>(self) }

To reproduce

when make , at zenoh-c, have an error above.

System info

amd x64 debian12

@youngday youngday added the bug Something isn't working label Mar 24, 2024
@youngday
Copy link
Author

youngday commented Mar 24, 2024

[  2%] Generating release/target/release/libzenohc.so, release/target/release/libzenohc.a
"RUSTFLAGS = $$RUSTFLAGS"
[  2%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/collections/vec.c.o
[  2%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/collections/bytes.c.o
[  2%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/collections/list.c.o
[  2%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/config/bt.c.o
[  9%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/api/api.c.o
[  9%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/config/serial.c.o
[  9%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/collections/intmap.c.o
[ 11%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/collections/string.c.o
[ 13%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/deprecated/platform.c.o
"cargo +stable build --release --manifest-path=/home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-build/release/Cargo.toml --features=logger-autoinit --features=shared-memory"
[ 13%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/config/tcp.c.o
[ 15%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/config/udp.c.o
[ 15%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/config/ws.c.o
[ 18%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/endpoint.c.o
[ 18%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/link.c.o
[ 20%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/multicast/bt.c.o
[ 20%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/multicast/udp.c.o
[ 20%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/unicast/tcp.c.o
[ 22%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/unicast/serial.c.o
[ 25%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/unicast/udp.c.o
[ 25%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/link/unicast/ws.c.o
[ 25%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/config.c.o
[ 25%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/memory.c.o
[ 27%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/primitives.c.o
[ 29%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/logger.c.o
[ 29%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/publish.c.o
[ 31%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/query.c.o
[ 31%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/session.c.o
[ 34%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/net/subscribe.c.o
[ 34%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/codec.c.o
[ 36%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/codec/core.c.o
[ 36%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/codec/declarations.c.o
[ 36%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/codec/message.c.o
[ 38%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/codec/ext.c.o
[ 38%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/codec/transport.c.o
[ 40%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/codec/network.c.o
[ 40%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/core.c.o
[ 43%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/config.c.o
[ 45%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/definitions/declarations.c.o
[ 45%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/definitions/message.c.o
[ 47%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/definitions/network.c.o
[ 47%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/definitions/transport.c.o
[ 47%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/iobuf.c.o
   Compiling proc-macro2 v1.0.67
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.1.0
   Compiling libc v0.2.153
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.4
   Compiling serde v1.0.188
   Compiling value-bag v1.4.1
   Compiling once_cell v1.18.0
   Compiling pin-project-lite v0.2.13
   Compiling memchr v2.6.3
[ 50%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/ext.c.o(build.rs), cfg-if, memchr, once_cell, value-bag, unicode-ident, autocfg, ser...
[ 52%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/protocol/keyexpr.c.o
[ 52%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/push.c.o
   Compiling futures-core v0.3.28
[ 54%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/query.c.obuild.rs), cfg-if, memchr, once_cell, value-bag, unicode-ident, autocfg, ser...
   Compiling syn v1.0.109
[ 54%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/queryable.c.od.rs), memchr, once_cell, value-bag, unicode-ident, autocfg, serde(build...
[ 56%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/reply.c.o
   Compiling spin v0.5.2
[ 59%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/rx.c.oo2(build.rs), memchr, once_cell, value-bag, spin, autocfg, serde(build.rs), fut...
[ 59%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/resource.c.o
   Compiling anyhow v1.0.75
[ 59%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/scout.c.obuild.rs), anyhow(build.rs), memchr, value-bag, spin, autocfg, serde(build.r...
[ 61%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/subscription.c.o
[ 61%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/tx.c.o
   Compiling log v0.4.20
[ 63%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/session/utils.c.obuild.rs), anyhow(build.rs), log, memchr, value-bag, spin, autocfg, serde(bu...
[ 63%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/common/lease.c.o, anyhow(build.rs), log, memchr, futures-core(build), value-bag, au...
   Compiling bytes v1.5.0
[ 63%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/common/read.c.o), anyhow(build.rs), log, memchr, serde(build), bytes, autocfg, futu...
   Compiling ppv-lite86 v0.2.17
[ 65%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/common/rx.c.ors), anyhow(build.rs), log, memchr, ppv-lite86, syn(build), bytes, aut...
[ 65%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/common/tx.c.o
   Compiling serde_json v1.0.107
   Compiling ahash v0.8.7
[ 68%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/manager.c.obuild.rs), log, memchr, ppv-lite86, bytes, serde_json(build.rs), autocfg...
   Compiling slab v0.4.9
[ 70%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/multicast/lease.c.oe86, bytes, proc-macro2(build), serde_json(build.rs), futures-co...
   Compiling crossbeam-utils v0.8.16
[ 70%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/multicast.c.opv-lite86, crossbeam-utils(build.rs), bytes, proc-macro2(build), serde...
   Compiling futures-io v0.3.28
[ 70%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/multicast/read.c.oils(build.rs), bytes, proc-macro2, serde_json(build.rs), libc, fu...
[ 72%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/multicast/rx.c.outils(build.rs), bytes, proc-macro2, serde_json(build.rs), libc, fu...
[ 72%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/multicast/transport.c.o
[ 75%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/multicast/tx.c.o
[ 77%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/raweth/link.c.o
[ 77%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/peer_entry.c.o
   Compiling lock_api v0.4.10
[ 77%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/raweth/read.c.o bytes, proc-macro2, serde_json(build.rs), libc, futures-io, libc, s...
   Compiling bitflags v1.3.2
[ 79%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/raweth/rx.c.o), bytes, proc-macro2, bitflags, libc, futures-io, libc, slab(build.rs...
   Compiling event-listener v2.5.3
[ 79%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/raweth/tx.c.oite86, crossbeam-utils(build.rs), bytes, proc-macro2, libc, libc, slab...
[ 79%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/unicast.c.o
[ 81%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/transport.c.oite86, crossbeam-utils(build.rs), bytes, proc-macro2, slab(build), lib...
   Compiling parking v2.1.0
[ 84%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/unicast/lease.c.or, ppv-lite86, bytes, proc-macro2, slab(build), libc, parking, lib...
[ 84%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/unicast/read.c.o
[ 86%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/unicast/rx.c.o
   Compiling scopeguard v1.2.0
[ 86%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/unicast/transport.c.ohr, bytes, proc-macro2, slab(build), libc, parking, libc, lock...
[ 88%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/unicast/tx.c.o
[ 88%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/transport/utils.c.o
[ 90%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/utils/checksum.c.opeguard, memchr, slab, bytes, proc-macro2, libc, parking, libc, lock_api(bu...
[ 90%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/utils/encoding.c.oopeguard, memchr, slab, bytes, proc-macro2, libc, parking, libc, ahash(build) 
[ 93%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/utils/pointers.c.o
   Compiling waker-fn v1.1.0
   Compiling fastrand v1.9.0
[ 93%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/utils/string.c.omemchr, slab, bytes, proc-macro2, waker-fn, libc, fastrand, libc, ahash(build)  
   Compiling zerocopy v0.7.32
[ 93%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/system/unix/link/raweth.c.ob, bytes, proc-macro2, waker-fn, libc, fastrand, libc, zerocopy      
   Compiling quote v1.0.33
[ 97%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/system/unix/network.c.o slab, bytes, proc-macro2, quote, libc, fastrand, libc, zerocopy         
[ 97%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/utils/uuid.c.o
   Compiling cc v1.0.83
[ 97%] Building C object _deps/zenohpico-build/CMakeFiles/zenohpico.dir/src/system/unix/system.c.o proc-macro2, quote, libc, fastrand, libc, zerocopy, cc                   
   Compiling io-lifetimes v1.0.11
   Compiling itoa v1.0.9
   Compiling concurrent-queue v2.2.0
   Compiling syn v2.0.33
   Compiling thiserror v1.0.48
   Compiling spin v0.9.8
[100%] Linking C shared library ../../lib/libzenohpico.soce_cell, crossbeam-utils, thiserror(build.rs), concurrent-queue, spin, io-lifetimes(build.rs), libc, syn, ahash,...
   Compiling futures-lite v1.13.0
   Compiling zenoh-result v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling async-lock v2.8.0
   Compiling polling v2.8.0
   Compiling lazy_static v1.4.0
   Compiling paste v1.0.14
   Compiling schemars v0.8.13
   Compiling rustix v0.37.25
   Compiling subtle v2.5.0
[100%] Built target zenohpico           ] 60/414: syn, io-lifetimes(build), paste(build.rs), schemars(build.rs), rustix(build.rs), subtle, async-lock, libc, syn, ahash, ...
   Compiling futures-sink v0.3.28
   Compiling typenum v1.16.0
   Compiling async-io v1.13.0
   Compiling generic-array v0.14.7
   Compiling pin-utils v0.1.0
   Compiling linux-raw-sys v0.3.8
   Compiling zenoh-collections v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zeroize v1.6.0
   Compiling getrandom v0.2.10
   Compiling socket2 v0.5.6
   Compiling mio v0.8.11
   Compiling num_cpus v1.16.0
   Compiling rand_core v0.6.4
   Compiling rand_chacha v0.3.1
   Compiling socket2 v0.4.9
   Compiling async-channel v1.9.0
   Compiling allocator-api2 v0.2.16
   Compiling rand v0.8.5
   Compiling async-task v4.4.0
   Compiling ryu v1.0.15
   Compiling futures-channel v0.3.28
   Compiling atomic-waker v1.1.1
   Compiling humantime v2.1.0
   Compiling hashbrown v0.14.0
   Compiling futures-task v0.3.28
   Compiling blocking v1.3.1
   Compiling async-executor v1.5.1
   Compiling futures-util v0.3.28
   Compiling signal-hook v0.3.17
   Compiling const-oid v0.9.5
   Compiling ring v0.17.6
   Compiling signal-hook-registry v1.4.1
   Compiling hashbrown v0.13.2
   Compiling memoffset v0.6.5
   Compiling async-process v1.7.0
   Compiling rustls-pki-types v1.3.1
   Compiling dyn-clone v1.0.13
   Compiling unicode-xid v0.2.4
   Compiling option-ext v0.2.0
   Compiling dirs-sys v0.4.1
   Compiling const_format_proc_macros v0.2.31
   Compiling crypto-common v0.1.6
   Compiling token-cell v1.5.0
   Compiling zenoh-buffers v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling async-trait v0.1.73
   Compiling no-std-net v0.6.0
   Compiling serde_derive_internals v0.26.0
   Compiling pnet_base v0.34.0
   Compiling keyed-set v0.4.5
   Compiling dirs v5.0.1
   Compiling nanorand v0.7.0
   Compiling pnet_sys v0.34.0
   Compiling kv-log-macro v1.0.7
   Compiling untrusted v0.9.0
   Compiling flume v0.11.0
   Compiling nix v0.23.2
   Compiling shellexpand v3.1.0
   Compiling block-buffer v0.10.4
   Compiling ring v0.16.20
   Compiling libloading v0.8.0
   Compiling home v0.5.5
   Compiling tinyvec_macros v0.1.1
   Compiling rustls v0.22.2
   Compiling tinyvec v1.6.0
   Compiling digest v0.10.7
   Compiling const_format v0.2.31
   Compiling ucd-trie v0.1.6
   Compiling libm v0.2.7
   Compiling untrusted v0.7.1
   Compiling base64 v0.21.4
   Compiling event-listener v4.0.0
   Compiling num-traits v0.2.16
   Compiling rustls v0.21.7
   Compiling equivalent v1.0.1
   Compiling cpufeatures v0.2.9
   Compiling indexmap v2.0.0
   Compiling unicode-normalization v0.1.22
   Compiling tracing-core v0.1.31
   Compiling percent-encoding v2.3.0
   Compiling byteorder v1.4.3
   Compiling base64ct v1.6.0
   Compiling httparse v1.8.0
   Compiling openssl-probe v0.1.5
   Compiling unicode-bidi v0.3.13
   Compiling bitflags v2.4.0
   Compiling pem-rfc7468 v0.7.0
   Compiling schemars_derive v0.8.13
   Compiling unzip-n v0.1.2
   Compiling form_urlencoded v1.2.0
   Compiling rustls-pemfile v1.0.3
   Compiling idna v0.4.0
   Compiling num-integer v0.1.45
   Compiling serde_derive v1.0.188
   Compiling tokio-macros v2.2.0
   Compiling thiserror-impl v1.0.48
   Compiling futures-macro v0.3.28
   Compiling shared_memory v0.12.4
   Compiling tracing-attributes v0.1.26
   Compiling validated_struct_macros v2.1.0
   Compiling tokio v1.36.0
   Compiling unsafe-libyaml v0.2.10
   Compiling fnv v1.0.7
   Compiling http v1.0.0
   Compiling url v2.4.1
   Compiling rustls-native-certs v0.6.3
   Compiling der v0.7.8
   Compiling pest v2.7.3
   Compiling tracing v0.1.37
   Compiling sha1 v0.10.5
   Compiling rustls-pemfile v2.0.0
   Compiling pest_meta v2.7.3
   Compiling aho-corasick v1.0.5
   Compiling num-iter v0.1.43
   Compiling regex-syntax v0.7.5
   Compiling semver v1.0.18
   Compiling utf-8 v0.7.6
   Compiling data-encoding v2.4.0
   Compiling rustc-hash v1.1.0
   Compiling pest_generator v2.7.3
   Compiling futures-executor v0.3.28
   Compiling tungstenite v0.21.0
   Compiling futures v0.3.28
   Compiling rustls-webpki v0.101.5
   Compiling sct v0.7.0
   Compiling async-global-executor v2.3.1
   Compiling zenoh-runtime v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-core v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling async-std v1.12.0
   Compiling tokio-util v0.7.10
   Compiling zenoh-sync v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling pest_derive v2.7.3
   Compiling regex-automata v0.3.8
   Compiling spki v0.7.2
   Compiling ipnetwork v0.20.0
   Compiling uhlc v0.6.3
   Compiling zenoh-shm v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling pnet_datalink v0.34.0
   Compiling json5 v0.4.1
   Compiling serde_yaml v0.9.25
   Compiling secrecy v0.8.0
   Compiling validated_struct v2.1.0
   Compiling quinn-udp v0.4.1
   Compiling zenoh-util v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling quinn-proto v0.10.4
   Compiling zenoh-keyexpr v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling rustls-webpki v0.102.2
   Compiling inout v0.1.3
   Compiling indexmap v1.9.3
   Compiling zenoh-protocol v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling proc-macro-hack v0.5.20+deprecated
   Compiling rustix v0.38.32
   Compiling num-bigint-dig v0.8.4
   Compiling cipher v0.4.4
   Compiling regex v1.9.5
   Compiling tokio-rustls v0.24.1
   Compiling pkcs8 v0.10.2
   Compiling tokio-tungstenite v0.21.0
   Compiling zenoh-codec v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-config v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling quinn v0.10.2
   Compiling rustls-native-certs v0.7.0
   Compiling nix v0.27.1
   Compiling webpki-roots v0.26.0
   Compiling uuid v1.4.1
   Compiling tokio-rustls v0.25.0
   Compiling utf8parse v0.2.1
   Compiling hashbrown v0.12.3
   Compiling keccak v0.1.4
   Compiling linux-raw-sys v0.4.13
   Compiling zenoh-link-commons v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling os_str_bytes v6.6.1
   Compiling zenoh-macros v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling smallvec v1.11.0
   Compiling static_assertions v1.1.0
   Compiling twox-hash v1.6.3
   Compiling zenoh-link-tcp v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-link-ws v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-link-unixsock_stream v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-link-udp v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-link-tls v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-link-quic v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling clap_lex v0.2.4
   Compiling sha3 v0.10.8
   Compiling anstyle-parse v0.2.1
   Compiling rustc_version v0.4.0
   Compiling pkcs1 v0.7.5
   Compiling aes v0.8.3
   Compiling hmac v0.12.1
   Compiling signature v2.1.0
   Compiling atty v0.2.14
   Compiling strsim v0.10.0
   Compiling cbindgen v0.24.5
   Compiling fastrand v2.0.1
   Compiling textwrap v0.16.1
   Compiling termcolor v1.4.1
   Compiling cache-padded v1.3.0
   Compiling anstyle-query v1.0.0
   Compiling colorchoice v1.0.0
   Compiling anstyle v1.0.6
   Compiling array-init v2.1.0
   Compiling git-version-macro v0.3.5
   Compiling ringbuffer-spsc v0.1.9
   Compiling clap v3.2.25
   Compiling anstream v0.6.12
   Compiling tempfile v3.10.1
   Compiling rsa v0.9.2
   Compiling zenoh-crypto v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-link v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling lz4_flex v0.11.1
   Compiling env_filter v0.1.0
   Compiling toml v0.5.11
   Compiling heck v0.4.1
   Compiling fixedbitset v0.4.2
   Compiling zenoh-plugin-trait v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling zenoh-transport v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
   Compiling petgraph v0.6.4
   Compiling env_logger v0.11.2
   Compiling git-version v0.3.5
   Compiling ordered-float v4.1.1
   Compiling stop-token v0.7.0
   Compiling fs2 v0.4.3
   Compiling vec_map v0.8.2
   Compiling bincode v1.3.3
   Compiling iana-time-zone v0.1.57
   Compiling is-terminal v0.4.9
   Compiling env_logger v0.10.2
   Compiling chrono v0.4.35
   Compiling zenoh-c v0.11.0-dev (/home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-build/release)
   Compiling zenoh-ext v0.11.0-dev (https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a264558)
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
  --> /home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-src/src/lib.rs:86:26
   |
86 |                 unsafe { std::mem::transmute::<$src_type, $dst_type>(self) }
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-src/src/get.rs:63:1
   |
63 | impl_guarded_transmute!(ReplyInner, z_owned_reply_t);
   | ---------------------------------------------------- in this macro invocation
   |
   = note: source type: `Option<zenoh::query::Reply>` (1920 bits)
   = note: target type: `get::z_owned_reply_t` (1792 bits)
   = note: this error originates in the macro `impl_guarded_transmute` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0512`.
error: could not compile `zenoh-c` (lib) due to 1 previous error
make[2]: *** [_deps/zenohc-build/CMakeFiles/cargo.dir/build.make:111: _deps/zenohc-build/release/target/release/libzenohc.so] Error 101
make[1]: *** [CMakeFiles/Makefile2:277: _deps/zenohc-build/CMakeFiles/cargo.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
(base) youngday@192:~/prj-cpp/zenoh-cpp/build$ make -j10
[  2%] Generating release/target/release/libzenohc.so, release/target/release/libzenohc.a
[100%] Built target zenohpico
"RUSTFLAGS = $$RUSTFLAGS"
"cargo +stable build --release --manifest-path=/home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-build/release/Cargo.toml --features=logger-autoinit --features=shared-memory"
   Compiling zenoh-c v0.11.0-dev (/home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-build/release)
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
  --> /home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-src/src/lib.rs:86:26
   |
86 |                 unsafe { std::mem::transmute::<$src_type, $dst_type>(self) }
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/youngday/prj-cpp/zenoh-cpp/build/_deps/zenohc-src/src/get.rs:63:1
   |
63 | impl_guarded_transmute!(ReplyInner, z_owned_reply_t);
   | ---------------------------------------------------- in this macro invocation
   |
   = note: source type: `Option<zenoh::query::Reply>` (1920 bits)
   = note: target type: `get::z_owned_reply_t` (1792 bits)
   = note: this error originates in the macro `impl_guarded_transmute` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0512`.
error: could not compile `zenoh-c` (lib) due to 1 previous error
make[2]: *** [_deps/zenohc-build/CMakeFiles/cargo.dir/build.make:111: _deps/zenohc-build/release/target/release/libzenohc.so] Error 101
make[1]: *** [CMakeFiles/Makefile2:277: _deps/zenohc-build/CMakeFiles/cargo.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

@Mallets
Copy link
Member

Mallets commented Mar 25, 2024

See eclipse-zenoh/zenoh-c#295

@Mallets
Copy link
Member

Mallets commented Mar 25, 2024

@youngday I assume are you compiling it with rust 1.77, am I correct?
Due to the latest changes introduced by rust 1.77, zenoh-0.10.10-rc does not compile anymore. Therefore, it is necessary to use a rust version <=1.76.

@youngday
Copy link
Author

my compile env:debian 12 x64 ,amd, gcc 12
rustup default 1.76 and 1.75, not passed.
just compile zenoh-c 0.10.1

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
  --> src/lib.rs:80:26
   |
80 |                 unsafe { std::mem::transmute::<$src_type, $dst_type>(self) }
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: src/get.rs:63:1
   |
63 | impl_guarded_transmute!(ReplyInner, z_owned_reply_t);
   | ---------------------------------------------------- in this macro invocation
   |
   = note: source type: `Option<zenoh::query::Reply>` (1920 bits)
   = note: target type: `get::z_owned_reply_t` (1792 bits)
   = note: this error originates in the macro `impl_guarded_transmute` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0512`.
error: could not compile `zenoh-c` (lib) due to 1 previous error
make[2]: *** [CMakeFiles/cargo.dir/build.make:105: /home/youngday/prj-rust/zenoh-c/target/release/libzenohc.so] Error 101
make[1]: *** [CMakeFiles/Makefile2:180: CMakeFiles/cargo.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@youngday
Copy link
Author

test ok ,zenoh-c 's git check point,

Fix alignment and layout for z_owned_reply_t 

align issues.

@youngday
Copy link
Author

Thanks!, continue zenoh .

@Mallets
Copy link
Member

Mallets commented Mar 25, 2024

You can also set the rust version to a specific one via cmake ../build -DZENOH_CARGO_CHANNEL=1.76.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants