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

not all headers are installed for C API #9382

Open
ognevny opened this issue Oct 6, 2024 · 7 comments
Open

not all headers are installed for C API #9382

ognevny opened this issue Oct 6, 2024 · 7 comments

Comments

@ognevny
Copy link

ognevny commented Oct 6, 2024

when built with MSYS2 toolchain, wasmtime/conf.h isn't installed, and (for example) tree-sitter compilation fails with

In file included from C:/msys64/clang64/include/wasmtime.h:182:
C:/msys64/clang64/include/wasi.h:12:10: fatal error: 'wasmtime/conf.h' file not found
   12 | #include <wasmtime/conf.h>
      |          ^~~~~~~~~~~~~~~~~
@alexcrichton
Copy link
Member

Thanks for the report! The installation of the C API changed a few versions ago in Wasmtime to use cmake to install, and cmake should install the conf.h header file. If it's missing here then that means whatever is managing the C API probably isn't pulling in the latest version one way or another. There's been a few other PRs/issues for tree-sitter using a Rust dependency on the C API and getting that working too.

If you're interested in primarily packaging tree-sitter this might be a better issue to raise with them? They might be more familiar with the build system and packaging of tree sitter.

@ognevny
Copy link
Author

ognevny commented Oct 22, 2024

I forgot to answer, but cmake doesn't install conf.h this just can't be issue from tree-sitter's side

@alexcrichton
Copy link
Member

Would you be able to provide some steps for reproduction?

@ognevny
Copy link
Author

ognevny commented Oct 23, 2024

download msys2
run makepkg-mingw -s for recipe

@ognevny
Copy link
Author

ognevny commented Oct 23, 2024

@alexcrichton
Copy link
Member

I ran these commands:

$ cmake -G Ninja -DCMAKE_INSTALL_PREFIX=`pwd`/target/c-api-install -DBUILD_SHARED_LIBS=OFF -S ./crates/c-api -B target/build-static
$ cmake --build target/build-static
$ DESTDIR=./target/c-api-install2 cmake --install target/build-static

to model what that script is doing

The --install step shows:

...
-- Installing: /home/alex/code/wasmtime/target/c-api-install/include/wasmtime/conf.h
-- Up-to-date: ./target/c-api-install2/home/alex/code/wasmtime/target/c-api-install/include
-- Installing: ./target/c-api-install2/home/alex/code/wasmtime/target/c-api-install/include/wasi.h
...

which shows that the conf.h is being installed, just to the wrong spot.

I think this has to do with the combination of DESTDIR and -DCMAKE_INSTALL_PREFIX and those being different. I fear though that I'm not knowledgable enough with CMake to know how best to solve this.

@ognevny
Copy link
Author

ognevny commented Oct 23, 2024

I wonder can you switch to meson?

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

2 participants