Skip to content

swift package-registry set doesn’t create .swiftpm on nightly version #6234

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

Closed
jfrog-qa opened this issue Mar 6, 2023 · 6 comments
Closed
Labels

Comments

@jfrog-qa
Copy link

jfrog-qa commented Mar 6, 2023

Description

There is an issue when you work with SWIFT-DEVELOPMENT-SNAPSHOT-2023-03-02-a and trying to log into a private registry, the swift package-registry set command does not create the .swiftpm that is expected. Therefore, requests are not sent to the remote registry.

Furthermore, in Package.swift, no "dependencies" section appears.

Expected behavior

swift package-registry set command will create the .swiftpm

Actual behavior

swift package-registry set command does not create the .swiftpm

Steps to reproduce

  1. mkdir swiftProject && cd swiftProject
  2. swift package init
  3. swift package-registry set --global

Swift Package Manager version/commit hash

SWIFT-DEVELOPMENT-SNAPSHOT-2023-03-02-a

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

No response

@jfrog-qa jfrog-qa added the bug label Mar 6, 2023
@yim-lee
Copy link
Contributor

yim-lee commented Mar 9, 2023

Tested with docker image swiftlang/swift:nightly-jammy dated from March 6, it seems like running a package-registry subcommand would always display its help only:

swift package-registry set --scope test https://yim.test.com
OVERVIEW: Set a custom registry

USAGE: swift package-registry set [--global] [--scope <scope>] <url>

ARGUMENTS:
  <url>                   The registry URL

OPTIONS:
  --global                Apply settings to all projects for this user
  --scope <scope>         Associate the registry with a given scope
  --version               Show the version.
  -h, -help, --help       Show help information.

@yim-lee
Copy link
Contributor

yim-lee commented Mar 9, 2023

Running the subcommand locally from the latest main works

@tomerd
Copy link
Contributor

tomerd commented Mar 9, 2023

may be related: #6247

@yim-lee
Copy link
Contributor

yim-lee commented Mar 14, 2023

#6254 seems to have fixed this.

I tested with swiftlang/swift:nightly-jammy dated from March 10 and configuration is saved as expected.

Swift version 5.9-dev (LLVM 890fc030f1e3860, Swift bac2b53c553263c)

@yuvalojfrog
Copy link

yuvalojfrog commented Mar 14, 2023

@yim-lee

It seems that indeed #6254 fixed this.

But, in Package.swift, still no "dependencies" section appears.

This is how Package.swift is in the nightly-jammy:

// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
let package = Package(
    name: "swiftProject",
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "swiftProject",
            targets: ["swiftProject"]),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .target(
            name: "swiftProject"),
        .testTarget(
            name: "swiftProjectTests",
            dependencies: ["swiftProject"]),
    ]
)

And this is how it looks in 5.7.1:

// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "swiftProject",
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "swiftProject",
            targets: ["swiftProject"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.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.
        .target(
            name: "swiftProject",
            dependencies: []),
        .testTarget(
            name: "swiftProjectTests",
            dependencies: ["swiftProject"]),
    ]
)

No "dependencies" section in the nightly-jammy

@MaxDesiatov
Copy link
Contributor

The dependencies empty array argument in the template was cleaned up in #6173, so that is expected. Either way, that's unrelated to the issue specified in the title, which I'd consider resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants