xmake-repo
                                
                                 xmake-repo copied to clipboard
                                
                                    xmake-repo copied to clipboard
                            
                            
                            
                        SFML Error
Xmake Version
2.6.4
Operating System Version and Architecture
MacOS Monterey 12.2.1 M1 ARM64
Describe Bug
Attempting to add sfml to xmake.lua produces the following error
> Executing task: xmake -w <
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... no
checking for SDK version of Xcode for macosx (arm64) ... 12.1
checking for Minimal target version of Xcode for macosx (arm64) ... 12.2
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> sfml latest 
please input: y (y/n/m)
y
  => install sfml latest .. failed
cannot copy file lib, file not found!
if you want to get more verbose errors, please see:
  -> /Users/crally/.xmake/cache/packages/2203/s/sfml/latest/installdir.failed/logs/install.txt
error: ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:56: install failed!
stack traceback:
        @programdir/core/base/utils.lua:290: in function <@programdir/core/base/utils.lua:280>
        [C]: in function 'error'
        @programdir/core/base/os.lua:849: in function 'os.raiselevel'
        (...tail calls...)
        ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:56: in field 'co_start_withopt'
        @programdir/modules/private/async/runjobs.lua:199: in function <@programdir/modules/private/async/runjobs.lua:159>
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'sandbox/modules/utils.trycall'
        @programdir/core/base/scheduler.lua:487: in function 'base/scheduler.co_group_begin'
        ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:94: in field 'co_group_begin'
        @programdir/modules/private/async/runjobs.lua:159: in function <@programdir/modules/private/async/runjobs.lua:54>
        (...tail calls...)
        ...     (skipping 2 levels)
        @programdir/actions/config/main.lua:409: in function <@programdir/actions/config/main.lua:249>
        (...tail calls...)
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'sandbox/modules/utils.trycall'
        (...tail calls...)
        @programdir/core/base/task.lua:519: in function 'base/task.run'
        @programdir/core/sandbox/modules/import/core/base/task.lua:63: in field 'run'
        @programdir/actions/build/main.lua:127: in function <@programdir/actions/build/main.lua:106>
        (...tail calls...)
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'sandbox/modules/utils.trycall'
        (...tail calls...)
        @programdir/core/base/task.lua:519: in function 'base/task.run'
        @programdir/core/main.lua:278: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:371: in function <@programdir/core/base/scheduler.lua:368>
The terminal process "/bin/zsh '-c', 'xmake -w'" terminated with exit code: 255.
Expected Behavior
Expect xmake to download and build the sfml package
Project Configuration
add_rules("mode.debug", "mode.release")
add_requires("sfml")
target("xmaketest")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("sfml")
Additional Information and Error Logs
xmaketest % xmake -vD
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... no
checking for SDK version of Xcode for macosx (arm64) ... 12.1
checking for Minimal target version of Xcode for macosx (arm64) ... 12.2
checkinfo: cannot runv(dmd --version), No such file or directory
checking for dmd ... no
checkinfo: cannot runv(ldc2 --version), No such file or directory
checking for ldc2 ... no
checkinfo: cannot runv(gdc --version), No such file or directory
checking for gdc ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /opt/homebrew/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/opt/homebrew/bin/git rev-parse HEAD
finding sfml from xmake ..
checking for xmake::sfml ... no
finding sfml from brew ..
checking for brew ... /opt/homebrew/bin/brew
finding sfml from vcpkg ..
checkinfo: vcpkg root directory not found, maybe you need set $VCPKG_ROOT!
finding sfml from conan ..
finding sfml from pkgconfig ..
checking for pkg-config ... /opt/homebrew/bin/pkg-config
finding sfml from system ..
checking for sfml ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> sfml latest 
please input: y (y/n/m)
y
error: @programdir/core/sandbox/modules/os.lua:90: cannot copy file lib, file not found!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:849]:
    [@programdir/core/sandbox/modules/os.lua:90]: in function 'cp'
    [....xmake/repositories/xmake-repo/packages/s/sfml/xmake.lua:117]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:125]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:205]:
  => install sfml latest .. failed
