-
Notifications
You must be signed in to change notification settings - Fork 120
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
Support runtime downloading/installing #230
Conversation
@MattKiazyk The PR is still a WIP but I may need some help regarding I rewrote the Downloader to be shared for downloading Xcodes and runtimes, For some reason, progress is not reported when downloading runtimes using Aria, but it's working fine when downloading Xcodes. |
@Stevenmagdy Haven't looked much at the PR but curious about:
I'm pretty sure we are free and clear of that these days, using the new |
I will investigate more, but Isn't that only for XcodeReleases? |
The So similarly for the simulators, we can get that download path from a public endpoint. So for the final download we just need to make sure we've called the |
Done. Thanks for the info. |
Sources/XcodesKit/RuntimeList.swift
Outdated
|
||
public func downloadAndInstallRuntime(identifier: String, downloader: Downloader) async throws { | ||
let downloadables = try await downloadableRuntimes(includeBetas: true) | ||
guard let matchedRuntime = downloadables.first(where: { $0.visibleIdentifier == identifier }) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So one concern I have is the onus on the user to have to put quotes around the version input.
Wondering how we could make that easier? Or allow alternative options?
- Allow
runtimes install ios 16.0
where it parses both. - Have no space
iOS16.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think requiring users to quote input with spaces is reasonable, especially since that's a pattern already established by many CLI tools (e.g. changing to a directory that includes a space in the name). I think the two proposed alternatives aren't desirable.
- A single input (in this case the version) should be consumed as a single argument, not n number of arguments. This would allow future extensibility of the command, such as specifying multiple versions to install in one command.
- Listing available runtimes shows a list where versions have spaces in the name (e.g. "ios 16.0"). Requiring users to input a version without spaces (e.g. "ios16.0") makes it harder to view available runtimes and then install them. It would also require documenting this need well enough for users to understand, in which case you might as well just say 'put quotes around the version'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MattKiazyk I tend to agree with @beechtom on this. The first option IMO is doing more harm than good, and the second option is partially applied in beta versions 16.1-beta1
(instead of 16.1 beta1
) but not the platform name itself because I don't think it looks good. I hope that doesn't block the PR from being merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stevenmagdy no it won't block it. I'm on the minority when it comes using a CLI, so if others think that's the normal, i'm good
8da9e94
to
159c807
Compare
4e0eae7
to
b9de774
Compare
b9de774
to
af6351c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 This is really appreciated and is super clear - thank you very much.
I just have one picky comment on some documentation around the install method and what it's doing.
af6351c
to
ca37613
Compare
@MattKiazyk Also fixed #242 |
dc1bd09
to
39160d7
Compare
39160d7
to
a7633bd
Compare
The PR now even handles a theoretical edge case where two builds of the same OS are installed, it will add a build number to differentiate the two:
|
First I would like to say I am REALLY looking forward to this feature. That would enable us to use xcodes for provisioning our CI/CD computers. And sorry if this is a spam message. I tested the branch to check if I can install older runtimes with it. But somehow it fails. This is my output:
Maybe it is just some wrong configuration on my computer? Or is this not supposed to work as I assume? I have Xcode 16.1 currently selected. Running macOS 12.5.1. When I open this pkg like this
|
Can you check if your terminal does have |
That was the solution! Thanks a lot. :-) |
@Stevenmagdy thanks for all this work - is it ready for another review? |
Yes, its ready for a review 👍🏼 |
This PR builds on #223, and adds a command for installing runtimes
xcodes runtimes install 'iOS 14.5'
Downloading will require an Apple account for new platforms released in 2022, it's not needed for older platforms.Installing is still a WIP