Wilfred / difftastic

a structural diff that understands syntax 🟥🟩
https://difftastic.wilfred.me.uk/
MIT License
19.94k stars 317 forks source link

Compilation Error on 3b049c2fd "cargo update" #689

Open egrieco opened 3 months ago

egrieco commented 3 months ago

After commit 3b049c2fd "cargo update" I'm seeing the following compilation error:

  cargo:warning=clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  cargo:warning=vendored_parsers/tree-sitter-lua-src/scanner.cc:2:10: fatal error: 'cwctype' file not found
  cargo:warning=#include <cwctype>
  cargo:warning=         ^~~~~~~~~
  cargo:warning=1 error generated.

  --- stderr

  error occurred: Command env -u IPHONEOS_DEPLOYMENT_TARGET "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-m64" "--target=x86_64-apple-darwin" "-mmacosx-version-min=10.7" "-std=c++14" "-I" "vendored_parsers/tree-sitter-lua-src" "-Wall" "-Wextra" "-o" "~/Repos/difftastic/target/debug/build/difftastic-a3b1e54c05e0af46/out/07332a6062849104-scanner.o" "-c" "vendored_parsers/tree-sitter-lua-src/scanner.cc" with args "c++" did not execute successfully (status code exit status: 1).

This the previous commit b3732b9eb compiles successfully.

Note: The error message above has been mildly edited. /Users/<MY_USER> was replaced with a tilde "~".

Wilfred commented 3 months ago

Hmm, so the commit updated the cc crate, but I'm surprised it broke the build for you.

What platform are you on, with which compilers? This header is part of the stdlib apparently: https://en.cppreference.com/w/cpp/header/cwctype

FWIW mos ttree-sitter parsers are trying to move to be pure C, which might help too. The most actively maintained Lua parser seems to have no C++ at least: https://github.com/tjdevries/tree-sitter-lua