Skip to content

Replace source code with binary targets to enforce Library Evolution and resolve conflicts#1

Open
sajal4me wants to merge 4 commits intomainfrom
sajal.gupta/1.7.5_le_via_binary_prebuilt_framework
Open

Replace source code with binary targets to enforce Library Evolution and resolve conflicts#1
sajal4me wants to merge 4 commits intomainfrom
sajal.gupta/1.7.5_le_via_binary_prebuilt_framework

Conversation

@sajal4me
Copy link
Copy Markdown
Collaborator

Description

Context

This repository serves as a shared wrapper for our internal SDKs and third-party integrations. Previously, it hosted the raw source code of the library directly.

The Problem

We are encountering two critical build issues when integrating with downstream dependencies:

  1. Unsafe Flags Error: Xcode blocks "unsafe flags" (specifically those required for Library Evolution support) when using versioned source packages.
  2. Diamond Dependency: Multiple internal modules and consumer apps depend on this library. Compiling from source leads to duplicate symbols and target collisions when these modules are integrated together.

The Solution

  • Removed Source Code: Deleted the Sources/ directory to prevent accidental source compilation and conflicts.
  • Switched to Binary Target: Updated Package.swift to use .binaryTarget, pointing to the hosted, pre-compiled XCFramework.
  • Enforced Library Evolution: The binary was compiled with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, ensuring ABI stability and compatibility across different Swift compiler versions.

Impact

  • Fixes Build: Bypasses the "unsafe flags" restriction by linking the pre-compiled binary instead of compiling source code.
  • Deduplication: Allows Swift Package Manager (SPM) to resolve this package as a single shared artifact for all consumers (Core SDKs and Host Apps), preventing "multiple binary target" errors.
  • Faster Builds: Eliminates the need to recompile the library during clean builds.

Verification

  • Verified checksum matches the hosted XCFramework.
  • Confirmed Library Evolution support is enabled in the linked binary.

bangnguyengrab and others added 4 commits January 22, 2026 13:53
- Replaces source code target with pre-compiled .binaryTarget
- Resolves "Unsafe Flags" error in SPM by baking Library Evolution settings into the binary
@sajal4me sajal4me force-pushed the sajal.gupta/1.7.5_le_via_binary_prebuilt_framework branch from 1a92600 to 02ab9ab Compare January 22, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants