termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
12.94k stars 2.98k forks source link

golang can not build deb package #4530

Closed CMingTseng closed 4 years ago

CMingTseng commented 4 years ago

Dear Sir

i want build our prefix package

and need use golang and python

but i get error

i use

./build-package.sh -a arm golang

get this error

" ninja: build stopped: subcommand failed. /home/builder/termux-packages/packages/libllvm/build.sh: line 99: zsh: command not found"

and

where can found clang ?

i do not found any clang package

THX

other info __

[2735/3771] Building CXX object tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o FAILED: tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o /home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/builder/.termux-build/_cache/android-r20-api-24-v2 --sysroot=/home/builder/.termux-build/_cache/android-r20-api-24-v2/sysroot -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/ASTMatchers/Dynamic -I/home/builder/.termux-build/libllvm/src/tools/clang/lib/ASTMatchers/Dynamic -I/home/builder/.termux-build/libllvm/src/tools/clang/include -Itools/clang/include -Iinclude -I/home/builder/.termux-build/libllvm/src/include -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -Oz -fno-addrsig --target=armv7a-linux-androideabi24 -I/data/data/io.busniess.va.sandhook/virtual/data/user/0/com.termux/files/usr/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -Os -DNDEBUG -fPIC -fno-exceptions -fno-rtti -MD -MT tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o -MF tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o.d -o tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o -c /home/builder/.termux-build/libllvm/src/tools/clang/lib/ASTMatchers/Dynamic/Registry.cpp clang++: error: unable to execute command: Killed clang++: error: clang frontend command failed due to signal (use -v to see invocation) Android (5220042 based on r346389c) clang version 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf643d27dbca1bb228957008617) (https://android.googlesource.com/toolchain/llvm 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn) Target: armv7a-unknown-linux-android24 Thread model: posix InstalledDir: /home/builder/.termux-build/_cache/android-r20-api-24-v2/bin clang++: note: diagnostic msg: PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace, preprocessed source, and associated run script. clang++: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /tmp/Registry-cd57ae.cpp clang++: note: diagnostic msg: /tmp/Registry-cd57ae.sh clang++: note: diagnostic msg:

Grimler91 commented 4 years ago

clang is a subpackage of libllvm.

Your build of golang is clearly failing when building libllvm so I guess the

" ninja: build stopped: subcommand failed.
/home/builder/termux-packages/packages/libllvm/build.sh: line 99: zsh: command not found"

error happens after the clang build error. I guess the error happens for some reason due to the changed TERMUX_PREFIX, but hard to know without knowing your full setup. I'll run a ./build-package.sh -a arm golang to verify that it doesn't happen for us.

RossComputerGuy commented 4 years ago

@Grimler91 btw, your markdown got messed up in your comment

Grimler91 commented 4 years ago

@RossComputerGuy thanks, fixed

Grimler91 commented 4 years ago

The error is not reproducible in the standard termux docker image so the error comes from some change you have made to the environment.

ghost commented 4 years ago
clang++: error: unable to execute command: Killed
clang++: error: clang frontend command failed due to signal (use -v to see invocation)

- failure happens due to out-of-ram condition. Try to use export TERMUX_MAKE_PROCESSES=1. If doesn't help, perhaps you need machine with at least 8 GB of RAM. Cannot be fixed on our side, LLVM is heavy and require a lot of resources.


We have following code piece in build.sh:

termux_step_make() {
    ninja || zsh
}

- here should be bash and not zsh (zsh is not installed in docker image by default). Shell call may be even removed, though it is useful to manually restarting build to see what is happening on failure.

CMingTseng commented 4 years ago

The error is not reproducible in the standard termux docker image so the error comes from some change you have made to the environment.

Dear Sir @Grimler91

My host OS is OSX 10.15 ( i7 . 6 core 16G DDR4)

i run this by docker

i clone the project

and then modify TERMUX_PREFIX / TERMUX_ANDROID_HOME

https://github.com/termux/termux-packages/blob/master/scripts/build/termux_step_setup_variables.sh

and then

sh ./scripts/run-docker.sh

get docker shell

and then

./build-package.sh golang

to make our prefix package

THX

clang++: error: unable to execute command: Killed
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
  • failure happens due to out-of-ram condition. Try to use export TERMUX_MAKE_PROCESSES=1. If doesn't help, perhaps you need machine with at least 8 GB of RAM. Cannot be fixed on our side, LLVM is heavy and require a lot of resources.

We have following code piece in build.sh:

termux_step_make() {
  ninja || zsh
}
  • here should be bash and not zsh (zsh is not installed in docker image by default). Shell call may be even removed, though it is useful to manually restarting build to see what is happening on failure.

Dear Sir @xeffyr

i run

./build-package.sh golang

at docker

and get the error

THX

CMingTseng commented 4 years ago

Dear Sir

i can pass to

2253/3772

but 2254 /2261 fail

THX

[2254/3772] Building CXX object lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o FAILED: lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o /home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/clang++ --target=aarch64-none-linux-android --gcc-toolchain=/home/builder/.termux-build/_cache/android-r20-api-24-v2 --sysroot=/home/builder/.termux-build/_cache/android-r20-api-24-v2/sysroot -DGTEST_HAS_RTTI=0 -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Passes -I/home/builder/.termux-build/libllvm/src/lib/Passes -Iinclude -I/home/builder/.termux-build/libllvm/src/include -fstack-protector-strong -Oz -fno-addrsig --target=aarch64-linux-android24 -I/data/data/io.busniess.va.sandhook/virtual/data/user/0/com.termux/files/usr/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Os -DNDEBUG -fPIC -fno-exceptions -fno-rtti -MD -MT lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o -MF lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o.d -o lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o -c /home/builder/.termux-build/libllvm/src/lib/Passes/PassBuilder.cpp clang++: error: unable to execute command: Killed clang++: error: clang frontend command failed due to signal (use -v to see invocation) Android (5220042 based on r346389c) clang version 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf643d27dbca1bb228957008617) (https://android.googlesource.com/toolchain/llvm 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn) Target: aarch64-unknown-linux-android24 Thread model: posix InstalledDir: /home/builder/.termux-build/_cache/android-r20-api-24-v2/bin clang++: note: diagnostic msg: PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace, preprocessed source, and associated run script. clang++: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /tmp/PassBuilder-d3ed8a.cpp clang++: note: diagnostic msg: /tmp/PassBuilder-d3ed8a.sh clang++: note: diagnostic msg:


[2261/3772] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86ISelLowering.cpp.o ninja: build stopped: subcommand failed. /home/builder/termux-packages/packages/libllvm/build.sh: line 99: zsh: command not found

ghost commented 4 years ago

I just wrote - you cannot build because compiler crashes on your host. This is unfixable! Use host with larger amount of RAM or use CI/CD like we do.