Skip to content

add .git extensions to dependency URLs #770

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

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

daSkier
Copy link
Contributor

@daSkier daSkier commented Sep 11, 2024

This PR adds .git extensions to the Swift Package Manager dependencies that didn't include them. For me, this resolves issues that I have had with an error produced by Xcode when updating to the latest package versions if I'm editing the project which depends on AHC in an Xcode Workspace.

image

The complete error is: github.com: https://github.com/apple/swift-algorithms: The repository could not be found. Make sure a valid repository exists at the specified location and try again.

Based on conversations in the Vapor Discord server, adding these extensions "shouldn't" make a difference to the dependency resolution done by swift package manager, however adding them resolves the error. 🤷

@PeterAdams-A
Copy link
Collaborator

@swift-server-bot test this please

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 12, 2024

I am very surprised to learn this has an impact. Are you using package mirroring?

@daSkier
Copy link
Contributor Author

daSkier commented Sep 12, 2024

Are you using package mirroring?

No.

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 12, 2024

Hmm, do you have a Feedback Assistant report for this? I'm trying to work out why Xcode would behave this way, as I've never seen it before.

@daSkier
Copy link
Contributor Author

daSkier commented Sep 12, 2024

I have not filed a feedback. I'm happy to if that helps. And, if you have any suggestion on what would be relevant to include please let me know. I can make sure to include it.

@daSkier
Copy link
Contributor Author

daSkier commented Sep 12, 2024

I don't remember if this issue started for me before or after I started using Xcode 16. I could try it in Xcode 15 to see if it happens there too. (I don't know if the Xcode version would/could impact this)

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 12, 2024

Would it be possible to file a Feedback Assistant report? My recommendation would be to see if you can reproduce this in a small workspace that you can attach to the report, along with information about the Xcode version.

@daSkier
Copy link
Contributor Author

daSkier commented Sep 13, 2024

I'm definitely having difficulty figuring out how to reproduce this in a small project at the moment, but I have also figured out how to solve my immediate issues.

If I do the following I can get Xcode to fetch new package versions:

  • use Xcode's File > Packages > Reset Package Caches and stop the process once it finishes the "Resetting package cache" based on the status displayed in the top the progress bar (unsure of the technical name).
  • Delete the workspace's internal Package.resolved file within the package contents (e.g. WorkspaceTest.xcworkspace > xcshareddata > swiftpm > Package.resolved).
  • Have Xcode resolve the latest versions by using File > Packages > Update to Latest Package Versions
  • Once again trigger the Reset Package Caches

I'll keep looking to see if I can reproduce the issue with a small sample project.

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 13, 2024

That's an interesting data point. If you do that series of steps you should end up with a new Package.resolved file: what does it look like?

@MahdiBM
Copy link
Contributor

MahdiBM commented Sep 13, 2024

I was the one who suggested trying adding .git to those repo urls (and subsequently suggested a PR), and I'm not surprised that it worked, although it certainly shouldn't work.

I had heard about some repo/url handling behavior differences/problems when using .git or not using .git in SwiftPM before, so I gave it chance that adding .git might have an effect on this new bug.

I understand and appreciate if anyone wants to find the root of the problem and I'm not trying to stop that discussion, but generally speaking, as far as this PR goes, I think this is still mergable even assuming it doesn't actually fix any Xcode problems.
The PR unifies all the repo urls to have a .git extention, and having .git in a git repository is also somewhat of an standard by itself 🙂.
That's at least what my thought-process was when suggesting to make a PR.

@FranzBusch
Copy link
Collaborator

Can we open an issue on SwiftPM for this. We can certainly make sure that all of our repos are using .git but this needs to be fixed in Swift PM itself cc @dschaefer2

@dschaefer2
Copy link

Can we open an issue on SwiftPM for this. We can certainly make sure that all of our repos are using .git but this needs to be fixed in Swift PM itself cc @dschaefer2

Does the same thing happen from the swift command line?

@daSkier
Copy link
Contributor Author

daSkier commented Sep 16, 2024

This does not happen on the CLI. This seems to be isolated to the Xcode workspace only for me.

Copy link
Collaborator

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this to get it aligned with our other dependencies here

@FranzBusch
Copy link
Collaborator

@swift-server-bot test this please

@FranzBusch
Copy link
Collaborator

@swift-server-bot add to allowlist

@FranzBusch
Copy link
Collaborator

@swift-server-bot test this please

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 19, 2024

@swift-server-bot add to allowlist

@FranzBusch FranzBusch enabled auto-merge (squash) September 19, 2024 09:10
@FranzBusch FranzBusch merged commit 10bd49c into swift-server:main Sep 19, 2024
6 of 7 checks passed
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

Successfully merging this pull request may close these issues.

6 participants