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

Plugin doesn't work with Swift 6.0 #13

Open
sebsto opened this issue Nov 4, 2024 · 0 comments
Open

Plugin doesn't work with Swift 6.0 #13

sebsto opened this issue Nov 4, 2024 · 0 comments

Comments

@sebsto
Copy link
Collaborator

sebsto commented Nov 4, 2024

I am trying to launch swift build commands from a command plugin. Until Swift 6.0, it worked. Now, the .build directory is locked and I receive

  Another instance of SwiftPM is already running using '/Users/stormacq/Documents/amazon/code/swift/lambda/swift-aws-lambda-sam-dsl/Examples/SAM/.build', waiting until that process has finished execution...

So, I tried --scratch-path .build.2 . The lock problem is gone, but I receive weird network (DNS) errors, such as

file:///Applications/Xcode-16.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift build --scratch-path .build.2 -c release --product AWSLambdaDeploymentDescriptor
  warning: /Users/stormacq/Library/org.swift.swiftpm/configuration is not accessible or not writable, disabling user-level cache features.
  warning: /Users/stormacq/Library/org.swift.swiftpm/security is not accessible or not writable, disabling user-level cache features.
  warning: /Users/stormacq/Library/Caches/org.swift.swiftpm is not accessible or not writable, disabling user-level cache features.
  Fetching https://github.com/swift-server/swift-aws-lambda-events.git
  error: Failed to clone repository https://github.com/swift-server/swift-aws-lambda-events.git:
    Cloning into bare repository '/Users/stormacq/swift-aws-lambda-sam-dsl/Examples/SAM/.build.2/repositories/swift-aws-lambda-events-00ed9a01'...
    fatal: unable to access 'https://github.com/swift-server/swift-aws-lambda-events.git/': Could not resolve host: github.com
error: file:///Applications/Xcode-16.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift build --scratch-path .build.2 -c release --product AWSLambdaDeploymentDescriptor failed with code 1

The network errors only happen when swift build commands are launched through the SwiftPM command plugin. When I type swift build --scratch-path .build.2 manually in a terminal, all packages are fetched correctly.

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

No branches or pull requests

1 participant