dflemstr / rq

Record Query - A tool for doing record analysis and transformation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to build on Ubuntu 17.04 (cargo install record-query)

OnkelTem opened this issue · comments

Very interesting tool, can't wait to try it! Unfortunately I can't get it working yet (although I'm in #rust now, trying to get some help).

This is the end of the output:

   Compiling v8-sys v0.14.7
     Running `rustc --crate-name build_script_build .cargo/registry/src/github.com-1ecc6299db9ec823/v8-sys-0.14.7/build.rs --crate-type bin --emit=dep-info,link -C opt-level=3 -C metadata=3c59d3aa98b83b67 -C extra-filename=-3c59d3aa98b83b67 --out-dir /tmp/cargo-install.zUq1aqe0fkwu/release/build/v8-sys-3c59d3aa98b83b67 -L dependency=/tmp/cargo-install.zUq1aqe0fkwu/release/deps --extern bindgen=/tmp/cargo-install.zUq1aqe0fkwu/release/deps/libbindgen-33d82076b08e1866.rlib --extern v8_api=/tmp/cargo-install.zUq1aqe0fkwu/release/deps/libv8_api-6e23d22258b7953d.rlib --extern gcc=/tmp/cargo-install.zUq1aqe0fkwu/release/deps/libgcc-118bac73fa1fe04b.rlib --extern pkg_config=/tmp/cargo-install.zUq1aqe0fkwu/release/deps/libpkg_config-7b4ed940afa8e62e.rlib --extern clang_sys=/tmp/cargo-install.zUq1aqe0fkwu/release/deps/libclang_sys-d3cd6993850d8fe4.rlib --extern clang=/tmp/cargo-install.zUq1aqe0fkwu/release/deps/libclang-b5878b92bc89abe7.rlib --cap-lints warn`
warning: use of deprecated item: gcc::Config has been renamed to gcc::Build
   --> .cargo/registry/src/github.com-1ecc6299db9ec823/v8-sys-0.14.7/build.rs:205:22
    |
205 |     let mut config = gcc::Config::new();
    |                      ^^^^^^^^^^^^^^^^
    |
    = note: #[warn(deprecated)] on by default
 
     Running `/tmp/cargo-install.zUq1aqe0fkwu/release/build/v8-sys-3c59d3aa98b83b67/build-script-build`
cargo:rerun-if-changed=src/v8-trampoline.h
cargo:rerun-if-changed=src/v8-glue.h
cargo:rerun-if-changed=src/v8-glue.cc
thread 'main' panicked at 'No clang found, is it installed?', /checkout/src/libcore/option.rs:819:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: failed to compile `record-query v0.10.4`, intermediate artifacts can be found at `/tmp/cargo-install.zUq1aqe0fkwu`
 
Caused by:
  failed to run custom build command for `v8-sys v0.14.7`
process didn't exit successfully: `/tmp/cargo-install.zUq1aqe0fkwu/release/build/v8-sys-3c59d3aa98b83b67/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=src/v8-trampoline.h
cargo:rerun-if-changed=src/v8-glue.h
cargo:rerun-if-changed=src/v8-glue.cc
 
--- stderr
thread 'main' panicked at 'No clang found, is it installed?', /checkout/src/libcore/option.rs:819:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Ubuntu 17.04

Ok, on #rust I was recommended to install clang:

sudo apt-get install clang

after which it went farther but stopped again at missing v8.h. Then I installed libv8-dev

sudo apt-get install libv8-dev

and after the next fail on missing v8-platform.h - nodejs-dev:

sudo apt-get install nodejs-dev

which oddly didn't resolve the issue with missing v8-platform.h:

Running `/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-3c59d3aa98b83b67/build-script-build`
cargo:rerun-if-changed=src/v8-trampoline.h
cargo:rerun-if-changed=src/v8-glue.h
cargo:rerun-if-changed=src/v8-glue.cc
-I"/usr/local/include"
-I"/usr/lib/llvm-4.0/bin/../lib/clang/4.0.0/include"
-I"/usr/include/x86_64-linux-gnu"
-I"/usr/include"
src/v8-trampoline.h:4:10: fatal error: 'v8-platform.h' file not found
preferring static linking: true
cargo:warning=pkg-config failed, falling back to naïve lib search: Err(Failure { command: "\"pkg-config\" \"--static\" \"--libs\" \"--cflags\" \"v8\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package v8 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `v8.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'v8\' found\n" } })
cargo:rustc-link-search=native=/usr/lib
cargo:rustc-link-search=native=/usr/local/lib
cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu
cargo:rustc-link-lib=static=v8_base
cargo:rustc-link-lib=static=v8_libbase
cargo:rustc-link-lib=static=v8_libsampler
cargo:rustc-link-lib=static=v8_nosnapshot
cargo:rustc-link-lib=static=icui18n
cargo:rustc-link-lib=static=icuuc
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = None
CXX_x86_64_unknown_linux_gnu = None
HOST_CXX = None
CXX = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXXFLAGS_x86_64-unknown-linux-gnu = None
CXXFLAGS_x86_64_unknown_linux_gnu = None
HOST_CXXFLAGS = None
CXXFLAGS = None
DEBUG = Some("false")
running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-I" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out" "-std=c++11" "-Wall" "-Wall" "-Wextra" "-o" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out/src/v8-glue.o" "-c" "src/v8-glue.cc"
cargo:warning=In file included from src/v8-glue.cc:1:0:
cargo:warning=src/v8-glue.h:4:25: fatal error: v8-platform.h: No such file or directory
cargo:warning= #include <v8-platform.h>
cargo:warning=                         ^
cargo:warning=compilation terminated.
exit code: 1
thread 'main' panicked at '

