-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support cross-compile install #5614
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
So looks like we have somewhat conflicting requests:
If we support @infinity0 could you explain your use-case a little bit? |
@matklad I'm giving |
@infinity0 do you distribute only the binaries, or If you are interested only in binaries, the currently-unstable |
I'm currently not distributing the I'm not sure what the intended differences between |
Sure!
I.e., Neither is a perfect fit for creating a binary distribution of the application. |
When you say "cargo-specific" do you mean "specific to how cargo has its own registered set of installed standalone binaries" as opposed to "specific to cargo as a dependency manager"? If I understood that correctly then it does sound like |
This one. By default,
Yep, the future is very hazy here! I am not on top of the things in this area, but looks like https://github.com/rust-lang-nursery/cli-wg/issues/8 is the current discussion. I think that the future directions would look like this:
So, for know, I think the best way is to use |
Fascinating! Regardless of what I think about the purposes of |
Traditionally packagers at least on UNIX/FHS-based systems rely on I can understand the need to distinguish these though so am happy to use |
I think I'd personally be inclined to take this route rather than #5606 after reading up on this. I do think that for the disto use case |
Note that if we do indeed decide to merge this we'd probably want to revert #5606 which I've basically accidentally merged at this point |
FWIW there are actually not that many different possible installation layouts, and everything I've seen can be done using the first few variables prescribed by GNU Make. Only the first few are essential, stuff further below is optional. Cargo could define its own installation layout for What I just described is a pretty standard structure across package managers. It is also quite common to use |
Correction, this would not be suitable - since the file gets rewritten every time something new is installed, it would have to maintain a file in |
@infinity0 can you include a revert of #5606 in this PR now as well since it'll be required if we merge? Additionally can you add a test that the |
To me, both #5606 and this PR seem valid (separately, of course :) ). I don't know the right solution here, but I agree that we should revert #5606 at least because it will break current packagers relying on this behavior, and that we should add The reasoning behind this my opinion is really fuzzy though, and relies on interaction with yet to be implemented features. I think
All in all, I fear that this in general perhaps is "needs design", but I don't want to block anything because I don't know a single person who is on top of all the things above. |
Excellent points @matklad! With those use cases in mind though I don't think it's clear that |
Yeah, my current understanding is that we should merge it (+ a revert) as well, I am just not confident that my current understanding is sufficiently informed :-) |
…project directory" This reverts commit 1bad991.
f2e8b01
to
86ac059
Compare
OK I've updated the PR, reverted #5606 as requested and added a test for the new |
@bors: r+ Ok thanks @infinity0! |
📌 Commit 0774e97 has been approved by |
Support cross-compile install Amazingly this Just Works, tested cross-compiling aho-corasick from amd64 to armhf on Debian.
☀️ Test successful - status-appveyor, status-travis |
Version 1.29.0 (2018-09-13) ========================== Compiler -------- - [Bumped minimum LLVM version to 5.0.][51899] - [Added `powerpc64le-unknown-linux-musl` target.][51619] - [Added `aarch64-unknown-hermit` and `x86_64-unknown-hermit` targets.][52861] Libraries --------- - [`Once::call_once` now no longer requires `Once` to be `'static`.][52239] - [`BuildHasherDefault` now implements `PartialEq` and `Eq`.][52402] - [`Box<CStr>`, `Box<OsStr>`, and `Box<Path>` now implement `Clone`.][51912] - [Implemented `PartialEq<&str>` for `OsString` and `PartialEq<OsString>` for `&str`.][51178] - [`Cell<T>` now allows `T` to be unsized.][50494] - [`SocketAddr` is now stable on Redox.][52656] Stabilized APIs --------------- - [`Arc::downcast`] - [`Iterator::flatten`] - [`Rc::downcast`] Cargo ----- - [Cargo can silently fix some bad lockfiles ][cargo/5831] You can use `--locked` to disable this behaviour. - [`cargo-install` will now allow you to cross compile an install using `--target`][cargo/5614] - [Added the `cargo-fix` subcommand to automatically move project code from 2015 edition to 2018.][cargo/5723] Misc ---- - [`rustdoc` now has the `--cap-lints` option which demotes all lints above the specified level to that level.][52354] For example `--cap-lints warn` will demote `deny` and `forbid` lints to `warn`. - [`rustc` and `rustdoc` will now have the exit code of `1` if compilation fails, and `101` if there is a panic.][52197] - [A preview of clippy has been made available through rustup.][51122] You can install the preview with `rustup component add clippy-preview` Compatibility Notes ------------------- - [`str::{slice_unchecked, slice_unchecked_mut}` are now deprecated.][51807] Use `str::get_unchecked(begin..end)` instead. - [`std::env::home_dir` is now deprecated for its unintuitive behaviour.][51656] Consider using the `home_dir` function from https://crates.io/crates/dirs instead. - [`rustc` will no longer silently ignore invalid data in target spec.][52330] [52861]: rust-lang/rust#52861 [52656]: rust-lang/rust#52656 [52239]: rust-lang/rust#52239 [52330]: rust-lang/rust#52330 [52354]: rust-lang/rust#52354 [52402]: rust-lang/rust#52402 [52103]: rust-lang/rust#52103 [52197]: rust-lang/rust#52197 [51807]: rust-lang/rust#51807 [51899]: rust-lang/rust#51899 [51912]: rust-lang/rust#51912 [51511]: rust-lang/rust#51511 [51619]: rust-lang/rust#51619 [51656]: rust-lang/rust#51656 [51178]: rust-lang/rust#51178 [51122]: rust-lang/rust#51122 [50494]: rust-lang/rust#50494 [cargo/5614]: rust-lang/cargo#5614 [cargo/5723]: rust-lang/cargo#5723 [cargo/5831]: rust-lang/cargo#5831 [`Arc::downcast`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.downcast [`Iterator::flatten`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flatten [`Rc::downcast`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.downcast
Amazingly this Just Works, tested cross-compiling aho-corasick from amd64 to armhf on Debian.