Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use process instead of copy to fix simulator builds #60

Merged
merged 5 commits into from
Jan 28, 2025

Conversation

gavinaboulhosn
Copy link
Contributor

Description

Hey there! When building for the iOS simulator (iphonesimulator SDK), Xcode 16+ attempts to code sign the JSONSchema resource bundle, resulting in the error:

bundle format unrecognized, invalid, or unsuitable.

Fix:

Change the resource declaration for the JSONSchema target from .copy("Resources") to .process("Resources").

.copy("Resources") creates a directory structure that Xcode may treat as a signable bundle for simulators (despite simulators not requiring code signing).

.process("Resources") copies files individually into the module’s resource path while preserving subdirectory structure, avoiding the creation of a monolithic bundle.

Verification:

  • Tested on iOS simulator (Xcode 16.2) and physical devices.
  • swift build && swift test

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

@gavinaboulhosn gavinaboulhosn marked this pull request as ready for review January 28, 2025 01:10
@ajevans99
Copy link
Owner

Thanks @gavinaboulhosn! I noticed this error the other day but never got around to looking into it. I'm mostly targeting macOS.

@ajevans99 ajevans99 self-assigned this Jan 28, 2025
@ajevans99 ajevans99 self-requested a review January 28, 2025 03:04
Sources/JSONSchema/Dialect.swift Show resolved Hide resolved
.github/workflows/format.yml Show resolved Hide resolved
@ajevans99 ajevans99 merged commit 707fc4c into ajevans99:main Jan 28, 2025
8 checks passed
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