Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

arm-linux: explore qemu _sytem emulation_ to run cargo test #12

Open
japaric opened this issue Feb 23, 2016 · 3 comments
Open

arm-linux: explore qemu _sytem emulation_ to run cargo test #12

japaric opened this issue Feb 23, 2016 · 3 comments

Comments

@japaric
Copy link
Contributor

japaric commented Feb 23, 2016

UPDATE

We are already using QEMU with user emulation to run cross compiled test suites. This issue is now about exploring running the cross compiled test suites under QEMU's system emulation.


https://github.com/rust-lang/libc does this, it uses qemu user emulation to run tests. But its docs mention:

Note that one downside of this QEMU system is that threads are barely implemented, so we're careful to not spawn many threads.

So we may also want to explore using qemu full system emulation if the user mode presents problems in practice.

@jan-hudec
Copy link

  • Why is this still open? The implementation is already merged, isn't it?
  • On my Debian system installing qemu-user-static and binfmt-support makes it possible to execute the arm binaries, so cargo test --target arm-unknown-linux-gnueabifh and corresponding run just work. It could be worth trying on Travis too to make the script simpler.

@japaric
Copy link
Contributor Author

japaric commented Mar 16, 2016

Why is this still open? The implementation is already merged, isn't it?

I left this open to remind me of testing cargo test under qemu system. In general I want to experiment with building/testing cargo projects natively inside qemu but that's blocked on having official rustc binaries for tier 2/3 platforms (which I hope are coming soon)

On my Debian system installing qemu-user-static and binfmt-support makes it possible to execute the arm binaries, so cargo test --target arm-unknown-linux-gnueabifh and corresponding run just work.

Oh, interesting. Do you know if there are equivalent brew packages for osx?

It could be worth trying on Travis too to make the script simpler.

Yeah, I'll be up for this if we can use the same trick on both linux and osx.

@jan-hudec
Copy link

interesting

I now remember the prefix path (given via -L when calling qemu-arm explicitly) still has to be defined and that I did that by creating a link in /etc (which can't be done due to no sudo), but it can also be done by setting environment variable QEMU_LD_PREFIX.

Do you know if there are equivalent brew packages for osx?

Sorry, I have absolutely zero experience with osx.

IMO the best solution would be to teach cargo itself to support target.*.interpreter key (similar to the ar and linker it already has) that would be used as prefix for running the binaries. Because that should work even for Android, NaCL, emscripten and such where I'm not sure binfmt can go that far and doing the full build under emulation is not an option.

@japaric japaric changed the title arm-linux: use qemu to run cargo test arm-linux: explore qemu _sytem emulation_ to run cargo test Aug 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants