Skip to content

compiling cli failed on schema #4000

Closed
Closed

Description

@trippleflux

Description

Compiling Cli 23.0.0 failed with the following error :

.go_work/build/src/github.com/docker/cli/cli/compose/schema/schema.go:62:12: pattern data/config_schema_v*.json: no matching files found

Full log :

( cd /home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/docker-23.0.0; GOOS="linux" GOARCH="amd64" GO386="" GOAMD64="v1" GOARM="" GOMIPS="" GOMIPS64="" GOPPC64="" CGO_ENABLED=1 CC="ccache_cc" CXX="ccache_cxx" CGO_CFLAGS="-mtune=tigerlake -march=tigerlake -O3 -funsafe-math-optimizations -ftree-vectorize -fno-caller-saves -fno-plt -mtune=tigerlake -march=tigerlake -O3 -funsafe-math-optimizations -ftree-vectorize -fhonour-copts -fmacro-prefix-map=/home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/docker-23.0.0=docker-23.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/home/username/works/openwrt/staging_dir/toolchain-x86_64_gcc-12.2.0_glibc/usr/include -I/home/username/works/openwrt/staging_dir/toolchain-x86_64_gcc-12.2.0_glibc/include" CGO_CXXFLAGS="-mtune=tigerlake -march=tigerlake -O3 -funsafe-math-optimizations -ftree-vectorize -fno-caller-saves -fno-plt -mtune=tigerlake -march=tigerlake -O3 -funsafe-math-optimizations -ftree-vectorize -fhonour-copts -fmacro-prefix-map=/home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/docker-23.0.0=docker-23.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_LDFLAGS="-L/home/username/works/openwrt/staging_dir/toolchain-x86_64_gcc-12.2.0_glibc/usr/lib -L/home/username/works/openwrt/staging_dir/toolchain-x86_64_gcc-12.2.0_glibc/lib -znow -zrelro -lc -lgcc_eh" GOPATH="/home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/docker-23.0.0/.go_work/build" GOCACHE="/home/username/works/openwrt/tmp/go-build" GOMODCACHE="/home/username/works/openwrt/dl/go-mod-cache" GOENV=off GO111MODULE=auto GITCOMMIT=e92dd87  GO_LINKMODE=static VERSION=23.0.0 ./scripts/build/binary; )
Building static docker-linux-amd64
+ go build -o build/docker-linux-amd64 -tags  osusergo pkcs11 -ldflags  -X "github.com/docker/cli/cli/version.GitCommit=e92dd87" -X "github.com/docker/cli/cli/version.BuildTime=2023-02-03T08:38:11Z" -X "github.com/docker/cli/cli/version.Version=23.0.0" -extldflags -static -buildmode=pie github.com/docker/cli/cmd/docker
.go_work/build/src/github.com/docker/cli/cli/compose/schema/schema.go:62:12: pattern data/config_schema_v*.json: no matching files found
make[2]: *** [Makefile:76: /home/username/works/openwrt/build_dir/target-x86_64_glibc_custom/docker-23.0.0/.built] Error 1
make[2]: Leaving directory '/home/username/works/openwrt/feeds/packages/utils/docker'
time: package/feeds/packages/docker/compile#11.08#4.83#17.00
    ERROR: package/feeds/packages/docker failed to build.
make[1]: *** [package/Makefile:116: package/feeds/packages/docker/compile] Error 1
make[1]: Leaving directory '/home/username/works/openwrt'
make: *** [/home/username/works/openwrt/include/toplevel.mk:231: package/docker/compile] Error 2

Reproduce

Compiling docker cli 23.0.0 on OpenWrt

Expected behavior

No response

docker version

None

docker info

None

Additional Info

No response

Activity

  1. trippleflux commented on Feb 3, 2023

    @trippleflux
    Author

    Using back esc is working fine, the patch :
    001-schema-fix.patch

  2. thaJeztah commented on Feb 4, 2023

    @thaJeztah
    Member

    What version of Go is this on?

  3. trippleflux commented on Feb 5, 2023

    @trippleflux
    Author

    @thaJeztah

    Version 1.19.5

  4. thaJeztah commented on Feb 6, 2023

    @thaJeztah
    Member

    Is the source located in GOPATH? (this project currently does not yet provide a go.mod)?

    Trying to reproduce in a fresh environment in a container (I'm setting CGO_ENABLED=0 related to #3494 (comment), but it worked without as well);

    docker run -it --rm golang:1.19.5-bullseye
    
    git clone https://github.com/docker/cli /go/src/github.com/docker/cli
    cd /go/src/github.com/docker/cli
    git checkout v23.0.0
    
    DISABLE_WARN_OUTSIDE_CONTAINER=1 CGO_ENABLED=0 make binary
    
    ./build/docker-linux-arm64 --version
    Docker version 23.0.0, build e92dd87c32
  5. trippleflux commented on Feb 9, 2023

    @trippleflux
    Author

    Hmm, I am building docker 23.0.0 for OpenWrt targeted x86_64, the docker makefile is located here, also I am not a go lang programmer so not quite sure on how proceed with your request.

  6. thaJeztah commented on Feb 28, 2023

    @thaJeztah
    Member

    I suspect the issue is either in

    • that script/makefile
    • a script called by that makefile (e.g. I see Build/Prepare/Default being called; don't know what that does)
    • an environment variable being set incorrectly that interferes with the build (you could check go env as part of that makefile for debugging)
    • build-dependencies missing?

    I tried some steps in a fresh environment (running on a golang:1.19 container), and ran some steps similar to what that script calls (but that's without the additional scripts that it may be calling), and in that situation things built;

    Download and extract the tar;

    curl -o docker.tgz https://codeload.github.com/docker/cli/tar.gz/v23.0.1
    
    mkdir -p /go/src/github.com/docker/cli
    tar -C /go/src/github.com/docker/cli --strip-components 1 -xvzf docker.tgz
    cd src/github.com/docker/cli/
    DISABLE_WARN_OUTSIDE_CONTAINER=1 CGO_ENABLED=0 GITCOMMIT=a5ee5b1dfc9b8f08ed9e020bb54fc18550173ef6 GO_LINKMODE=static VERSION=v23.0.1 ./scripts/build/binary
    Building static docker-linux-amd64
    + go build -o build/docker-linux-amd64 -tags  -ldflags  -X "github.com/docker/cli/cli/version.GitCommit=a5ee5b1dfc9b8f08ed9e020bb54fc18550173ef6" -X "github.com/docker/cli/cli/version.BuildTime=2023-02-28T12:18:41Z" -X "github.com/docker/cli/cli/version.Version=v23.0.1" github.com/docker/cli/cmd/docker

    After that;

    ./build/docker --version
    Docker version v23.0.1, build a5ee5b1dfc9b8f08ed9e020bb54fc18550173ef6
    
    ./build/docker version
    Client:
     Version:           v23.0.1
     API version:       1.42
     Go version:        go1.19.6
     Git commit:        a5ee5b1dfc9b8f08ed9e020bb54fc18550173ef6
     Built:             Tue Feb 28 12:20:29 2023
     OS/Arch:           linux/amd64
     Context:           default
    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

    The above steps were for v23.0.1, but also tried on v23.0.0, downloading the tar-ball from the same location as the script does.

    So from the above, I don't think there's a bug in this repository, but possibly in the OpenWRT scripts to build the binaries, and I'd recommend opening a ticket with the OpenWRT project to see if they can help.

    I'm closing the ticket here, but feel free to continue the conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions