Extend cargo based recipe support
v2 cover Extend cargo based recipe support
From: Frederic Martinsons <[email protected]>
This series brings the support of local git repository inside a cargo based recipe.
It also enables devtool capacity on it and provides a real crate example recipe to show how things are done.
The following changes since commit 4876189dd2ae5a04a296b11b537b9f613159c6bf:
xcb-proto: Fix install conflict when enable multilib. (2023-03-23 22:38:41 +0000)
are available in the Git repository at:
https://gitlab.com/fmartinsons/openembedded-core cargo-extend-support-git-and-devtool
Alex Kiernan (1):
cargo_common.bbclass: Support local github repos
Frederic Martinsons (4):
cargo_common.bbclass: add support of user in url for patch
rust-example: provide a recipe for zvariant
devtool: add support for multiple git url inside a cargo based recipe
patch: support of git patches when the source uri contained subpath
parameter
meta/classes-recipe/cargo_common.bbclass | 33 + meta/classes/externalsrc.bbclass | 4 +- meta/lib/oe/patch.py | 57 +- .../rust-example/zvariant-crates.inc | 140 ++ .../0001-Tweak-zvariant-cargo-config.patch | 1249 +++++++++++++++++ .../rust-example/zvariant_3.12.0.bb | 20 + 6 files changed, 1487 insertions(+), 16 deletions(-) create mode 100644 meta/recipes-extended/rust-example/zvariant-crates.inc create mode 100644 meta/recipes-extended/rust-example/zvariant/0001-Tweak-zvariant-cargo-config.patch create mode 100644 meta/recipes-extended/rust-example/zvariant_3.12.0.bb
Signature · 1 line
2.34.1
PATCH v2 3/5 rust-example: provide a recipe for zvariant
From: Frederic Martinsons <[email protected]>
This recipe is for showing a "real world" example of a crate that depends on some git repositories.
Usually, this kind of crate is built within a global workspace (here it is the zbus project) and so doesn't need a Cargo.lock on its own.
For the sake of the demonstration, I had to add
a patch for providing a Cargo.lock and modifyingzvariant_derive to get it from crates.io instead
of pulling locally with a relative path.
The use case where the crate had some git repository in dependency is very common for "private" crate that are not aimed to be published on crates.io. When the project grow bigger, it is common to have a bin and multiple lib developped in parallel, and these libs are surely on a git repostitory.
Hence the need of this support in oe-core.
--- .../rust-example/zvariant-crates.inc | 140 ++ .../0001-Tweak-zvariant-cargo-config.patch | 1249 +++++++++++++++++ .../rust-example/zvariant_3.12.0.bb | 20 + 3 files changed, 1409 insertions(+) create mode 100644 meta/recipes-extended/rust-example/zvariant-crates.inc create mode 100644 meta/recipes-extended/rust-example/zvariant/0001-Tweak-zvariant-cargo-config.patch create mode 100644 meta/recipes-extended/rust-example/zvariant_3.12.0.bb
meta/recipes-extended/rust-example/zvariant-crates.inc new file +140 -0
@@ -0,0 +1,140 @@ +SRC_URI += " \ + crate://crates.io/anes/0.1.6 \ + crate://crates.io/anyhow/1.0.70 \ + crate://crates.io/arrayvec/0.7.2 \ + crate://crates.io/atty/0.2.14 \ + crate://crates.io/autocfg/1.1.0 \ + crate://crates.io/bitflags/1.3.2 \ + crate://crates.io/bumpalo/3.12.0 \ + crate://crates.io/byteorder/1.4.3 \ + crate://crates.io/cast/0.3.0 \ + crate://crates.io/cfg-if/1.0.0 \ + crate://crates.io/chrono/0.4.24 \ + crate://crates.io/ciborium-io/0.2.0 \ + crate://crates.io/ciborium-ll/0.2.0 \ + crate://crates.io/ciborium/0.2.0 \ + crate://crates.io/clap/3.2.23 \ + crate://crates.io/clap_lex/0.2.4 \ + crate://crates.io/criterion-plot/0.5.0 \ + crate://crates.io/criterion/0.4.0 \ + crate://crates.io/crossbeam-channel/0.5.7 \ + crate://crates.io/crossbeam-deque/0.8.3 \ + crate://crates.io/crossbeam-epoch/0.9.14 \ + crate://crates.io/crossbeam-utils/0.8.15 \ + crate://crates.io/either/1.8.1 \ + crate://crates.io/enumflags2/0.7.5 \ + crate://crates.io/enumflags2_derive/0.7.4 \ + crate://crates.io/form_urlencoded/1.1.0 \ + crate://crates.io/futures-channel/0.3.27 \ + crate://crates.io/futures-core/0.3.27 \ + crate://crates.io/futures-executor/0.3.27 \ + crate://crates.io/futures-macro/0.3.27 \ + crate://crates.io/futures-task/0.3.27 \ + crate://crates.io/futures-util/0.3.27 \ + crate://crates.io/getrandom/0.2.8 \ + crate://crates.io/half/1.8.2 \ + crate://crates.io/hashbrown/0.12.3 \ + crate://crates.io/heck/0.3.3 \ + crate://crates.io/hermit-abi/0.1.19 \ + crate://crates.io/hermit-abi/0.2.6 \ + crate://crates.io/idna/0.3.0 \ + crate://crates.io/indexmap/1.9.2 \ + crate://crates.io/itertools/0.10.5 \ + crate://crates.io/itertools/0.9.0 \ + crate://crates.io/itoa/1.0.6 \ + crate://crates.io/js-sys/0.3.61 \ + crate://crates.io/lazy_static/1.4.0 \ + crate://crates.io/libc/0.2.140 \ + crate://crates.io/log/0.4.17 \ + crate://crates.io/memchr/2.5.0 \ + crate://crates.io/memoffset/0.8.0 \ + crate://crates.io/num-integer/0.1.45 \ + crate://crates.io/num-traits/0.2.15 \ + crate://crates.io/num_cpus/1.15.0 \ + crate://crates.io/once_cell/1.17.1 \ + crate://crates.io/oorandom/11.1.3 \ + crate://crates.io/os_str_bytes/6.5.0 \ + crate://crates.io/percent-encoding/2.2.0 \ + crate://crates.io/pin-project-lite/0.2.9 \ + crate://crates.io/pin-utils/0.1.0 \ + crate://crates.io/pkg-config/0.3.26 \ + crate://crates.io/plotters-backend/0.3.4 \ + crate://crates.io/plotters-svg/0.3.3 \ + crate://crates.io/plotters/0.3.4 \ + crate://crates.io/ppv-lite86/0.2.17 \ + crate://crates.io/proc-macro-crate/0.1.5 \ + crate://crates.io/proc-macro-crate/1.3.1 \ + crate://crates.io/proc-macro-error-attr/1.0.4 \ + crate://crates.io/proc-macro-error/1.0.4 \ + crate://crates.io/proc-macro2/1.0.53 \ + crate://crates.io/quote/1.0.26 \ + crate://crates.io/rand/0.8.5 \ + crate://crates.io/rand_chacha/0.3.1 \ + crate://crates.io/rand_core/0.6.4 \ + crate://crates.io/rayon-core/1.11.0 \ + crate://crates.io/rayon/1.7.0 \ + crate://crates.io/regex-syntax/0.6.29 \ + crate://crates.io/regex/1.7.2 \ + crate://crates.io/ryu/1.0.13 \ + crate://crates.io/same-file/1.0.6 \ + crate://crates.io/scopeguard/1.1.0 \ + crate://crates.io/serde/1.0.158 \ + crate://crates.io/serde_bytes/0.11.9 \ + crate://crates.io/serde_derive/1.0.158 \ + crate://crates.io/serde_json/1.0.94 \ + crate://crates.io/serde_repr/0.1.12 \ + crate://crates.io/slab/0.4.8 \ + crate://crates.io/static_assertions/1.1.0 \ + crate://crates.io/strum/0.18.0 \ + crate://crates.io/strum_macros/0.18.0 \ + crate://crates.io/syn/1.0.109 \ + crate://crates.io/syn/2.0.8 \ + crate://crates.io/system-deps/1.3.2 \ + crate://crates.io/textwrap/0.16.0 \ + crate://crates.io/thiserror-impl/1.0.40 \ + crate://crates.io/thiserror/1.0.40 \ + crate://crates.io/time-core/0.1.0 \ + crate://crates.io/time-macros/0.2.8 \ + crate://crates.io/time/0.3.20 \ + crate://crates.io/tinytemplate/1.2.1 \ + crate://crates.io/tinyvec/1.6.0 \ + crate://crates.io/tinyvec_macros/0.1.1 \ + crate://crates.io/toml/0.5.11 \ + crate://crates.io/toml_datetime/0.6.1 \ + crate://crates.io/toml_edit/0.19.8 \ + crate://crates.io/unicode-bidi/0.3.13 \ + crate://crates.io/unicode-ident/1.0.8 \ + crate://crates.io/unicode-normalization/0.1.22 \ + crate://crates.io/unicode-segmentation/1.10.1 \ + crate://crates.io/url/2.3.1 \ + crate://crates.io/uuid/1.3.0 \ + crate://crates.io/version-compare/0.0.10 \ + crate://crates.io/version_check/0.9.4 \ + crate://crates.io/walkdir/2.3.3 \ + crate://crates.io/wasi/0.11.0+wasi-snapshot-preview1 \ + crate://crates.io/wasm-bindgen-backend/0.2.84 \ + crate://crates.io/wasm-bindgen-macro-support/0.2.84 \ + crate://crates.io/wasm-bindgen-macro/0.2.84 \ + crate://crates.io/wasm-bindgen-shared/0.2.84 \ + crate://crates.io/wasm-bindgen/0.2.84 \ + crate://crates.io/web-sys/0.3.61 \ + crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi-util/0.1.5 \ + crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi/0.3.9 \ + crate://crates.io/winnow/0.4.0 \ + crate://crates.io/zvariant_derive/3.12.0 \ + crate://crates.io/zvariant_utils/1.0.0 \ + git://github.com/gtk-rs/glib;protocol=https;nobranch=1;name=glib;destsuffix=glib \ + git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=glib-sys;destsuffix=glib-sys;subpath=glib-sys \ + git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=gobject-sys;destsuffix=gobject-sys;subpath=gobject-sys \ +" + +SRCREV_FORMAT .= "_glib" +SRCREV_glib = "c9ee583cea07830c099cdcccd33eda9ef705ea93" + +SRCREV_FORMAT .= "_glib-sys" +SRCREV_glib-sys = "5f35e26c65d24f8f018f643218de0f5807ba5f01" + +SRCREV_FORMAT .= "_gobject-sys" +SRCREV_gobject-sys = "5f35e26c65d24f8f018f643218de0f5807ba5f01"
meta/recipes-extended/rust-example/zvariant/0001-Tweak-zvariant-cargo-config.patch new file +1249 -0
1,249 lines not on this page · raw message
meta/recipes-extended/rust-example/zvariant_3.12.0.bb new file +20 -0
@@ -0,0 +1,20 @@ +SUMMARY = "Provides API for encoding/decoding of data to/from D-Bus wire format" +DESCRIPTION = "This crate provides API for encoding/decoding of data to/from D-Bus wire format.\ +This binary wire format is simple and very efficient and hence useful outside of D-Bus context as well.\ +A modified form of this format, GVariant is very commonly used for efficient storage of arbitrary \ +data and is also supported by this crate." +HOMEPAGE = "https://gitlab.freedesktop.org/dbus/zbus/" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b377b220f43d747efdec40d69fcaa69d" + +SRC_URI = " \ + git://gitlab.freedesktop.org/dbus/zbus;protocol=https;branch=main;subpath=zvariant \ + file://0001-Tweak-zvariant-cargo-config.patch;striplevel=2 \ +" + +SRCREV = "07506776fab5f58e029760bb4b288f670c7eecd6" +S = "${WORKDIR}/zvariant" + +inherit cargo cargo-update-recipe-crates + +require ${BPN}-crates.inc
Signature · 1 line
2.34.1
PATCH v2 5/5 patch: support of git patches when the source uri contained subpath parameter
In reply to [email protected]From: Frederic Martinsons <[email protected]>
This is for a specific case where:
- A recipe use a subpath on a git repo (e.g. git://repo.git/projects;subpath=subproject)
- The recipe contains a patch to apply
- a devtool modify is used on this recipe
With these conditions, the patch cannot be applied at all. GitApplyTree class is used for handling patch under devtool, but when subpath is present in SRC_URI, the resulting git tree
is dirty (every files and directories which was not in subpath are suppressed) and so "git am" refuse to apply patches.
That would not be an issue since the GitApplyTree have a fallback to PatchTree in case of error, but during this error management, there is a "git reset --hard HEAD" call which suppress the subpath operation and finally prevents the patch to be applied even with PatchTree.
When devtool is not involved, only PatchTree class is used and the above problem is irrelevant.
To support git patching during devtool, the presence of subpath and the dirtyness of the repo are checked. If both conditions are met, we directly call PatchTree like it was already done in case of error during git apply.
--- meta/lib/oe/patch.py | 57 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 13 deletions(-)
meta/lib/oe/patch.py +44 -13
@@ -499,6 +499,36 @@ class GitApplyTree(PatchTree): finally: shutil.rmtree(tempdir) + def _need_dirty_check(self): + fetch = bb.fetch2.Fetch([], self.d) + check_dirtyness = False + for url in fetch.urls: + url_data = fetch.ud[url] + parm = url_data.parm + # a git url with subpath param will surely be dirty + # since the git tree from which we clone will be emptied + # from all files that are not in the subpath + if url_data.type == 'git' and parm.get('subpath'): + check_dirtyness = True + return check_dirtyness + + def _commitpatch(self, patch, patchfilevar): + output = "" + # Add all files + shellcmd = ["git", "add", "-f", "-A", "."] + output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + # Exclude the patches directory + shellcmd = ["git", "reset", "HEAD", self.patchdir] + output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + # Commit the result + (tmpfile, shellcmd) = self.prepareCommit(patch['file'], self.commituser, self.commitemail) + try: + shellcmd.insert(0, patchfilevar) + output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + finally: + os.remove(tmpfile) + return output + def _applypatch(self, patch, force = False, reverse = False, run = True): import shutil
@@ -534,6 +564,19 @@ class GitApplyTree(PatchTree): shutil.copy2(commithook, applyhook) try: patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file']) + if self._need_dirty_check(): + # Check dirtyness of the tree + try: + output = runcmd(["git", "--work-tree=%s" % reporoot, "status", "--short"]) + except CmdError: + pass + else: + if output: + # The tree is dirty, not need to try to apply patches with git anymore + # since they fail, fallback directly to patch + output = PatchTree._applypatch(self, patch, force, reverse, run) + output += self._commitpatch(patch, patchfilevar) + return output try: shellcmd = [patchfilevar, "git", "--work-tree=%s" % reporoot] self.gitCommandUserOptions(shellcmd, self.commituser, self.commitemail)
@@ -560,19 +603,7 @@ class GitApplyTree(PatchTree): except CmdError: # Fall back to patch output = PatchTree._applypatch(self, patch, force, reverse, run) - # Add all files - shellcmd = ["git", "add", "-f", "-A", "."] - output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) - # Exclude the patches directory - shellcmd = ["git", "reset", "HEAD", self.patchdir] - output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) - # Commit the result - (tmpfile, shellcmd) = self.prepareCommit(patch['file'], self.commituser, self.commitemail) - try: - shellcmd.insert(0, patchfilevar) - output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) - finally: - os.remove(tmpfile) + output += self._commitpatch(patch, patchfilevar) return output finally: shutil.rmtree(hooks_dir)
Signature · 1 line
2.34.1
PATCH v2 1/5 cargo_common.bbclass: Support local github repos
In reply to [email protected]From: Alex Kiernan <[email protected]>
Since disable network was added cargo configurations which reference git repos fail as they attempt to fetch across the network as part of do_compile, even if EXTRA_OECARGO_PATHS to add them as part of paths is used, as this is documented as only working for packages which exist in crates.io.
Add parsing of the SRC_URIs for git repos and include [patch] sections to redirect to the checked out source repos which the bitbake fetcher has already populated.
There are still cases which don't work - if you have multiple copies of the same repo with different revisions, there's currently no way to represent that and anything using a repo which has a virtual manifest will fail to build (see https://github.com/rust-lang/cargo/issues/4934).
--- meta/classes-recipe/cargo_common.bbclass | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
meta/classes-recipe/cargo_common.bbclass +30 -0
@@ -116,6 +116,36 @@ cargo_common_do_configure () { EOF } +python cargo_common_do_patch_paths() { + cargo_config = os.path.join(d.getVar("CARGO_HOME"), "config") + if not os.path.exists(cargo_config): + return + + src_uri = (d.getVar('SRC_URI') or "").split() + if len(src_uri) == 0: + return + + patches = dict() + workdir = d.getVar('WORKDIR') + fetcher = bb.fetch2.Fetch(src_uri, d) + for url in fetcher.urls: + ud = fetcher.ud[url] + if ud.type == 'git': + name = ud.parm.get('name') + destsuffix = ud.parm.get('destsuffix') + if name is not None and destsuffix is not None: + repo = '%s://%s%s' % (ud.proto, ud.host, ud.path) + path = '%s = { path = "%s" }' % (name, os.path.join(workdir, destsuffix)) + patches.setdefault(repo, []).append(path) + + with open(cargo_config, "a+") as config: + for k, v in patches.items(): + print('\n[patch."%s"]' % k, file=config) + for name in v: + print(name, file=config) +} +do_configure[postfuncs] += "cargo_common_do_patch_paths" + oe_cargo_fix_env () { export CC="${RUST_TARGET_CC}" export CXX="${RUST_TARGET_CXX}"
Signature · 1 line
2.34.1
PATCH v2 2/5 cargo_common.bbclass: add support of user in url for patch
In reply to [email protected]From: Frederic Martinsons <[email protected]>
To handle url like git://git@repo/project
--- meta/classes-recipe/cargo_common.bbclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/classes-recipe/cargo_common.bbclass +4 -1
@@ -134,7 +134,10 @@ python cargo_common_do_patch_paths() { name = ud.parm.get('name') destsuffix = ud.parm.get('destsuffix') if name is not None and destsuffix is not None: - repo = '%s://%s%s' % (ud.proto, ud.host, ud.path) + if ud.user: + repo = '%s://%s@%s%s' % (ud.proto, ud.user, ud.host, ud.path) + else: + repo = '%s://%s%s' % (ud.proto, ud.host, ud.path) path = '%s = { path = "%s" }' % (name, os.path.join(workdir, destsuffix)) patches.setdefault(repo, []).append(path)
Signature · 1 line
2.34.1
PATCH v2 4/5 devtool: add support for multiple git url inside a cargo based recipe
In reply to [email protected]From: Frederic Martinsons <[email protected]>
Without that, the possible git urls that are in SRC_URI of a recipe are removed from SRC_URI during devtool process and so the cargo_common_do_patch_paths in cargo_common.bbclass cannot patch these packages to fetch them locally.
I use a generic type name because I foresee this change will be useful for recipe that used a package manager (cargo but also npm) see https://bugzilla.yoctoproject.org/show_bug.cgi?id=11015
--- meta/classes/externalsrc.bbclass | 4 +--- meta/recipes-extended/rust-example/zvariant-crates.inc | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-)
meta/classes/externalsrc.bbclass +1 -3
@@ -68,9 +68,7 @@ python () { for url in fetch.urls: url_data = fetch.ud[url] parm = url_data.parm - if (url_data.type == 'file' or - url_data.type == 'npmsw' or url_data.type == 'crate' or - 'type' in parm and parm['type'] == 'kmeta'): + if url_data.type in ['file', 'npmsw', 'crate'] or parm.get('type') in ['kmeta', 'git-dependency']: local_srcuri.append(url) d.setVar('SRC_URI', ' '.join(local_srcuri))
meta/recipes-extended/rust-example/zvariant-crates.inc +3 -3
@@ -125,9 +125,9 @@ SRC_URI += " \ crate://crates.io/winnow/0.4.0 \ crate://crates.io/zvariant_derive/3.12.0 \ crate://crates.io/zvariant_utils/1.0.0 \ - git://github.com/gtk-rs/glib;protocol=https;nobranch=1;name=glib;destsuffix=glib \ - git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=glib-sys;destsuffix=glib-sys;subpath=glib-sys \ - git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=gobject-sys;destsuffix=gobject-sys;subpath=gobject-sys \ + git://github.com/gtk-rs/glib;protocol=https;nobranch=1;name=glib;destsuffix=glib;type=git-dependency \ + git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=glib-sys;destsuffix=glib-sys;subpath=glib-sys;type=git-dependency \ + git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=gobject-sys;destsuffix=gobject-sys;subpath=gobject-sys;type=git-dependency \ " SRCREV_FORMAT .= "_glib"
Signature · 1 line
2.34.1
Re: [OE-core] [PATCHV2 3/5] rust-example: provide a recipe for zvariant
In reply to [email protected]Quoted 24 lines · Frederic Martinsons
From: Frederic Martinsons <[email protected]>
This recipe is for showing a "real world" example of a crate that depends on some git repositories.
Usually, this kind of crate is built within a global workspace (here it is the zbus project) and so doesn't need a Cargo.lock on its own.
For the sake of the demonstration, I had to add a patch for providing a Cargo.lock and modifying
zvariant_deriveto get it from crates.io instead of pulling locally with a relative path.The use case where the crate had some git repository in dependency is very common for "private" crate that are not aimed to be published on crates.io. When the project grow bigger, it is common to have a bin and multiple lib developped in parallel, and these libs are surely on a git repostitory.
Hence the need of this support in oe-core.
Signed-off-by Frederic Martinsons <[email protected]>
Quoted 8 lines
--- .../rust-example/zvariant-crates.inc | 140 ++ .../0001-Tweak-zvariant-cargo-config.patch | 1249 +++++++++++++++++ .../rust-example/zvariant_3.12.0.bb | 20 + 3 files changed, 1409 insertions(+)create mode 100644 meta/recipes-extended/rust-example/zvariant-crates.inc
create mode 100644meta/recipes-extended/rust-example/zvariant/0001-Tweak-zvariant-cargo-config.patchcreate mode 100644 meta/recipes-extended/rust-example/zvariant_3.12.0.bb
Why not use meta-skeleton for the examples? I know and have seen before that for some reason the rust-example is placed in oe-core/meta, but think rust-example should have its home in meta-skeleton as it is the place for example recipes. Just a suggestion to move this now before filling up more example recipes among the core recipes.
/Peter
Re: [OE-core] [PATCHV2 3/5] rust-example: provide a recipe for zvariant
rust-hello-world is actually used in test images to verify that toolchains produce working binaries.
For zvariant I guess meta-skeleton would work best, if the recipe comes with a README explaining why is it there, and how to handle maintenance of similar recipes.
Alex
Quoted 54 lines · Peter Bergin
Quoted 24 lines · Frederic Martinsons
From: Frederic Martinsons <[email protected]>
This recipe is for showing a "real world" example of a crate that depends on some git repositories.
Usually, this kind of crate is built within a global workspace (here it is the zbus project) and so doesn't need a Cargo.lock on its own.
For the sake of the demonstration, I had to add a patch for providing a Cargo.lock and modifying
zvariant_deriveto get it from crates.io instead of pulling locally with a relative path.The use case where the crate had some git repository in dependency is very common for "private" crate that are not aimed to be published on crates.io. When the project grow bigger, it is common to have a bin and multiple lib developped in parallel, and these libs are surely on a git repostitory.
Hence the need of this support in oe-core.
Signed-off-by Frederic Martinsons <[email protected]>Quoted 8 lines
--- .../rust-example/zvariant-crates.inc | 140 ++ .../0001-Tweak-zvariant-cargo-config.patch | 1249 +++++++++++++++++ .../rust-example/zvariant_3.12.0.bb | 20 + 3 files changed, 1409 insertions(+)create mode 100644 meta/recipes-extended/rust-example/zvariant-crates.inc
create mode 100644meta/recipes-extended/rust-example/zvariant/0001-Tweak-zvariant-cargo-config.patchcreate mode 100644 meta/recipes-extended/rust-example/zvariant_3.12.0.bbWhy not use meta-skeleton for the examples? I know and have seen before that for some reason the rust-example is placed in oe-core/meta, but think rust-example should have its home in meta-skeleton as it is the place for example recipes. Just a suggestion to move this now before filling up more example recipes among the core recipes.
/Peter
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#179150): https://lists.openembedded.org/g/openembedded-core/message/179150
Mute This Topic: https://lists.openembedded.org/mt/97862976/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCHV2 3/5] rust-example: provide a recipe for zvariant
There is an ongoing discussion about the place for this recipe. When it wil' be clear, I'll issue a dedicated patch for this.
In the meantime, I removed this example in the last version of this series (V3)
Le lun. 27 mars 2023, 11:12, Alexander Kanavin <[email protected]> a écrit :
Quoted 71 lines
rust-hello-world is actually used in test images to verify that toolchains produce working binaries.
For zvariant I guess meta-skeleton would work best, if the recipe comes with a README explaining why is it there, and how to handle maintenance of similar recipes.
Alex
Quoted 24 lines · Peter Bergin
Quoted 21 lines · Frederic Martinsons
From: Frederic Martinsons <[email protected]>
This recipe is for showing a "real world" example of a crate that depends on some git repositories.
Usually, this kind of crate is built within a global workspace (here it is the zbus project) and so doesn't need a Cargo.lock on its own.
For the sake of the demonstration, I had to add a patch for providing a Cargo.lock and modifying
zvariant_deriveto get it from crates.io instead of pulling locally with a relative path.The use case where the crate had some git repository in dependency is very common for "private" crate that are not aimed to be published on crates.io. When the project grow bigger, it is common to have a bin and multiple lib developped in parallel, and these libs are surely on a git repostitory.
Quoted 6 lines
Quoted 6 lines
Hence the need of this support in oe-core.
Signed-off-by Frederic Martinsons <[email protected]>--- .../rust-example/zvariant-crates.inc | 140 ++ .../0001-Tweak-zvariant-cargo-config.patch | 1249+++++++++++++++++
Quoted 3 lines
Quoted 3 lines
.../rust-example/zvariant_3.12.0.bb | 20 + 3 files changed, 1409 insertions(+)create mode 100644
meta/recipes-extended/rust-example/zvariant-crates.inc
Quoted 1 line
Quoted 1 line
create mode 100644
meta/recipes-extended/rust-example/zvariant/0001-Tweak-zvariant-cargo-config.patchQuoted 1 line
Quoted 1 line
create mode 100644 meta/recipes-extended/rust-example/
zvariant_3.12.0.bb
Quoted 7 lines
Why not use meta-skeleton for the examples? I know and have seen before that for some reason the rust-example is placed in oe-core/meta, but think rust-example should have its home in meta-skeleton as it is the place for example recipes. Just a suggestion to move this now before filling up more example recipes among the core recipes.
Quoted 7 lines
/Peter
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#179150):https://lists.openembedded.org/g/openembedded-core/message/179150
Quoted 3 lines
Mute This Topic: https://lists.openembedded.org/mt/97862976/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Quoted 2 lines
-=-=-=-=-=-=-=-=-=-=-=-