Add RunScript.sh and Debug-arm64e configuration for arm64e debug builds#57
Add RunScript.sh and Debug-arm64e configuration for arm64e debug builds#57
Conversation
…un script Adds the design doc for a new RuntimeViewer-Debug.xcworkspace (mirrors RuntimeViewer.xcworkspace + iOSPackagesShouldBuildARM64e=true) and a RunScript.sh that builds Debug arm64e via xcodebuild to bypass the Xcode GUI compile bug, then launches the app.
Adds the task-by-task plan for the Debug arm64e workspace + RunScript.sh: Task 1 (workspace files), Task 2 (script skeleton + arg parsing), Task 3 (build pipeline + launch), Task 4 (manual end-to-end + lipo verification). Three independent commit points.
…arm64e flag Mirrors RuntimeViewer.xcworkspace (with local sibling repo references for MachOKit/MachOObjCSection/MachOSwiftSection/swift-demangling/swift-semantic-string) and adds iOSPackagesShouldBuildARM64e=true so xcodebuild produces arm64e SPM slices. The Xcode GUI compile bug under this flag is bypassed by the upcoming RunScript.sh, which drives xcodebuild from the command line.
Adds the bash skeleton: shebang, defaults (Debug + arm64e workspace, DerivedData/Debug-arm64e), helper functions (fail/log/pretty/run/run_piped) modeled after ArchiveScript.sh, argument parsing, and workspace existence check. Build and launch logic land in the next commit.
Implements the build pipeline: optional update_packages, the Catalyst helper build (Mac Catalyst destination), the main macOS app build (generic/platform=macOS), .app discovery, and default launch via open. Both xcodebuild invocations pass ARCHS=arm64e ONLY_ACTIVE_ARCH=NO so the binary is forced to a pure arm64e slice. --no-launch and --dry-run are honored.
Adds a Debug-arm64e build configuration to RuntimeViewerUsingAppKit.xcodeproj and RuntimeViewerServer.xcodeproj. It is a copy of Debug except that the two targets that need to inspect arm64e processes have ENABLE_POINTER_AUTHENTICATION=YES, which causes their binaries to gain an arm64e slice on Apple Silicon: - RuntimeViewerServer.framework (RuntimeViewerServer.xcodeproj) - dev.mxiris.runtimeviewer.service (RuntimeViewerUsingAppKit.xcodeproj) All other targets in Debug-arm64e behave identically to Debug, so the main app stays arm64-only and macro plugins are not forced to arm64e. The Xcode GUI Debug build path is therefore unaffected. Also pins SPM dependencies for RuntimeViewer-Debug.xcworkspace.
Switches RunScript.sh to the new Debug-arm64e configuration instead of forcing ARCHS=arm64e ONLY_ACTIVE_ARCH=NO on the command line. The previous override broke macro plugins (FrameworkToolboxMacros, MemberwiseInitMacros, MachOMacros, etc.) because they have VALID_ARCHS=arm64 and cannot be built for arm64e. The Debug-arm64e configuration applies EPA=YES only to the two targets that need an arm64e slice (RuntimeViewerServer.framework, dev.mxiris.runtimeviewer.service); macros and the main app continue to build arm64-only. Also tightens the .app discovery to skip RuntimeViewerCatalystHelper.app, and updates the script header to describe the new approach.
… configuration Updates the design and plan to reflect the final approach: a Debug-arm64e build configuration (per-target EPA=YES on the two arm64e-needing targets) instead of a command-line ARCHS=arm64e override that broke macro plugins. The lipo verification steps are also rewritten to check RuntimeViewerServer.framework and dev.mxiris.runtimeviewer.service instead of the main app, which deliberately stays arm64-only under Debug-arm64e.
There was a problem hiding this comment.
Code Review
This pull request introduces a new Debug-arm64e build configuration and a RunScript.sh script to facilitate arm64e debugging by bypassing Xcode GUI limitations. It includes a new workspace, updated project files, and comprehensive documentation. The review feedback highlights the need to explicitly disable ONLY_ACTIVE_ARCH for specific targets to ensure arm64e slices are generated and to resolve inconsistencies in pointer authentication settings across service targets.
| DYLIB_CURRENT_VERSION = 1; | ||
| DYLIB_INSTALL_NAME_BASE = "@rpath"; | ||
| ENABLE_MODULE_VERIFIER = YES; | ||
| ENABLE_POINTER_AUTHENTICATION = YES; |
There was a problem hiding this comment.
The RuntimeViewerServer target is intended to support arm64e in this configuration. However, it inherits ONLY_ACTIVE_ARCH = YES from the project level (line 808), which may prevent the generation of the arm64e slice when building on a standard arm64 development machine. It is recommended to explicitly set ONLY_ACTIVE_ARCH = NO for this target to ensure both slices are produced.
ENABLE_POINTER_AUTHENTICATION = YES;
ONLY_ACTIVE_ARCH = NO;
| CODE_SIGN_STYLE = Automatic; | ||
| DEVELOPMENT_TEAM = D5Q73692VW; | ||
| ENABLE_HARDENED_RUNTIME = YES; | ||
| ENABLE_POINTER_AUTHENTICATION = YES; |
There was a problem hiding this comment.
The dev.mxiris.runtimeviewer.service target should explicitly set ONLY_ACTIVE_ARCH = NO to ensure that the arm64e slice is built even when the active architecture is arm64. This would make it consistent with the com.JH.RuntimeViewerService target configuration at line 1601.
ENABLE_POINTER_AUTHENTICATION = YES;
ONLY_ACTIVE_ARCH = NO;
| CODE_SIGN_STYLE = Automatic; | ||
| DEVELOPMENT_TEAM = D5Q73692VW; | ||
| ENABLE_HARDENED_RUNTIME = YES; | ||
| ENABLE_POINTER_AUTHENTICATION = NO; |
There was a problem hiding this comment.
The com.mxiris.runtimeviewer.service target has ENABLE_POINTER_AUTHENTICATION set to NO in this configuration, which is inconsistent with other service targets and its own Release configuration (line 1783). If this service is intended to inspect arm64e processes during debugging, it should likely have this enabled along with ONLY_ACTIVE_ARCH = NO.
ENABLE_POINTER_AUTHENTICATION = YES;
ONLY_ACTIVE_ARCH = NO;
There was a problem hiding this comment.
Pull request overview
This PR adds a command-line build path for producing arm64e-capable Debug artifacts (to work around an Xcode GUI build failure under iOSPackagesShouldBuildARM64e=true) by introducing a dedicated debug workspace, a Debug-arm64e configuration, and a driver script.
Changes:
- Add
RunScript.shto build (and optionally launch) RuntimeViewer usingxcodebuildwith theDebug-arm64econfiguration. - Add
RuntimeViewer-Debug.xcworkspacewithiOSPackagesShouldBuildARM64e=trueand pinned SwiftPM state. - Add
Debug-arm64ebuild configurations toRuntimeViewerUsingAppKit.xcodeprojandRuntimeViewerServer.xcodeproj.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| RuntimeViewerUsingAppKit/RuntimeViewerUsingAppKit.xcodeproj/project.pbxproj | Adds Debug-arm64e configs; currently introduces hardcoded signing/bundle settings that should be aligned with existing Debug conventions. |
| RuntimeViewerServer/RuntimeViewerServer.xcodeproj/project.pbxproj | Adds Debug-arm64e configs; currently hardcodes signing team and omits CodeSigning base config like existing Debug/Release. |
| RuntimeViewer-Debug.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | Enables iOSPackagesShouldBuildARM64e=true for the debug workspace. |
| RuntimeViewer-Debug.xcworkspace/xcshareddata/swiftpm/Package.resolved | Adds pinned SwiftPM dependency resolution for the new workspace. |
| RuntimeViewer-Debug.xcworkspace/contents.xcworkspacedata | Defines the debug workspace contents (including sibling repo references). |
| RunScript.sh | New CLI script to build Catalyst helper + main app and (optionally) launch the app; logs raw xcodebuild output. |
| Documentations/Plans/2026-05-06-debug-arm64e-runscript-plan.md | Implementation plan; currently contains outdated expectations vs the actual script behavior. |
| Documentations/Plans/2026-05-06-debug-arm64e-runscript-design.md | Design doc describing the approach and rationale for avoiding global ARCHS overrides. |
Files not reviewed (1)
- RuntimeViewer-Debug.xcworkspace/contents.xcworkspacedata: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| E9958CD62FAB79100073036F /* Debug-arm64e configuration for PBXProject "RuntimeViewerUsingAppKit" */ = { | ||
| isa = XCBuildConfiguration; | ||
| buildSettings = { | ||
| ALWAYS_SEARCH_USER_PATHS = NO; | ||
| ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; |
| CODE_SIGN_STYLE = Automatic; | ||
| DEVELOPMENT_TEAM = D5Q73692VW; | ||
| ENABLE_HARDENED_RUNTIME = YES; | ||
| ENABLE_POINTER_AUTHENTICATION = YES; | ||
| MACOSX_DEPLOYMENT_TARGET = 15.0; | ||
| PRODUCT_NAME = "$(TARGET_NAME)"; |
| CODE_SIGN_STYLE = Automatic; | ||
| DEVELOPMENT_TEAM = D5Q73692VW; | ||
| ENABLE_HARDENED_RUNTIME = YES; | ||
| ENABLE_POINTER_AUTHENTICATION = NO; | ||
| MACOSX_DEPLOYMENT_TARGET = 15.0; | ||
| PRODUCT_NAME = "$(TARGET_NAME)"; |
| INFOPLIST_FILE = "$(SRCROOT)/$(TARGETNAME)/Info.plist"; | ||
| MACOSX_DEPLOYMENT_TARGET = 15.0; | ||
| ONLY_ACTIVE_ARCH = NO; | ||
| PRODUCT_BUNDLE_IDENTIFIER = com.JH.RuntimeViewerService; |
| 1. `[RunScript] workspace=RuntimeViewer-Debug.xcworkspace scheme=RuntimeViewer macOS configuration=Debug build=...` | ||
| 2. `[RunScript] Building Catalyst helper (arm64e)` | ||
| 3. `+ xcodebuild build -workspace RuntimeViewer-Debug.xcworkspace -scheme RuntimeViewerCatalystHelper -configuration Debug -destination generic/platform=macOS,variant=Mac\ Catalyst -derivedDataPath .../DerivedData/Debug-arm64e -skipPackagePluginValidation -skipMacroValidation ARCHS=arm64e ONLY_ACTIVE_ARCH=NO CURRENT_PROJECT_VERSION=...` | ||
| 4. `[RunScript] Building main app (arm64e)` | ||
| 5. `+ xcodebuild build -workspace RuntimeViewer-Debug.xcworkspace -scheme RuntimeViewer\ macOS -configuration Debug -destination generic/platform=macOS -derivedDataPath .../DerivedData/Debug-arm64e -skipPackagePluginValidation -skipMacroValidation ARCHS=arm64e ONLY_ACTIVE_ARCH=NO CURRENT_PROJECT_VERSION=...` | ||
| 6. `[RunScript] Launching <app-path>` | ||
| 7. `+ open <app-path>` | ||
| 8. `[RunScript] Done. Outputs:` | ||
|
|
||
| 确认每条 xcodebuild 命令都包含 `ARCHS=arm64e ONLY_ACTIVE_ARCH=NO`,主 app destination 是 `generic/platform=macOS`,Catalyst helper 是 `generic/platform=macOS,variant=Mac Catalyst`。 |
| E9958CDE2FAB79270073036F /* Debug-arm64e */ = { | ||
| isa = XCBuildConfiguration; | ||
| buildSettings = { | ||
| ALWAYS_SEARCH_USER_PATHS = NO; | ||
| ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; | ||
| CLANG_ANALYZER_NONNULL = YES; | ||
| CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; | ||
| CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; | ||
| CLANG_ENABLE_MODULES = YES; |
| DEAD_CODE_STRIPPING = YES; | ||
| DEVELOPMENT_TEAM = D5Q73692VW; | ||
| DYLIB_COMPATIBILITY_VERSION = 1; | ||
| DYLIB_CURRENT_VERSION = 1; | ||
| DYLIB_INSTALL_NAME_BASE = "@rpath"; | ||
| ENABLE_MODULE_VERIFIER = YES; | ||
| ENABLE_POINTER_AUTHENTICATION = YES; | ||
| GENERATE_INFOPLIST_FILE = YES; |
| DEAD_CODE_STRIPPING = YES; | ||
| DEVELOPMENT_TEAM = D5Q73692VW; | ||
| DYLIB_COMPATIBILITY_VERSION = 1; | ||
| DYLIB_CURRENT_VERSION = 1; | ||
| DYLIB_INSTALL_NAME_BASE = "@rpath"; | ||
| ENABLE_MODULE_VERIFIER = YES; | ||
| ENABLE_POINTER_AUTHENTICATION = NO; | ||
| GENERATE_INFOPLIST_FILE = YES; |
| ); | ||
| MACOSX_DEPLOYMENT_TARGET = 15.0; | ||
| MARKETING_VERSION = 2.0.1; | ||
| ONLY_ACTIVE_ARCH = YES; | ||
| PRODUCT_BUNDLE_IDENTIFIER = dev.JH.RuntimeViewer; | ||
| PRODUCT_NAME = "RuntimeViewer-Debug"; |
Summary
Adds
RunScript.sh— a command-line driver that builds and launches a Debug build of RuntimeViewer with the newDebug-arm64econfiguration. The Xcode GUI fails to compile underiOSPackagesShouldBuildARM64e=true, so this script is the only working path to produce arm64e slices for debugging.Adds
RuntimeViewer-Debug.xcworkspace— a copy ofRuntimeViewer.xcworkspace(with local sibling repo references for MachOKit / MachOObjCSection / MachOSwiftSection / swift-demangling / swift-semantic-string) plusiOSPackagesShouldBuildARM64e=true. Used exclusively byRunScript.sh.Adds a
Debug-arm64ebuild configuration toRuntimeViewerUsingAppKit.xcodeprojandRuntimeViewerServer.xcodeproj. It mirrorsDebugexceptENABLE_POINTER_AUTHENTICATION=YESis set on the two targets that need to inspect arm64e processes:RuntimeViewerServer.frameworkdev.mxiris.runtimeviewer.serviceAll other targets stay arm64-only just like Debug. Macro plugins (FrameworkToolboxMacros, MemberwiseInitMacros, MachOMacros, etc.) are not affected because we use a per-target build setting instead of a command-line
ARCHS=arm64eoverride.Distribution / Release builds and the regular
RuntimeViewer.xcworkspaceGUI flow are completely unaffected.Design and plan:
Documentations/Plans/2026-05-06-debug-arm64e-runscript-{design,plan}.md.Test plan
bash -n RunScript.sh— syntax OK./RunScript.sh --help/--bogus/--dry-run/--no-launch --dry-run— argument parsing and dispatch verified./RunScript.sh --no-launch— full Catalyst helper + main app build succeeds, log files produced underProducts/Logs/lipo -infoconfirms slice composition:RuntimeViewer-Debug→x86_64 arm64(no arm64e — expected, EPA stays NO)RuntimeViewerServer.framework/RuntimeViewerServer→x86_64 arm64 arm64e✓dev.mxiris.runtimeviewer.service→x86_64 arm64 arm64e✓./RunScript.sh(default) — app launches viaopendev.mxiris.runtimeviewer.serviceand confirm breakpoints hit the arm64e slice