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

[BUG; website] Cross compilation instructions seem broken=? #156

Open
akauppi opened this issue Dec 21, 2024 · 2 comments
Open

[BUG; website] Cross compilation instructions seem broken=? #156

akauppi opened this issue Dec 21, 2024 · 2 comments

Comments

@akauppi
Copy link

akauppi commented Dec 21, 2024

Describe the bug

Wanting to have probe-rs run on Raspberry Pi 3B hardware, I'm following Crosscompiling instructions.

In my case I'm running these within a Multipass VM (Ubuntu), but let's pretend that's not the cause..

$ cross build -p probe-rs-tools --release --target=armv7-unknown-linux-gnueabihf
[cross] warning: unable to get metadata for package
[cross] note: Falling back to `cargo` on the host.
error: failed to parse manifest at `/home/ubuntu/probe-rs/Cargo.toml`

Caused by:
  this virtual manifest specifies a `target` section, which is not allowed

If I remove the changes to Cargo.toml, cross build seems to work and I can see:

$ file target/armv7-unknown-linux-gnueabihf/release/probe-rs
target/armv7-unknown-linux-gnueabihf/release/probe-rs: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=3214d84cfb4b080e1e0dd6530341621c70320eb3, not stripped

This leads me to believe that something has changed - perhaps in cross itself? - and the instructions should reflect that.

To Reproduce

  1. Follow the instructions, on Ubuntu
  2. Does the final command succeed?

Expected behavior

No response

Stacktrace

Operating System

Linux (Ubuntu)

Additional context

No response

@Tiwalun Tiwalun transferred this issue from probe-rs/probe-rs Dec 21, 2024
@Tiwalun
Copy link
Member

Tiwalun commented Dec 21, 2024

From what I understand this is just an issue with the website instructions, right?

The CI cross-compiles for aarch64-unknown-linux-gnu all the time, so I'm assuming there is no problem with the Cross.toml in the repository.

@akauppi
Copy link
Author

akauppi commented Dec 21, 2024

From what I understand this is just an issue with the website instructions, right?

Correct.

The CI cross-compiles for aarch64-unknown-linux-gnu all the time, so I'm assuming there is no problem with the Cross.toml in the repository.

Only now I realize the name of that file is Cross.toml. My brain read it as Cargo.toml (capital-C + toml, how many could there be?) so the problem was self-inflicted!

However, since the instructions (webside only!) have target also as a command argument, and since my steps worked without changes to Cross.toml, perhaps the section on adding lines to it can be omitted?

This text:

# Create and edit a Cross.toml file in the root of the cloned repo.
vim Cross.toml
Add the following to the Cross.toml. Which will define to cross which container should be used for the target architecture:

[target.armv7-unknown-linux-gnueabihf]
image = "crossimage"

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

2 participants