Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onig_sys v69.2.0 fails to build on Centos with "Unable to find libclang" #109

Closed
pcallahan-r7 opened this issue Aug 8, 2019 · 7 comments · Fixed by #126
Closed

onig_sys v69.2.0 fails to build on Centos with "Unable to find libclang" #109

pcallahan-r7 opened this issue Aug 8, 2019 · 7 comments · Fixed by #126

Comments

@pcallahan-r7
Copy link

onig_sys v69.1.0 compiles ok.

error: failed to run custom build command for `onig_sys v69.2.0`
process didn't exit successfully: `/libtcellagent/docker_linux_target/debug/build/onig_sys-76e23c1154f13aa7/build-script-build` (exit code: 101)
--- stdout
cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable

--- 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: [])"', src/libcore/result.rs:997: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
@pcallahan-r7
Copy link
Author

Similar error on Windows:

error: failed to run custom build command for `onig_sys v69.2.0`
Caused by:
  process didn't exit successfully: `D:\git\libtcellagent\target\debug\build\onig_sys-d53bdd35ac8a2bf3\build-script-build` (exit code: 101)
--- stdout
cargo:warning=couldn't execute `llvm-config --prefix` (error: The system cannot find the file specified. (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable
--- stderr
thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'clang.dll\', \'libclang.dll\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', src\libcore\result.rs:999: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

@sophiajt
Copy link

sophiajt commented Aug 8, 2019

This also causes onig 4.3 to fail. It appears that 69.2 includes breaking changes from 69.1.

This may indicate that 69.2 is not semver compatible with 69.1 (and potentially should be called 70.0 instead)

@iwillspeak
Copy link
Collaborator

Yeah, it isn’t compatible. The build changed quite a lot. The major version is supposed to contain the underlying onig version. Can provably bump it all the way to 690 though

@iwillspeak
Copy link
Collaborator

Hopefully this should be worked around by pinning the onig_sys version in #112

@iwillspeak
Copy link
Collaborator

For compiling with onig 5.x at the moment you'll need the dependencies for bindgen available at build time too.

@getaaron
Copy link

On Debian I worked around this by running apt-get install llvm before installing onig_sys 🤷‍♂️

@iwillspeak
Copy link
Collaborator

While the work-around for this issue with newer versions of onig is to either use an older crate version or ensure LLVM & clang are installed I'm going to treat this issue as "compilation on common targets shouldn't require bindgen on every build" instead. I'll work on a branch over the next few days to pull together some of @kornelski 's bindgen-related changes and refactor the way we do compile-time binding generation.

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

Successfully merging a pull request may close this issue.

4 participants