Skip to content

[build_support] Fixed python 3 errors #2111

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

Merged
merged 1 commit into from
Apr 9, 2016

Conversation

harlanhaskins
Copy link
Contributor

What's in this pull request?

Fixes python3 errors with the build support module
All tests now pass on python3.5 and python2.7

Resolved bug number: N/A Addresses this comment


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

@harlanhaskins
Copy link
Contributor Author

@swift-ci please test

@harlanhaskins
Copy link
Contributor Author

@RLovelett This should address your python3 issues.
Another issue is that subprocess.check_output() returns bytes in python3, which broke our tests.

@harlanhaskins
Copy link
Contributor Author

@practicalswift Anything you think I'm missing here?

@practicalswift
Copy link
Contributor

@harlanhaskins LGTM :-)

@harlanhaskins
Copy link
Contributor Author

@practicalswift Thanks for looking! 😄

@harlanhaskins
Copy link
Contributor Author

@swift-ci please Python lint

@harlanhaskins harlanhaskins merged commit dc2629c into swiftlang:master Apr 9, 2016
@harlanhaskins
Copy link
Contributor Author

Thanks @practicalswift and @RLovelett!

@RLovelett
Copy link
Contributor

I'm really sorry I was not able to get here sooner. Unfortunately this did not resolve the issue I reported #1586. Some line number shifted but the error is still largely the same.

Traceback (most recent call last):
  File "utils/build-script", line 1172, in <module>
    sys.exit(main())
  File "utils/build-script", line 1168, in main
    return main_normal()
  File "utils/build-script", line 1028, in main_normal
    xcrun_toolchain=args.darwin_xcrun_toolchain)
  File "utils/swift_build_support/swift_build_support/toolchain.py", line 133, in host_clang
    suffixes=['', '-3.8', '-3.7', '-3.6', '-3.5'])
  File "utils/swift_build_support/swift_build_support/toolchain.py", line 110, in host_toolchain
    return _first_common_toolchain(tools, suffixes=suffixes)
  File "utils/swift_build_support/swift_build_support/toolchain.py", line 72, in _first_common_toolchain
    for name, tool in tools.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

Again this is my fault. I should have been more responsive to give the feeback before the merge of this.

I'll see what I can come up with and then submit a PR to resolve it and link back to here for tracability. @harlanhaskins thanks for even looking into this.

@harlanhaskins
Copy link
Contributor Author

Nope, my fault for not catching that as well. Could you try again with latest master?

@harlanhaskins harlanhaskins deleted the python3-toolchain branch April 11, 2016 18:04
@RLovelett
Copy link
Contributor

75de4fe does the trick.

Thank you. 🙇

@harlanhaskins
Copy link
Contributor Author

Thank you for reporting!

Aside, I feel like we should probably standardize on python3. It's not too difficult to require python3 as a dependency for building Swift, and I'm personally not a fan of keeping python2 around longer.

@RLovelett
Copy link
Contributor

You have my vote to switch to python3.

It might be a hallow victory though because I think swift-lldb (or rather just LLDB) relies on Python 2. All that having been said, swift-lldb usually is just merging in upstream changes. Meaning that switching this over to Python 3 it would have reduced the maintained Python 2 code. I digress.

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

Successfully merging this pull request may close these issues.

3 participants