Skip to content

Cross with managed volumes #131

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

Closed
wants to merge 11 commits into from
Closed

Conversation

jamesmunns
Copy link
Contributor

@jamesmunns jamesmunns commented Sep 26, 2017

Hey @japaric, this is a not-yet-ready-to-merge branch, but I'd like to get your feedback on it. I'm happy to spend time cleaning this up, but I have the "big picture" functionality in place (or at least I think so).

Putting out some known negatives first:

  • I removed a lot of stuff. I could definitely use guidance to make sure I didn't accidentally cut out something important, particularly everything regarding interpreter.rs.
  • I have not tested this outside of Linux yet. I tried with a VM, but docker doesn't run there, so I will need a physical machine. I should have access to one this week.
  • I have not implemented a cap on the number of environments, or any kind of "garbage collection".
  • Lots of documentation will need to be updated, and I expect all of the tests to break.
  • Some behavior is probably not consistent to respecting flags and environment variables that should override/set behavior.

Some positives:

  • This worked really well with my limited testing (basically cross compiling cross itself to different targets with different toolchains, entirely dockerized, and including cross run)
  • Theoretically, this should have no environmental dependencies (other than Docker), so users could now get a precompiled binary of cross, and be compiling/cross compiling with no rust environment installed at all. Still needs to be tested/verified.
  • Theoretically, this should work on OSX/Windows now, as long as they have Docker.
  • It was not necessary to modify any of your existing docker images. The rust toolchain just comes from somewhere else now.

If you'd like to test this locally, there is one manual step required, you will have to build the volume manager image locally, with docker build -t volmgr -f ./volume_manager/Dockerfile ./volume_manager from the root of the repository. This step is only necessary once (or if you modify something in <crate root>/volume_manager.

@jamesmunns
Copy link
Contributor Author

NOTE: cross rustup instead of garbage collection?

@jamesmunns
Copy link
Contributor Author

NOTE: Only one copy of the registry.

@homunkulus
Copy link
Contributor

☔ The latest upstream changes (presumably #138) made this pull request unmergeable. Please resolve the merge conflicts.

@homunkulus
Copy link
Contributor

☔ The latest upstream changes (presumably #157) made this pull request unmergeable. Please resolve the merge conflicts.

@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 28, 2018

cc me

@dvc94ch dvc94ch mentioned this pull request Mar 3, 2018
7 tasks
@dvc94ch
Copy link
Contributor

dvc94ch commented Mar 6, 2018

So the first two commits work for me, I'm not sure about the rest, had some trouble but can retest.

Why is Cross.toml required?

@jamesmunns
Copy link
Contributor Author

@dvc94ch at least from a first skim, I need somewhere to specify what the toolchain to use is, similar to how you do this:

cargo +nightly build

This allows you to set the version of rust used to build in this instance (since it is decoupled from your host environment), so you could select stable, nightly, nightly-2018-02-01 etc.

@jamesmunns
Copy link
Contributor Author

We probably could "steal" the cargo syntax, and take it on the command line instead of a config file, which might be better UX anyway. I don't think I knew about that syntax while I was writing this PR.

@dvc94ch
Copy link
Contributor

dvc94ch commented Mar 6, 2018

This allows you to set the version of rust used to build in this instance (since it is decoupled from your host environment), so you could select stable, nightly, nightly-2018-02-01 etc.

Yes, but I prefer having a reasonable default, and add a Cross.toml if I want to change the default.

I also like the cli method...

@jamesmunns
Copy link
Contributor Author

Yeah, I would say CLI is preferred, or you can optionally make a cross.toml if you want it to be "persistent", or checked in. I would suggest stealing that code from Cargo.

I probably won't have time to work on this until at least this weekend (working on svd2rust in my existing free time), but feel free to ping me via here, IRC, or email (or we can set up a video chat) if you want to take over or understand what/why I did something.

dvc94ch referenced this pull request in riscv-rust/riscv-rust-toolchain Mar 13, 2018
@jamesmunns
Copy link
Contributor Author

jamesmunns commented Mar 17, 2018

@dvc94ch I added support for the cross +nightly-2018-02-01 syntax, any chance you could hop on IRC (#rust-embedded) to discuss what you need?

I also would like to understand how to integrate a self-built rustc and/or cargo.

@dvc94ch
Copy link
Contributor

dvc94ch commented Mar 17, 2018

I wrote on IRC, not sure if you got it. I'm reposting here in case you haven't seen it.

I'm not sure what I need yet. I've been distracted lately with some sideprojects. I told japaric I'd PR Rust's llvm - which may solve the problem entirely and see how much resistance there is. getting the PR merged is worthwhile for cross regardless... :)

@dvc94ch
Copy link
Contributor

dvc94ch commented Mar 23, 2018

Looks like we need an embedded rust http server for distributing target specific toolchains and then we can pass RUSTUP_DIST_ROOT to load the toolchain from there.

cc @japaric @dylanmckay @pftbest

@dvc94ch
Copy link
Contributor

dvc94ch commented Mar 24, 2018

@jamesmunns here's a custom rust release in case you are still playing around with this:
https://github.com/riscv-rust/rust/releases/tag/riscv-rust-1.26.0-1-dev

@dvc94ch
Copy link
Contributor

dvc94ch commented Mar 24, 2018

@jamesmunns:
After checking out the latest branch and running:

cargo install --force
docker build -t volmgr  ./volume_manager
cross +stable build

I get this:

Skipping Xargo install...
Targeting stable x86_64-unknown-linux-gnu
sh: 6: rustup: not found
sh: 9: rustup: not found
sh: 1: cargo: not found

@Dylan-DPC-zz
Copy link

@jamesmunns any updates on this?

@jamesmunns
Copy link
Contributor Author

@Dylan-DPC This was generally a PoC, though worked for at least basic use cases on Linux at least last time I tested it. If there is interest in it, I can try to freshen it up, it would be nice to have at least one person willing to test on Windows, I have a Mac and Linux PCs to test with (it needs to be an actual machine that can run a docker service, or a VM that supports virtualization from the guest, which doesn't include QEMU or VirtualBox, last I checked).

@Dylan-DPC-zz
Copy link

Dylan-DPC-zz commented Oct 8, 2018

@jamesmunns not sure. you will have to discuss this with the others whether it is a good idea to go forward with this or not.

@dignifiedquire
Copy link

This would be great to have, I have both mac and windows machines here that I could help test on

@dignifiedquire
Copy link

I found a fix for the rustup not found issue. It seems docker really wants that mount directory to end in a slash so this change, in src/volume.rs, fixes the problem for me on my mac.

-    let base_mapping = format!("{}:/volwork", &base_path);
+    let base_mapping = format!("{}/:/volwork", &base_path);

@dignifiedquire
Copy link

I just ran tests on my mac with this against --target aarch64-linux-android 🎉

@Disasm
Copy link

Disasm commented Feb 20, 2019

What is the current status of this PR?

@Disasm Disasm added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-tools labels Feb 22, 2019
@dignifiedquire
Copy link

any update, happy to help, but this would be really useful

@xoac xoac mentioned this pull request Apr 17, 2019
@jamesmunns
Copy link
Contributor Author

Closing this, as it is very stale, and unlikely to happen as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants