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

Add no_std support #277

Merged
merged 1 commit into from
Jun 5, 2022
Merged

Add no_std support #277

merged 1 commit into from
Jun 5, 2022

Conversation

mcroad
Copy link
Contributor

@mcroad mcroad commented Oct 31, 2021

Closes #201. Related to bitcoindevkit/bdk#205

Not ready.

Maintains backward compatibility. To use it in a no_std context set default-features = false and enable the no-std feature.

To the maintainers: I added the no-std-compat crate. It wraps core and hashbrown and makes them look like std. This is a different than what rust-bitcoin did. They use core and hashbrown directly. I believe using no-std-compat makes the code more readable. I'd like to hear your thoughts on this. Now using hashbrown and core directly.

@mcroad
Copy link
Contributor Author

mcroad commented Oct 31, 2021

I need help getting the rust 1.29.0 tests to pass. Specific test here: https://github.com/mcroad/rust-miniscript/runs/4061570991.

Run ./contrib/test.sh
+ FEATURES=compiler rand use-serde
+ [ -n  ]
+ [  = true ]
+ [  = true ]
+ cargo test --verbose
 Downloading bitcoin v0.27.1
 Downloading no-std-compat v0.4.1
error: unable to get packages from source

Caused by:
  failed to parse manifest at `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/no-std-compat-0.4.1/Cargo.toml`

Caused by:
  editions are unstable

Caused by:
  feature `edition` is required

this Cargo does not support nightly features, but if you
switch to nightly channel you can add
`cargo-features = ["edition"]` to enable this feature
Error: Process completed with exit code 101.

I'm not familiar enough with this version of rust to debug it.

@sanket1729
Copy link
Member

