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

Swift 6 build error: Static property 'schema' is not concurrency-safe #3891

Open
concavegit opened this issue Sep 19, 2024 · 2 comments
Open
Labels
bug Something isn't working pending-maintainer-response Issue is pending response from an Amplify team member transferred This issue was transferred from another Amplify project

Comments

@concavegit
Copy link

concavegit commented Sep 19, 2024

Environment information

System:
  OS: macOS 15.0
  CPU: (8) arm64 Apple M2
  Memory: 118.66 MB / 24.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 22.9.0 - /opt/homebrew/bin/node
  Yarn: undefined - undefined
  npm: 10.8.3 - /opt/homebrew/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.3.1
  @aws-amplify/backend: 1.2.2
  @aws-amplify/backend-auth: 1.1.5
  @aws-amplify/backend-cli: 1.2.7
  @aws-amplify/backend-data: 1.1.4
  @aws-amplify/backend-deployer: 1.1.3
  @aws-amplify/backend-function: 1.4.1
  @aws-amplify/backend-output-schemas: 1.2.0
  @aws-amplify/backend-output-storage: 1.1.2
  @aws-amplify/backend-secret: 1.1.2
  @aws-amplify/backend-storage: 1.1.3
  @aws-amplify/cli-core: 1.1.3
  @aws-amplify/client-config: 1.3.1
  @aws-amplify/deployed-backend-client: 1.4.1
  @aws-amplify/form-generator: 1.0.2
  @aws-amplify/model-generator: 1.0.7
  @aws-amplify/platform-core: 1.1.0
  @aws-amplify/plugin-types: 1.2.2
  @aws-amplify/sandbox: 1.2.2
  @aws-amplify/schema-generator: 1.2.3
  aws-amplify: 6.6.2
  aws-cdk: 2.159.0
  aws-cdk-lib: 2.159.0
  typescript: 5.6.2
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Describe the bug

I updated my iOS app from Swift 5 to Swift 6, and the build fails due to this error in the generated +Schema.swift files:

/Users/concaveusr/Projects/Kanai/Kanai/AmplifyModels/KanaiUserInfo+Schema.swift:23:21 Static property 'schema' is not concurrency-safe because non-'Sendable' type 'ModelSchema' may have shared mutable state

Note that putting @preconcurrency at the top of the generated Schema files suppresses the error, but I'm creating this issue to either add that automatically, or to even better find a way to make schema concurrency-safe.

Reproduction steps

Make any model in Amplify Gen 2 and put it in your Swift 6 Xcode project and try to build it.

@concavegit concavegit added the pending-triage Issue is pending triage label Sep 19, 2024
@ykethan
Copy link
Member

ykethan commented Sep 19, 2024

Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂

@ykethan ykethan transferred this issue from aws-amplify/amplify-backend Sep 19, 2024
@ykethan ykethan added the transferred This issue was transferred from another Amplify project label Sep 19, 2024
@AnilMaktala AnilMaktala transferred this issue from aws-amplify/amplify-category-api Sep 20, 2024
@dpilch
Copy link
Member

dpilch commented Oct 4, 2024

ModelSchema actually is defined in the Amplify Swift library, so I think this issue will be solved there.

@dpilch dpilch transferred this issue from aws-amplify/amplify-codegen Oct 4, 2024
@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 4, 2024
@ruisebas ruisebas added bug Something isn't working and removed pending-triage Issue is pending triage labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending-maintainer-response Issue is pending response from an Amplify team member transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

4 participants