tarantool / cartridge-cli

Command-line utility to manage tarantool cartridge applications
Other
49 stars 17 forks source link

Building on Alpine via mage: no matching files found #723

Open DonJuanMatus opened 2 years ago

DonJuanMatus commented 2 years ago

Hi!

I've tried to build cartridge-cli on alpine 3.15.4 via mage and got an error:

cli/create/create.go:20:12: pattern all:templates/cartridge/*: no matching files found
Error: Failed to build cartridge-cli executable: running "go build -o /opt/cartridge-cli/cartridge -ldflags -s -w -X github.com/tarantool/cartridge-cli/cli/version.gitTag=2.12.2-5-g2542beb -X github.com/tarantool/cartridge-cli/cli/version.gitCommit=2542beb -X github.com/tarantool/cartridge-cli/cli/version.versionLabel= -asmflags all=-trimpath=/opt/cartridge-cli -gcflags all=-trimpath=/opt/cartridge-cli ./cli" failed with exit code 1

Please, help to get over this error, I'm stuck.

alpine 3.15.4

Tarantool 2.10.0-1-g370040ca1

Mage Build Tool dev Build Date: 2022-06-28T07:30:39Z Commit: built with: go1.17.10

LeonidVas commented 2 years ago

Hi! Try using go 1.18.

DonJuanMatus commented 2 years ago

Hi! Try using go 1.18.

Hello!

Initially I used the tarantool image from dockerhub (Alpine 3.15.4) as a base image for cartridge. For Alpine 3.15.4 is only available Go 1.17 package.

Version 1.18 is available for Alpine 3.16. In order to use this version tarantool should be installed first. There's no tarantool packages for Alpine and therefore there's only one way is to build from source. According to the docs: https://www.tarantool.io/en/doc/latest/dev_guide/building_from_source/ version CMake 3.3+ is required to build tarantool from source. But there's only version CMake 3.23 available for Alpine: https://pkgs.alpinelinux.org/package/edge/main/x86/cmake

So when I've tried to build tarantool in Alpine 3.16, I got an error

/opt/tarantool/src/tarantool-master/build # cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DIST=ON
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:52 (message):
  Failed to find submodules