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

Podspec mode doesn't pass through swift version 4.2 properly #1015

Closed
tackgyu opened this issue Oct 10, 2018 · 6 comments
Closed

Podspec mode doesn't pass through swift version 4.2 properly #1015

tackgyu opened this issue Oct 10, 2018 · 6 comments
Labels

Comments

@tackgyu
Copy link

tackgyu commented Oct 10, 2018

I tried generating swift docs named TDS using jazzy using following command:
jazzy --podspec LocalPods/TDS/TDS.podspec --swift-version 4.2

and also tried with config file .jazzy.yaml like:

module: TDS
swift_version: 4.2

using following command:
jazzy --podspec LocalPods/TDS/TDS.podspec --config LocalPods/TDS/.jazzy.yaml

but both failed with the following output:

Running xcodebuild
Could not parse compiler arguments from `xcodebuild` output.
Please confirm that `xcodebuild` is building a Swift module.
Saved `xcodebuild` log file: /var/folders/0_/wjng6zns5r9btwdgnt7hcxc00000gn/T/xcodebuild-A5CA7AF9-153E-4658-A443-46B8456E5373.log
Failed to generate documentation
bundler: failed to load command: jazzy (/Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bin/jazzy)
RuntimeError: /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/bin/sourcekitten ["doc", "--module-name", "TDS", "--", "-target", "TDS", "SWIFT_VERSION\\=4.0"]

Running xcodebuild

Could not parse compiler arguments from `xcodebuild` output.

Please confirm that `xcodebuild` is building a Swift module.

Saved `xcodebuild` log file: /var/folders/0_/wjng6zns5r9btwdgnt7hcxc00000gn/T/xcodebuild-A5CA7AF9-153E-4658-A443-46B8456E5373.log

Failed to generate documentation

  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/executable.rb:36:in `execute_command'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/sourcekitten.rb:230:in `run_sourcekitten'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/podspec_documenter.rb:32:in `block (3 levels) in sourcekitten_output'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/podspec_documenter.rb:28:in `map'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/podspec_documenter.rb:28:in `block (2 levels) in sourcekitten_output'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/podspec_documenter.rb:23:in `chdir'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/podspec_documenter.rb:23:in `block in sourcekitten_output'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/gems/cocoapods-1.5.3/lib/cocoapods/config.rb:41:in `with_changes'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/podspec_documenter.rb:18:in `sourcekitten_output'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/lib/jazzy/doc_builder.rb:62:in `build'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/bin/jazzy:15:in `<top (required)>'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bin/jazzy:23:in `load'
  /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bin/jazzy:23:in `<top (required)>'

It seems to me that the swift version I passed as paramter is somehow ignored while jazzy passing its parameters to sourcekitten, regarding the line in the output says:
RuntimeError: /Users/tackgyu/Sources/toss-ios/vendor/bundle/ruby/2.4.0/bundler/gems/jazzy-6932e5efe0eb/bin/sourcekitten ["doc", "--module-name", "TDS", "--", "-target", "TDS", "SWIFT_VERSION\\=4.0"].

Does jazzy just not support Swift 4.2 yet, or can you at least let me know if there's a workaround for this issue if any?

@realm-probot realm-probot bot added the O:User label Oct 10, 2018
@tackgyu
Copy link
Author

tackgyu commented Oct 11, 2018

Clearly jazzy currently does not support Swift 4.2 (as described in lib/podspec_documenter.rb, it creates version string using major version string with trailing .0), so I tried using different version of jazzy 0.7.3 of which the version extraction logic does not depend on major version value.

Then I failed again with the following output:

Build settings from command line:
    CODE_SIGN_IDENTITY = 
    CODE_SIGNING_REQUIRED = NO
    SWIFT_VERSION = "4.2"

note: Using new build system

** CLEAN SUCCEEDED ** [0.175 sec]

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'FlexLayout')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'Atributika')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'RxSwift')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'RxCocoa')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'Atributika')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'FlexLayout')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'SkeletonView')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'Then')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'SnapKit')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'RxCocoa')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'SkeletonView')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'RxSwift')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'TDS')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'Then')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'SnapKit')

Build system information
error: Invalid SWIFT_VERSION: Could not parse version component from: '"4' (in target 'TDS')

** BUILD FAILED **

which I assume the Swift versions of target project and its dependencies do not match. So I guess we need to set different versions per pod basis, maybe by passing parameters through --xcodebuild-arguments option... So anyone have the idea doing this?

@bartekzabicki
Copy link

@tackgyu Did you find any solution for this? I have the same problem

@tackgyu
Copy link
Author

tackgyu commented Oct 16, 2018

@bartekzabicki Still nothing. Just have to wait for it to support Swift 4.2

@erdnussflips
Copy link

erdnussflips commented Oct 30, 2018

Could this PR fix that problem: #1019 ?

You can try it by installing the PR branch with https://github.com/rdp/specific_install

@johnfairh johnfairh changed the title --swift-version parameter or one in config file ignored Podspec mode doesn't pass through swift version 4.2 properly Dec 23, 2018
@tackgyu
Copy link
Author

tackgyu commented Jan 3, 2019

@erdnussflips Thanks for the updates, but I did make it work by not passing swift version parameter at all, as:
jazzy --podspec path/to/podspec --config path/to/config
which is odd, because the project setting has never changed since the last try. I will

I will leave this issue open and try your suggestion if I encounter the same issue.

@johnfairh
Copy link
Collaborator

Fixed in master via #1037.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants