AdinAck / cargo-embassy

Command line tool for creating Embassy projects.
GNU General Public License v3.0
15 stars 7 forks source link

bug: Installation Issue on Linux #22

Open ismet55555 opened 3 days ago

ismet55555 commented 3 days ago

System:

Linux 6.8.0-40-generic #40~22.04.3-Ubuntu

rustc

rustc 1.80.1 (3f5fd8dd4 2024-08-06)
binary: rustc
commit-hash: 3f5fd8dd41153bc5fdca9427e9e05be2c767ba23
commit-date: 2024-08-06
host: x86_64-unknown-linux-gnu
release: 1.80.1
LLVM version: 18.1.7

Cargo:

cargo 1.80.1 (376290515 2024-07-16)
> cargo install cargo-embassy
    Updating crates.io index
  Installing cargo-embassy v0.3.1
    Updating crates.io index
     Locking 228 packages to latest compatible versions
      Adding bitfield v0.15.0 (latest: v0.17.0)
      Adding core-foundation v0.9.4 (latest: v0.10.0)
      Adding darling v0.14.4 (latest: v0.20.10)
      Adding darling_core v0.14.4 (latest: v0.20.10)
      Adding darling_macro v0.14.4 (latest: v0.20.10)
      Adding deku v0.16.0 (latest: v0.18.1)
      Adding deku_derive v0.16.0 (latest: v0.18.1)
      Adding encode_unicode v0.3.6 (latest: v1.0.0)
      Adding generic-array v0.14.7 (latest: v1.1.0)
      Adding gimli v0.29.0 (latest: v0.31.0)
      Adding hermit-abi v0.3.9 (latest: v0.4.0)
      Adding idna v0.5.0 (latest: v1.0.2)
      Adding io-lifetimes v1.0.11 (latest: v2.0.3)
      Adding itertools v0.12.1 (latest: v0.13.0)
      Adding linux-raw-sys v0.4.14 (latest: v0.6.5)
      Adding miniz_oxide v0.7.4 (latest: v0.8.0)
      Adding nix v0.27.1 (latest: v0.29.0)
      Adding object v0.35.0 (latest: v0.36.4)
      Adding proc-macro-crate v1.3.1 (latest: v3.2.0)
      Adding radium v0.7.0 (latest: v1.1.0)
      Adding strsim v0.10.0 (latest: v0.11.1)
      Adding syn v1.0.109 (latest: v2.0.77)
      Adding toml_edit v0.19.15 (latest: v0.22.20)
      Adding typed-path v0.8.0 (latest: v0.9.1)
      Adding udev v0.8.0 (latest: v0.9.0)
      Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.2+wasi-0.2.1)
      Adding windows-sys v0.48.0 (latest: v0.59.0)
      Adding windows-sys v0.52.0 (latest: v0.59.0)
      Adding windows-targets v0.48.5 (latest: v0.52.6)
      Adding windows_aarch64_gnullvm v0.48.5 (latest: v0.52.6)
      Adding windows_aarch64_msvc v0.48.5 (latest: v0.52.6)
      Adding windows_i686_gnu v0.48.5 (latest: v0.52.6)
      Adding windows_i686_msvc v0.48.5 (latest: v0.52.6)
      Adding windows_x86_64_gnu v0.48.5 (latest: v0.52.6)
      Adding windows_x86_64_gnullvm v0.48.5 (latest: v0.52.6)
      Adding windows_x86_64_msvc v0.48.5 (latest: v0.52.6)
      Adding winnow v0.5.40 (latest: v0.6.18)
      Adding wyz v0.5.1 (latest: v0.6.1)
   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.13
   Compiling autocfg v1.3.0
   Compiling serde v1.0.210
   Compiling libc v0.2.158
   Compiling cfg-if v1.0.0
   Compiling crossbeam-utils v0.8.20
   Compiling once_cell v1.20.0
   Compiling syn v1.0.109
   Compiling parking_lot_core v0.9.10
   Compiling memchr v2.7.4
   Compiling signal-hook v0.3.17
   Compiling log v0.4.22
   Compiling bitflags v2.6.0
   Compiling equivalent v1.0.1
   Compiling hashbrown v0.14.5
   Compiling rustix v0.38.37
   Compiling typenum v1.17.0
   Compiling version_check v0.9.5
   Compiling linux-raw-sys v0.4.14
   Compiling lock_api v0.4.12
   Compiling pkg-config v0.3.30
   Compiling num-traits v0.2.19
   Compiling ident_case v1.0.1
   Compiling generic-array v0.14.7
   Compiling aho-corasick v1.1.3
   Compiling pin-project-lite v0.2.14
   Compiling strsim v0.10.0
   Compiling fnv v1.0.7
   Compiling quote v1.0.37
   Compiling indexmap v2.5.0
   Compiling regex-syntax v0.8.4
   Compiling syn v2.0.77
   Compiling byteorder v1.5.0
   Compiling tinyvec_macros v0.1.1
   Compiling tinyvec v1.8.0
   Compiling thiserror v1.0.63
   Compiling winnow v0.5.40
   Compiling toml_datetime v0.6.8
   Compiling scopeguard v1.2.0
   Compiling heck v0.5.0
   Compiling smallvec v1.13.2
   Compiling rustversion v1.0.17
   Compiling radium v0.7.0
   Compiling signal-hook-registry v1.4.2
   Compiling unicode-normalization v0.1.23
   Compiling percent-encoding v2.3.1
   Compiling unicode-bidi v0.3.15
   Compiling unicode-width v0.1.13
   Compiling ryu v1.0.18
   Compiling parking v2.2.1
   Compiling regex-automata v0.4.7
   Compiling toml_edit v0.19.15
   Compiling tap v1.0.1
   Compiling itoa v1.0.11
   Compiling shlex v1.3.0
   Compiling cc v1.1.19
   Compiling wyz v0.5.1
   Compiling mio v1.0.2
   Compiling idna v0.5.0
   Compiling darling_core v0.14.4
   Compiling form_urlencoded v1.2.1
   Compiling proc-macro-crate v1.3.1
   Compiling parking_lot v0.12.3
   Compiling regex v1.10.6
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling libudev-sys v0.1.4
   Compiling concurrent-queue v2.5.0
   Compiling slab v0.4.9
   Compiling heapless v0.8.0
   Compiling funty v2.0.0
   Compiling io-lifetimes v1.0.11
   Compiling darling_macro v0.14.4
   Compiling stable_deref_trait v1.2.0
   Compiling paste v1.0.15
   Compiling bitvec v1.0.1
   Compiling serde_derive v1.0.210
   Compiling thiserror-impl v1.0.63
   Compiling darling v0.14.4
   Compiling deku_derive v0.16.0
   Compiling strum_macros v0.26.4
   Compiling tracing-attributes v0.1.27
   Compiling event-listener v5.3.1
   Compiling signal-hook-mio v0.2.4
