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

Doesn't compile on Linux with Swift 5.1 #2874

Closed
Fryie opened this issue Sep 23, 2019 · 8 comments · Fixed by #2894
Closed

Doesn't compile on Linux with Swift 5.1 #2874

Fryie opened this issue Sep 23, 2019 · 8 comments · Fixed by #2894

Comments

@Fryie
Copy link

Fryie commented Sep 23, 2019

New Issue Checklist

Describe the bug

The reason is that the XML support has been moved to a separate package on Linux, which breaks something in the transitive dependency SWXMLHash, where the issue has apparently been fixed, but of course this package is still using an old version.

Since the package is not a direct dependency of SwiftLint, it probably needs to be fixed in some other package first, but I have no idea how to find out which dependency pulls this in, so apologies for filing this here.

@Fryie
Copy link
Author

Fryie commented Sep 30, 2019

I looked at it in a bit more detail. The dependency is pulled in by SourceKitten, which has been updated such that it also fetches the fixed version of SWXMLHash. However, the SourceKitten update also introduces new enum cases for some of its types, which means that the relevant places in the SwiftLint source that use those enums need to be updated in order for this to compile.

@minuscorp
Copy link

I experience this same issue on macOS compiling Swiftlint from scratch

@minuscorp
Copy link

In macOS this issue was fixed using SourceKitten at 0.25.0

@Fryie
Copy link
Author

Fryie commented Oct 8, 2019

Now it fails with a different error (repeated a couple of times):

/SwiftLint/Source/SwiftLintFramework/Models/Command.swift:83:59: error: 'scanUpToString' is unavailable
        guard let actionString = actionAndModifierScanner.scanUpToString(":"),
                                                          ^~~~~~~~~~~~~~
Foundation.Scanner:19:17: note: 'scanUpToString' was introduced in Swift 5.0
    public func scanUpToString(_ substring: String) -> String?

@minuscorp
Copy link

Have you tried to fix the version of SourceKitten to 0.25.0?

@marcelofabri marcelofabri reopened this Oct 8, 2019
@marcelofabri
Copy link
Collaborator

This is still an issue even with SourceKitten 0.26.0. See #2896.

I will try to take a look later today.

@Fryie
Copy link
Author

Fryie commented Oct 9, 2019

@marcelofabri #2896 appears to fix the issue for me

@marcelofabri
Copy link
Collaborator

Thanks for verifying, @Fryie 🚀

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

Successfully merging a pull request may close this issue.

3 participants