Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Build failure on architecture without atomics #11

Open
piegamesde opened this issue Feb 6, 2022 · 5 comments
Open

Build failure on architecture without atomics #11

piegamesde opened this issue Feb 6, 2022 · 5 comments

Comments

@piegamesde
Copy link

piegamesde commented Feb 6, 2022

When I add the bitvec dependency to my embedded project (RISCV-32), I get the following compile errors:

error[E0432]: unresolved imports `core::sync::atomic::AtomicBool`, `core::sync::atomic::AtomicI8`, `core::sync::atomic::AtomicU8`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/lib.rs:44:34
   |
44 |         use core::sync::atomic::{AtomicBool, AtomicI8, AtomicU8};
   |                                  ^^^^^^^^^^  ^^^^^^^^  ^^^^^^^^ no `AtomicU8` in `sync::atomic`
   |                                  |           |
   |                                  |           no `AtomicI8` in `sync::atomic`
   |                                  no `AtomicBool` in `sync::atomic`

error[E0432]: unresolved imports `core::sync::atomic::AtomicI16`, `core::sync::atomic::AtomicU16`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/lib.rs:47:34
   |
47 |         use core::sync::atomic::{AtomicI16, AtomicU16};
   |                                  ^^^^^^^^^  ^^^^^^^^^ no `AtomicU16` in `sync::atomic`
   |                                  |
   |                                  no `AtomicI16` in `sync::atomic`

error[E0432]: unresolved imports `core::sync::atomic::AtomicI32`, `core::sync::atomic::AtomicU32`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/lib.rs:50:34
   |
50 |         use core::sync::atomic::{AtomicI32, AtomicU32};
   |                                  ^^^^^^^^^  ^^^^^^^^^ no `AtomicU32` in `sync::atomic`
   |                                  |
   |                                  no `AtomicI32` in `sync::atomic`

error[E0432]: unresolved imports `core::sync::atomic::AtomicI64`, `core::sync::atomic::AtomicU64`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/lib.rs:53:34
   |
53 |         use core::sync::atomic::{AtomicI64, AtomicU64};
   |                                  ^^^^^^^^^  ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
   |                                  |
   |                                  no `AtomicI64` in `sync::atomic`

error[E0432]: unresolved imports `core::sync::atomic::AtomicIsize`, `core::sync::atomic::AtomicPtr`, `core::sync::atomic::AtomicUsize`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/lib.rs:56:34
   |
56 |         use core::sync::atomic::{AtomicIsize, AtomicPtr, AtomicUsize};
   |                                  ^^^^^^^^^^^  ^^^^^^^^^  ^^^^^^^^^^^ no `AtomicUsize` in `sync::atomic`
   |                                  |            |
   |                                  |            no `AtomicPtr` in `sync::atomic`
   |                                  no `AtomicIsize` in `sync::atomic`

error[E0412]: cannot find type `AtomicBool` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:10:43
   |
10 |     if atomic(bool) { core::sync::atomic::AtomicBool }
   |                                           ^^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicI8` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:16:40
   |
16 |     if atomic(8) { core::sync::atomic::AtomicI8 }
   |                                        ^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicU8` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:22:40
   |
22 |     if atomic(8) { core::sync::atomic::AtomicU8 }
   |                                        ^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicI16` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:28:41
   |
28 |     if atomic(16) { core::sync::atomic::AtomicI16 }
   |                                         ^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicU16` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:34:41
   |
34 |     if atomic(16) { core::sync::atomic::AtomicU16 }
   |                                         ^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicI32` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:40:41
   |
40 |     if atomic(32) { core::sync::atomic::AtomicI32 }
   |                                         ^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicU32` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:46:41
   |
46 |     if atomic(32) { core::sync::atomic::AtomicU32 }
   |                                         ^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicI64` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:52:41
   |
52 |     if atomic(64) { core::sync::atomic::AtomicI64 }
   |                                         ^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicU64` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:58:41
   |
58 |     if atomic(64) { core::sync::atomic::AtomicU64 }
   |                                         ^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicIsize` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:64:43
   |
64 |     if atomic(size) { core::sync::atomic::AtomicIsize }
   |                                           ^^^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicUsize` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:70:43
   |
70 |     if atomic(size) { core::sync::atomic::AtomicUsize }
   |                                           ^^^^^^^^^^^ not found in `core::sync::atomic`

error[E0412]: cannot find type `AtomicPtr` in module `core::sync::atomic`
  --> $CARGO_HOME/registry/src/github.heygears.com-1ecc6299db9ec823/radium-0.7.0/src/types.rs:76:42
   |
76 |     if atomic(ptr) { core::sync::atomic::AtomicPtr<T> }
   |                                          ^^^^^^^^^ not found in `core::sync::atomic`

As far as I can tell, this crate's purpose is to deal with systems without atomics, so I'm a bit confused.

@StefanB7
Copy link

StefanB7 commented Sep 6, 2023

I am having similar issues. I am trying to use the nmea-parser crate on an ESP32-S3 board, the crate uses bitvec.
@piegamesde did you manage to sort this?

@ProfFan
Copy link

ProfFan commented Nov 6, 2023

Same here, I guess the best way out is to fork this library

@yanshay
Copy link

yanshay commented Nov 11, 2023

Same here, using it through deku on ESP32 and face the same issue.
Any, even hacky, workaround to this issue?

@myrrlyn
Copy link
Collaborator

myrrlyn commented Nov 26, 2023

I am so sorry for the long silence. I have been pretty much unable to do any F/LOSS work for the past two years due to moving and a surprise unemployment. I've gotten quite a backlog of work to chew through, but delaying won't make it any easier.


We began this crate before the compiler exposed a stable way to query for the presence of atomic symbols. The v0 series used a build script whose contents were populated by, well, me trying to compile this crate for every single target available in rustup at the time, and turning off individual types in individual targets until the errors went away. I didn't keep that list up-to-date with Rust releases or changes in the target list, so I am unfortunately not surprised that this has cropped up.

In Rust 1.65, the cfg(has_atomic = "width") gate stabilized. v1 of the library uses that to conditionally access symbols that do not always exist. Unfortunately, this happened right around the time I stopped being able to work on this project, so bitvec is still on 0.7 and doesn't use radium 1.0.

Please apply the following change to your Cargo.toml:

[patch.crates-io]
radium = "1.0"

This should force bitvec to ignore its radium 0.7 dependency in favor of the 1.0 version.

If you don't mind, can you also post the specific target name for which you are compiling? While I strive to ensure that cargo check and cargo build pass for every target available through rustup target list when I cut a release, I do not actually have infrastructure for running the test suite on foreign targets and would not be surprised if I missed something due to these blind spots.

@yanshay
Copy link

yanshay commented Nov 27, 2023

If you don't mind, can you also post the specific target name for which you are compiling? While I strive to ensure that cargo check and cargo build pass for every target available through rustup target list when I cut a release, I do not actually have infrastructure for running the test suite on foreign targets and would not be surprised if I missed something due to these blind spots.

I'm using xtensa-esp32-none-elf

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants