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

[SR-15067] swift-format swift-5.4.2-RELEASE tag may be at wrong revision #306

Closed
swift-ci opened this issue Aug 14, 2021 · 2 comments
Closed
Labels
bug Something isn't working swift-format

Comments

@swift-ci
Copy link

Previous ID SR-15067
Radar None
Original Reporter msbit (JIRA User)
Type Bug

Attachment: Download

Environment

$ swift --version
Swift version 5.4.2 (swift-5.4.2-RELEASE)
Target: x86_64-unknown-linux-gnu

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal

$ wslconfig.exe /list
Windows Subsystem for Linux Distributions:
Legacy (Default)

Additional Detail from JIRA
Votes 0
Component/s swift-format
Labels Bug
Assignee None
Priority Medium

md5: a113eea07050ac47a50718ea01fec0b1

Issue Description:

When checking out `swift-format` at `swift-5.4.2-RELEASE` and running:

```
swift build
```

I get errors when building the `SwiftSyntax` dependency (`output1.txt` attached).

When reverting just `Package.swift` to the `swift-5.4-branch` branch with:

```
git checkout origin/swift-5.4-branch Package.swift
```

I get errors building `swift-format` itself (`output2.txt` attached).

When checking out `0.50400.0`, the build completes fine, which seems to indicate that `9c15831` may be the better revision.

@typesanitizer
Copy link

cc @allevato

@allevato
Copy link
Collaborator

AFAIK, the swift-X.Y.Z-RELEASE tags are automatically created by some part of Swift's CI/release process? They're not something I've intentionally created; looking at the Package.swift file (https://github.com/apple/swift-format/blob/swift-5.4.2-RELEASE/Package.swift#L142), we can see that it's trying to depend on main for the SwiftSyntax dependency, which would definitely be wrong—the tag was just created based on whatever was in the main branch at that time.

In general for swift-format, you should only rely on the numbered tags (like 0.50400.0) that represent releases that we've explicitly created and pinned to the correct version of swift-syntax. They're differentiated on https://github.com/apple/swift-format/releases by having more release information than just the tag name. (Unfortunately GitHub still shows both on that page, but the one labeled "Latest Release" is the one you want, which may not be the top one.)

I'm not familiar enough with swift-ci (which we don't have working yet for swift-format) to know if there's a way to have it automatically update the Package.swift dependencies to use the one corresponding to the same tag, or how other projects with inter-repository dependencies manage this.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
@allevato allevato closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working swift-format
Projects
None yet
Development

No branches or pull requests

3 participants