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

Support for gatesgarth #49

Closed
wants to merge 10 commits into from
Closed

Conversation

shr-project
Copy link

No description provided.

* Update from dunfell brach

* Use newer version of the rust compiler
@ghost
Copy link

ghost commented Oct 20, 2020

CLA assistant check
All CLA requirements met.

@shr-project
Copy link
Author

shr-project commented Nov 4, 2020

Yocto 3.2 Gatesgarth is now released, can someone please review this for meta-iotedge to parse with it?

https://lists.yoctoproject.org/g/yocto/message/51262

@shr-project
Copy link
Author

@myagley any update on this? Or do you expect me to fix the CI somehow?

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* the binaries are built in ${B} since meta-rust commit:
  meta-rust/meta-rust@a673320
  adjust do_install to match that

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
* using AUTOREV in public layers is wrong, forces bitbake to always run git ls-remote just
  to parse the recipe and breaks reproducibility (as newer SRCREV could cause whole build
  to fail even without any changes in metadata)

* for hyperlocal-windows, tokio-uds-windows the latest commit currently matches with v0.1.0
  mio-uds-windows is one commit ahead of v0.1.0:

  hyperlocal-windows$ git log --oneline | head
  2bd432b v0.1.0
  c2a9ea2 Initial commit
  f1eab0c Initial commit
  866dd9f Initial commit

  tokio-uds-windows$ git log --oneline | head
  b689a91 v0.1.0
  b317f75 Initial commit
  7578e01 Initial commit
  c1bad3b Initial commit

  mio-uds-windows$ git log --oneline | head
  87a4a99 Remove extra indirection from cast (Azure#2)
  67c2c78 v0.1.0
  b24a96b Initial commit
  4a93639 Initial commit
  9c4b19e Initial commit

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
* 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>
…nings

* to fix build with rust 1.42.0 and newer

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
* cardoe/yocto wasn't updated in last 3 years and the gcc included in this image
  is too old for gatesgarth OE release as shown in:
  https://iotedge.visualstudio.com/iotedge/_build/results?buildId=50386&view=logs&j=2300b2b4-4206-5c4f-16ca-41bcbb8288aa&t=03c45bbf-90ac-5137-e381-689c3f1fcab4
  ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Your version of gcc is older than 6.0 and will break builds. Please install a newer version of gcc (you could use the project's buildtools-extended-tarball or use scripts/install-buildtools).

  switch to officially supported crops/poky image based
  on latest LTS Ubuntu release 20.04

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
@shr-project
Copy link
Author

@myagley I've fixed CI as well and included changes from #58 to make it compatible with newer meta-rust which is needed for compatibility with gatesgarth as well.

This was referenced Feb 7, 2021
* now there is 1.49.0 version and other improvements

git log --oneline c72b2dda3a4f70ed257c7de9bedb4b04732970a4..origin/master  | tee
81d4b4c Merge pull request #301 from shr-project/jansa/lic-1.49.0
26609f4 rust.inc: use 'v8.1a' feature when building for aarch64 instead of 'v8'
71538c8 rust_versions.inc: switch the default version to 1.49.0
c976184 {cargo,rust}-1.49.0: simplify as in meta-rust/meta-rust#299
d15e66a Merge pull request #303 from janderholm/nativebuilds
2c34da1 Merge pull request #293 from danc86/add-rust-1.49
dd7aa2e Merge pull request #300 from shr-project/jansa/lic
0025ceb Fix *-native cargo builds
3ab7542 rust-source, rust-snaphost: drop md5sums
b163a89 rust-source, rust-snapshot: simplify as well
0ee328a add rust 1.49.0
c90c9b0 Merge pull request #299 from shr-project/jansa/lic
3e73030 rust-target.inc: add new include file to simplify all rust_*.bb
9c0a105 rust_versions.inc: add include for easy switching between versions
a31a407 cargo: move LIC_FILES_CHKSUM from cargo_*.bb to cargo.inc where LICENSE is set
1d64f90 rust: move LIC_FILES_CHKSUM from rust-source-*.inc to rust.inc where LICENSE is set
433b721 Merge pull request #297 from shr-project/jansa/lic
80c30c3 rust-llvm-ncsa.inc: reorder to actually set LICENSE and LIC_FILES_CHKSUM
1cb40bd Revert "rust-llvm: Use early variable assignment for the license checksum in rust-llvm.inc"
8055036 Merge pull request #289 from floion/correct_license_file_assignment
a6c6297 Merge pull request #290 from YoeDistro/yoe/mut
1c18023 Merge pull request #295 from danc86/fix-lto
d5ab20d rust-hello-world: enable LTO in the build
b7eacc0 libstd-rs: embed bitcode for LTO
1936904 cargo: Mark the cargo-native dependency specific to target
5dda6c4 rust-llvm: Use early variable assignment for the license checksum in rust-llvm.inc

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* it's part of meta-rust since:
  meta-rust/meta-rust@8a44bae
* and since meta-rust/meta-rust@87e8d50
  this bbappend doesn't have corresponding recipe anymore
…t meta-rust

* CARGO_SRC_DIR is now used in MANIFEST_PATH after meta-rust commit:
  commit 4e960136779edb39685b018a0bfc023402e22d72
  Author: Benjamin Isbarn <benjamin.isbarn@gmail.com>
  Date:   Mon Feb 15 14:36:46 2021 +0100

    Factor in `CARGO_SRC_DIR` when setting `MANIFEST_PATH`.

  which changed the default
  MANIFEST_PATH ??= "${S}/Cargo.toml"

  to
  CARGO_SRC_DIR ??= ""
  MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"

  and iotedge-{cli,daemon} is now failing with:
  NOTE: cargo build -v --target aarch64-oe-linux --release --manifest-path=iotedge-cli/1.0.9.4-r0/iotedge-1.0.9.4/edgelet/iotedge/iotedge/Cargo.toml
  error: manifest path `iotedge-cli/1.0.9.4-r0/iotedge-1.0.9.4/edgelet/iotedge/iotedge/Cargo.toml` does not exist

diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass
index 72e77b0..c2eee10 100644
--- a/classes/cargo.bbclass
+++ b/classes/cargo.bbclass
@@ -22,8 +22,12 @@ B = "${WORKDIR}/build"
 # where the issue occured
 export RUST_BACKTRACE = "1"

-# Assume there's a Cargo.toml directly in the source directory
-MANIFEST_PATH ??= "${S}/Cargo.toml"
+# The directory of the Cargo.toml relative to the root directory, per default
+# assume there's a Cargo.toml directly in the root directory
+CARGO_SRC_DIR ??= ""
+
+# The actual path to the Cargo.toml
+MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
@micahl micahl closed this Feb 6, 2023
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.

None yet

3 participants