quilkin: Cant build with `cross`

What happened:

When running make build-image (or more exactly build-linux-binary) I get

make: *** [Makefile:94: build-linux-binary] Error 127

This also happens when running the failing step without make:

docker run --rm \
  -w /workspace \
  -v /path/to/quilkin:/workspace \
  -v ~/.cargo/registry:/usr/local/cargo/registry \
  -v /var/run/docker.sock:/var/run/docker.sock \
   --entrypoint=cross quilkin-build build --target x86_64-unknown-linux-gnu ; echo $?
127

What you expected to happen:

Quilkin to build successfully with cross.

How to reproduce it (as minimally and precisely as possible):

docker run --rm \
  -w /workspace \
  -v /path/to/quilkin:/workspace \
  -v ~/.cargo/registry:/usr/local/cargo/registry \
  -v /var/run/docker.sock:/var/run/docker.sock \
   --entrypoint=cross quilkin-build build --target x86_64-unknown-linux-gnu

Just changing the entrypoint to cargo makes it work.

Anything else we need to know?:

I don’t get any output from the Makefile or when running Docker manually but if I attach to the image and try to run cross manually I get the following:

docker run --rm -it \
  -v /path/to/quilkin:/workspace \
  -v ~/.cargo/registry:/usr/local/cargo/registry \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -w /workspace \
  --entrypoint=/bin/bash quilkin-build 
root@6f37b81e4dcc:/workspace#  echo $PATH
/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

root@6f37b81e4dcc:/workspace# echo $CARGO_HOME
/usr/local/cargo

root@6f37b81e4dcc:/workspace# cross build --target x86_64-unknown-linux-gnu
info: syncing channel updates for '1.59.0-x86_64-unknown-linux-gnu'

  1.59.0-x86_64-unknown-linux-gnu unchanged - rustc 1.59.0 (9d1b2106e 2022-02-23)

info: checking for self-updates
info: downloading component 'rust-src'
info: installing component 'rust-src'
sh: 1: cargo: not found

Environment:

  • Quilkin version: 0.4.0
  • Execution environment (binary, container, etc): -
  • Operating system: WSL Ubuntu 20.04 under Windows 11
  • Custom filters? (Yes/No - if so, what do they do?): No
  • Log(s): -
  • Others: -

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Actually, this wasn’t very hard at all - been pottering on this this evening. WIP here: https://github.com/markmandel/quilkin/tree/feature/remove-cross

I expect we can leave the cross compile to mac in place, since none of that uses Docker in Docker.

I just need to make sure the generation of the Docker image still works (some of the paths of binary creation may have changed), then I can submit PRs.