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

m1芯片导出Xcode,无法运行 #5268

Open
yingnierxiao opened this issue Jun 27, 2024 · 10 comments
Open

m1芯片导出Xcode,无法运行 #5268

yingnierxiao opened this issue Jun 27, 2024 · 10 comments
Labels

Comments

@yingnierxiao
Copy link

yingnierxiao commented Jun 27, 2024

Xmake Version

v2.9.3

Operating System Version and Architecture

Mac 14.5 Xcode 15.4

Describe Bug

Could not launch “MyEngine”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'
User Info: {
    DVTErrorCreationDateKey = "2024-06-27 13:26:29  0000";
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'";
}
--
Could not launch “MyEngine”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'
User Info: {
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'";
}
--

Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "MacBookPro18,2";
    "device_osBuild" = "14.5 (23F79)";
    "device_platform" = "com.apple.platform.macosx";
    "dvt_coredevice_version" = "355.28";
    "dvt_mobiledevice_version" = "1643.120.2";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 7;
    "operation_errorCode" = 3;
    "operation_errorDomain" = IDEDebugSessionErrorDomain;
    "operation_errorWorker" = DBGLLDBLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.macosx";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 0;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 3;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.tool";
    "param_structuredConsoleMode" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "macosx14.5";
    "sdk_osVersion" = "14.5";
    "sdk_variant" = macos;
}
--


System Information

macOS Version 14.5 (Build 23F79)
Xcode 15.4 (22622) (Build 15F31d)
Timestamp: 2024-06-27T21:26:29 08:00

### Expected Behavior

not

### Project Configuration


set_languages("c99", "c  20")

add_requires("bgfx")
add_requires("stb")
add_requires("imgui", {configs = {glfw_opengl3 = true}})
add_requires("spdlog")
add_requires("fmt")
add_requires("assimp")
add_requires("glfw")
add_requires("boost", {configs = {all = true}}) 
add_requires("abseil")


target("MyEngine")
    set_kind("binary")

    add_packages("bgfx", {public = true})
    add_packages("stb", {public = true})
    add_packages("spdlog")
    add_packages("fmt")
    add_packages("assimp")
    add_packages("glfw")
    add_packages("imgui")
	add_packages("abseil")
	add_packages("boost")

    add_files("src/*.cpp")
	add_files("src/*/*.cpp")


    if is_plat("linux") then
		add_syslinks("dl")
		add_defines("BX_PLATFORM_LINUX")
	elseif is_plat("windows") then
		add_defines("BX_PLATFORM_WINDOWS")
	elseif is_plat("macosx") then
		add_defines("BX_PLATFORM_OSX")
	end
	add_defines("BGFX_CONFIG_MULTITHREADED=1")

### Additional Information and Error Logs

Could not launch “MyEngine”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'
User Info: {
    DVTErrorCreationDateKey = "2024-06-27 13:26:29  0000";
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'";
}
--
Could not launch “MyEngine”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'
User Info: {
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "The specified architecture 'arm64-*-*' is not compatible with 'x86_64-apple-macosx14.5.0' in '/Users/jiezheng/Desktop/c  /MyEngine/build/macosx/x86_64/release/Debug/MyEngine'";
}
--

Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "MacBookPro18,2";
    "device_osBuild" = "14.5 (23F79)";
    "device_platform" = "com.apple.platform.macosx";
    "dvt_coredevice_version" = "355.28";
    "dvt_mobiledevice_version" = "1643.120.2";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 7;
    "operation_errorCode" = 3;
    "operation_errorDomain" = IDEDebugSessionErrorDomain;
    "operation_errorWorker" = DBGLLDBLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.macosx";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 0;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 3;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.tool";
    "param_structuredConsoleMode" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "macosx14.5";
    "sdk_osVersion" = "14.5";
    "sdk_variant" = macos;
}

--

System Information

macOS Version 14.5 (Build 23F79)
Xcode 15.4 (22622) (Build 15F31d)
Timestamp: 2024-06-27T21:26:29 08:00

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: m1 chip exports Xcode and cannot run

@waruqi
Copy link
Member

waruqi commented Jun 27, 2024

目前是借助 cmake 来生成的,可以先 check 下 xmake project -k cmake 生成的 cmakelists.txt