error: failed to run custom build command for `libudev-sys v0.1.4`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installSb5NyO/release/build/libudev-sys-ca92c3424a6d368e/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBUDEV_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=LIBUDEV_STATIC
  cargo:rerun-if-env-changed=LIBUDEV_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at /home/<USER_REMOVED>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libudev-sys-0.1.4/build.rs:38:41:
  called `Result::unwrap()` on an `Err` value: "\npkg-config exited with status code 1\n> PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libudev\n\nThe system library `libudev` required by crate `libudev-sys` was not found.\nThe file `libudev.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.\nThe PKG_CONFIG_PATH environment variable is not set.\n\nHINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libudev.pc`.\n"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-embassy v0.3.1`, intermediate artifacts can be found at `/tmp/cargo-installSb5NyO`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

The last part in verbose mode:

   Compiling signal-hook-mio v0.2.4
     Running `/home/<USER_REMOVED>/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name signal_hook_mio --edition=2018 /home/<USER_REMOVED>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/signal-hook-mio-0.2.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=217 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="mio-1_0"' --cfg 'feature="support-v1_0"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("mio-0_6", "mio-0_7", "mio-0_8", "mio-1_0", "mio-uds", "support-v0_6", "support-v0_7", "support-v0_8", "support-v1_0"))' -C metadata=81b29d4083577d9f -C extra-filename=-81b29d4083577d9f --out-dir /tmp/cargo-installaTAcEI/release/deps -C strip=debuginfo -L dependency=/tmp/cargo-installaTAcEI/release/deps --extern libc=/tmp/cargo-installaTAcEI/release/deps/liblibc-8262032f1e05c089.rmeta --extern mio_1_0=/tmp/cargo-installaTAcEI/release/deps/libmio-920f19b536e953ae.rmeta --extern signal_hook=/tmp/cargo-installaTAcEI/release/deps/libsignal_hook-433d4e3a3c417cb2.rmeta --cap-lints allow`
error: failed to run custom build command for `libudev-sys v0.1.4`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installaTAcEI/release/build/libudev-sys-ca92c3424a6d368e/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBUDEV_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=LIBUDEV_STATIC
  cargo:rerun-if-env-changed=LIBUDEV_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at /home/<USER_REMOVED>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libudev-sys-0.1.4/build.rs:38:41:
  called `Result::unwrap()` on an `Err` value: "\npkg-config exited with status code 1\n> PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libudev\n\nThe system library `libudev` required by crate `libudev-sys` was not found.\nThe file `libudev.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.\nThe PKG_CONFIG_PATH environment variable is not set.\n\nHINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libudev.pc`.\n"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-embassy v0.3.1`, intermediate artifacts can be found at `/tmp/cargo-installaTAcEI`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
AdinAck commented 3 days ago

You need to install libudev. Ubuntu doesn't come with it and the libudev-sys crate requires it.

This is not specific to cargo-embassy, I've encountered it any time I set up embedded rust envs on Ubuntu, I'm not sure which common crate requires it...

There are some stack overflow posts that explain how to install libudev.

Edit: Or just refer to the libudev-sys README.