Skip to content

Xmake can't find emscripten or ninja on MacOS #7466

@SzarAbod

Description

@SzarAbod

Xmake Version

v3.0.8+20260323

Operating System Version and Architecture

Macbook 15-inch 2019, Sequoia 15.7.5, intel based

Describe Bug

when trying to build an sdl3 project to wasm, xmake can't seems find emscripten or ninja on macos, even tho packages where downloaded using HomeBrew, and there is a symlink for them in /usr/bin and /usr/local/bun

Expected Behavior

Xmake should find emscripten and ninja

Project Configuration

add_rules("mode.debug", "mode.release")

add_requires("libsdl3")

target("szar")
    add_rules("xcode.application")
    set_kind("binary")
    add_files("src/*.cpp")
    add_files("src/Info.plist")
    add_packages("libsdl3")

Additional Information and Error Logs

ninja@Ninjas-MacBook-Pro szar % xmake f -p wasm -vD
checking for platform ... wasm (wasm32)
checking for emsdk directory ... no
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(dotnet --version), No such file or directory
checking for dotnet ... no
checking for .NET SDK directory ... no
checking for ninja ... no
checking for cmake ... no
checking for cmake ... /usr/local/bin/cmake
finding egl-headers from xmake ..
checking for xmake::egl-headers ... egl-headers 2023.12.16
finding opengl-headers from xmake ..
checking for xmake::opengl-headers ... opengl-headers 2024.01.04
finding libsdl3 from xmake ..
checking for xmake::libsdl3 ... no
finding libsdl3 from vcpkg ..
checking for brew ... /usr/local/bin/brew
finding libsdl3 from conan ..
checking for libsdl3 ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> libsdl3 3.4.2 [license:zlib]
please input: y (y/n/m)
y
checking for curl ... /usr/bin/curl
pinging the host(github.com) ... 65 ms
pinging the host(www.libsdl.org) ... 293 ms
checking for unzip ... /usr/bin/unzip
/usr/bin/unzip -o libsdl3-3.4.2.zip -d source.tmp
Archive:  libsdl3-3.4.2.zip
  inflating: source.tmp/SDL3-3.4.2/.clang-format  
  inflating: source.tmp/SDL3-3.4.2/.clang-tidy  
  inflating: source.tmp/SDL3-3.4.2/.editorconfig  
  inflating: source.tmp/SDL3-3.4.2/.wikiheaders-options  
  inflating: source.tmp/SDL3-3.4.2/Android.mk  
  inflating: source.tmp/SDL3-3.4.2/BUGS.txt  
  inflating: source.tmp/SDL3-3.4.2/CMakeLists.txt  
  inflating: source.tmp/SDL3-3.4.2/CREDITS.md  
  inflating: source.tmp/SDL3-3.4.2/INSTALL.md  
  inflating: source.tmp/SDL3-3.4.2/LICENSE.txt  
  inflating: source.tmp/SDL3-3.4.2/README.md
...  
 inflating: source.tmp/SDL3-3.4.2/wayland-protocols/xdg-shell.xml  
  inflating: source.tmp/SDL3-3.4.2/wayland-protocols/xdg-toplevel-icon-v1.xml  
  inflating: source.tmp/SDL3-3.4.2/REVISION.txt  
  inflating: source.tmp/SDL3-3.4.2/.git-hash  
checking for ninja ... /Users/ninja/.xmake/packages/n/ninja/v1.13.1/4b5fb445e9104f33bade9151c48b7c60/bin/ninja
checking for emsdk directory ... no
checking for em++ ... /usr/local/bin/em++
checking for the linker (ld) ... em++
checking for emsdk directory ... no
checking for emcc ... /usr/local/bin/emcc
checking for the c compiler (cc) ... emcc
checking for emsdk directory ... no
error: @programdir/modules/package/tools/cmake.lua:605: emscripten not found!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1148]: in function 'raiselevel'
    [@programdir/core/sandbox/modules/utils.lua:144]: in function 'assert'
    [@programdir/modules/package/tools/cmake.lua:605]: in function '_get_configs_for_wasm'
    [@programdir/modules/package/tools/cmake.lua:933]: in function '_get_configs'
    [@programdir/modules/package/tools/cmake.lua:1309]: in function 'configure'
    [@programdir/modules/package/tools/cmake.lua:1368]: in function 'install'
    [...ake/repositories/xmake-repo/packages/l/libsdl3/xmake.lua:154]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:480]:

  => install libsdl3 3.4.2 .. failed
error: @programdir/core/main.lua:274: @programdir/modules/async/runjobs.lua:282: .../modules/private/action/require/impl/actions/install.lua:592: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1148]:
    [.../modules/private/action/require/impl/actions/install.lua:592]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:447]:
    [...modules/private/action/require/impl/install_packages.lua:514]: in function 'job_func'
    [@programdir/modules/async/runjobs.lua:462]:

stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:1148: in function 'base/os.raiselevel'
        (...tail calls...)
        @programdir/core/main.lua:274: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:514: in function <@programdir/core/base/scheduler.lua:507>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions