SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Running make install fails on Linux for version 0.47.0 and higher

Open Azbagheri opened this issue 2 years ago • 0 comments

New Issue Checklist

Describe the bug

We have always built SwiftLint from source using make install on Linux. However, we cannot install the latest version 0.47.1 and version 0.47.0 using the same approach anymore. The below output shows the results of running our install script for version 0.47.1. This script basically clones the repo, checks out a tag, and then runs make install.

Are there some additional steps required to install SwiftLint using make install on Linux for version 0.47.0 and higher? Any help is much appreciated.

Complete output when running SwiftLint, including the stack trace and command used
$./install_swiftlint.sh 0.47.1
Cloning into 'SwiftLint'...
remote: Enumerating objects: 39200, done.
remote: Counting objects: 100% (91/91), done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 39200 (delta 3), reused 89 (delta 3), pack-reused 39109
Receiving objects: 100% (39200/39200), 12.32 MiB | 10.56 MiB/s, done.
Resolving deltas: 100% (27408/27408), done.
Note: checking out 'e497f1f5b161af96ba439049d21970c6204d06c6'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

/SwiftLint /
rm -f "SwiftLint.pkg"
rm -rf "/tmp/SwiftLint.dst"
rm -f "./*.zip"
swift package clean
swift build --configuration release -Xlinker -dead_strip --arch x86_64
Fetching https://github.com/apple/swift-syntax.git
Fetching https://github.com/scottrhoyt/SwiftyTextTable.git
Fetching https://github.com/drmohundro/SWXMLHash.git
Fetched https://github.com/scottrhoyt/SwiftyTextTable.git (0.62s)
Fetching https://github.com/jpsim/Yams.git
Fetched https://github.com/drmohundro/SWXMLHash.git (0.96s)
Fetching https://github.com/jpsim/SourceKitten.git
Fetched https://github.com/apple/swift-syntax.git (2.38s)
Fetching https://github.com/apple/swift-argument-parser.git
Fetched https://github.com/jpsim/SourceKitten.git (3.74s)
Fetching https://github.com/krzyzanowskim/CryptoSwift.git
Fetched https://github.com/jpsim/Yams.git (4.46s)
Fetched https://github.com/apple/swift-argument-parser.git (2.79s)
Fetched https://github.com/krzyzanowskim/CryptoSwift.git (1.94s)
Computing version for https://github.com/krzyzanowskim/CryptoSwift.git
Computed https://github.com/krzyzanowskim/CryptoSwift.git at 1.4.3 (0.20s)
Computing version for https://github.com/scottrhoyt/SwiftyTextTable.git
Computed https://github.com/scottrhoyt/SwiftyTextTable.git at 0.9.0 (0.76s)
Computing version for https://github.com/jpsim/Yams.git
Computed https://github.com/jpsim/Yams.git at 4.0.6 (0.20s)
Computing version for https://github.com/jpsim/SourceKitten.git
Computed https://github.com/jpsim/SourceKitten.git at 0.32.0 (0.22s)
Computing version for https://github.com/apple/swift-syntax.git
Computed https://github.com/apple/swift-syntax.git at 0.50500.0 (0.31s)
Computing version for https://github.com/apple/swift-argument-parser.git
Computed https://github.com/apple/swift-argument-parser.git at 1.0.3 (0.23s)
Computing version for https://github.com/drmohundro/SWXMLHash.git
Computed https://github.com/drmohundro/SWXMLHash.git at 6.0.0 (0.21s)
Creating working copy for https://github.com/scottrhoyt/SwiftyTextTable.git
Working copy of https://github.com/scottrhoyt/SwiftyTextTable.git resolved at 0.9.0
Creating working copy for https://github.com/jpsim/SourceKitten.git
Working copy of https://github.com/jpsim/SourceKitten.git resolved at 0.32.0
Creating working copy for https://github.com/apple/swift-argument-parser.git
Working copy of https://github.com/apple/swift-argument-parser.git resolved at 1.0.3
Creating working copy for https://github.com/krzyzanowskim/CryptoSwift.git
Working copy of https://github.com/krzyzanowskim/CryptoSwift.git resolved at 1.4.3
Creating working copy for https://github.com/apple/swift-syntax.git
Working copy of https://github.com/apple/swift-syntax.git resolved at 0.50500.0
Creating working copy for https://github.com/jpsim/Yams.git
Working copy of https://github.com/jpsim/Yams.git resolved at 4.0.6
Creating working copy for https://github.com/drmohundro/SWXMLHash.git
Working copy of https://github.com/drmohundro/SWXMLHash.git resolved at 6.0.0
/usr/bin/ld.gold: warning: cannot find entry symbol 'ad_strip'
[31/31] Build complete!
swift build --configuration release -Xlinker -dead_strip --arch arm64
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/src/scanner.c:479:
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/src/yaml_private.h:1:
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/include/yaml.h:18:
/usr/include/stdlib.h:25:10: fatal error: 'bits/libc-header-start.h' file not found
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/src/reader.c:2:
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/src/yaml_private.h:1:
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/include/yaml.h:18:
/usr/include/stdlib.h:25:10: fatal error: 'bits/libc-header-start.h' file not found
:
:
#include <bits/libc-header-start.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~

         ^~~~~~~~~~~~~~~~~~~~~~~~~~
:



In file included from /SwiftLint/.build/checkouts/swift-syntax/Sources/_CSwiftSyntax/src/atomic-counter.c:1:
In file included from /SwiftLint/.build/checkouts/swift-syntax/Sources/_CSwiftSyntax/include/atomic-counter.h:1:
In file included from /usr/lib/clang/10.0.0/include/stdint.h:52:
/usr/include/stdint.h:26:10: fatal error: 'bits/libc-header-start.h' file not found
#include <bits/libc-header-start.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
:2:
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/src/yaml_private.h:1:
In file included from /SwiftLint/.build/checkouts/Yams/Sources/CYaml/include/yaml.h:18:
/usr/include/stdlib.h:25:10: fatal error: 'bits/libc-header-start.h' file not found
#include <bits/libc-header-start.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[0/11] Compiling SourceKit SourceKit.m
Makefile:75: recipe for target 'build_arm64' failed
make: *** [build_arm64] Error 1

Environment

  • SwiftLint version: 0.47.0 and higher
  • Installation method used: building from source using make install
  • Swift version - observed the issue on 5.5.3 and also the current version 5.6.1
  • Ubuntu version - the issue is observed on both 18.04 and 20.04

Azbagheri avatar Jun 14 '22 04:06 Azbagheri