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

Suddenly stopped working #22

Open
haarj opened this issue Apr 30, 2023 · 26 comments
Open

Suddenly stopped working #22

haarj opened this issue Apr 30, 2023 · 26 comments

Comments

@haarj
Copy link

haarj commented Apr 30, 2023

No description provided.

@kiliankoe
Copy link
Owner

Hi @haarj, what do you mean by it stopped working? Is there an error? Everything appears to work fine on my end.

@haarj
Copy link
Author

haarj commented May 1, 2023 via email

@kiliankoe
Copy link
Owner

How did you install swift-outdated? From the title I assume it worked before? Are you aware of any changes in your installation? Do you see a version when running swift-outdated --version? And - just spitballing here - are any of your dependencies not on github.com or possibly not accessible without a VPN or something like that? Not sure how swift-outdated would behave in that case.

@haarj
Copy link
Author

haarj commented May 1, 2023

Hey @kiliankoe I have 0.4.0 and installed through Homebrew. It did work before then one day it just got stuck. I would assume that all of my swift packages are available since "swift-outdated" was working just fine. Maybe I'll have to go through each of them and see if one updated recently and what those changes were.

@kiliankoe
Copy link
Owner

Could you maybe check and see if swift-outdated works in another (sample) project on your machine? That would rule out any kind of broken installation. Feel free to also just clone this repo and run it inside of that, it should show you something like this.

$ swift outdated
| Package               | Current | Latest |
|-----------------------|---------|--------|
| Rainbow               | 3.2.0   | 4.0.1  |
| swift-argument-parser | 1.1.4   | 1.2.2  |

@haarj
Copy link
Author

haarj commented May 3, 2023

Just cloned and yes it works. Hmm! What do you suggest here?

@kiliankoe
Copy link
Owner

Ah! In that case I'm willing to guess one of your dependencies is hosted somewhere git ls-remote --tags <url> doesn't work (or maybe is just super slow?), that's what swift-outdated uses under the hood to get a list of available versions.

@haarj
Copy link
Author

haarj commented May 3, 2023

It could be the one where I am forced to use the "master" branch instead of a specific version in the version rules. Could this be the culprit? For whatever reason this specific package won't work specifying a "version".

@kiliankoe
Copy link
Owner

I thought that that should be working (and just gets ignored by swift-outdated), but maybe I'm mistaken. Is this a public dependency that you could share? And if not, are the version tags there somehow malformed, e.g. not just "1.2.3" or "v1.2.3"?

@haarj
Copy link
Author

haarj commented May 3, 2023

@kiliankoe
Copy link
Owner

Hmm, that doesn't appear to be a problem. Also I've checked to make sure and packages without resolved versions (such as your pin on master) are filtered and shown correctly. Are you sure you don't have an internal dependency in your project that's only accessible over a VPN or something? Because swift-outdated definitely locks up if it can't make that network request.

@haarj
Copy link
Author

haarj commented May 4, 2023

Yea all of my packages were working just fine and then suddenly just stopped. Is there a way I can debug this on my end? See at what step "swift-outdated" gets locked up?

@kiliankoe
Copy link
Owner

Hey @haarj, I just pushed the branch add-verbose-flag, which adds a flag to show verbose output. Could you checkout that branch, build it (debug build through swift build is fine) and then run that version (from checkout-dir/.build/debug/swift-outdated) with the -v flag in your project directory?
It'll show what it's doing, maybe we'll see what package it gets stuck on and with a bit of luck it might also output an error git ls-remote encounters, although I'm unsure if ShellOut forwards those correctly or if git ls-remote even has an error and doesn't just get stuck. But at least it should give us something to act on.

@haarj
Copy link
Author

haarj commented May 7, 2023

Sorry @kiliankoe. Little bit of an amateur here. I did the swift-build step but not sure exactly how to do the,
"run that version (from checkout-dir/.build/debug/swift-outdated) with the -v flag in your project directory" step.

@kiliankoe
Copy link
Owner

Ah, no worries! What I meant was the following, assuming swift-oudated is checked out in ~/dev/swift-outdated and your project is in ~/dev/project.

$ cd ~/dev/project
$ ../swift-outdated/.build/debug/swift-outdated -v

When running swift build in swift-outdated's directory, swift will build and store the binary in .build/debug/swift-outdated. You can run that freshly-built binary directly in your project's directory like that.

@haarj
Copy link
Author

haarj commented May 7, 2023

Aha! So it's logging a bunch and hangs on UIOnboarding

2023-05-07T10:17:54-0400 info SwiftOutdated : [SwiftOutdated] Found 7 versions for uionboarding.

Actually after running that command a couple of times, it hangs on different ones each time.

@kiliankoe
Copy link
Owner

Are you seeing any output of "Package $name has resolved version, queueing version fetch." that's not matched with a "Found $count versions for $name."? And is that consistent by any chance?

@haarj
Copy link
Author

haarj commented May 7, 2023

jdstatusbarnotification had no "Found $count for $name" and
dznemptydataset had nothing at all

dznemptydataset I point to the "master" branch for its SPM just FYI.

@kiliankoe
Copy link
Owner

I assume that's https://github.com/calimarkus/JDStatusBarNotification or are you using a fork? If it is that, I don't know what's going on, unfortunately that package is also working fine on my end if I add it as a dependency :/

Does git ls-remote --tags https://github.com/calimarkus/JDStatusBarNotification output a list of tags for you?

@haarj
Copy link
Author

haarj commented May 7, 2023

Yea all of the tags are there. swift-outdated stopped working before I added JDStatusBarNotification so maybe it's coming down to dznemptydataset?

@kiliankoe
Copy link
Owner

I... don't know. The fact that it stopped working before you added JDStatusBarNotification sure makes it sound like that's not the problem. The logs make it sound like it's locking up during the fetching of that. If there's no output at all for dznemptydataset that also shouldn't be the problem, since swift-outdated apparently hasn't even gotten around to queuing up the verion check then.

My last theory would be that it's somehow deadlocking itself through the concurrent version lookups, I gotta say I'm not super comfortable with the async/await APIs yet. The current implementation uses a TaskGroup to queue up these tasks, maybe that's starving your machine somehow? It's weird though that that issue hasn't appeared elsewhere before and also seems to be super reproducible on your end. I'll try and investigate a bit.

@haarj
Copy link
Author

haarj commented May 8, 2023

Sorry @kiliankoe wish I could be of more help. I tried reinstalling swift-outdated too with no success. Let me know if I can help in any other way. Thanks for checking!

@kiliankoe
Copy link
Owner

Hi @haarj, I just added a new branch/PR sequential-version-fetchign (oh damn, mistyped there, oh well). I don't know if it will make a difference for you, but it adds the new flag --run-sequentially, which forces swift-outdated to not fetch version information concurrently using async/await. I'd love to see if that makes a difference, just in case 😬

@haarj
Copy link
Author

haarj commented May 31, 2023

Hey @kiliankoe I tried that but it always hangs on "Found X versions for {swift-package}."

@kiliankoe
Copy link
Owner

Ah ok, so my assumption about it somehow locking up due to the concurrent version fetches is moot then. Worth a try I guess, thanks for checking though!

@haarj
Copy link
Author

haarj commented May 31, 2023

No problem and thanks for helping!

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

No branches or pull requests

2 participants