swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

Add a progress-file option to swiftly install and swiftly init

Open cmcgee1024 opened this issue 9 months ago • 2 comments

It is possible that a GUI could be driving swiftly in these two cases where things can take a significant time, mostly the downloading the toolchain portion. Add some kind of progress-file option to swiftly so that it can report back progress periodically to the GUI.

This option can be just a simple path, provided by the client, and swiftly appends JSON Lines of progress output there. Note that swift test has a similar capability that's currently used by VSCode to report test execution progress.

It will be up to the client to pre-create, or otherwise make available the file. It could be a regular file, or a named pipe, or even a device (e.g. /dev/stdout on Unix). The client then reads or tails from this file and updates the UI with the information.

See this module in swift testing for an idea of the JSON Line records it uses for this purpose: https://github.com/swiftlang/swift-testing/tree/main/Sources/Testing/ABI

cmcgee1024 avatar Mar 19 '25 16:03 cmcgee1024

Consider versioning with this option too (e.g. --progress-file-version=0. It could be that the schema changes over time.

cmcgee1024 avatar Mar 19 '25 16:03 cmcgee1024

I do realize this is a part of GSoC 2025 for integrating swiftly with VSCode (and I did submit a proposal for it), but since this is a public issue I went ahead and made a little poc for swiftly install, hope this helps anybody eventually picking up the project, and also possibly bring up some discussion around it.

  • #343

louisunlimited avatar May 05 '25 05:05 louisunlimited