Skip to content

Commit 7075ad7

Browse files
robertmetaclaude
andcommitted
Handle pre-built frameworks in universal binary build
Fix framework handling when OggDecoder provides pre-built binaries: - Check architecture of each framework before combining - If frameworks have same architecture in both builds, use as-is - Only use lipo when architectures actually differ - Add detailed logging to show what's happening This handles the case where dependency frameworks are pre-built for a single architecture (typically x86_64). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
1 parent 9c5a64e commit 7075ad7

1 file changed

Lines changed: 48 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,58 @@ jobs:
102102
file swiftmac-universal
103103
lipo -info swiftmac-universal
104104
105-
# Create universal frameworks by copying arm64 structure and merging binaries
105+
# Check framework architectures
106106
mkdir -p universal-frameworks
107107
108-
# OggDecoder framework
109-
cp -r build-artifacts/arm64/ogg.framework universal-frameworks/
110-
lipo -create \
111-
build-artifacts/arm64/ogg.framework/ogg \
112-
build-artifacts/x86_64/ogg.framework/ogg \
113-
-output universal-frameworks/ogg.framework/ogg
108+
echo ""
109+
echo "Checking ogg.framework architectures..."
110+
echo "ARM64 version:"
111+
lipo -info build-artifacts/arm64/ogg.framework/ogg || true
112+
echo "x86_64 version:"
113+
lipo -info build-artifacts/x86_64/ogg.framework/ogg || true
114114
115-
# Vorbis framework
116-
cp -r build-artifacts/arm64/vorbis.framework universal-frameworks/
117-
lipo -create \
118-
build-artifacts/arm64/vorbis.framework/vorbis \
119-
build-artifacts/x86_64/vorbis.framework/vorbis \
120-
-output universal-frameworks/vorbis.framework/vorbis
115+
# Handle ogg framework - check if architectures differ
116+
ARM_OGG_ARCH=$(lipo -info build-artifacts/arm64/ogg.framework/ogg 2>&1 | grep -o 'arm64\|x86_64' | head -1)
117+
X86_OGG_ARCH=$(lipo -info build-artifacts/x86_64/ogg.framework/ogg 2>&1 | grep -o 'arm64\|x86_64' | head -1)
118+
119+
if [ "$ARM_OGG_ARCH" = "$X86_OGG_ARCH" ]; then
120+
echo "ogg.framework has same architecture in both builds, using as-is"
121+
cp -r build-artifacts/arm64/ogg.framework universal-frameworks/
122+
else
123+
echo "Creating universal ogg.framework"
124+
cp -r build-artifacts/arm64/ogg.framework universal-frameworks/
125+
lipo -create \
126+
build-artifacts/arm64/ogg.framework/ogg \
127+
build-artifacts/x86_64/ogg.framework/ogg \
128+
-output universal-frameworks/ogg.framework/ogg
129+
fi
130+
131+
echo ""
132+
echo "Checking vorbis.framework architectures..."
133+
echo "ARM64 version:"
134+
lipo -info build-artifacts/arm64/vorbis.framework/vorbis || true
135+
echo "x86_64 version:"
136+
lipo -info build-artifacts/x86_64/vorbis.framework/vorbis || true
137+
138+
# Handle vorbis framework - check if architectures differ
139+
ARM_VORBIS_ARCH=$(lipo -info build-artifacts/arm64/vorbis.framework/vorbis 2>&1 | grep -o 'arm64\|x86_64' | head -1)
140+
X86_VORBIS_ARCH=$(lipo -info build-artifacts/x86_64/vorbis.framework/vorbis 2>&1 | grep -o 'arm64\|x86_64' | head -1)
141+
142+
if [ "$ARM_VORBIS_ARCH" = "$X86_VORBIS_ARCH" ]; then
143+
echo "vorbis.framework has same architecture in both builds, using as-is"
144+
cp -r build-artifacts/arm64/vorbis.framework universal-frameworks/
145+
else
146+
echo "Creating universal vorbis.framework"
147+
cp -r build-artifacts/arm64/vorbis.framework universal-frameworks/
148+
lipo -create \
149+
build-artifacts/arm64/vorbis.framework/vorbis \
150+
build-artifacts/x86_64/vorbis.framework/vorbis \
151+
-output universal-frameworks/vorbis.framework/vorbis
152+
fi
121153
122-
# Verify frameworks are universal
123-
echo "Verifying universal frameworks..."
154+
# Verify final frameworks
155+
echo ""
156+
echo "Final framework architectures:"
124157
lipo -info universal-frameworks/ogg.framework/ogg
125158
lipo -info universal-frameworks/vorbis.framework/vorbis
126159

0 commit comments

Comments
 (0)