junaire opened a new issue, #2101:
URL: https://github.com/apache/incubator-opendal/issues/2101

   Hi, I'm trying to build opendal but ran into some issues:
   OS:
   ```
   Ubuntu 22.04.2 LTS on Windows 10 x86_64
   ```
   rustc:
   ```
   ❯ rustc --version
   rustc 1.69.0 (84c898d65 2023-04-16)
   ```
   What I did:
   ```
   git clone https://github.com/apache/incubator-opendal.git
   cd incubator-opendal
   RUST_BACKTRACE=1 cargo build
   ```
   
   What did I see:
   ```
   ❯ RUST_BACKTRACE=1 cargo build
      Compiling opendal v0.33.0 (/tmp/incubator-opendal/core)
      Compiling rb-sys v0.9.72
   error: failed to run custom build command for `rb-sys v0.9.72`
   note: To improve backtraces for build dependencies, set the 
CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable 
debug information generation.
   
   Caused by:
     process didn't exit successfully: 
`/tmp/incubator-opendal/target/debug/build/rb-sys-bd4af8129b7fe53a/build-script-main`
 (exit status: 101)
     --- stdout
     cargo:rerun-if-env-changed=RUBY
     cargo:rerun-if-env-changed=RBCONFIG_ruby_version
     cargo:rerun-if-env-changed=RBCONFIG_platform
     cargo:rerun-if-env-changed=RBCONFIG_arch
     cargo:rerun-if-env-changed=RUBY_ROOT
     cargo:rerun-if-env-changed=RUBY_VERSION
     cargo:rerun-if-env-changed=RUBY
     cargo:rerun-if-changed=build/main.rs
     cargo:rerun-if-changed=build/ruby_macros.rs
     cargo:rerun-if-changed=build/features.rs
     cargo:rerun-if-changed=build/version.rs
     cargo:rerun-if-env-changed=RUBY_STATIC
     cargo:rerun-if-env-changed=RBCONFIG_ENABLE_SHARED
     cargo:rerun-if-env-changed=RBCONFIG_rubyhdrdir
     cargo:rerun-if-env-changed=RBCONFIG_rubyarchhdrdir
     cargo:rerun-if-env-changed=RBCONFIG_CPPFLAGS
   
     --- stderr
     Using bindgen with clang args: ["-I/usr/include/ruby-3.0.0", 
"-I/usr/include/x86_64-linux-gnu/ruby-3.0.0", "-fms-extensions", "-O3", 
"-ggdb3", "-Wall", "-Wextra", "-Wdeprecated-declarations", "-Wduplicated-cond", 
"-Wimplicit-function-declaration", "-Wimplicit-int", 
"-Wmisleading-indentation", "-Wpointer-arith", "-Wwrite-strings", 
"-Wimplicit-fallthrough=0", "-Wmissing-noreturn", "-Wno-cast-function-type", 
"-Wno-constant-logical-operand", "-Wno-long-long", 
"-Wno-missing-field-initializers", "-Wno-overlength-strings", 
"-Wno-packed-bitfield-compat", "-Wno-parentheses-equality", "-Wno-self-assign", 
"-Wno-tautological-compare", "-Wno-unused-parameter", "-Wno-unused-value", 
"-Wsuggest-attribute=format", "-Wsuggest-attribute=noreturn", 
"-Wunused-variable", "-Wdate-time", "-D_FORTIFY_SOURCE=2"]
     warning: unknown warning option '-Wduplicated-cond' 
[-Wunknown-warning-option]
     warning: unknown warning option '-Wimplicit-fallthrough=0'; did you mean 
'-Wimplicit-fallthrough'? [-Wunknown-warning-option]
     warning: unknown warning option '-Wno-packed-bitfield-compat' 
[-Wunknown-warning-option]
     warning: unknown warning option '-Wsuggest-attribute=format'; did you mean 
'-Wproperty-attribute-mismatch'? [-Wunknown-warning-option]
     warning: unknown warning option '-Wsuggest-attribute=noreturn' 
[-Wunknown-warning-option]
     
/home/jun/.cargo/registry/src/github.com-1ecc6299db9ec823/rb-sys-0.9.72/wrapper.h:1:10:
 fatal error: 'ruby.h' file not found
     clang diag: warning: unknown warning option '-Wduplicated-cond' 
[-Wunknown-warning-option]
     clang diag: warning: unknown warning option '-Wimplicit-fallthrough=0'; 
did you mean '-Wimplicit-fallthrough'? [-Wunknown-warning-option]
     clang diag: warning: unknown warning option '-Wno-packed-bitfield-compat' 
[-Wunknown-warning-option]
     clang diag: warning: unknown warning option '-Wsuggest-attribute=format'; 
did you mean '-Wproperty-attribute-mismatch'? [-Wunknown-warning-option]
     clang diag: warning: unknown warning option '-Wsuggest-attribute=noreturn' 
[-Wunknown-warning-option]
     thread 'main' panicked at 'generate bindings: 
ClangDiagnostic("/home/jun/.cargo/registry/src/github.com-1ecc6299db9ec823/rb-sys-0.9.72/wrapper.h:1:10:
 fatal error: 'ruby.h' file not found\n")', 
/home/jun/.cargo/registry/src/github.com-1ecc6299db9ec823/rb-sys-0.9.72/build/main.rs:53:6
     stack backtrace:
        0: rust_begin_unwind
                  at 
/rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
        1: core::panicking::panic_fmt
                  at 
/rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
        2: core::result::unwrap_failed
                  at 
/rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1750:5
        3: core::result::Result<T,E>::expect
        4: build_script_main::main
        5: core::ops::function::FnOnce::call_once
     note: Some details are omitted, run with `RUST_BACKTRACE=full` for a 
verbose backtrace.
   warning: build failed, waiting for other jobs to finish...
   ```
   It seems that we don't have `ruby.h`? I also think the include paths are 
wrong:
   ```
   ❯ cd /usr/include/ruby-3.0.0
   cd: no such file or directory: /usr/include/ruby-3.0.0
   ❯ cd /usr/include/x86_64-linux-gnu/ruby-3.0.0
   cd: no such file or directory: /usr/include/x86_64-linux-gnu/ruby-3.0.0
   ```
   
   But I do have ruby and libruby installed
   ```
   ❯ ruby --version
   ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
   
   ❯ sudo apt list | grep libruby
   
   WARNING: apt does not have a stable CLI interface. Use with caution in 
scripts.
   
   libruby3.0/jammy-updates,jammy-security,now 3.0.2-7ubuntu2.3 amd64 
[installed,automatic]
   libruby/jammy,now 1:3.0~exp1 all [installed]
   ```
   
   And for some reasons, it uses some unknown clang flags?
   Clang version:
   ```
   ❯ clang --version
   Ubuntu clang version 14.0.0-1ubuntu1
   Target: x86_64-pc-linux-gnu
   Thread model: posix
   InstalledDir: /usr/bin
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to