Skip to content

swiftlint reports wrong version #3887

Closed
@jberkel

Description

@jberkel

New Issue Checklist

  • Updated SwiftLint to the latest version
    I searched for existing GitHub issues

Describe the bug

The version returned by swiftlint version is incorrect, and does not correspond to the downloaded package.

$ curl -L https://github.com/realm/SwiftLint/releases/download/0.46.5/SwiftLint.pkg > SwiftLint.pkg
$ sudo installer -pkg SwiftLint.pkg -target /
$ swiftlint version
0.46.4

(The 0.46.4 pkg reports version 0.46.3)

Update: it looks like swiftlint gets installed twice, to /usr/local/bin/swiftlint and /usr/local/bin/usr/local/bin/swiftlint. The latter binary has the correct version. (I made sure to rm /usr/local/bin/swiftlint before running the installation)

Looks related to #3815

Environment

  • SwiftLint version (run swiftlint version to be sure)?

0.46.5 (4)

  • Installation method used (Homebrew, CocoaPods, building from source, etc)?

manual, Github releases

Activity

jpsim

jpsim commented on Mar 10, 2022

@jpsim
Collaborator

To be honest I didn't believe you, so I installed the package in a VM and you're absolutely right, the package does install SwiftLint twice:

image

Here's where the package is created:

SwiftLint/Makefile

Lines 114 to 120 in 3273cef

package: installables
pkgbuild \
--identifier "io.realm.swiftlint" \
--install-location "/usr/local/bin" \
--root "$(TEMPORARY_FOLDER)" \
--version "$(VERSION_STRING)" \
"$(OUTPUT_PACKAGE)"

The installables make command must be incorrect:

SwiftLint/Makefile

Lines 94 to 96 in 3273cef

installables: build
install -d "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)"
install "$(SWIFTLINT_EXECUTABLE)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)"

jberkel

jberkel commented on Mar 11, 2022

@jberkel
Author

Thanks, in the meantime I switched to the portable zip version, which can be installed to any location and does not require root permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Participants

    @jberkel@jpsim

    Issue actions

      swiftlint reports wrong version · Issue #3887 · realm/SwiftLint