cross-rs / cross-toolchains

Additional Dockerfiles and crosstool-ng config files to build additional toolchains.
Apache License 2.0
88 stars 16 forks source link

Publish more images #32

Open mcandre opened 1 year ago

mcandre commented 1 year ago

When I try to consume cross-toolchains images, then Docker often complains of missing images from the GHCR.

$ cat Cross.toml
[target.aarch64-pc-windows-msvc]
image = "ghcr.io/cross-rs/aarch64-pc-windows-msvc:local"

$ cross build --target aarch64-pc-windows-msvc
Unable to find image 'ghcr.io/cross-rs/aarch64-pc-windows-msvc:local' locally
docker: Error response from daemon: Head "https://ghcr.io/v2/cross-rs/aarch64-pc-windows-msvc/manifests/local": denied.
See 'docker run --help'.
Emilgardis commented 1 year ago

You need to build them yourself according to the instructions.

git clone https://github.com/cross-rs/cross
cd cross
git submodule update --init --remote
cargo build-docker-image <target>-cross --tag local

we don't host these images because they are too large, too specific, legal reasons or break often.

mcandre commented 1 year ago

I am curious.

The Go compiler is able to build Apple targets as a built-in feature. The Go user does not need to manually build Docker images for this.

I'll accept that rustc and cargo do not have the same level of completeness regarding stock cross-compilation ability. But I am unsure why cross[-toolchains] considers it a legal issue to self publish the Docker images. How does Go get away with it? Why can't cross[-toolchains] similarly publish its artifacts?

Is there another way of implementing cross, or of implementing the Docker images, that would allow cross-toolchains to publish its images?

Emilgardis commented 1 year ago

the issue is republishing the toolchains for c/c++ and linking, go doesn't need to do that because it doesn't use them.

This could maybe be solved with another backend for codegeneration and linking.

So, the problem with MSVC is that Visual Studio isn't distributable, so a docker image with it inside is neither. The problem with Darwin/apple is that the SDK is needed, and we can't distribute that either.

Does that explain it?