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.

@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
michael-weng added a commit to michael-weng/vscode-swift that referenced this issue Oct 24, 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 25, 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 29, 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 31, 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 Nov 4, 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 Nov 5, 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 Nov 6, 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 Nov 8, 2024
- Verify various contract calls with spm
- Exercises use local version workflow

Issue: swiftlang#1052
award999 pushed a commit that referenced this issue Nov 13, 2024
* Add integration tests for package dependencies

- Verify various contract calls with spm
- Exercises use local version workflow

Issue: #1052

* - Split the original test case into smaller test cases
- Switch to assert directly on executeCommand return

* - Update enum name to match convention
- Move tests to a more appropriate location under integration-tests/commands

* Remove forgotten return statement

* - Fix extra command constant that's not correctly mapped
- Rename to CONSTANT_CASE for module level enums' value

* - Adjust Swift version for the Swift-Markdown package used by the test
to match up.

* - Shift test order for spm update as the return code is different
between toolchains above 5.9 and 5.9 + below.
- Move to a spot where spm update is guranteed to return 0, after
local dependency is fully set up.

* - Add some debug lines to see which part failed in CI
- Unified return for the dependencies command to return boolean

* - Re-enable logToConsole behaviour, Paul's patch will give us the
desired behaviour.

* - Set the timeout to be more reasonable for running in CI

* - Disable flaky test and add comment on subsequent action

* - Maintain original register command ordering
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
Development

No branches or pull requests

3 participants