I think this is because no-std-compat does not support rust 1.29 :(. I am not well versed with embedded code, maybe that is the reason why rust-bitcoin uses the underlying crates directly?

@mcroad
Copy link
Contributor Author

mcroad commented Nov 13, 2021

Removed the no-std-compat. All test pass. Waiting on rust-bitcoin/rust-bitcoin#637 to be released and for an answer regarding no_std MSRV rust-bitcoin/rust-bitcoin#690.

Please approve CI workflow.

@sanket1729
Copy link
Member

Sorry, Github is annoying for first-time contributors.

@apoelstra
Copy link
Member

Approved the github workflow.

apoelstra added a commit to rust-bitcoin/rust-bitcoin that referenced this pull request Apr 30, 2022
7854bd7 Fix `no_std` MSRV Fixes #690, #947 (mcroad)

Pull request description:

  `rust-bitcoin` does not work with rust 1.29 under a `no_std` environment. This could be considered a bug. However, `no_std` support is a recent addition and this is likely not breaking anyone's builds.

  A decision needs to be made, either `no_std` MSRV is the current stable version while keeping the `std` MSRV as 1.29, or it needs to be fixed.

  This pr adds `no_std` to the 1.29 test suite.

  This came as I try to get rust-bitcoin/rust-miniscript#277 working and got stuck on the issue of testing `no_std` under 1.29.

ACKs for top commit:
  Kixunil:
    ACK 7854bd7
  tcharding:
    ACK 7854bd7
  sanket1729:
    ACK 7854bd7
  apoelstra:
    ACK 7854bd7

Tree-SHA512: 1614fb2193f760ed340592bdb94d076066f6f783bc1dc2b145d97f7151a28316e56b1975f1ad948460eb26db04e7e9382e60076686a681e46dcf33521fda5fca
@mcroad
Copy link
Contributor Author

mcroad commented May 1, 2022

Last 2 items on the checklist are done. Will squash and rebase on master.

@mcroad mcroad force-pushed the master branch 2 times, most recently from e603e44 to da43e40 Compare May 2, 2022 01:07
@mcroad
Copy link
Contributor Author

mcroad commented May 2, 2022

@apoelstra Given rust-bitcoin moved it's MSRV to 1.41.1, will rust-miniscript follow suit?

@sanket1729 sanket1729 marked this pull request as ready for review May 2, 2022 23:33
@sanket1729
Copy link
Member

@mcroad, we just moved to 2018 and this PR now has lots of conflicts. Sorry about that.

@mcroad
Copy link
Contributor Author

mcroad commented May 3, 2022

Just rebased. Still working on the PR. It's not ready for review.

@mcroad mcroad force-pushed the master branch 2 times, most recently from 778e65e to f8855d1 Compare May 3, 2022 03:10
@mcroad
Copy link
Contributor Author

mcroad commented May 3, 2022

All test pass but PR will not be final until rust-bitcoin/rust-bitcoin#690 is released.

https://github.com/mcroad/rust-miniscript/actions/runs/2261662000

Until then, I await your comments on the PR as it is.

src/lib.rs Outdated Show resolved Hide resolved
@sanket1729
Copy link
Member

Sorry about this, but this would face a lot of conflicts because of our move to 2018. We can focus on getting no-std in rust-miniscript now that it is released in rust-bitcoin.

@mcroad mcroad force-pushed the master branch 7 times, most recently from 2af2fc9 to c1d4345 Compare May 22, 2022 21:33
@mcroad
Copy link
Contributor Author

mcroad commented May 22, 2022

Rebased and finally got tests to pass.

@sanket1729
Copy link
Member

@mcroad Really sorry again for the conflicts. I will put this on top of my review list so that there are no more conflicts after this one

@mcroad mcroad force-pushed the master branch 8 times, most recently from 3f8d447 to 28d304e Compare May 28, 2022 05:18
@mcroad
Copy link
Contributor Author

mcroad commented May 28, 2022

Rebased again.

src/lib.rs Show resolved Hide resolved
apoelstra
apoelstra previously approved these changes May 30, 2022
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 28d304e

I'm a little sad to see that we can no longer compile without default features, but I guess that's been true of rust-bitcoin for a long time, so c'est la vie.

Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. We can address the comments in a follow PR if required.

I have zero expirience in no-std development. I just tried to follow the instructions to build the no-std build. Initially, I could not get it to build and tried to mimic the CI. Installing the rust-src component seemed to do the trick. Should we also that in the README?

I ran into a linker error:

sanket1729:~/rust-miniscript/embedded$ echo $RUSTFLAGS
-C link-arg=-Tlink.x

sanket1729:~/rust-miniscript/embedded$ echo $CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER
qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel

sanket1729:~/rust-miniscript/embedded$ cargo run +nightly --target thumbv7m-none-eabi
Compiling typenum v1.15.0
Compiling cortex-m v0.7.4
Compiling proc-macro2 v1.0.39
Compiling libc v0.2.126
Compiling memchr v2.5.0
Compiling syn v1.0.95
Compiling cortex-m-rt v0.6.15
Compiling cortex-m v0.6.7
error: linking with cc failed: exit status: 1
= note: "cc" "-m64" "/tmp/rustcu8JyXT/symbols.o" "/home/sanket1729/rust-miniscript/embedded/target/debug/build/cortex-m-78cb07deae82bed4/build_script_build-78cb07deae82bed4.build_script_build.2257045c-cgu.0.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/debug/build/cortex-m-78cb07deae82bed4/build_script_build-78cb07deae82bed4.build_script_build.2257045c-cgu.1.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/debug/build/cortex-m-78cb07deae82bed4/build_script_build-78cb07deae82bed4.build_script_build.2257045c-cgu.10.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/debug/build/cortex-m-78cb07deae82bed4/build_script_build-78cb07deae82bed4.build_script_build.2257045c-cgu.11.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/debug/build/cortex-m-78cb07deae82bed4/build_script_build-78cb07deae82bed4.build_script_build.2257045c-cgu.12.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/debug/build/cortex-m-78cb07deae82bed4/build_script_build-78cb07deae82bed4.build

Probably, something else might be off in my system because the following works 🤷

RUSTFLAGS=$RUSTFLAGS CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER=$CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER cargo run --target thumbv7m-none-eabi --release
Finished release [optimized + debuginfo] target(s) in 0.02s

  1. I am also not able to build this in debug mode (without the --release flag). Is this expected?

Compiling embedded v0.1.0 (/home/sanket1729/rust-miniscript/embedded)
error: linking with rust-lld failed: exit status: 1
|
= note: "rust-lld" "-flavor" "gnu" "/tmp/rustc90zJr1/symbols.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1a4vfh3jry9qhmtf.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1aoq3x7wmhn8n29u.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1b8rm12f45qaldm2.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1h6zyj1rmnpmfcoi.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1itggcb0fccfedej.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1k8nddveuc69crrg.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1kuhmdd5hcuxpir8.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1lc2im5g0e0lu66d.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1nam0vrwxtu0s903.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1pzhzutagmqjg64z.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1u7uty6l4hxvj89p.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1u9ph96gmb8vymbh.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.1uel84j51kktbvcm.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.23c0uin0qhigctw.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.24eq9zezcp1zrsmt.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.251oqgzfi9t5az0y.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.2a6qgbkabaaclpvc.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.2j7gbbp2u9sykfgo.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.2k8irx23kmk13rk6.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.2r9whzo63erlzygp.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.2x525qruyaeln3nr.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3b5k6z5sphn7j3pl.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3bv8lgwtl141o5pj.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3m75df4qbs5wjltp.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3n3eeumeiyxvb2mo.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3nkoszhj0sxtzc94.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3qjzqm0l32uclc5z.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3s0ohddi4j5jayga.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3sh0l8v86dqb6k25.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.439wmgcig5q70hpt.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.456gzcon6482dqlt.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.48ycblph89kak52b.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4dkbcmqoteiqjb9r.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4eob32fyhrzpmg0a.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4ernbojsis0t20rg.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4hnu9bhv3y9syh5g.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4o58r3nx75v3a8b2.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4oqndp04mbr4zwx6.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4t6q0gvit5vmtqh2.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4v9i8wqsssropkr7.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.4z58clcdwpuno69g.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.512qk1ak5bimee9p.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.51aupj3hj8733ih0.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.5b5q4lecv8en8ted.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.5buru3ykyz9m97sh.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.5cjlfujuitjcc6cv.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.cgvhk5ocpbte80m.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.egkotks9bo7ddef.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.g51hkg8i617m5wd.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.gk60olq4xfsfvq6.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.ijujnka561m924c.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.xzuqetkl9uhq6et.rcgu.o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788.3c6nn0krnharmlvm.rcgu.o" "--as-needed" "-L" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps" "-L" "/home/sanket1729/rust-miniscript/embedded/target/debug/deps" "-L" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/build/cortex-m-aeea63aea6ffdc2f/out" "-L" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/build/cortex-m-rt-076aecb144ce0d41/out" "-L" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/build/cortex-m-semihosting-a68a8a89ca250f7f/out" "-L" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/build/secp256k1-sys-1d469d5bff022d46/out" "-L" "/home/sanket1729/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib" "-Bstatic" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libminiscript-bc8f8ca73da25eca.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libbitcoin-ec03fc4a63c88d70.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libhashbrown-2288f4321118a88f.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libahash-6cc44301a08b6cd7.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libbech32-990ecd751650535e.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libsecp256k1-ad59a94bc87e11e8.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libsecp256k1_sys-c03b8d37363bd6ad.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libbitcoin_hashes-16d8139e1876d7d7.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libcore2-b53703a46090b77a.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libhashbrown-9c86b8600d94aec9.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libahash-2e4b8b19a0c5ef7f.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libcortex_m_semihosting-424ad78302277fc2.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libcortex_m_rt-367afd52f356e9af.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libr0-777d267c3f5e883a.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libcortex_m-58c69b609c826e0c.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libaligned-efb924f7f569df32.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libas_slice-7cc634893bc17dca.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libstable_deref_trait-659fd4fc938e6d63.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libgeneric_array-f32408a42fd0c608.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libgeneric_array-48c0a4d35713388a.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libgeneric_array-2acafc3aedb05a8a.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libtypenum-6293bcb1e7be9b07.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/liballoc_cortex_m-902a7616d29b0ddc.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/liblinked_list_allocator-a436f22cf48dfc61.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libcortex_m-9a6749038f6e8315.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libembedded_hal-be2cd19e255d0054.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libvoid-c3ac384dc77c7432.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libnb-44e1f3fb8154762e.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libnb-d2fd7374c8472436.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libvolatile_register-31350fb3fd26a60d.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libvcell-5928b0c31e98c32b.rlib" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/libbare_metal-2ebd85282e1bb3be.rlib" "/home/sanket1729/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/liballoc-b1f8a41d3c5b29df.rlib" "/home/sanket1729/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/librustc_std_workspace_core-ba626387a2e50982.rlib" "/home/sanket1729/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/libcore-bc639632082e340c.rlib" "/home/sanket1729/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib/libcompiler_builtins-87b489c55aae9c9f.rlib" "-Bdynamic" "--eh-frame-hdr" "-znoexecstack" "-L" "/home/sanket1729/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7m-none-eabi/lib" "-o" "/home/sanket1729/rust-miniscript/embedded/target/thumbv7m-none-eabi/debug/deps/embedded-46e018162ba49788" "--gc-sections" "-Tlink.x"
= note: rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 263 bytes
rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 274 bytes
rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 276 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 276 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 276 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 280 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 284 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 288 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 288 bytes
rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 263 bytes
rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 274 bytes
rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 276 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 276 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 276 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 280 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 284 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 288 bytes
rust-lld: error: section '.data' will not fit in region 'FLASH': overflowed by 288 bytes
rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 263 bytes
rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 274 bytes
rust-lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

error: could not compile embedded due to previous error

sanket1729
sanket1729 previously approved these changes Jun 1, 2022
Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 28d304e

@sanket1729
Copy link
Member

@mcroad, really sorry for the last time. This has conflicts again. After your next rebase, we can merge this and address the issues in follow-up PRs.

@mcroad
Copy link
Contributor Author

mcroad commented Jun 5, 2022

Rebased and documented no_std Mutex stub.

Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK ac16e05

@sanket1729
Copy link
Member

Reviewed the range-diff. Merging this to avoid further conflicts. @mcroad, can you please clarify if the debug build is supposed to fail as mentioned in my comment above?

@sanket1729 sanket1729 merged commit ea76eb1 into rust-bitcoin:master Jun 5, 2022
@mcroad
Copy link
Contributor Author

mcroad commented Jun 6, 2022

The debug build fails because the produced binary is too big to fit within 2048K limit defined in embedded/memory.x. As I continue to explore and use rust-miniscript in embedded contexts, I may submit another PR to further optimize the build to produce smaller binaries.

Thanks to all who reviewed this PR.

ChallengeDev210 pushed a commit to ChallengeDev210/rust-bitcoin that referenced this pull request Aug 1, 2022
… under 1.29 (MSRV)

7854bd7 Fix `no_std` MSRV Fixes #690, #947 (mcroad)

Pull request description:

  `rust-bitcoin` does not work with rust 1.29 under a `no_std` environment. This could be considered a bug. However, `no_std` support is a recent addition and this is likely not breaking anyone's builds.

  A decision needs to be made, either `no_std` MSRV is the current stable version while keeping the `std` MSRV as 1.29, or it needs to be fixed.

  This pr adds `no_std` to the 1.29 test suite.

  This came as I try to get rust-bitcoin/rust-miniscript#277 working and got stuck on the issue of testing `no_std` under 1.29.

ACKs for top commit:
  Kixunil:
    ACK 7854bd7
  tcharding:
    ACK 7854bd7
  sanket1729:
    ACK 7854bd7
  apoelstra:
    ACK 7854bd7

Tree-SHA512: 1614fb2193f760ed340592bdb94d076066f6f783bc1dc2b145d97f7151a28316e56b1975f1ad948460eb26db04e7e9382e60076686a681e46dcf33521fda5fca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no_std support
3 participants