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

Can't get pest to compile for thumbv7em-none-eabihf target #795

Closed
seanybaggins opened this issue Feb 10, 2023 · 6 comments
Closed

Can't get pest to compile for thumbv7em-none-eabihf target #795

seanybaggins opened this issue Feb 10, 2023 · 6 comments
Labels

Comments

@seanybaggins
Copy link

Describe the bug
Can't get pest to compile for thumbv7em-none-eabihf target.

To Reproduce

  1. clone the repo
  2. Make sure you have the thumbv7em-none-eabihf target on your toolchain by using the following command
rustup target add aarch64-linux-android
  1. Try to build
cargo build --target thumbv7em-none-eabihf --no-default-features

Expected behavior
The library to build with no compiler errors.

Looks like dependencies are still looking for std.

Actual Behavior

   Compiling once_cell v1.17.0
   Compiling bytes v1.4.0
   Compiling ucd-trie v0.1.5
   Compiling memchr v2.5.0
   Compiling socket2 v0.4.7
   Compiling openssl-sys v0.9.80
   Compiling mio v0.8.5
   Compiling futures-core v0.3.26
   Compiling num_cpus v1.15.0
   Compiling fnv v1.0.7
   Compiling thiserror v1.0.38
   Compiling slab v0.4.7
   Compiling futures-task v0.3.26
   Compiling hashbrown v0.12.3
   Compiling pest_meta v2.5.5 (/home/demo/forks/pest/meta)
   Compiling native-tls v0.2.11
error[E0583]: file not found for module `sys`
   --> /home/demo/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.7/src/lib.rs:124:1
    |
124 | mod sys;
    | ^^^^^^^^
    |
    = help: to create the module `sys`, create file "/home/demo/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.7/src/sys.rs" or "/home/demo/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.7/src/sys/mod.rs"

error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7em-none-eabihf` target may not support the standard library
  = note: `std` is required by `ucd_trie` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

...
@tomtau
Copy link
Contributor

tomtau commented Feb 11, 2023

native-tls is a dependency of reqwest; so that's likely due to this new feature in pest_debugger: #779 by @Jamalam360

@seanybaggins do you need to compile pest_debugger CLI for thumbv7em-none-eabihf or pest (or other crates) are fine? If the latter, perhaps you can try cargo build --target thumbv7em-none-eabihf --no-default-features -p pest (or whichever crate is needed, besides pest_debugger)?

if the former, maybe we can feature-guard that version check in pest_debugger?

@Jamalam360
Copy link
Contributor

Making it a default feature that can therefore be disabled does sound like a good thing to do

@seanybaggins
Copy link
Author

@tomtau
cargo build --target thumbv7em-none-eabihf --no-default-features -p pest works.

cargo build --target thumbv7em-none-eabihf --no-default-features -p pest_derive does not work.

cargo build --target thumbv7em-none-eabihf --no-default-features -p pest_derive
   Compiling syn v1.0.107
   Compiling ucd-trie v0.1.5
   Compiling once_cell v1.17.0
   Compiling thiserror v1.0.38
   Compiling pest_meta v2.5.5 (/home/demo/forks/pest/meta)
error: failed to run custom build command for `pest_meta v2.5.5 (/home/demo/forks/pest/meta)`

Caused by:
  process didn't exit successfully: `/home/demo/forks/pest/target/debug/build/pest_meta-7a0831d7849d17e7/build-script-build` (exit status: 101)
  --- stdout
  rerun-if-changed=src/grammar.pest
  Bootstrapping `meta/src/grammar.rs`

  --- stderr
  thread 'main' panicked at 'Bootstrap failed because no bootstrap executable was found. Please run `cargo build --package pest_bootstrap` or `cargo bootstrap` and then try again.', meta/build.rs:50:21
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
cargo build --target thumbv7em-none-eabihf --no-default-features -p pest_bootstrap
   Compiling syn v1.0.107
   Compiling proc-macro2 v1.0.51
   Compiling unicode-ident v1.0.6
   Compiling quote v1.0.23
   Compiling ucd-trie v0.1.5
   Compiling once_cell v1.17.0
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7em-none-eabihf` target may not support the standard library
  = note: `std` is required by `ucd_trie` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

@tomtau
Copy link
Contributor

tomtau commented Feb 14, 2023

'Bootstrap failed because no bootstrap executable was found. Please run cargo build --package pest_bootstrap or cargo bootstrap and then try again.'

@seanybaggins did you run the bootstrap first?

@tomtau
Copy link
Contributor

tomtau commented Feb 14, 2023

you can run the bootstrap without --target thumbv7em-none-eabihf

@tomtau
Copy link
Contributor

tomtau commented Mar 4, 2023

I just tried:

✗ cargo bootstrap
...
✗ cargo build --target thumbv7em-none-eabihf --no-default-features -p pest_derive
   Compiling pest_meta v2.5.5 (.../pest/meta)
   Compiling pest_generator v2.5.5 (.../pest/generator)
   Compiling pest_derive v2.5.5 (.../pest/derive)
    Finished dev [unoptimized + debuginfo] target(s) in 1.57s

for feature-guarding pest_debugger, I find that it'd also need changing pest_vm etc. I'll add a note to docs about the no_std support -- if there's a need to support no_std on pest crates that currently don't support it (like pest_vm or pest_meta), feel free to open an issue for it

@tomtau tomtau closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2023
tomtau pushed a commit to tomtau/pest that referenced this issue Mar 4, 2023
tomtau added a commit that referenced this issue Mar 5, 2023
ref: #795 (comment)

Co-authored-by: Tomas Tauber <me@tomtau.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants