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

Document that libc++-dev is a build dependency #57

Closed
SimonSapin opened this issue Apr 19, 2023 · 2 comments
Closed

Document that libc++-dev is a build dependency #57

SimonSapin opened this issue Apr 19, 2023 · 2 comments

Comments

@SimonSapin
Copy link

In DioxusLabs/taffy#450 at first I didn’t manage to compile yoga-rs. Output line that seems most relevant:

  src/yoga/yoga/Yoga.h:371:10: fatal error: 'functional' file not found

Full output:

   Compiling yoga v0.4.0
error: failed to run custom build command for `yoga v0.4.0`

Caused by:
  process didn't exit successfully: `/home/simon/projects/taffy/target/debug/build/yoga-96bccafd4f3c4b8f/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=src/yoga/yoga
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CXX_x86_64-unknown-linux-gnu
  CXX_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXX_x86_64_unknown_linux_gnu
  CXX_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-unknown-linux-gnu
  CXXFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_unknown_linux_gnu
  CXXFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/event/event.o" "-c" "src/yoga/yoga/event/event.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/internal/experiments.o" "-c" "src/yoga/yoga/internal/experiments.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/log.o" "-c" "src/yoga/yoga/log.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/Utils.o" "-c" "src/yoga/yoga/Utils.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGConfig.o" "-c" "src/yoga/yoga/YGConfig.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGEnums.o" "-c" "src/yoga/yoga/YGEnums.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGLayout.o" "-c" "src/yoga/yoga/YGLayout.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGNode.o" "-c" "src/yoga/yoga/YGNode.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGNodePrint.o" "-c" "src/yoga/yoga/YGNodePrint.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGStyle.o" "-c" "src/yoga/yoga/YGStyle.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGValue.o" "-c" "src/yoga/yoga/YGValue.cpp"
  exit status: 0
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "src/yoga" "-Wall" "-Wextra" "-std=c++11" "-fno-omit-frame-pointer" "-fexceptions" "-Wall" "-O3" "-fPIC" "-o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/Yoga.o" "-c" "src/yoga/yoga/Yoga.cpp"
  exit status: 0
  cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
  AR_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
  AR_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_AR
  HOST_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-linux-gnu
  ARFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_linux_gnu
  ARFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_ARFLAGS
  HOST_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  running: ZERO_AR_DATE="1" "ar" "cq" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/libyoga.a" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/event/event.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/internal/experiments.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/log.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/Utils.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGConfig.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGEnums.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGLayout.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGNode.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGNodePrint.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGStyle.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/YGValue.o" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/src/yoga/yoga/Yoga.o"
  exit status: 0
  running: "ar" "s" "/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out/libyoga.a"
  exit status: 0
  cargo:rustc-link-lib=static=yoga
  cargo:rustc-link-search=native=/home/simon/projects/taffy/target/debug/build/yoga-261b21c272a3ad54/out
  cargo:rerun-if-env-changed=CXXSTDLIB_x86_64-unknown-linux-gnu
  CXXSTDLIB_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXXSTDLIB_x86_64_unknown_linux_gnu
  CXXSTDLIB_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXXSTDLIB
  HOST_CXXSTDLIB = None
  cargo:rerun-if-env-changed=CXXSTDLIB
  CXXSTDLIB = None
  cargo:rustc-link-lib=stdc++

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git
  fatal: not a git repository (or any of the parent directories): .git
  src/yoga/yoga/Yoga.h:371:10: fatal error: 'functional' file not found
  thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("src/yoga/yoga/Yoga.h:371:10: fatal error: 'functional' file not found\n")', /home/simon/tmp/cargo-home/registry/src/github.com-1ecc6299db9ec823/yoga-0.4.0/build.rs:65:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It’s only with external help that I eventually found I needed to install LLVM’s libc++. I already had /usr/include/c++/12.2.1/functional on my system but that one came with GCC.

Please consider adding something in README.md to document this requirement.

@nicoburns
Copy link
Contributor

The ideal fix for this would be to drop the dependency on libc++ ( in favour of libstdc++), because the libc++ dep is also blocking docs.rs builds of yoga-rs. See:

And fixing that on the docs.rs side is blocked by this ubuntu bug https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-14/+bug/1989124.

However, we currently can't do that due to this bindgen bug rust-lang/rust-bindgen#2157, so in the meantime documenting the dependency is probably sensible.

@bschwind
Copy link
Owner

Thanks for bringing this up, I updated the README for now to reflect this.

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

No branches or pull requests

3 participants