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

Can not build example project on MacOS #4391

Closed
SebastianKeller opened this issue Nov 16, 2023 · 7 comments
Closed

Can not build example project on MacOS #4391

SebastianKeller opened this issue Nov 16, 2023 · 7 comments
Labels

Comments

@SebastianKeller
Copy link

Xmake Version

v2.8.5+20231107 (Installed via Homebrew)

Operating System Version and Architecture

macOS Sonoma 14.0

Describe Bug

I can not build a 'Hello, World!" C project on macOS 14.0.

I used xmake create -l c to create the project, followed by xmake to build it. The build did not succeed after 5 minutes.

BTW: Thank you so much for this software!

Expected Behavior

The 'Hello, World!" C project should build on macOS 14.0.

Project Configuration

xmake-macOS-14.0.zip

Additional Information and Error Logs

➜  xmake-macOS-14.0 time xmake -vD
checking for platform ... macosx
checking for architecture ... arm64
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... Apple Development: Sebastian Keller (XYZXYZXYZY)
checking for SDK version of Xcode for macosx (arm64) ... 14.2
checking for Minimal target version of Xcode for macosx (arm64) ... 14.0
^C
xmake -vD  0.11s user 0.13s system 0% cpu 5:39.51 total
@waruqi
Copy link
Member

waruqi commented Nov 17, 2023

Can you try this and give me some logs. #2033

@SebastianKeller
Copy link
Author

SebastianKeller commented Nov 17, 2023

@waruqi Here hare two logs.
It takes a couple of seconds to go from checking for architecture to checking for Xcode directory so this is the first:

➜  map git:(main) XMAKE_PROFILE=stuck xmake -vD
<subprocess: sysctl>: /usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features machdep.cpu.brand_string
checking for platform ... macosx
checking for architecture ... arm64
^C[xmake]: [engine]: stack traceback:
        [C]: in function 'base/process._openv'
        @programdir/core/base/process.lua:266: in function 'base/process.openv'
        @programdir/core/base/os.lua:837: in function 'os.execv'
        @programdir/core/base/os.lua:887: in function 'os.iorunv'
        (...tail calls...)
        @programdir/core/base/macos.lua:38: in function 'base/macos.version'
        @programdir/core/sandbox/modules/macos.lua:30: in field 'version'
        @programdir/modules/detect/sdks/find_xcode.lua:97: in global '_find_target_minver'
        @programdir/modules/detect/sdks/find_xcode.lua:122: in global '_find_xcode'
        @programdir/modules/detect/sdks/find_xcode.lua:197: in function <@programdir/modules/detect/sdks/find_xcode.lua:180>
        (...tail calls...)
        @programdir/toolchains/xcode/check.lua:43: in function <@programdir/toolchains/xcode/check.lua:28>
        (...tail calls...)
        ...     (skipping 3 levels)
        @programdir/actions/config/main.lua:362: in function <@programdir/actions/config/main.lua:211>
        (...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:501: in function 'base/task.run'
        @programdir/core/sandbox/modules/import/core/base/task.lua:63: in field 'run'
        @programdir/actions/build/main.lua:191: in function <@programdir/actions/build/main.lua:165>
        (...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:501: in function 'base/task.run'
        @programdir/core/main.lua:307: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:404: in function <@programdir/core/base/scheduler.lua:397>
[1]    2381 segmentation fault  XMAKE_PROFILE=stuck xmake -vD

After that, xmake is getting stuck in checking for Minimal target version of Xcode for macosx.

➜  map git:(main) XMAKE_PROFILE=stuck xmake -vD
<subprocess: sysctl>: /usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features machdep.cpu.brand_string
checking for platform ... macosx
checking for architecture ... arm64
<subprocess: sw_vers>: sw_vers -productVersion
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... Apple Development: Sebastian Keller (XYZXYZXYZY)
checking for SDK version of Xcode for macosx (arm64) ... 14.2
checking for Minimal target version of Xcode for macosx (arm64) ... 14.0
^C[xmake]: [engine]: stack traceback:
        [C]: in function 'base/process._openv'
        @programdir/core/base/process.lua:266: in function 'base/process.openv'
        @programdir/core/base/os.lua:837: in function 'base/os.execv'
        @programdir/core/base/os.lua:887: in function 'base/os.iorunv'
        .../core/sandbox/modules/import/lib/detect/find_program.lua:213: in field '_find'
        .../core/sandbox/modules/import/lib/detect/find_program.lua:314: in function <.../core/sandbox/modules/import/lib/detect/find_program.lua:274>
        (...tail calls...)
        @programdir/modules/detect/tools/find_zig.lua:45: in function <@programdir/modules/detect/tools/find_zig.lua:37>
        (...tail calls...)
        @programdir/modules/lib/detect/find_tool.lua:31: in global '_find_from_modules'
        @programdir/modules/lib/detect/find_tool.lua:42: in global '_find_tool'
        @programdir/modules/lib/detect/find_tool.lua:88: in function <@programdir/modules/lib/detect/find_tool.lua:83>
        (...tail calls...)
        ...     (skipping 4 levels)
        @programdir/actions/config/main.lua:362: in function <@programdir/actions/config/main.lua:211>
        (...tail calls...)
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'base/utils.trycall'
        (...tail calls...)
        @programdir/core/base/task.lua:501: in function 'base/task.run'
        @programdir/core/sandbox/modules/import/core/base/task.lua:63: in field 'run'
        @programdir/actions/build/main.lua:191: in function <@programdir/actions/build/main.lua:165>
        (...tail calls...)
        [C]: in function 'xpcall'
        @programdir/core/base/utils.lua:280: in function 'base/utils.trycall'
        (...tail calls...)
        @programdir/core/base/task.lua:501: in function 'base/task.run'
        @programdir/core/main.lua:307: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:404: in function <@programdir/core/base/scheduler.lua:397>
[1]    2179 segmentation fault  XMAKE_PROFILE=stuck xmake -vD

And here is one with video :)

asciicast

➜  map git:(main) time XMAKE_PROFILE=stuck xmake -vD
<subprocess: sysctl>: /usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features machdep.cpu.brand_string
checking for platform ... macosx
checking for architecture ... arm64
<subprocess: sw_vers>: sw_vers -productVersion
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... Apple Development: Sebastian Keller (XYXYXYXYXY)
checking for SDK version of Xcode for macosx (arm64) ... 14.2
checking for Minimal target version of Xcode for macosx (arm64) ... 14.0
^C[xmake]: [engine]: stack traceback:
        [C]: in function 'base/process._openv'
        @programdir/core/base/process.lua:266: in function 'base/process.openv'
        @programdir/core/base/os.lua:837: in function 'os.execv'
        @programdir/core/base/os.lua:887: in function 'os.iorunv'
        .../core/sandbox/modules/import/lib/detect/find_program.lua:213: in field '_find'
        .../core/sandbox/modules/import/lib/detect/find_program.lua:314: in function <.../core/sandbox/modules/import/lib/detect/find_program.lua:274>
        (...tail calls...)
        @programdir/modules/detect/tools/find_zig.lua:45: in function <@programdir/modules/detect/tools/find_zig.lua:37>
        (...tail calls...)
        @programdir/modules/lib/detect/find_tool.lua:31: in global '_find_from_modules'
        @programdir/modules/lib/detect/find_tool.lua:42: in global '_find_tool'
        @programdir/modules/lib/detect/find_tool.lua:88: in function <@programdir/modules/lib/detect/find_tool.lua:83>
        (...tail calls...)
        ...     (skipping 4 levels)
        @programdir/actions/config/main.lua:362: in function <@programdir/actions/config/main.lua:211>
        (...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:501: in function 'base/task.run'
        @programdir/core/sandbox/modules/import/core/base/task.lua:63: in field 'run'
        @programdir/actions/build/main.lua:191: in function <@programdir/actions/build/main.lua:165>
        (...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:501: in function 'base/task.run'
        @programdir/core/main.lua:307: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:404: in function <@programdir/core/base/scheduler.lua:397>
[2]    4963 segmentation fault  XMAKE_PROFILE=stuck xmake -vD
XMAKE_PROFILE=stuck xmake -vD  0.21s user 0.21s system 0% cpu 2:11.34 total

@waruqi
Copy link
Member

waruqi commented Nov 17, 2023

Can you try running the following commands? Does it stuck?

/usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features machdep.cpu.brand_string
sw_vers -productVersion

@SebastianKeller
Copy link
Author

That was super fast

 time  /usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features machdep.cpu.brand_string
sw_vers -productVersion
sysctl: unknown oid 'machdep.cpu.vendor'
/usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family    0.00s user 0.00s system 34% cpu 0.009 total
14.1.1

@waruqi
Copy link
Member

waruqi commented Nov 17, 2023

Can you try remove .xmake directory, then run xmake f -c -vD?

@waruqi
Copy link
Member

waruqi commented Jan 30, 2024

Can you try dev version again? It should be fixed. #4645

xmake update -s dev

@SebastianKeller
Copy link
Author

It's fixed with xmake v2.9.1+20240422. Thank you!

➜ xmake create -l c test
create test ...
  [+]: xmake.lua
  [+]: src/main.c
  [+]: .gitignore
create ok!
➜ cd test
➜ xmake
checking for platform ... macosx
checking for architecture ... arm64
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... Apple Development: Sebastian Keller (XXXXXXXXXX)
checking for SDK version of Xcode for macosx (arm64) ... 14.2
checking for Minimal target version of Xcode for macosx (arm64) ... 14.2
[ 50%]: cache compiling.release src/main.c
[ 75%]: linking.release test
[100%]: build ok, spent 0.228s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants