axolotl icon indicating copy to clipboard operation
axolotl copied to clipboard

dependencies-deb-arm64 target doesn't install cmake

Open josch opened this issue 3 years ago • 1 comments

Without cmake installed, running make build-deb-arm64 after make dependencies-deb-arm64 results in:

error: failed to run custom build command for 

Caused by:
  process didn't exit successfully: cargo:rerun-if-changed=/home/josch/axolotl/third-party/protobuf/cmake (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/home/josch/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake
  CMAKE_TOOLCHAIN_FILE_aarch64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_aarch64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-unknown-linux-gnu = None
  CMAKE_GENERATOR_aarch64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_aarch64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-unknown-linux-gnu = None
  CMAKE_aarch64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/home/josch/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake" "-Dprotobuf_BUILD_TESTS=OFF" "-DCMAKE_INSTALL_PREFIX=/home/josch/axolotl/crayfish/target/release/build/prost-build-00556a1a96e175f7/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"

  --- stderr
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', /home/josch/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with  environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:269: build-deb-arm64] Error 101

Apart from that, https://github.com/nanu-c/axolotl/blob/main/docs/INSTALL.md#mobian-or-debian-arm64-systems says "Packaging is still under improvement to comply with official Debian packaging rules." Where is this packaging located? What I found is very far away from complying with official Debian packaging rules. Is there ongoing work elsewhere?

josch avatar Oct 14 '22 12:10 josch

Hey josch, thanks for posting the issue. I'll look into it!

And yes, packaging is far from being run on a Debian server for official packaging. My skills are limited and I tried my best to make it run automatically in the Github workflow to get a deb file.

If you are more experienced with packaging, we could try it together...

Have a nice day!

nuehm-arno avatar Oct 15 '22 11:10 nuehm-arno

Hey josch, could you give me more information about your building steps? I couldn't reproduce your error and from my point of view, it seems, you wanted to cross-compile Axolotl using the non-cross-compiling make targets. If so, please try the make build-deb-arm64-cc target. Cheers

nuehm-arno avatar Nov 21 '22 15:11 nuehm-arno

Me again. I think, I found your error. It seems to be two missing dependencies for building prost-build in rust. Please try to run this following command before executing the make targets.

apt install libprotobuf-dev protobuf-compiler

If successful, I will change the Makefile accordingly.

Cheers.

P.S.: Source

nuehm-arno avatar Nov 23 '22 07:11 nuehm-arno

No, I do not want to cross compile. I'm on an arm64 laptop. This one: https://shop.mntmn.com/products/mnt-reform

To reproduce my error, just temporarily remove the cmake package from your system, move your ~/.cargo directory elsewhere and run the steps outlined in https://github.com/nanu-c/axolotl/blob/main/docs/INSTALL.md#mobian-or-debian-arm64-systems Many dependencies will get installed but not cmake, so the build fails because it needs cmake for compiling some cargo module. Here is the beginning of the newly packages that will be installed by that make target:

The following NEW packages will be installed:
  adduser curl debmake devscripts dirmngr eslint fakeroot file gnupg gnupg-l10n gnupg-utils golang golang-1.19
  golang-1.19-doc golang-doc gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gyp libassuan0
  libb-hooks-op-check-perl libc-ares2 libclass-method-modifiers-perl libclass-xsaccessor-perl libclone-perl libcurl4
  libdevel-callchecker-perl libdynaloader-functions-perl libencode-locale-perl libfakeroot libfile-dirlist-perl
  libfile-homedir-perl libfile-listing-perl libfile-touch-perl libfile-which-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-date-perl libhttp-message-perl
  libhttp-negotiate-perl libicu72 libimport-into-perl libio-html-perl libio-pty-perl libio-socket-ssl-perl

As you can see, this list is sorted alphabetically, and cmake is not among them.

Alternatively, if you do not want to temporarily remove cmake from your system and move your ~/.cargo elsewhere to reproduce the problem, you can also try it inside a clean chroot with only git,ca-certificates,build-essential,golang-go,sudo installed initially:

mmdebstrap --variant=apt --include=git,ca-certificates,build-essential,golang-go,sudo --customize-hook='chroot "$1" sh -c "
git clone https://github.com/nanu-c/axolotl.git && cd axolotl &&
make dependencies-deb-arm64 &&
env GO111MODULE=off go get -d -u github.com/nanu-c/axolotl/ &&
make build-deb-arm64"' unstable /dev/null

josch avatar Nov 23 '22 07:11 josch

Ah, I was writing my post while you already had replied as well. :slightly_smiling_face:

I don't think that #1781 is the same as this one. In #1781 the problem is a missing
protoc binary. This bug is about missing cmake. Installing libprotobuf-dev and protobuf-compiler does not pull in cmake so this doesn't fix the problem.

josch avatar Nov 23 '22 08:11 josch

I did a run with these two new dependencies and it went through. Please give it a try! From my point of view, cargo is shiping its own cmake instance.

nuehm-arno avatar Nov 23 '22 15:11 nuehm-arno

P.S.: Excuse my misinterpretation of your arm64 machine. Looks like a nice notebook!

nuehm-arno avatar Nov 23 '22 15:11 nuehm-arno

Both are not needed to let the build run through. It's sufficient to just additionally add protobuf-compiler. So this works now without errors:

mmdebstrap --variant=apt --include=git,ca-certificates,build-essential,golang-go,sudo,protobuf-compiler \
--customize-hook='chroot "$1" sh -c "export HOME=/root &&
git clone https://github.com/nanu-c/axolotl.git && cd axolotl &&
make dependencies-deb-arm64 &&
env GO111MODULE=off go get -d -u github.com/nanu-c/axolotl/ &&
make build-deb-arm64"' unstable /dev/null

josch avatar Nov 25 '22 20:11 josch