@yingnierxiao
Copy link
Author

yingnierxiao commented Jun 27, 2024

target_compile_options(MyEngine PRIVATE $<$<COMPILE_LANGUAGE:C>:-target> $<$<COMPILE_LANGUAGE:CXX>:-target> $<$<COMPILE_LANGUAGE:C>:x86_64-apple-macos14.5> $<$<COMPILE_LANGUAGE:CXX>:x86_64-apple-macos14.5> $<$<COMPILE_LANGUAGE:C>:-isysroot> $<$<COMPILE_LANGUAGE:CXX>:-isysroot> $<$<COMPILE_LANGUAGE:C>:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk> $<$<COMPILE_LANGUAGE:CXX>:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk> $<$<COMPILE_LANGUAGE:C>:-DNDEBUG> $<$<COMPILE_LANGUAGE:CXX>:-DNDEBUG> ) target 感觉不太对,然后x86_64也不对,应该是arm64

@waruqi
Copy link
Member

waruqi commented Jun 27, 2024

xmake f -cvD
xmake -rvD
xmake project -k cmake

给下完整 logs 和 cmakelists

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


xmake f -cvD
xmake -rvD
xmake project -k cmake

Give the complete logs and cmakelists

@yingnierxiao
Copy link
Author

yingnierxiao commented Jun 29, 2024

build.log
把日志传上来,麻烦看下什么问题
CMakeLists.txt

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


build.log
Upload the logs, please check what the problem is.

@waruqi
Copy link
Member

waruqi commented Jun 29, 2024

build.log 把日志传上来,麻烦看下什么问题 CMakeLists.txt

我看生成的 cmakelist 没啥问题,也没看到你提到的 x86_64 ,里面都是 arm64 的 flags

@yingnierxiao
Copy link
Author

error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:325: @programdir/core/sandbox/modules/os.lua:288: bad argument #1 to 'args' (string expected, got nil)
stack traceback:
[C]: in function 'args'
[@programdir/core/sandbox/modules/os.lua:288]: in function 'vrunv'
[@programdir/modules/private/utils/batchcmds.lua:96]: in function 'script'
[@programdir/modules/private/utils/batchcmds.lua:200]: in function '_runcmd'
[@programdir/modules/private/utils/batchcmds.lua:207]: in function '_runcmds'
[@programdir/modules/private/utils/batchcmds.lua:449]: in function 'callback'
[@programdir/modules/core/project/depend.lua:217]: in function 'on_changed'
[@programdir/modules/private/utils/batchcmds.lua:448]: in function 'runcmds'
[@programdir/actions/build/kinds/object.lua:147]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:241]:

stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:973: in function 'os.raiselevel'
(...tail calls...)
@programdir/core/main.lua:329: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>

有一段报错了。 ..vformat(" --platform $(os)")
看起来是这个代码一起的

@waruqi
Copy link
Member

waruqi commented Jun 29, 2024

error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:325: @programdir/core/sandbox/modules/os.lua:288: bad argument #1 to 'args' (string expected, got nil) stack traceback: [C]: in function 'args' [@programdir/core/sandbox/modules/os.lua:288]: in function 'vrunv' [@programdir/modules/private/utils/batchcmds.lua:96]: in function 'script' [@programdir/modules/private/utils/batchcmds.lua:200]: in function '_runcmd' [@programdir/modules/private/utils/batchcmds.lua:207]: in function '_runcmds' [@programdir/modules/private/utils/batchcmds.lua:449]: in function 'callback' [@programdir/modules/core/project/depend.lua:217]: in function 'on_changed' [@programdir/modules/private/utils/batchcmds.lua:448]: in function 'runcmds' [@programdir/actions/build/kinds/object.lua:147]: in function 'jobfunc' [@programdir/modules/async/runjobs.lua:241]:

stack traceback: [C]: in function 'error' @programdir/core/base/os.lua:973: in function 'os.raiselevel' (...tail calls...) @programdir/core/main.lua:329: in upvalue 'cotask' @programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>

有一段报错了。 ..vformat(" --platform $(os)") 看起来是这个代码一起的

不同问题,不要混一起,这个跟当前 issue 无关

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

3 participants