cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.8k stars 379 forks source link

Adding Cross.toml with empty `pre-build` causes `Unable to find image` #1526

Open nyurik opened 4 months ago

nyurik commented 4 months ago

Checklist

Describe your issue

Martin project uses cross to build aarch64-unknown-linux-musl and other targets, and so far worked well. Now I need to add nodejs in order to pre-build a few static resources as part of the build.rs. I added Cross.toml with [build] / pre-build = [ ... ] to configure nodejs installation, but adding even empty pre-build step causes this error:

WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Unable to find image 'cross-custom-martin:aarch64-unknown-linux-musl-4c595-pre-build' locally
docker: Error response from daemon: pull access denied for cross-custom-martin, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

See action run at https://github.com/maplibre/martin/pull/1416/checks - note that it simply adds "echo $CROSS_DEB_ARCH" as a pre-build step and nothing else. That PR also removes all unrelated CI steps to focus on just the failing one.

What target(s) are you cross-compiling for?

aarch64-unknown-linux-musl

Which operating system is the host (e.g computer cross is on) running?

What architecture is the host?

What container engine is cross using?

cross version

cross 0.2.5

Example

No response

Additional information / notes

No response

Emilgardis commented 4 months ago

The problem is actually a docker problem where after installing buildkit it does something strange with normal docker build that we use in cross 0.2.5. This was fixed in https://github.com/cross-rs/cross/commit/edf1e17cefd48c77c705fe85eafe78fa5f0404be

the real problem is this warning

WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load

To resolve this, either set CROSS_BUILD_OPTS="--output=type=docker"/CROSS_BUILD_OPTS="--load" or install cross from the main branch.

nyurik commented 4 months ago

Thx for prompt response! When do you think will be the next release?