Closed chanderlud closed 8 months ago
This pr solves a problem which doesn't exist, the situation here is unfortunate though.
We don't call docker build
, we call docker buildx build
, which absolutely does support --progress
. The issue here is how docker handles error reporting. See https://github.com/cross-rs/cross/issues/1055
You should be getting an error message in the cross output suggesting how to fix this, which is to check that buildx/buildkit is available or to set CROSS_CONTAINER_ENGINE_NO_BUILDKIT=1
Yup, installing buildx got rid of the progress error. Do you think it would be reasonable for Cross to check if buildx is installed before trying to use it? That way a more helpful error message could be delivered to the user.
If you can find a good way to detect buildx, I'd be happy to include a check like that!
It looks like the docker buildx version
command is a good candidate for testing installation. I wrote this function to test for buildx being installed, but I am not sure what the best place to call it from would be.
fn is_buildx() -> bool {
let mut cmd = Command::new("docker");
cmd.args(["buildx", "version"])
.output()
// if buildx is present, it will print the version and exit 0
// if buildx is not present, it will print a warning and exit 1
.map_or(false, |out| out.status.success())
}
Newer versions of Docker no longer support the --progress flag on the docker build command. This causes Cross to fail when using versions of Docker such as 23 and 24.
For example:
I have removed the progress code from cross in this pull request, this error no longer occurs.