-
Notifications
You must be signed in to change notification settings - Fork 712
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
Bazel: @emsdk cannot pick up SDL2 headers and libraries. #1099
Comments
The |
Thanks ! Now it fails with some permission error, about RO file system. I am on Ubuntu 22.04 with sudo access. `Starting local Bazel server and connecting to it... Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging |
I think this is a limitation of the bazel setup for emsdk. IIRC you can't build new ports that were not already built when the emsdk was created/built. Is that right @walkingeyerobot ? I though that we set |
Thanks ! Is there any workaround for the limitation in bazel setup ? |
I don't know of any way to add new ports to the bazel SDK today. Presumably the right solution would be to convert the ports builds into bazel BUILD files? Perhaps this could be done automatically, but I don't know of anyone that is working on it. |
The right solution is indeed to convert the ports builds into bazel BUILD files. This cannot be done automatically, but I am actively working on it. It's quite a large undertaking though, and I don't expect to finish for some time (on the order of months). I'm not exactly sure how to workaround, but unsetting |
Can we automatically generate BUILD files from tools/system_libc.py? I would have through that would be the simplest way to keep them up-to-date.. I was thinking of generating ninja or cmake files from that code too.. in order to speed up out builds. |
Yes, we can generate most of the rules required. However, there's some logic which will make it tricky to generate (i.e. switching what files are part of the input based on certain features such as threading). Generating these rules seems much preferable to keeping them up to date by hand. Also, there's a lot of infrastructure that needs to be figured out and written to make sure the new library rules are built and integrated correctly. |
Thank you for checking this. With `ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/756dee633784ef959e49802380c6f32b/external/spirv_cross/BUILD.bazel:4:11: Compiling spirv_cross_parsed_ir.cpp failed: (Exit 1): emcc.sh failed: error executing command external/emsdk/emscripten_toolchain/emcc.sh '--sysroot=external/emscripten_bin_linux/emscripten/cache/sysroot' -fdiagnostics-color -fno-exceptions -fno-strict-aliasing -funsigned-char ... (remaining 33 arguments skipped) Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging |
Hey ! No, we went for a workaround and included sdl2 as a separate 3rd party library in our project, instead of relying on emscripten. |
Sorry to hear about the workaround, and thanks a lot for the change link :). |
Bazel build with emsdk (for wasm_cc_binary) is unable to fetch and discover the SDL2 file on specifying them in linkopts ("-sUSE_SDL=2", "-sUSE_SDL_IMAGE=2", "-sUSE_SDL_TTF=2", "-sUSE_SDL_NET=2") and coopts ("-DUSE_SDL=2", "-DUSE_SDL_IMAGE=2", "-DUSE_SDL_TTF=2", "-DUSE_SDL_NET=2",) as mentioned in https://emscripten.org/docs/compiling/Building-Projects.html?#emscripten-ports
Compilation fails with "SDL2/SDL.h" headers not found errors.
Note : SDL1 headers and libs/API, work out of the box. We are experimenting in Skia bazel environment.
The text was updated successfully, but these errors were encountered: