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

fix: use same aws-crt-swift version in aws-sdk-swift as smithy-swift #822

Merged
merged 5 commits into from
Jan 18, 2023

Conversation

ganeshnj
Copy link
Contributor

@ganeshnj ganeshnj commented Jan 13, 2023

Issue #

Fixes #820

Description of changes

Motivation

aws-crt-swift added to aws-sdk-swift and smithy-swift, hence we have to update in both packages. Additionally, SPM started throwing warning on double inclusion of the dependency which will be covered to error in future versions.

Also, aws-crt-swift used as main and specific version smithy-swift which can cause further confusion.

Modifications

  • aws-crt-swift version is same on both aws-sdk-swift and smithy-swift
  • every target list their dependencies explicitly rather depending on the transitive deps.

Result

no warnings in SPM

In CI following

let useLocalDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_LOCAL_DEPS"] != nil
let useMainDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_MAIN_DEPS"] != nil

switch (useLocalDeps, useMainDeps) {
case (true, true):
    fatalError("Unable to determine which dependencies to use. Please only specify one of AWS_SWIFT_SDK_USE_LOCAL_DEPS or AWS_SWIFT_SDK_USE_MAIN_DEPS.")
case (true, false):
    package.dependencies += [
        .package(path: "../smithy-swift")
    ]
case (false, true):
    package.dependencies += [
        .package(url: "https://github.com/awslabs/smithy-swift", branch: "main")
    ]
case (false, false):
    package.dependencies += [
        .package(url: "https://github.com/awslabs/smithy-swift", .exact("0.10.0"))
    ]
}

translated to

 let useLocalDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_LOCAL_DEPS"] != nil
let useMainDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_MAIN_DEPS"] != nil

switch (useLocalDeps, useMainDeps) {
case (true, true):
    fatalError("Unable to determine which dependencies to use. Please only specify one of AWS_SWIFT_SDK_USE_LOCAL_DEPS or AWS_SWIFT_SDK_USE_MAIN_DEPS.")
case (true, false):
    package.dependencies += [
        .package(path: "/Users/runner/work/aws-sdk-swift/aws-sdk-swift/target/build/deps/smithy-swift")
    ]
case (false, true):
    package.dependencies += [
        .package(url: "https://github.com/awslabs/smithy-swift", branch: "main")
    ]
case (false, false):
    package.dependencies += [
        .package(url: "https://github.com/awslabs/smithy-swift", .exact("0.10.0"))
    ]
}

New/existing dependencies impact assessment, if applicable

Conventional Commits

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ganeshnj ganeshnj marked this pull request as ready for review January 13, 2023 21:26
@ganeshnj ganeshnj changed the title fix: use aws-crt-swift which comes along smithy-swift fix: use same aws-crt-swift version in aws-sdk-swift as smithy-swift Jan 17, 2023
Copy link
Contributor

@jbelkins jbelkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this will work properly for release.

scripts/generatePackageSwift.swift Show resolved Hide resolved
scripts/setup_for_crt_builder.sh Show resolved Hide resolved
@ganeshnj ganeshnj merged commit fb30b38 into main Jan 18, 2023
@ganeshnj ganeshnj deleted the jangirg/fix/crt-version-issue branch January 18, 2023 01:27
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.

Redundant aws-crt-swift in aws-sdk-swift package
3 participants