realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.55k stars 2.21k forks source link

Build fails on macOS 10.12 Sierra GM #815

Closed zmwangx closed 7 years ago

zmwangx commented 7 years ago

I'm a maintainer of Homebrew, and we're in the process of testing and packaging things for Sierra, which will be out in a few days.

When we build the latest release, or even the master branch with

make prefix_install PREFIX=<prefix> TEMPORARY_FOLDER=<buildpath>SwiftLint.dst

Here's what we get:

xcodebuild -workspace 'SwiftLint.xcworkspace' -scheme 'swiftlint' DSTROOT=/private/tmp/swiftlint-20160915-55561-13o1han/SwiftLint.dst OTHER_LDFLAGS=-Wl,-headerpad_max_install_names -configuration Debug clean
*** Updating submodules...
Build settings from command line:
    DSTROOT = /private/tmp/swiftlint-20160915-55561-13o1han/SwiftLint.dst
    OTHER_LDFLAGS = -Wl,-headerpad_max_install_names

=== CLEAN TARGET SWXMLHash OSX OF PROJECT SWXMLHash WITH CONFIGURATION Debug ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

=== CLEAN TARGET Yaml OSX OF PROJECT Yaml WITH CONFIGURATION Debug ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

** CLEAN FAILED **

The following build commands failed:
    Check dependencies
    Check dependencies
(2 failures)

Full log is here (it might get purged after a while though).

Looks like your project hasn't been configured for Xcode 8 so that you can still compile Swift 2?

zmwangx commented 7 years ago

Any update on this? It's been more than a week since Xcode 8's release and Sierra has officially landed too. If we don't get a proper response in the next few days we may have to consider migrating the formula to boneyard, at least temporarily.

(You probably should care because brew install swiftlint seems to be your preferred method of installation.)

norio-nomura commented 7 years ago

We have a PR https://github.com/realm/SwiftLint/pull/771 expecting fix this issue.

zmwangx commented 7 years ago

@norio-nomura Thanks for the info. Is that PR approaching a mergeable state? Any ETA?

norio-nomura commented 7 years ago

I fixed an issue that caused failing tests I know. But before merging that, I hope someone in @realm/swiftlint to reviews…

lsunsi commented 7 years ago

Yep, I got the same issue. Just waiting on the update now. (:

lsunsi commented 7 years ago

@norio-nomura any news on that?

norio-nomura commented 7 years ago

I merged https://github.com/realm/SwiftLint/pull/771 to master. Now, brew install --HEAD swiftlint works on Sierra:

➜  17:58:05 git:(master) ✗ brew install --HEAD swiftlint
==> Auto-updated Homebrew!
Updated Homebrew from d624627 to 41b2df8.
Updated 1 tap (homebrew/core).
No changes to formulae.

==> Using the sandbox
==> Cloning https://github.com/realm/SwiftLint.git
Cloning into '/Users/norio/Library/Caches/Homebrew/swiftlint--git'...
remote: Counting objects: 177, done.
remote: Compressing objects: 100% (167/167), done.
remote: Total 177 (delta 23), reused 48 (delta 0), pack-reused 0
Receiving objects: 100% (177/177), 361.63 KiB | 151.00 KiB/s, done.
Resolving deltas: 100% (23/23), done.
==> Checking out branch master
==> make prefix_install PREFIX=/usr/local/Cellar/swiftlint/HEAD-2380cdd TEMPORARY_FOLDER=/private/tmp/swiftlint-20160930-82158-1vsdko5/SwiftLint.dst
🍺  /usr/local/Cellar/swiftlint/HEAD-2380cdd: 33 files, 9.7M, built in 4 minutes 11 seconds
brew install --HEAD swiftlint  184.45s user 30.29s system 83% cpu 4:17.59 total

@zmwangx Do we need new release to avoid migrating the swiftlint formula to boneyard in Homebrew?

zmwangx commented 7 years ago

@norio-nomura I can confirm master now works, thanks for the fix.

Do we need new release

Yes, please.

matteocrippa commented 7 years ago

@norio-nomura I tested brew install --HEAD swiftlint but won't work for me on 10.12.1

hashier commented 7 years ago

Works for me fine!

@matteocrippa what's your error?

matteocrippa commented 7 years ago

@hashier here's the log of the installation: https://gist.github.com/matteocrippa/5874fbd2b12bb2c56c4037db7caa6859

Seems a mix of permission and missing directories, but it's a fresh install of 10.12.1.

norio-nomura commented 7 years ago

I did not fail on trying with fresh installed 10.12.1 VM. It seems your site issue.

2016-10-08 18:30:16.138 xcodebuild[60483:1608003] Error saving log: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSFilePath=/Volumes/HDD/matteocrippa/Library/Developer/Xcode/DerivedData/SwiftLint-gvymkdypzbjaftfbleglucydatgu/Logs/Build/687A30F7-61A0-485E-94D8-130E40053335.xcactivitylog, NSLocalizedDescription=No such file or directory} | User info: {
    NSFilePath = "/Volumes/HDD/matteocrippa/Library/Developer/Xcode/DerivedData/SwiftLint-gvymkdypzbjaftfbleglucydatgu/Logs/Build/687A30F7-61A0-485E-94D8-130E40053335.xcactivitylog";
    NSLocalizedDescription = "No such file or directory";
}

Could you try to fix your DerivedData /Volumes/HDD/matteocrippa/Library/Developer/Xcode/DerivedData directory's permission manually?

zmwangx commented 7 years ago

@norio-nomura Any news on the release?

Pryntie commented 7 years ago

Can't install either on 10.12.1 with brew install --HEAD swiftlint.

I get the following error message, similar to the one of @matteocrippa :

Last 15 lines from /Users/Shared/Jenkins/Library/Logs/Homebrew/swiftlint/01.make:
Method:   +loadOrCreateInBuildDirectory:withTargetBuildContext:withBasePath:
Thread:   <NSThread: 0x7fe1f86409a0>{number = 9, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Couldn't create workspace arena folder '/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/SwiftLint-gkfqpyazpzwnbacsjrrrdzykfeza': You don’t have permission to save the file “SwiftLint-gkfqpyazpzwnbacsjrrrdzykfeza” in the folder “DerivedData”.
Couldn't update module cache session file '/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation': You don’t have permission to save the file “Session.modulevalidation” in the folder “ModuleCache”.

2016-10-27 21:05:23.955 xcodebuild[43957:129701] Error saving log: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSFilePath=/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/SwiftLint-gkfqpyazpzwnbacsjrrrdzykfeza/Logs/Build/BB251E32-DA62-4196-B414-C50D8572759E.xcactivitylog, NSLocalizedDescription=No such file or directory} | User info: {
    NSFilePath = "/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/SwiftLint-gkfqpyazpzwnbacsjrrrdzykfeza/Logs/Build/BB251E32-DA62-4196-B414-C50D8572759E.xcactivitylog";
    NSLocalizedDescription = "No such file or directory";
}
** CLEAN FAILED **

Manually modifying the access on the derivedData folder didn't change the issue. Any news on this ?

norio-nomura commented 7 years ago

https://github.com/Homebrew/homebrew-core/pull/6584

norio-nomura commented 7 years ago

I confirmed that brew install swiftlint success on Sierra.

➜  18:34:08  brew install swiftlint
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.

Warning: You are using a pre-release version of Xcode.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Downloading https://homebrew.bintray.com/bottles/swiftlint-0.13.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring swiftlint-0.13.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/swiftlint/0.13.0: 34 files, 9.9M
brew install swiftlint  3.28s user 3.66s system 39% cpu 17.644 total