Skip to content

Support installing toolchains from pull requests #260

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

Open
FranzBusch opened this issue Mar 27, 2025 · 5 comments
Open

Support installing toolchains from pull requests #260

FranzBusch opened this issue Mar 27, 2025 · 5 comments

Comments

@FranzBusch
Copy link
Member

The Swift CI is capable of producing toolchains on a PR for testing purposes. It would be great if Swiftly could help installing those by just pointing Swiftly at a PR or download URL. As an example this PR did produce a toolchain swiftlang/swift#80316.

@cmcgee1024
Copy link
Member

This would be a really useful feature, for sure!

@louisunlimited
Copy link
Contributor

Is it possible to figure out jenkin's CI run No ahead of time to build the download string? The 1888 in the file is CI build No, then 80316 is the PR.

If not, would adding an extra flag like swiftly install --swift-ci <URL> a good idea?

EXAMPLE LINK: https://ci.swift.org/job/swift-PR-toolchain-macos/1888/artifact/branch-main/swift-PR-80316-1888-osx.tar.gz

@ADKaster
Copy link

Chiming in to say that this feature would be very useful for testing after a team pushes a fix to swift/main for bugs I've reported, so that I don't have to wait for the next main snapshot to pass all of its tests and get released to test with my full project.

@cmcgee1024
Copy link
Member

@louisunlimited I think that it would be preferable to do something that's more structured that bare links to the toolchain tarball. It would need some investigation to see if there are ways to go from a PR down to one of those artifacts.

Something also to consider is that these artifacts are not as safe as the swift toolchain releases. There will need to be some special treatment and warnings in swiftly for that so that the user is aware of the risks.

@louisunlimited
Copy link
Contributor

louisunlimited commented Apr 14, 2025

I did some digging and I don't think I found anything that can go from a PR number directly to build artifacts. However, (correct me if I'm wrong) I was thinking that A PR might have multiple CI runs (failed runs, runs with updated code, etc) it could make more sense to let the user support a Jenkins Run Number instead of a PR number, which also gives them more control as to which build they want to install.

The good side is that it's relatively easy to find build artifacts based on a CI Run, for example:

For the PR listed above: Jenkins Build #1888

We can easily get infos for the artifact(s) with Jenkin's API:

https://ci.swift.org/job/swift-PR-toolchain-macos/1888/api/json

which returns a bunch of stuff related to this Run, and it includes

    "artifacts": [
        {
            "displayPath": "swift-PR-80316-1888-osx.tar.gz",
            "fileName": "swift-PR-80316-1888-osx.tar.gz",
            "relativePath": "branch-main/swift-PR-80316-1888-osx.tar.gz"
        }
    ],

From here, all we need to do to get the download link is:

https://ci.swift.org/job/swift-PR-toolchain-macos/<CI_RUN_NUMBER>/artifact/<RELATIVE_PATH>

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

4 participants