Skip to content

Commit 372d5b1

Browse files
authored
Merge pull request #753 from XcodesOrg/matt/FixXcoded26Check
fix: xcode 26 check for Apple Silicon installs
2 parents 4063796 + a6dec75 commit 372d5b1

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

Scripts/fix_libfido2_framework.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
# Fix libfido2.framework structure for macOS validation
4+
# If this script is not run, the build will fail because xcodebuild is expecting the library in a specific structure
5+
FRAMEWORK_PATH="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks/libfido2.framework"
6+
7+
if [ -d "$FRAMEWORK_PATH" ] && [ -f "$FRAMEWORK_PATH/Info.plist" ] && [ ! -d "$FRAMEWORK_PATH/Versions" ]; then
8+
echo "Fixing libfido2.framework bundle structure..."
9+
10+
# Create proper bundle structure
11+
mkdir -p "$FRAMEWORK_PATH/Versions/A/Resources"
12+
13+
# Move files to proper locations
14+
mv "$FRAMEWORK_PATH/Info.plist" "$FRAMEWORK_PATH/Versions/A/Resources/"
15+
mv "$FRAMEWORK_PATH/libfido2" "$FRAMEWORK_PATH/Versions/A/"
16+
if [ -f "$FRAMEWORK_PATH/LICENSE" ]; then
17+
mv "$FRAMEWORK_PATH/LICENSE" "$FRAMEWORK_PATH/Versions/A/"
18+
fi
19+
20+
# Create symbolic links
21+
ln -sf A "$FRAMEWORK_PATH/Versions/Current"
22+
ln -sf Versions/Current/libfido2 "$FRAMEWORK_PATH/libfido2"
23+
ln -sf Versions/Current/Resources "$FRAMEWORK_PATH/Resources"
24+
25+
echo "libfido2.framework structure fixed"
26+
fi

Xcodes.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@
703703
buildConfigurationList = CAD2E7BC2449575100113D76 /* Build configuration list for PBXNativeTarget "Xcodes" */;
704704
buildPhases = (
705705
CAD2E79A2449574E00113D76 /* Sources */,
706+
D971F84C2E79102E005F84C9 /* Fix libfido2 structure */,
706707
CAD2E79B2449574E00113D76 /* Frameworks */,
707708
CA9FF8292594F33200E47BAF /* Generate Acknowledgements */,
708709
CAD2E79C2449574E00113D76 /* Resources */,
@@ -876,6 +877,24 @@
876877
shellPath = /bin/sh;
877878
shellScript = "cd \"${SRCROOT}/Xcodes/AcknowledgementsGenerator\"\nxcrun -sdk macosx swift run AcknowledgementsGenerator \\\n -p \"${SRCROOT}/Xcodes.xcodeproj\" \\\n -o \"${SRCROOT}/Xcodes/Resources/Licenses.rtf\"\n";
878879
};
880+
D971F84C2E79102E005F84C9 /* Fix libfido2 structure */ = {
881+
isa = PBXShellScriptBuildPhase;
882+
buildActionMask = 2147483647;
883+
files = (
884+
);
885+
inputFileListPaths = (
886+
);
887+
inputPaths = (
888+
);
889+
name = "Fix libfido2 structure";
890+
outputFileListPaths = (
891+
);
892+
outputPaths = (
893+
);
894+
runOnlyForDeploymentPostprocessing = 0;
895+
shellPath = /bin/sh;
896+
shellScript = "${SRCROOT}/Scripts/fix_libfido2_framework.sh\n";
897+
};
879898
/* End PBXShellScriptBuildPhase section */
880899

881900
/* Begin PBXSourcesBuildPhase section */

Xcodes/Backend/AppState+Runtimes.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ extension AppState {
6363
if selectedXcode.version > Version(major: 16, minor: 0, patch: 0) {
6464

6565
if runtime.architectures?.isAppleSilicon ?? false {
66-
if selectedXcode.version > Version(major: 26, minor: 0, patch: 0) {
66+
// Need Xcode 26 but with some RC/Beta's its simpler to just to greater > 25
67+
if selectedXcode.version > Version(major: 25, minor: 0, patch: 0) {
6768
downloadRuntimeViaXcodeBuild(runtime: runtime)
6869
} else {
6970
// not supported

0 commit comments

Comments
 (0)