Internal error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-I" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out" "-std=c++11" "-Wall" "-Wall" "-Wextra" "-o" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out/src/v8-glue.o" "-c" "src/v8-glue.cc" with args "c++" did not execute successfully (status code exit code: 1).

', .cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.54/src/lib.rs:1670:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: failed to compile `record-query v0.10.4`, intermediate artifacts can be found at `/tmp/cargo-install.lVqBlxh1x7qh`

Caused by:
  failed to run custom build command for `v8-sys v0.14.7`
process didn't exit successfully: `/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-3c59d3aa98b83b67/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=src/v8-trampoline.h
cargo:rerun-if-changed=src/v8-glue.h
cargo:rerun-if-changed=src/v8-glue.cc
-I"/usr/local/include"
-I"/usr/lib/llvm-4.0/bin/../lib/clang/4.0.0/include"
-I"/usr/include/x86_64-linux-gnu"
-I"/usr/include"
preferring static linking: true
cargo:warning=pkg-config failed, falling back to naïve lib search: Err(Failure { command: "\"pkg-config\" \"--static\" \"--libs\" \"--cflags\" \"v8\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package v8 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `v8.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'v8\' found\n" } })
cargo:rustc-link-search=native=/usr/lib
cargo:rustc-link-search=native=/usr/local/lib
cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu
cargo:rustc-link-lib=static=v8_base
cargo:rustc-link-lib=static=v8_libbase
cargo:rustc-link-lib=static=v8_libsampler
cargo:rustc-link-lib=static=v8_nosnapshot
cargo:rustc-link-lib=static=icui18n
cargo:rustc-link-lib=static=icuuc
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = None
CXX_x86_64_unknown_linux_gnu = None
HOST_CXX = None
CXX = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CXXFLAGS_x86_64-unknown-linux-gnu = None
CXXFLAGS_x86_64_unknown_linux_gnu = None
HOST_CXXFLAGS = None
CXXFLAGS = None
DEBUG = Some("false")
running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-I" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out" "-std=c++11" "-Wall" "-Wall" "-Wextra" "-o" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out/src/v8-glue.o" "-c" "src/v8-glue.cc"
cargo:warning=In file included from src/v8-glue.cc:1:0:
cargo:warning=src/v8-glue.h:4:25: fatal error: v8-platform.h: No such file or directory
cargo:warning= #include <v8-platform.h>
cargo:warning=                         ^
cargo:warning=compilation terminated.
exit code: 1

--- stderr
src/v8-trampoline.h:4:10: fatal error: 'v8-platform.h' file not found
thread 'main' panicked at '

Internal error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-I" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out" "-std=c++11" "-Wall" "-Wall" "-Wextra" "-o" "/tmp/cargo-install.lVqBlxh1x7qh/release/build/v8-sys-fb0f0887dcaf9ddb/out/src/v8-glue.o" "-c" "src/v8-glue.cc" with args "c++" did not execute successfully (status code exit code: 1).

', .cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.54/src/lib.rs:1670:4
note: Run with `RUST_BACKTRACE=1` for a backtrace

Ok, I'm giving up.

Let me leave my few poopy cents: I expected more from your cargo thing, after all - shouldn't it provision a guided installation process and, particularly, recommend missing libraries at least? See, I had to manually investigate logs output in search for the causes, manually find missing files in Ubuntu repos, manually install them... I don't know... This is all messy.

You're absolutely right that this is a bit messy right now. The root cause is that V8 is incredibly slow to compile so I don't want to do it as part of the rq build process, and each OS ships a totally different version of V8. Also, V8 breaks API compatibility constantly.

What I'm trying to do right now is to improve the v8 crate to use a more modern bindgen with direct C++ support, as well as using a stable subset of the API. Then the V8 build will be more portable.

I can confirm that this is still an issue (on MacOS):

error: failed to compile `record-query v0.10.4`, intermediate artifacts can be found at `/var/folders/04/8qq85w2s5fn86jd1thbg8tq80j2yx0/T/cargo-install.Gv2L8xhAPTu2`

Caused by:
  failed to run custom build command for `v8-sys v0.14.7`
process didn't exit successfully: `/var/folders/04/8qq85w2s5fn86jd1thbg8tq80j2yx0/T/cargo-install.Gv2L8xhAPTu2/release/build/v8-sys-26688e6b25149b07/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=src/v8-trampoline.h
cargo:rerun-if-changed=src/v8-glue.h
cargo:rerun-if-changed=src/v8-glue.cc
-I"/usr/local/include"
-I"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include"
-I"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include"
-I"/usr/include"
-I"/System/Library/Frameworks"
-I"/Library/Frameworks"
preferring static linking: true
cargo:warning=pkg-config failed, falling back to naïve lib search: Err(Failure { command: "\"pkg-config\" \"--static\" \"--libs\" \"--cflags\" \"v8\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package v8 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `v8.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'v8\' found\n" } })
cargo:rustc-link-search=native=/usr/lib
cargo:rustc-link-search=native=/usr/local/lib
cargo:rustc-link-search=native=/usr/local/opt/icu4c/lib
cargo:rustc-link-lib=static=v8_base
cargo:rustc-link-lib=static=v8_libbase
cargo:rustc-link-lib=static=v8_libsampler
cargo:rustc-link-lib=static=v8_nosnapshot
cargo:rustc-link-lib=static=icui18n
cargo:rustc-link-lib=static=icuuc
cargo:rustc-link-lib=static=icudata
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXX_x86_64-apple-darwin = None
CXX_x86_64_apple_darwin = None
HOST_CXX = None
CXX = None
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXXFLAGS_x86_64-apple-darwin = None
CXXFLAGS_x86_64_apple_darwin = None
HOST_CXXFLAGS = None
CXXFLAGS = None
DEBUG = Some("false")
running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-I" "/var/folders/04/8qq85w2s5fn86jd1thbg8tq80j2yx0/T/cargo-install.Gv2L8xhAPTu2/release/build/v8-sys-c50018fbd3cf8623/out" "-std=c++11" "-Wall" "-Wall" "-Wextra" "-o" "/var/folders/04/8qq85w2s5fn86jd1thbg8tq80j2yx0/T/cargo-install.Gv2L8xhAPTu2/release/build/v8-sys-c50018fbd3cf8623/out/src/v8-glue.o" "-c" "src/v8-glue.cc"
cargo:warning=In file included from src/v8-glue.cc:1:
cargo:warning=src/v8-glue.h:3:10: fatal error: 'v8.h' file not found
cargo:warning=#include <v8.h>
cargo:warning=         ^~~~~~
cargo:warning=1 error generated.
exit code: 1

--- stderr
src/v8-trampoline.h:3:10: fatal error: 'v8.h' file not found
thread 'main' panicked at '

Internal error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-I" "/var/folders/04/8qq85w2s5fn86jd1thbg8tq80j2yx0/T/cargo-install.Gv2L8xhAPTu2/release/build/v8-sys-c50018fbd3cf8623/out" "-std=c++11" "-Wall" "-Wall" "-Wextra" "-o" "/var/folders/04/8qq85w2s5fn86jd1thbg8tq80j2yx0/T/cargo-install.Gv2L8xhAPTu2/release/build/v8-sys-c50018fbd3cf8623/out/src/v8-glue.o" "-c" "src/v8-glue.cc" with args "c++" did not execute successfully (status code exit code: 1).
commented

Also fails to build on Fedora 29 with v8 6.7.17 (one issue is that there is no static library built by default on f29). But it sounds like there could be other problems: dflemstr/v8-rs#28. I wonder whether it's just easier to build the v8-sys with the static v8 version that's used in CI...

This is still the case.

Should be fixed now.

@XVilka there's still one build error to fix for cargo install to work:

   Compiling record-query v1.0.1
error: git describe failed with status 128: fatal: not a git repository (or any parent up to mount point /)
  --> /home/d33tah/.cargo/registry/src/github.com-1ecc6299db9ec823/record-query-1.0.1/src/lib.rs:29:31
   |
29 | pub const GIT_VERSION: &str = git_version::git_version!();
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to previous error

error: could not compile `record-query`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `record-query v1.0.1`, intermediate artifacts can be found at `/tmp/cargo-installCgCkFW`

Caused by:
  build failed

@d33tah yes, I opened an issue: #205
Should work with cargo install --path .

This should now be fixed since 1.0.2