pingcap / tiflash

The analytical engine for TiDB and TiDB Cloud. Try free: https://tidbcloud.com/free-trial
https://docs.pingcap.com/tidb/stable/tiflash-overview
Apache License 2.0
945 stars 409 forks source link

Build Failed on Arch exactly following the README #5968

Closed JigaoLuo closed 2 years ago

JigaoLuo commented 2 years ago

Bug Report

1. Minimal reproduce step (Required)

> ninja tiflash    

[0/40] Building TiFlash Proxy using release profile
./release.sh
make[1]: Entering directory '/home/jigao/Workspace/tiflash/contrib/tiflash-proxy'
PROXY_ENABLE_FEATURES="portable sse test-engine-kv-rocksdb test-engine-raft-raft-engine cloud-aws cloud-gcp cloud-azure pprof-fp" ./build.sh
profile is release
engine is tiflash
prometheus metric name prefix is tiflash_proxy_
frame pointer is enabled
+ [[ -n 1 ]]
+ [[ 1 != \0 ]]
+ rustup component add rust-src
info: component 'rust-src' is up to date
+ cargo build --no-default-features --features 'portable sse test-engine-kv-rocksdb test-engine-raft-raft-engine cloud-aws cloud-gcp cloud-azure pprof-fp' --release -Z build-std=core,std,alloc,proc_macro,test --target=x86_64-unknown-linux-gnu -Z unstable-options --out-dir=target/release
   Compiling snappy-sys v0.1.0 (https://github.com/busyjay/rust-snappy.git?branch=static-link#8c12738b)
   Compiling grpcio-sys v0.10.1+1.44.0
error: failed to run custom build command for `snappy-sys v0.1.0 (https://github.com/busyjay/rust-snappy.git?branch=static-link#8c12738b)`

Caused by:
  process didn't exit successfully: `/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/release/build/snappy-sys-4bb1c1b3c53e7d57/build-script-build` (exit status: 101)
  --- stdout
  running: "/usr/bin/cmake" "/home/jigao/.cargo/git/checkouts/rust-snappy-0ed33e4b7b96fc57/8c12738/snappy-sys/snappy" "-DCMAKE_INSTALL_PREFIX=/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu -w -fuse-ld=lld -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" "-DCMAKE_C_COMPILER=/usr/bin/clang" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu -w -fuse-ld=lld -stdlib=libc++ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" "-DCMAKE_CXX_COMPILER=/usr/bin/clang++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu -w -fuse-ld=lld -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" "-DCMAKE_ASM_COMPILER=/usr/bin/clang" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is Clang 14.0.6
  -- The CXX compiler identification is Clang 14.0.6
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /usr/bin/clang
  -- Check for working C compiler: /usr/bin/clang - broken
  -- Configuring incomplete, errors occurred!
  See also "/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeOutput.log".
  See also "/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/usr/bin/clang"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeTmp

      Run Build Command(s):/usr/bin/make -f Makefile cmTC_f752e/fast && make[2]: Entering directory '/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeTmp'
      /usr/bin/make  -f CMakeFiles/cmTC_f752e.dir/build.make CMakeFiles/cmTC_f752e.dir/build
      make[3]: Entering directory '/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeTmp'
      Building C object CMakeFiles/cmTC_f752e.dir/testCCompiler.c.o
      /usr/bin/clang   -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu -w -fuse-ld=lld -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -MD -MT CMakeFiles/cmTC_f752e.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_f752e.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_f752e.dir/testCCompiler.c.o -c /home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      Linking C executable cmTC_f752e
      /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f752e.dir/link.txt --verbose=1
      /usr/bin/clang  -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu -w -fuse-ld=lld -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -rdynamic CMakeFiles/cmTC_f752e.dir/testCCompiler.c.o -o cmTC_f752e 
      clang-14: error: invalid linker name in argument '-fuse-ld=lld'
      make[3]: *** [CMakeFiles/cmTC_f752e.dir/build.make:100: cmTC_f752e] Error 1
      make[3]: Leaving directory '/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeTmp'
      make[2]: *** [Makefile:127: cmTC_f752e/fast] Error 2
      make[2]: Leaving directory '/home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/x86_64-unknown-linux-gnu/release/build/snappy-sys-3c3ee3f3563c6036/out/build/CMakeFiles/CMakeTmp'

    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:2 (project)

  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/jigao/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
make[1]: *** [Makefile:178: build] Error 101
make[1]: Leaving directory '/home/jigao/Workspace/tiflash/contrib/tiflash-proxy'
make: *** [Makefile:194: release] Error 2
FAILED: /home/jigao/Workspace/tiflash/contrib/tiflash-proxy/target/release/libtiflash_proxy.so 
cd /home/jigao/Workspace/tiflash/contrib/tiflash-proxy && /usr/bin/cmake -E env CC=/usr/bin/clang CXX=/usr/bin/clang++ CXXSTDLIB=c++ CMAKE=/usr/bin/cmake "CFLAGS=-w -fuse-ld=lld" "CXXFLAGS=-w -fuse-ld=lld -stdlib=libc++" "RUSTFLAGS=-C rpath=yes -C linker=/home/jigao/Workspace/tiflash/build/contrib/tiflash-proxy-cmake/tiflash-linker" PROTOC=/home/jigao/Workspace/tiflash/build/contrib/protobuf-cmake/protoc PROTOC_INCLUDE=/home/jigao/Workspace/tiflash/contrib/protobuf/src ENGINE_LABEL_VALUE=tiflash make release
ninja: build stopped: subcommand failed.

2. What did you expect to see? (Required)

Build success.

3. What did you see instead (Required)

Build fails

4. What is your TiFlash version? (Required)

TiFlash: master Cmake: 3.24.1 Clang 14 OS: Arch

JigaoLuo commented 2 years ago

/assign