On 2021-10-19 9:10 p.m., Randy MacLeod wrote:
On 2021-10-19 3:58 p.m., Richard Purdie wrote:
On Tue, 2021-10-19 at 20:37 +0200, Alexander Kanavin wrote:
On Tue, 19 Oct 2021 at 20:31, Khem Raj <raj.k...@gmail.com> wrote:
It would be wise to hear people who use rust and develop applications
using rust, meta-rust is being used
to develop field deployed products. Again I urge you to think with a
little bit of wider scope.

Look, it's just an example of a recipe generated with cargo-bitbake. Where is
this
cargo-bitbake in core, so we can test that it works as it should? Until it's
available,
there's no point in keeping the recipe.
Rust is a story that is more at the start than at the finish and as such I think it is too premature to be removing this just yet. Having a rust recipe in core generated by cargo-bitbake does have some value in its own right. I'd hope over time we find the tool becomming a first class citizen in core but that will
likely take time.

I am curious about Randy's views on this.

I can see both points of view.

It is nice to have an example cargo bitbake recipe and that's why this one was added to meta-rust and oe-core:

https://github.com/meta-rust/meta-rust/commit/49d94ef0a74bb3274ffcb3fe25011b64865b80bc

Ok, I've looked at this for a little while tonight and I've changed my mind.

We should have an example recipe generated using using cargo bitbake.
Maybe the best example is cargo-bitbake itself!? See below.


I see that rustfmt is not exactly an easy package to serve in that role so we should remove it. rustfmt seems to be tightly coupled to rust's internals and I wasn't able to easily compile it even outside of bitbake due to a rustc_ast crate fetch error.
rustc_ast seems to be a crate that is internal to the rustc compiler:

   https://github.com/rust-lang/rust/tree/master/compiler/rustc_ast
Have I missed something here?


We could write a cargo-hello-world example or use 'simpler' packages such as
ripgrep or fd-find. The latter two packages still have ~95 crates that they
depend on so they are not exactly simple. That's why I looked into using
cargo-bitbake itself as the example.

Does anyone have a better existing package to use as a 'cargo bitbake' example
that has say fewer than 10 crates that it depends upon?



It's also possible that some users would not want to use anything except the version of rust and associated tools that are provided by oe-core and that populate an SDK. I don't have that requirement yet but I expect it may come given that some organization's
systems are tightly controlled.


We can consider adding rustfmt back if we find that having it in the SDK
or eventually for self-hosted development is useful.


I started to update my cargo-bitbake and the rustfmt recipe so let me finish that and we'll see what makes sense.

cargo-bitbake depends on 170 crates so it's not simple but
I did look at using it as an example anyway and so far it's failing to build
with the error:

| error: failed to run custom build command for `openssl-sys v0.9.54`


I'll fix that bug next, hopefully tomorrow.


I also found a simple overrides change that I'll send upstream (1).

All for tonight,

../Randy



1)
git diff

diff --git a/src/main.rs b/src/main.rs

index b2ed5d0..0fe5159 100644

--- a/src/main.rs

+++ b/src/main.rs

@@ -360,7 +360,7 @@ fn real_main(options: Args, config: &mut Config) -> CliResult {

     let git_srcpv = if !project_repo.tag && project_repo.rev.len() > 10 {

// we should be using ${SRCPV} here but due to a bitbake bug we cannot. see:

         // https://github.com/meta-rust/meta-rust/issues/136

-        format!("PV_append = \".AUTOINC+{}\"", &project_repo.rev[..10])

+        format!("PV:append = \".AUTOINC+{}\"", &project_repo.rev[..10])

     } else {

         // its a tag so nothing needed

         "".into()



I should look into that bitbake bug.


../Randy



Cheers,

Richard








--
# Randy MacLeod
# Wind River Linux

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#157471): 
https://lists.openembedded.org/g/openembedded-core/message/157471
Mute This Topic: https://lists.openembedded.org/mt/86442640/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to