error: @programdir/core/main.lua:280: @programdir/core/sandbox/modules/import/core/base/task.lua:65: ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:96: ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:56: @programdir/modules/private/async/runjobs.lua:232: .../modules/private/action/require/impl/actions/install.lua:301: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:849]:
    [.../modules/private/action/require/impl/actions/install.lua:301]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:127]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:170]:
    [...modules/private/action/require/impl/install_packages.lua:367]: in function 'jobfunc'
    [@programdir/modules/private/async/runjobs.lua:208]:
stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:849: in function 'os.raiselevel'
        (...tail calls...)
        @programdir/modules/private/async/runjobs.lua:232: in field 'catch'
        @programdir/core/sandbox/modules/try.lua:127: in global 'try'
        @programdir/modules/private/async/runjobs.lua:200: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:371: in function <@programdir/core/base/scheduler.lua:368>
stack traceback:
        @programdir/core/base/utils.lua:290: in function <@programdir/core/base/utils.lua:280>
        [C]: in function 'error'
        @programdir/core/base/os.lua:849: in function 'os.raiselevel'
        (...tail calls...)
        ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:56: in field 'co_start_withopt'
        @programdir/modules/private/async/runjobs.lua:199: in function <@programdir/modules/private/async/runjobs.lua:159>
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'sandbox/modules/utils.trycall'
        @programdir/core/base/scheduler.lua:487: in function 'base/scheduler.co_group_begin'
        ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:94: in field 'co_group_begin'
        @programdir/modules/private/async/runjobs.lua:159: in function <@programdir/modules/private/async/runjobs.lua:54>
        (...tail calls...)
        ...     (skipping 2 levels)
        @programdir/actions/config/main.lua:409: in function <@programdir/actions/config/main.lua:249>
        (...tail calls...)
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'sandbox/modules/utils.trycall'
        (...tail calls...)
        @programdir/core/base/task.lua:519: in function 'base/task.run'
        @programdir/core/sandbox/modules/import/core/base/task.lua:63: in field 'run'
        @programdir/actions/build/main.lua:127: in function <@programdir/actions/build/main.lua:106>
        (...tail calls...)
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'sandbox/modules/utils.trycall'
        (...tail calls...)
        @programdir/core/base/task.lua:519: in function 'base/task.run'
        @programdir/core/main.lua:278: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:371: in function <@programdir/core/base/scheduler.lua:368>
stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:849: in function 'os.raiselevel'
        (...tail calls...)
        @programdir/core/main.lua:280: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:371: in function <@programdir/core/base/scheduler.lua:368>
I tried it on my macOS. It works for me.
$ xmake 
checking for platform ... macosx
checking for architecture ... x86_64
checking for Xcode directory ... /Applications/Xcode.app
checking for SDK version of Xcode for macosx (x86_64) ... 11.3
checking for Minimal target version of Xcode for macosx (x86_64) ... 11.4
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> sfml 2.5.1 
please input: y (y/n/m)
  => install sfml 2.5.1 .. ok       
[ 25%]: ccache compiling.release src/main.cpp
[ 50%]: linking.release xmaketest
[100%]: build ok!
cannot copy file lib, file not found! if you want to get more verbose errors, please see: -> /Users/crally/.xmake/cache/packages/2203/s/sfml/latest/installdir.failed/logs/install.txt error: @programdir/core/sandbox/modules/os.lua:90: cannot copy file lib, file not found!
I saw your error.
/Users/crally/.xmake/cache/packages/2203/s/sfml/latest/source/SFML-2.5.1-macos-clang/lib/ not found. You can look at it.
Another point, very strange, why you installed the latest instead of the 2.5.1 version. you can try update repo first. xrepo update-repo
my path: ~/.xmake/cache/packages/2203/s/sfml/2.5.1/source/SFML-2.5.1-macos-clang/lib/
I updated the repo before I opened the issue. Also, your macOS is x86_64, maybe that's the reason? Otherwise I have no clue.