Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

New libclang dependency! #543

Open
Hoverbear opened this issue May 29, 2020 · 2 comments
Open

New libclang dependency! #543

Hoverbear opened this issue May 29, 2020 · 2 comments

Comments

@Hoverbear
Copy link

Hoverbear commented May 29, 2020

Heads up! A recent change introduced a new libclang build time dependency. I had to add libclang after updating Vector from 0.6.1 to the master.

In 0.6.1 I did not need libclang so this seems like a new undocumented dependency and @iximeow said I should open an issue. :)

    Checking wabt v0.9.2
error: failed to run custom build command for `userfaultfd-sys v0.2.0`

Caused by:
  process didn't exit successfully: `/git/timberio/vector/target/debug/build/userfaultfd-sys-f6b2cf3cce5b4db1/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'libclang.so\', \'libclang-*.so\', \'libclang.so.*\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', /home/hoverbear/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/lib.rs:1731:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

warning: build failed, waiting for other jobs to finish...
error: build failed

I found in this checkout: https://github.com/timberio/vector/tree/f13723d4a8d82c164150fa78e0167c9e92c334c3

After applying this diff:

vector on  wasm-engine [$!?] is 📦 v0.9.1 via 🦀 v1.43.0 via ❄️  impure 
❯ git diff
diff --git a/default.nix b/default.nix
index 03634999..77917307 100644
--- a/default.nix
+++ b/default.nix
@@ -32,7 +32,7 @@ pkgs.buildEnv {
         ref = "refs/heads/nixpkgs-unstable";
         rev = "f61b3e02c05d36c58cb5f5fc793c38df5a79e490";
       }) {}).wabt
-      llvmPackages.libclang
+      # llvmPackages.libclang
     ]  ++ stdenv.lib.optional stdenv.isDarwin [ Security libiconv ];
     passthru = {
         shellHook = ''
@@ -42,7 +42,7 @@ pkgs.buildEnv {
             export LC_ALL="en_US.UTF-8";
             export OPENSSL_DIR="${pkgs.openssl.dev}";
             export OPENSSL_LIB_DIR="${pkgs.openssl.out}/lib";
-            export LIBCLANG_PATH ="${pkgs.llvmPackages.libclang}/lib";
+            # export LIBCLANG_PATH ="${pkgs.llvmPackages.libclang}/lib";
         '';
         PROTOC="${pkgs.protobuf}/bin/protoc";
         PROTOC_INCLUDE="${pkgs.protobuf}/include";
@@ -50,6 +50,6 @@ pkgs.buildEnv {
         LC_ALL="en_US.UTF-8";
         OPENSSL_DIR="${pkgs.openssl.dev}";
         OPENSSL_LIB_DIR="${pkgs.openssl.out}/lib";
-        LIBCLANG_PATH ="${pkgs.llvmPackages.libclang}/lib";
+        # LIBCLANG_PATH ="${pkgs.llvmPackages.libclang}/lib";
     };
 }
diff --git a/shell.nix b/shell.nix
index f31d0171..17c971ac 100644
--- a/shell.nix
+++ b/shell.nix
@@ -10,5 +10,5 @@ pkgs.mkShell {
   buildInputs = [ (import ./default.nix { inherit pkgs; }) ];
   OPENSSL_DIR="${pkgs.openssl.dev}";
   OPENSSL_LIB_DIR="${pkgs.openssl.out}/lib";
-  LIBCLANG_PATH ="${pkgs.llvmPackages.libclang}/lib";
+  # LIBCLANG_PATH ="${pkgs.llvmPackages.libclang}/lib";
 }

If you checkout https://github.com/timberio/vector/tree/1d88625ce5c35708a42d612c7abc6b4087676f78 then run the same shell build, it'll work since 0.6.1 didn't need libclang. :)

@iximeow
Copy link
Contributor

iximeow commented May 29, 2020

for context/flavor: my suspicion is that we happened to not notice this in, say, testing, because our tests are run with clang-6.0 installed for fuzz bitrot testing in the first place. So we should probably verify that being the case or not and see if we need to update installation/Getting Started docs appropriately.

@williamoverton
Copy link

I've just ran into this issue after following these docs: https://bytecodealliance.github.io/lucet/Compiling-on-Linux.html

They seem to state that llvm and clang will be installed for you but I had to install them myself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants