Skip to content

Commit

Permalink
README.md: add a note about meta-rust version
Browse files Browse the repository at this point in the history
* when newer rust is used, iotedge-* fails with:

with 1.47.0 and 1.46.0 rust_2018_idioms, triggers unused_attributes warning
because rust_2018_idioms is for crate level only since:
rust-lang/rust#73300
which is then an error because warnings are denied as well:

| ''+v8+v8' is not a recognized feature for this target' is not a recognized feature for this target (ignoring feature)
|  (ignoring feature)
| '+v8' is not a recognized feature for this target' (ignoring feature)
| +v8' is not a recognized feature for this target (ignoring feature)
| error: deny(rust_2018_idioms) is ignored unless specified at crate level
|  --> edgelet-http/src/authentication.rs:3:9
|   |
| 3 | #![deny(rust_2018_idioms, warnings)]
|   |         ^^^^^^^^^^^^^^^^
|   |
| note: the lint level is defined here
|  --> edgelet-http/src/authentication.rs:3:27
|   |
| 3 | #![deny(rust_2018_idioms, warnings)]
|   |                           ^^^^^^^^
|   = note: `#[deny(unused_attributes)]` implied by `#[deny(warnings)]`
|
| error: deny(rust_2018_idioms) is ignored unless specified at crate level
|  --> edgelet-http/src/certificate_manager.rs:1:9
|   |
| 1 | #![deny(rust_2018_idioms, warnings)]
|   |         ^^^^^^^^^^^^^^^^
|   |
| note: the lint level is defined here
|  --> edgelet-http/src/certificate_manager.rs:1:27
|   |
| 1 | #![deny(rust_2018_idioms, warnings)]
|   |                           ^^^^^^^^
|
| error: deny(rust_2018_idioms) is ignored unless specified at crate level
|  --> edgelet-http/src/authentication.rs:3:9
|   |
| 3 | #![deny(rust_2018_idioms, warnings)]
|   |         ^^^^^^^^^^^^^^^^
|
| error: deny(rust_2018_idioms) is ignored unless specified at crate level
|  --> edgelet-http/src/certificate_manager.rs:1:9
|   |
| 1 | #![deny(rust_2018_idioms, warnings)]
|   |         ^^^^^^^^^^^^^^^^
|
| ''+v8+v8' is not a recognized feature for this target' is not a recognized feature for this target (ignoring feature)
|  (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)

with 1.43.0 it still fails due to use of deprecated description
(since 1.42.0 with rust-lang/rust#66919)

| error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
|    --> iotedge/src/support_bundle.rs:248:54
|     |
| 248 |             let err_message = inspect.err().unwrap().description().to_owned();
|     |                                                      ^^^^^^^^^^^
|     |
| note: the lint level is defined here
|    --> iotedge/src/lib.rs:3:27
|     |
| 3   | #![deny(rust_2018_idioms, warnings)]
|     |                           ^^^^^^^^
|     = note: `#[deny(deprecated)]` implied by `#[deny(warnings)]`
|
| error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
|    --> iotedge/src/support_bundle.rs:302:54
|     |
| 302 |             let err_message = inspect.err().unwrap().description().to_owned();
|     |                                                      ^^^^^^^^^^^
|
| error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
|    --> iotedge/src/support_bundle.rs:375:54
|     |
| 375 |             let err_message = inspect.err().unwrap().description().to_owned();
|     |                                                      ^^^^^^^^^^^
|
| error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
|    --> iotedge/src/support_bundle.rs:457:54
|     |
| 457 |             let err_message = inspect.err().unwrap().description().to_owned();
|     |                                                      ^^^^^^^^^^^

  you can either work around it by allowing warnings (deprecated and unused_attributes):
  find ${WORKDIR}/iotedge-${PV} -name "*.rs" -exec sed -i 's/idioms, warnings)/idioms)/g' {} \;
  or fix it properly in next iotedge release, or just select older rust version
  which doesn't trigger fatal error for this with:

  RUST_VERSION = "1.41.0"
  PREFERRED_VERSION_rust-native ?= "${RUST_VERSION}"
  PREFERRED_VERSION_rust-cross-${TARGET_ARCH} ?= "${RUST_VERSION}"
  PREFERRED_VERSION_rust-llvm-native ?= "${RUST_VERSION}"
  PREFERRED_VERSION_libstd-rs ?= "${RUST_VERSION}"
  PREFERRED_VERSION_cargo-native ?= "${RUST_VERSION}"

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
  • Loading branch information
shr-project committed Jan 21, 2021
1 parent 62670f5 commit 85e82fc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This layer depends on:
```
URI: git://github.com/meta-rust/meta-rust.git
branch: master
revision: e4d25b98083bcecb94df6ee189a165d63ede7f3d
revision: c72b2dda3a4f70ed257c7de9bedb4b04732970a4
prio: default
```

Expand All @@ -30,6 +30,19 @@ revision: HEAD
prio: default
```

If you use newer meta-rust and iotedge-{cli,daemon} fail because of:
#![deny(rust_2018_idioms, warnings)]
in various files, then select older than current (1.47.0) version of rust:
RUST_VERSION = "1.41.0"
PREFERRED_VERSION_rust-native ?= "${RUST_VERSION}"
PREFERRED_VERSION_rust-cross-${TARGET_ARCH} ?= "${RUST_VERSION}"
PREFERRED_VERSION_rust-llvm-native ?= "${RUST_VERSION}"
PREFERRED_VERSION_libstd-rs ?= "${RUST_VERSION}"
PREFERRED_VERSION_cargo-native ?= "${RUST_VERSION}"

or work around this issue in source with do_compile_prepend():
find ${WORKDIR}/iotedge-${PV} -name "*.rs" -exec sed -i 's/idioms, warnings)/idioms)/g' {} \;

Adding the meta-iotedge layer to your build
=================================================

Expand Down

0 comments on commit 85e82fc

Please sign in to comment.