swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.76k stars 1.35k forks source link

package.swift file required to authenticate with aws codeartifact registry #7637

Open tushar1998 opened 5 months ago

tushar1998 commented 5 months ago

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

Description

I am using a xcode project I don't understand why it needs package.swift file. .xcodeproj handles internally all dependencies !! To overcome this I always have to make the package.swift which is reduntant as it is only required if you are making a switf package, or cross platform code

Expected behavior

aws codeartifact login --tool swift --domain <domain> --domain-owner <domain-owner> --repository <repo> --namespace <namespace> --region us-west-2

Successfully configured swift to use AWS CodeArtifact repository https://<domain>-<domain-owner>.d.codeartifact.us-west-2.amazonaws.com/swift/<repo>/ 
Login expires in 12 hours at 2024-06-06 07:02:18+05:30

Actual behavior

aws codeartifact login --tool swift --domain <domain> --domain-owner <domain-owner> --repository <repo> --namespace <namespace> --region us-west-2

Command '['swift', 'package-registry', 'set', 'https://<domain>-<domain-owner>.d.codeartifact.us-west-2.amazonaws.com/swift/<repo>/', '--scope', <namespace>]' returned non-zero exit status 1. Stderr from command:
Error: Could not find Package.swift in this directory or any of its parent directories.

Steps to reproduce

  1. Create a xcode project File -> New -> Project
  2. Try using a codeartifact swift package
  3. Follow docs to consume package

Swift Package Manager version/commit hash

5.9

Swift & OS version (output of swift --version ; uname -a)

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5) Target: arm64-apple-macosx14.0 Darwin Tushars-MacBook-Pro.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64

Syrou commented 4 days ago

+1