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

libraylib.a: No such file or directory #4737

Open
DmarshalTU opened this issue Jan 21, 2025 · 2 comments
Open

libraylib.a: No such file or directory #4737

DmarshalTU opened this issue Jan 21, 2025 · 2 comments

Comments

@DmarshalTU
Copy link

Context

I started to learn odin and followed Karl example https://github.com/karl-zylinski/odin-raylib-web to try odin and wasm,
Odin was installed with homebrew version dev-2025-01:2aae4cfd4, Mac OS version 15.2 (24C101) (air m1).

    Odin:    dev-2025-01:2aae4cfd4
    OS:      macOS Unknown
    CPU:     Apple M1
    RAM:     16384 MiB
    Backend: LLVM 19.1.6

Expected Behavior

as I run build_web.sh I expect to get done and the wasm files in the web folder

Current Behavior

denistu@Deniss-MacBook-Air odin-raylib-web % ./build_web.sh

emcc: error: /opt/homebrew/Cellar/odin/2025-01/libexec//vendor/raylib/wasm/libraylib.a: No such file or directory ("/opt/homebrew/Cellar/odin/2025-01/libexec//vendor/raylib/wasm/libraylib.a" was expected to be an input file, based on the commandline arguments provided)
Web build created in build/web

so the directory of raylib/wasm is actually empty and I need to add the libraylib.a and libraygui.a(found in this repo vendors) to get it work

denistu@Deniss-MacBook-Air odin-raylib-web % ls /opt/homebrew/Cellar/odin/2025-01/libexec/vendor/raylib/wasm/
denistu@Deniss-MacBook-Air odin-raylib-web %

after this files added to the raylib/wasm directory it works fine:

./build_web.sh
cache:INFO: generating system headers: sysroot_install.stamp... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot_install.stamp" for subsequent builds)
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libGL-getprocaddr.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libGL-getprocaddr.a" for subsequent builds)
system_libs:INFO: compiled 4 inputs in 0.13s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libal.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libal.a" for subsequent builds)
system_libs:INFO: compiled 1 inputs in 0.13s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libhtml5.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libhtml5.a" for subsequent builds)
system_libs:INFO: compiled 5 inputs in 0.13s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libstubs-debug.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libstubs-debug.a" for subsequent builds)
system_libs:INFO: compiled 2 inputs in 0.13s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libnoexit.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libnoexit.a" for subsequent builds)
system_libs:INFO: compiled 1 inputs in 0.13s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libc-debug.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libc-debug.a" for subsequent builds)
system_libs:INFO: compiled 1043 inputs in 3.82s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libdlmalloc-debug.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libdlmalloc-debug.a" for subsequent builds)
system_libs:INFO: compiled 2 inputs in 0.28s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libcompiler_rt.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libcompiler_rt.a" for subsequent builds)
system_libs:INFO: compiled 162 inputs in 0.85s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libc++-noexcept.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libc++-noexcept.a" for subsequent builds)
system_libs:INFO: compiled 57 inputs in 5.06s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libc++abi-debug-noexcept.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libc++abi-debug-noexcept.a" for subsequent builds)
system_libs:INFO: compiled 16 inputs in 1.43s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libsockets.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/sysroot/lib/wasm32-emscripten/libsockets.a" for subsequent builds)
system_libs:INFO: compiled 27 inputs in 0.56s
cache:INFO:  - ok
cache:INFO: generating system asset: symbol_lists/11a5a1540fc944aa58cd667d65e4086f6089e816.json... (this will be cached in "/opt/homebrew/Cellar/emscripten/4.0.1/libexec/cache/symbol_lists/11a5a1540fc944aa58cd667d65e4086f6089e816.json" for subsequent builds)
cache:INFO:  - ok

and the server and the app works fine.

@laytan
Copy link
Collaborator

laytan commented Jan 22, 2025

Not an issue with Odin in the first place, but an "issue" with homebrew. In homebrew's CI we have to build everything from scratch, and can't use the precompiled libraries.

Somebody would need to make a PR or issue there to ask if it's even allowed to use emscripten there to build a bunch of things, I don't think they will allow that, the version of raylib from brew also only ships the libraries for native, nothing for wasm/emscripten.

Alternatively that template should contain the libraries, instead of the Odin repo, seems a bit weird to me that it's here when we don't actually want anything to do with emscripten directly here, but I've voiced that concern before.

Another option is adding a script, or readme with steps to build the library, and doing the when !#exists(RAYLIB_WASM_LIB) { #panic("go to blah/blah to build the library / follow steps in readme") }

@laytan
Copy link
Collaborator

laytan commented Jan 22, 2025

Just had a talk with @karl-zylinski and he will try to make a PR when he has time that adds the when statement, and instructions for downloading to point to.

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