Cross-building a binary from a private registry

What's the recommended way to cross-compile a program from a private registry? It doesn't look like cargo build supports a --registry parameter.
It seems like I could use cargo install, but I don't actually want it in my ~/.cargo/bin.

This looks a little promising:

$ cargo install --registry <REG> --no-track --root ~/tmp/foo/ --target <TRIP> myprog@0.1.0`

Or is there some other way?

1 Like

cargo build builds a project from the current directory that has Cargo.toml. You would need to get the source code of the package you want to build, locally on disk, regardless of which registry it has been published to.

cargo install is fine for building executables. It can't install libraries.

2 Likes