{"action":"created","issue":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5650","repository_url":"https://api.github.com/repos/CocoaPods/CocoaPods","labels_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5650/labels{/name}","comments_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5650/comments","events_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5650/events","html_url":"https://github.com/CocoaPods/CocoaPods/pull/5650","id":166806129,"number":5650,"title":"WIP: Set Swift version when linting Pods","user":{"login":"neonichu","id":118992,"avatar_url":"https://avatars.githubusercontent.com/u/118992?v=3","gravatar_id":"","url":"https://api.github.com/users/neonichu","html_url":"https://github.com/neonichu","followers_url":"https://api.github.com/users/neonichu/followers","following_url":"https://api.github.com/users/neonichu/following{/other_user}","gists_url":"https://api.github.com/users/neonichu/gists{/gist_id}","starred_url":"https://api.github.com/users/neonichu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neonichu/subscriptions","organizations_url":"https://api.github.com/users/neonichu/orgs","repos_url":"https://api.github.com/users/neonichu/repos","events_url":"https://api.github.com/users/neonichu/events{/privacy}","received_events_url":"https://api.github.com/users/neonichu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-07-21T12:23:57Z","updated_at":"2016-09-10T21:10:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/pulls/5650","html_url":"https://github.com/CocoaPods/CocoaPods/pull/5650","diff_url":"https://github.com/CocoaPods/CocoaPods/pull/5650.diff","patch_url":"https://github.com/CocoaPods/CocoaPods/pull/5650.patch"},"body":"Linting Pods written in Swift is currently not working with Xcode 8 beta 3, because Swift targets without the `SWIFT_VERSION` setting do not even build anymore. Our current strategy of looking at the user project for input also does not work at all for the linter case, because we generate the user project here and also the Pods project is manually generated before the user project.\r\n\r\nThis PR currently just sets `SWIFT_VERSION` to 2.3 unconditionally, which probably would work for most existing Pods targeting stable versions of Swift, but isn't really a feasible solution.\r\n\r\nI see a few potential solutions for this:\r\n\r\n1) Default to 2.3 and add a CLI flag `--swift-version` to let users specify a different version for their Pod being used for linting. A variant of this which would make the flag more discoverable would be having no default and instead failing when linting a Swift Pod and forcing the user to always specify the version explicitly.\r\n\r\n2) Adding a `swift_version` attribute to the podspec DSL. We have discussed this quite a few times and dismissed it for many good reasons, but I'm still including it here for completeness sake.\r\n\r\n3) Try to infer the Swift version, using `swift-update` or compiling the Pod with all the different available toolchains. This seems pretty brittle, because even version 2.2 vs. 2.3 aren't fully source-compatible.\r\n\r\n4) Use `.swift-version` files as a way to determine the Swift language version of a Pod.\r\n\r\nPersonally, I think the first solution is the most feasible one and defaulting to 2.3 should be good enough — we can update the default in due time when Swift 3 becomes the more prevalent version.\r\n\r\ncc @mrackwitz @segiddins @DanToml "},"comment":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/comments/246140579","html_url":"https://github.com/CocoaPods/CocoaPods/pull/5650#issuecomment-246140579","issue_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5650","id":246140579,"user":{"login":"edwardvalentini","id":1571326,"avatar_url":"https://avatars.githubusercontent.com/u/1571326?v=3","gravatar_id":"","url":"https://api.github.com/users/edwardvalentini","html_url":"https://github.com/edwardvalentini","followers_url":"https://api.github.com/users/edwardvalentini/followers","following_url":"https://api.github.com/users/edwardvalentini/following{/other_user}","gists_url":"https://api.github.com/users/edwardvalentini/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardvalentini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardvalentini/subscriptions","organizations_url":"https://api.github.com/users/edwardvalentini/orgs","repos_url":"https://api.github.com/users/edwardvalentini/repos","events_url":"https://api.github.com/users/edwardvalentini/events{/privacy}","received_events_url":"https://api.github.com/users/edwardvalentini/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T21:10:24Z","updated_at":"2016-09-10T21:10:24Z","body":"i am seeing this for an ios library on xcode 8 GM and `cocoapods 1.1.0.rc.1` - even though i have this set in my podspec:\r\n\r\n```\r\n  s.pod_target_xcconfig = {\r\n                 'SWIFT_VERSION' => '3.0'\r\n               }\r\n```\r\n\r\n```\r\nCheck dependencies\r\n“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.\r\n“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.\r\n\r\n** BUILD FAILED **\r\n```"}}
{"actor":{"display_login":"edwardvalentini"}}