Re: [OE-core] mickledore - adding rust tooling to sdk seems to create problematic rustc/cargo executable configurations

2023-09-13 Thread Alexander Kanavin
Can you try this in a plain poky checkout (to the same revision as in
your setup) with no other layers? Machine qemuarm, image
core-image-minimal. If it works, you have a reference point to compare
with and untangle where the breaking difference is. If it doesn't
work, then I or someone else have a way to reproduce the issue.

Alex

On Tue, 12 Sept 2023 at 23:42, Danny  wrote:
>
> Hi Alex! Thanks for the quick response. I tried removing my 
> `TOOLCHAIN_HOST_TASK` assignment and adding the `SDK_TOOLCHAIN_LANGS` entry 
> but I'm still seeing the error.
>
> fwiw the output from `cargo build --verbose` shows me the `rustc` calls:
>
> ```
> rustc --crate-name omg --edition=2021 src/main.rs --error-format=json 
> --json=diagnostic-rendered-ansi,artifacts,future-incompat 
> --diagnostic-width=157 --crate-type bin --emit=dep-info,link -C 
> embed-bitcode=no -C debuginfo=2 -C metadata=62f339e5c64d61ff -C 
> extra-filename=-62f339e5c64d61ff --out-dir 
> /target/armv7-unknown-linux-gnueabihf/debug/deps --target 
> armv7-unknown-linux-gnueabihf -C linker=target-rust-ccld -C 
> incremental=/target/armv7-unknown-linux-gnueabihf/debug/incremental 
> -L dependency=/target/armv7-unknown-linux-gnueabihf/debug/deps -L 
> dependency=/target/debug/deps 
> --sysroot=/sysroots/cortexa7t2hf-neon-vfpv4-linux-gnueabi/usr -C 
> link-arg=--sysroot=/sysroots/cortexa7t2hf-neon-vfpv4-linux-gnueabi
> ```
> should I be double checking something is available to me in those sysroot 
> paths?
>
>
> On Tue, Sep 12, 2023 at 1:48 PM Alexander Kanavin  
> wrote:
>>
>> On Tue, 12 Sept 2023 at 19:26, Danny Hadley  wrote:
>>
>> > I can provide as much additional information as needed!
>>
>> I think you need to set
>> SDK_TOOLCHAIN_LANGS = "rust"
>> and then things should just work.
>>
>> Alex

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



Re: [OE-core] mickledore - adding rust tooling to sdk seems to create problematic rustc/cargo executable configurations

2023-09-12 Thread Danny Hadley
Hi Alex! Thanks for the quick response. I tried removing my
`TOOLCHAIN_HOST_TASK` assignment and adding the `SDK_TOOLCHAIN_LANGS` entry
but I'm still seeing the error.

fwiw the output from `cargo build --verbose` shows me the `rustc` calls:

```
rustc --crate-name omg --edition=2021 src/main.rs --error-format=json
--json=diagnostic-rendered-ansi,artifacts,future-incompat
--diagnostic-width=157 --crate-type bin --emit=dep-info,link -C
embed-bitcode=no -C debuginfo=2 -C metadata=62f339e5c64d61ff -C
extra-filename=-62f339e5c64d61ff --out-dir
/target/armv7-unknown-linux-gnueabihf/debug/deps --target
armv7-unknown-linux-gnueabihf -C linker=target-rust-ccld -C
incremental=/target/armv7-unknown-linux-gnueabihf/debug/incremental
-L dependency=/target/armv7-unknown-linux-gnueabihf/debug/deps -L
dependency=/target/debug/deps
--sysroot=/sysroots/cortexa7t2hf-neon-vfpv4-linux-gnueabi/usr -C
link-arg=--sysroot=/sysroots/cortexa7t2hf-neon-vfpv4-linux-gnueabi
```
should I be double checking something is available to me in those sysroot
paths?


On Tue, Sep 12, 2023 at 1:48 PM Alexander Kanavin 
wrote:

> On Tue, 12 Sept 2023 at 19:26, Danny Hadley  wrote:
>
> > I can provide as much additional information as needed!
>
> I think you need to set
> SDK_TOOLCHAIN_LANGS = "rust"
> and then things should just work.
>
> Alex
>

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



Re: [OE-core] mickledore - adding rust tooling to sdk seems to create problematic rustc/cargo executable configurations

2023-09-12 Thread Alexander Kanavin
On Tue, 12 Sept 2023 at 19:26, Danny Hadley  wrote:

> I can provide as much additional information as needed!

I think you need to set
SDK_TOOLCHAIN_LANGS = "rust"
and then things should just work.

Alex

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



[OE-core] mickledore - adding rust tooling to sdk seems to create problematic rustc/cargo executable configurations

2023-09-12 Thread Danny Hadley
Hey all!

I am working on rust project targeting the STM32MPU, (specifically the
stm32MP135F-DK). ST has provided two layers for supporting os development
on yocto:

their distro: https://github.com/STMicroelectronics/meta-st-openstlinux
their BSP: https://github.com/STMicroelectronics/meta-st-stm32mp

I have started to add rust support to the SDK by adding the following to my
`local.conf`:

```
TOOLCHAIN_HOST_TASK:append = " \
  packagegroup-rust-cross-canadian-${MACHINE} \
"
```

I can see this adding `rustc` and `cargo` binaries to the SDK (e.g `which
rustc` after sourcing the environment file prints
`/sysroots/x86_64-ostl_sdk-linux/usr/bin/rustc`), but they are
not letting me compile the default binary project created with `cargo new`:

```
   Compiling demo v0.1.0 (/home/vboxuser/sdk-testing/demo)
error[E0463]: can't find crate for `std`
  |
  = note: the `armv7-unknown-linux-gnueabihf` target may not be installed
  = help: consider downloading the target with `rustup target add
armv7-unknown-linux-gnueabihf`

error: cannot find macro `println` in this scope
 --> src/main.rs:2:5
  |
2 | println!("Hello, world!");
  | ^^^

error: requires `sized` lang_item

For more information about this error, try `rustc --explain E0463`.
error: could not compile `demo` due to 3 previous errors
```

Would anyone know how I can go about debugging what the problem is here? I
originally thought it may have something to do with `TARGET_VENDOR`, but
clearing that value out (so that we get `unknown` in the triple) did not
seem to work.

For reference, the build configuration looks like:

```
Build Configuration:
BB_VERSION   = "2.4.0"
BUILD_SYS= "x86_64-linux"
NATIVELSBSTRING  = "debian-11"
TARGET_SYS   = "arm-linux-gnueabi"
MACHINE  = "stm32mp13-disco"
DISTRO   = "openstlinux-weston"
DISTRO_VERSION   = "4.2.1-snapshot-20230912"
TUNE_FEATURES= "arm vfp cortexa7 neon vfpv4 thumb
callconvention-hard"
TARGET_FPU   = "hard"
DISTRO_CODENAME  = "mickledore"
ACCEPT_EULA_stm32mp13-disco = "1"
GCCVERSION   = "12.%"
PREFERRED_PROVIDER_virtual/kernel = "linux-stm32mp"
meta-rauc= "HEAD:c0dcec7b1b0d20862806915e12b4f332e5bef58c"
meta-python
meta-oe
meta-gnome
meta-initramfs
meta-multimedia
meta-networking
meta-webserver
meta-filesystems
meta-perl= "HEAD:57c516973978ca2667339bf1aae7dc722b5bcac7"
meta-st-stm32mp  = "HEAD:931b3f5be2c00f55d114c8f9122082a9d229b776"
meta-qt5 = "HEAD:cf6ffcbad5275a3428f6046468a0c9d572e813d1"
meta-st-openstlinux  = "HEAD:8c780facff81d3c3878c5fdcd18bdd24fc36478d"
meta = "HEAD:ab232138f633b0521867216570ff81fcdceb3be1"
```

I can provide as much additional information as needed!

Thank you!
- Danny

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