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

How to select version #184

Open
frosch01 opened this issue Jul 23, 2024 · 6 comments
Open

How to select version #184

frosch01 opened this issue Jul 23, 2024 · 6 comments

Comments

@frosch01
Copy link

Hi,

when I check the code, it seems there are many different cargo version supported at the same time. Can you please update documentation on how a version can be selected. I was not able to find an answer looking at the Yocto documentation.

Thx

Ralph

@seimonw
Copy link
Contributor

seimonw commented Jul 23, 2024

I use yocto's PREFERRED_VERSION variable, set in my local.conf:

PREFERRED_VERSION_rust-bin-cross-arm = "1.76.0"
PREFERRED_VERSION_cargo-bin-cross-arm = "1.76.0"

@robagar
Copy link

robagar commented Sep 4, 2024

Is it possible to select the rust version on a per-recipe basis? Generally I want to use latest stable rust, but some things need a fixed version (specifically in our case, Zenoh needing to built with rust 1.75)

@seimonw
Copy link
Contributor

seimonw commented Sep 4, 2024

I don't think there's an easy way to do this, to my knowledge you can't have two versions of a package at the same time.
Only thing I could think of is something like creating your own cargo-bin-175 class and pulling that into your zenoh recipe instead of the regular class.
Feels a bit messy, but might work!

@nastevens
Copy link
Member

There's no guide for it at the moment, but it should be possible to use Yocto multiconfig to do this. There's a short guide here and more details in the Yocto documentation itself.

If you get this working it'd be awesome to see your notes on how!

@seimonw
Copy link
Contributor

seimonw commented Sep 5, 2024

Yeah, that works @nastevens

I was able to create a build/conf/multiconfig/rust-175.conf:

PREFERRED_VERSION_rust-bin-cross-arm = "1.75.0"
PREFERRED_VERSION_cargo-bin-cross-arm = "1.75.0"

Add BBMULTICONFIG = "rust-175" to my local.conf

Then bitbake mc:rust-175:myrustdemo

In myrustdemo's log.do_compile I can see

NOTE: rustc --version rustc 1.75.0 (82e1608df 2023-12-21)
NOTE: cargo --version cargo 1.75.0 (1d8b05cdd 2023-11-20)

@nastevens
Copy link
Member

That's great, thanks for testing that out @seimonw!

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

No branches or pull requests

4 participants