Skip to content

Conversation

@arkavo-com
Copy link
Contributor

Summary

Removes Apple FairPlay SDK binaries (~2MB) from the repository and implements external dependency management for license compliance and security.

Fixes #27

Changes

Removed from Repository

  • vendor/fpssdk/prebuilt/macos/libfpscrypto.dylib (1.0MB)
  • vendor/fpssdk/prebuilt/x86_64-unknown-linux-gnu/libfpscrypto.so (492KB)
  • vendor/fpssdk/prebuilt/aarch64-unknown-linux-gnu/libfpscrypto.so (524KB)

Total: ~2MB removed (git history cleanup recommended separately)

Smart Library Detection (build.rs)

Implements intelligent library search with priority order:

  1. FPSSDK_LIB_PATH environment variable (custom location)
  2. prebuilt/ directory (backwards compatibility)
  3. System paths (/usr/local/lib, /opt/homebrew/lib, /opt/local/lib)

Provides clear, actionable error messages when library not found.

Documentation Updates

  • CLAUDE.md: Brief reference to docs/fairplay.md
  • docs/fairplay.md: Complete installation guide with 3 options
  • .gitignore: Added vendor/fpssdk/prebuilt/ to prevent future commits

Developer Installation

Developers building with FairPlay must install libfpscrypto separately:

Option A: System-wide (recommended)

# Download SDK from Apple Developer Portal
# Extract to vendor/FairPlay_Streaming_Server_SDK_26/

# macOS
sudo cp vendor/FairPlay_*/Development/lib/macos/libfpscrypto.dylib /usr/local/lib/

# Linux x86_64
sudo cp vendor/FairPlay_*/Development/lib/linux/x86_64/libfpscrypto.so /usr/local/lib/

Option B: Environment variable

export FPSSDK_LIB_PATH=/path/to/fairplay/lib
cargo build --features fairplay

Option C: Temporary build

LIBRARY_PATH=/path/to/fairplay/lib cargo build --features fairplay

Benefits

License Compliance: No redistribution of Apple proprietary binaries
Security: Developers verify binaries directly from Apple
Repository Size: 2MB immediate reduction, more with history cleanup
Flexibility: Multiple installation methods for different workflows
Clear Errors: Helpful messages guide developers to correct setup

Testing Performed

  • ✅ Build succeeds with FPSSDK_LIB_PATH set
  • ✅ Build succeeds with LIBRARY_PATH set
  • ✅ Build succeeds with library in /usr/local/lib
  • ✅ Clear error message displayed when library missing
  • ✅ Runtime works with DYLD_LIBRARY_PATH
  • ✅ Build without --features fairplay still works

CI Notes

Expected CI behavior:

  • ❌ FairPlay feature builds will FAIL (library not installed in CI)
  • ✅ Default builds (without --features fairplay) will PASS

This is intentional. FairPlay binaries cannot be committed, so CI cannot build FairPlay features unless we:

  1. Add SDK download step to CI workflow (requires Apple Developer credentials)
  2. Store binaries in GitHub secrets/artifacts (license compliance unclear)
  3. Skip FairPlay builds in CI (current approach)

Recommendation: Keep FairPlay builds as optional developer feature, test manually.

Rollback Plan

If issues arise:

git revert 16305fa

Binaries can be temporarily restored from this commit for emergency use.

Next Steps

After merge:

  • Consider git history cleanup with BFG Repo-Cleaner
  • Update CI workflow if FairPlay testing needed
  • Document FairPlay setup in team wiki/onboarding

Note: Builds without --features fairplay are unaffected. FairPlay is an optional feature.

arkavo-com and others added 3 commits October 25, 2025 14:55
## Changes

**Removed from git:**
- vendor/fpssdk/prebuilt/macos/libfpscrypto.dylib (1.0MB)
- vendor/fpssdk/prebuilt/x86_64-unknown-linux-gnu/libfpscrypto.so (492KB)
- vendor/fpssdk/prebuilt/aarch64-unknown-linux-gnu/libfpscrypto.so (524KB)
Total: ~2MB removed from git history

**Updated build.rs:**
- Smart library detection with multiple search paths
- Priority: FPSSDK_LIB_PATH env var → prebuilt/ → system paths
- Helpful error messages when library not found
- Support for /usr/local/lib, /opt/homebrew/lib on macOS

**Updated .gitignore:**
- Added vendor/fpssdk/prebuilt/ to exclude future binaries

**Updated documentation:**
- CLAUDE.md: Brief reference to docs/fairplay.md
- docs/fairplay.md: Complete installation instructions
- Removed outdated TODO about moving binaries to external storage

## Installation

Developers must now install libfpscrypto separately:

```bash
# Download SDK from Apple Developer Portal
# Extract to vendor/FairPlay_Streaming_Server_SDK_26/

# Install library (choose one):
# 1. System-wide (recommended)
sudo cp vendor/FairPlay_*/Development/lib/macos/libfpscrypto.dylib /usr/local/lib/

# 2. Custom location
export FPSSDK_LIB_PATH=/path/to/lib

# 3. Temporary build
LIBRARY_PATH=/path/to/lib cargo build --features fairplay
```

## Benefits

- License compliance: No redistribution of Apple proprietary binaries
- Security: Developers verify binaries directly from Apple
- Repository size: 2MB removed (permanent git history cleanup needed)
- Flexibility: Support for multiple library installation methods

## Testing

- ✅ Build succeeds with FPSSDK_LIB_PATH
- ✅ Build succeeds with LIBRARY_PATH
- ✅ Build succeeds with library in /usr/local/lib
- ✅ Clear error message when library missing
- ✅ Runtime works with DYLD_LIBRARY_PATH

Addresses #27

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The fairplay feature requires Apple FairPlay SDK binaries (libfpscrypto)
which are no longer included in the repository. CI cannot build this
feature without the external dependencies.

Changes:
- Remove --all-features from clippy command
- Add comment explaining why fairplay is excluded
- CI now only checks core functionality without optional FairPlay support

FairPlay builds must be tested manually by developers who have installed
the Apple SDK as documented in docs/fairplay.md.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The MAX_SPC_DATA_SIZE constant is only used within #[cfg(feature = "fairplay")]
blocks, but was not itself feature-gated. This caused clippy dead_code warnings
when building without the fairplay feature.

Solution: Add #[cfg(feature = "fairplay")] attribute to the constant definition.

This allows CI builds (which exclude fairplay) to pass clippy checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud
Copy link

@arkavo-com arkavo-com changed the title [Issue #27] Remove FairPlay SDK binaries from repository Fix FairPlay SDK Oct 25, 2025
@arkavo-com arkavo-com merged commit d5df6ab into main Oct 25, 2025
8 checks passed
@arkavo-com arkavo-com deleted the feature/issue-27-external-fairplay-sdk branch October 25, 2025 19:26
arkavo-com added a commit that referenced this pull request Oct 25, 2025
Co-authored-by: Claude <noreply@anthropic.com>
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.

[HIGH] Refactor vendor SDK management to external dependency

2 participants