Closed kneekey23 closed 2 years ago
I can't replicate this because it is looking for a local package ~/Projects/Amplify/SwiftSDK/aws-sdk-swift/codegen/sdk-codegen/build/smithyprojections/sdk-codegen/s3.2006-03-01/swift-codegen
which I don't have
If you view the Terminal you should see the results of a swift package resolve
. Does that return any errors?
No errors from running that command.
In order to locally generate that package, you can add a local.properties
file to the root of the repo with the following:
onlyIncludeModels=s3.2006-03-01
and then run ./gradlew build -p codegen/sdk-codegen
if you have gradle installed. You will also need this repo cloned as well: https://github.com/awslabs/smithy-swift and then you can include a path to it in the above local.properties
file with this key:
compositeProjects=~/path/to/smithy-swift
@kneekey23 can you see if you can build a repo that has the same issue, which doesn't require me to install gradle and generate a load of code
yes will try to see if can resolve the dependency from a tag and experience the same issue. @adam-fowler
changing the Pacakge.swift to use a tagged version of the sdk didn't fix the issue for me either.
import PackageDescription
let package = Package(
name: "TestSdk",
platforms: [.macOS(.v10_15)],
dependencies: [
// Dependencies declare other packages that this package depends on.
//FIXME change this path to be non-localized
// .package(name: "AWSS3", path: "~/Projects/Amplify/SwiftSDK/aws-sdk-swift/codegen/sdk-codegen/build/smithyprojections/sdk-codegen/s3.2006-03-01/swift-codegen"),
.package(name: "AWSSwiftSDK", url: "https://github.com/awslabs/aws-sdk-swift", from: "0.2.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.executableTarget(
name: "TestSdk",
dependencies: [
.product(name: "AWSS3", package: "AWSSwiftSDK")
],
path: "Sources/TestSdk",
resources: [.copy("Resources")]),
.testTarget(
name: "TestSdkTests",
dependencies: ["TestSdk"]),
]
)
I removed the .vscode folder that I manually created. and then tried to open this in vs code to see if the extension would create the files, it did not sadly :(
Hey @kneekey23 I can't replicate this. I get launch configs generated. What version of swift are you using? Also which version of the extension do you have?
$ swift --version
swift-driver version: 1.26.21 Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
Target: x86_64-apple-macosx11.0
and version 0.2.0 of the extension. hm I wonder where I am going wrong. I do have other swift extensions installed, could they be conflicting? Should I try un-installing extensions to see if I can get it to work?
Yes I’d remove the other swift extension. It might be disabling the SSWG version. I haven’t really looked into how the two extension work together.
On Thu, 17 Feb 2022 at 20:28, Nicki Stone @.***> wrote:
$ swift --version swift-driver version: 1.26.21 Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30) Target: x86_64-apple-macosx11.0
and version 0.2.0 of the extension. hm I wonder where I am going wrong. I do have other swift extensions installed, could they be conflicting? Should I try un-installing extensions to see if I can get it to work?
— Reply to this email directly, view it on GitHub https://github.com/swift-server/vscode-swift/issues/140#issuecomment-1043396917, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHSVJZ5QFNE4TXBU6IYGH3U3VLALANCNFSM5OVGEOBQ . You are receiving this because you were mentioned.Message ID: @.***>
@kneekey23 are you still having issues with this Package? If so, I've a couple of questions
swift package describe --type json
is the first line of the text a warning?yes I am. I tried removing all my other extensions and reloading it and it still didnt create the Tasks for me so I put them back.
when you load it, does the package dependencies view appear? No
if you run swift package describe --type json is the first line of the text a warning? No
$ swift package describe --type json
{
"dependencies" : [
{
"identity" : "swift-codegen",
"name" : "AWSLambda",
"url" : "/Users/nickik/Projects/Amplify/SwiftSDK/aws-sdk-swift/codegen/sdk-codegen/build/smithyprojections/sdk-codegen/lambda.2015-03-31/swift-codegen"
}
],
"name" : "TestSdk",
"path" : "/Users/nickik/Projects/Amplify/SwiftSDK/aws-sdk-swift/TestLambdaSdk",
"platforms" : [
{
"name" : "macos",
"version" : "10.15"
}
],
"products" : [
{
"name" : "TestSdk",
"targets" : [
"TestSdk"
],
"type" : {
"executable" : null
}
}
],
"targets" : [
{
"c99name" : "TestSdkTests",
"module_type" : "SwiftTarget",
"name" : "TestSdkTests",
"path" : "Tests/TestSdkTests",
"sources" : [
"TestSdkTests.swift",
"XCTestManifests.swift"
],
"target_dependencies" : [
"TestSdk"
],
"type" : "test"
},
{
"c99name" : "TestSdk",
"module_type" : "SwiftTarget",
"name" : "TestSdk",
"path" : "Sources/TestSdk",
"product_memberships" : [
"TestSdk"
],
"resources" : [
{
"path" : "/Users/nickik/Projects/Amplify/SwiftSDK/aws-sdk-swift/TestLambdaSdk/Sources/TestSdk/Resources",
"rule" : "copy"
}
],
"sources" : [
"TestSdk.swift",
"tmp.swift"
],
"target_dependencies" : [
],
"type" : "executable"
}
],
"tools_version" : "5.5"
}
I am guessing tho since you can't reproduce it's specific to my environment and I just need to figure out what about it is causing the issue.
So your swift package describe
output loads fine.
swift package reset
on your folder and see if that fixes it.don't even see that? ran the command
Extension is installed
@kneekey23 don't know if you have anytime to look at this, or if you have access to the project but I've added some extra error messaging to v0.5.0 when projects fail to load, which might give us an idea what is happening here
I am experiencing the same problem.
@Jeffrey-de-Bruijn is it a SwiftPM package? What version of Swift, VSCode, the extension, OS etc are you seeing it in? And can you provide the outlet from the extension as described https://github.com/swift-server/vscode-swift/issues/140#issuecomment-1054404467
@Jeffrey-de-Bruijn is it a SwiftPM package? What version of Swift, VSCode, the extension, OS etc are you seeing it in? And can you provide the outlet from the extension as described #140 (comment)
Also does it have an executable. launch.json configs are only generated for executables? The extension does not create a tasks.json file
I retract my comment, the problem turned out to be different.
Closing this as it has never been reported since.
I opened this package: https://github.com/awslabs/aws-sdk-swift/tree/main/TestLambdaSdk in VS Code and it did not automatically create the json files for me to launch a debugging session. I had to manually create them in order to debug this package. I did try restarting VS Code as well as disabling the extension and re-enabling it, however I did not try reloading window using the command palette. The package I opened loads a locally generated dependency.