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

Dependency names are lower-cased, disallowing setting a local version #1052

Open
nmggithub opened this issue Sep 4, 2024 · 1 comment
Open
Labels
bug Something isn't working SwiftPM Swift Package Manager

Comments

@nmggithub
Copy link

nmggithub commented Sep 4, 2024

Describe the bug

I'm currently developing my reverse-engineering toolkit, Kass on my device in a folder named Kass (uppercase K). The package itself is also named with an uppercase K, which I think is the actual causal contribution to this.

I have a package in a separate folder I use for testing it as a library, pulling in the latest main via my Package.swift like so:

let package = Package(
  ...
  dependencies: [
    ...
    .package(url: "https://github.com/nmggithub/Kass", revision: "main"),
    ...
  ],
  ...
)

It appears in my dependencies on VSCode like this:
Screenshot 2024-09-04 at 11 22 09

It appears as lowercase, which isn't ideal, but it doesn't affect my ability to use it. It does affect my ability to select my local development version as a path, though.

To Reproduce
Steps to reproduce the behavior:

  1. Right click the "kass" dependency
  2. Select "Use Local Version"
  3. Navigate to folder (potentially named "Kass") with Kass inside and select it
  4. See error:
'kass': package at '{/path/to}/Kass' is Kass but was expecting kass

Expected behavior
The local version should be selected.

Environment

  • OS: macOS Sonoma 14.6.1
  • Swift version (output of swift --version)
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
  • Visual Studio Code version:
Version: 1.92.2 (Universal)
Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
Date: 2024-08-14T17:29:30.058Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0
  • vscode-swift version: v1.11.0

Additional context
It seems the VSCode plugin is running this command behind the scenes:

swift package edit --path {/path/to}/Kass kass

If I instead run this command myself, it works fine (and I can use my local development version):

swift package edit --path {/path/to}/Kass Kass

I'm not sure why the plugin lowercases dependency names to begin with, but it seems to be the root cause of this issue.

@nmggithub nmggithub added the bug Something isn't working label Sep 4, 2024
@bripeticca
Copy link

Hello! :)

It seems like this issue is related to this one which was recently moved from this project over to swift package manager. I'm currently looking into this!

@award999 award999 added the SwiftPM Swift Package Manager label Sep 11, 2024
michael-weng added a commit to michael-weng/vscode-swift that referenced this issue Oct 16, 2024
- Verify various contract calls with spm
- Exercises use local version workflow

Issue: swiftlang#1052
michael-weng added a commit to michael-weng/vscode-swift that referenced this issue Oct 16, 2024
- Verify various contract calls with spm
- Exercises use local version workflow

Issue: swiftlang#1052
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SwiftPM Swift Package Manager
Projects
None yet
Development

No branches or pull requests

3 participants