Skip to content

Commit

Permalink
iotedge-{cli,daemon}: allow unused_attributes and deprecated rust war…
Browse files Browse the repository at this point in the history
…nings

* to fix build with rust 1.42.0 and newer

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
  • Loading branch information
shr-project committed Jan 21, 2021
1 parent 4c0ca9f commit 96bdc91
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
15 changes: 1 addition & 14 deletions 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,19 +30,6 @@ 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
2 changes: 1 addition & 1 deletion builds/checkin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
- script: scripts/fetch.sh gatesgarth
displayName: Fetch
env:
METARUST_REV: 'e4d25b98083bcecb94df6ee189a165d63ede7f3d'
METARUST_REV: 'c72b2dda3a4f70ed257c7de9bedb4b04732970a4'
- script: scripts/build.sh
displayName: Build
17 changes: 17 additions & 0 deletions recipes-core/iotedge-cli/iotedge-cli_1.0.9.4.bb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,23 @@ SRCREV_FORMAT .= "_tokio-uds-windows"
SRCREV_tokio-uds-windows = "b689a914dbaa905f359f89200c01fed7a6c8df3f"
EXTRA_OECARGO_PATHS += "${WORKDIR}/tokio-uds-windows"

# Lower unused_attributes from error (implied by deny(warnings)) to allow, because
# rust_2018_idioms is for crate level only since:
# https://github.com/rust-lang/rust/pull/73300
# causing:
# error: deny(rust_2018_idioms) is ignored unless specified at crate level
# with rust 1.46.0 and newer
RUSTFLAGS += "-A unused_attributes"

# Lower deprecated from error (implied by deny(warnings)) to allow, because
# Error::description is deprecated since 1.42.0 with https://github.com/rust-lang/rust/pull/66919
# error: use of deprecated associated function `std::error::Error::description`: use the Display impl or to_string()
# --> iotedge/src/support_bundle.rs:248:54
# --> iotedge/src/support_bundle.rs:302:54
# --> iotedge/src/support_bundle.rs:375:54
# --> iotedge/src/support_bundle.rs:457:54
RUSTFLAGS += "-A deprecated"

LIC_FILES_CHKSUM=" \
file://../../LICENSE;md5=0f7e3b1308cb5c00b372a6e78835732d \
file://../../THIRDPARTYNOTICES;md5=1cda6520d68499d4f60c7270445fe436 \
Expand Down
8 changes: 8 additions & 0 deletions recipes-core/iotedge-daemon/iotedge-daemon_1.0.9.4.bb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ SRCREV_FORMAT .= "_tokio-uds-windows"
SRCREV_tokio-uds-windows = "b689a914dbaa905f359f89200c01fed7a6c8df3f"
EXTRA_OECARGO_PATHS += "${WORKDIR}/tokio-uds-windows"

# Lower unused_attributes from error (implied by deny(warnings)) to warning, because
# rust_2018_idioms is for crate level only since:
# https://github.com/rust-lang/rust/pull/73300
# causing:
# error: deny(rust_2018_idioms) is ignored unless specified at crate level
# with rust 1.46.0 and newer
RUSTFLAGS += "-A unused_attributes"

LIC_FILES_CHKSUM=" \
file://../../LICENSE;md5=0f7e3b1308cb5c00b372a6e78835732d \
file://../../THIRDPARTYNOTICES;md5=1cda6520d68499d4f60c7270445fe436 \
Expand Down

0 comments on commit 96bdc91

Please sign in to comment.