Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
make buck Python3 compatible (#2391)
Browse files Browse the repository at this point in the history
Summary:
The function attributes named func_X have been renamed to use the __X__ form in Python3, https://docs.python.org/3/whatsnew/3.0.html#operators-and-special-methods and also built-in changes https://wiki.python.org/moin/Python3.0#Built-In_Changes.
The old names can't be used in Python3.
This PR changes the old names to new names to make buck Python3 compatible.
Python2 was EOL on 1/1/2020, Homebrew/homebrew-core#49796.
Pull Request resolved: #2391

Reviewed By: philipjameson, v-jizhang

Pulled By: v-jizhang

shipit-source-id: c00dae81ea0e0356ebacb2429ddee26bb8fe9362
  • Loading branch information
Jinlin Zhang authored and facebook-github-bot committed Feb 28, 2020
1 parent 1178050 commit 8c3ca7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ jobs:
cd "${BUCKROOT}"
export PATH="${ANDROID_SDK}/tools/bin:${PATH}"
export PATH="$(pyenv root)/shims:${PATH}"
export GROOVY_HOME=$HOME/.sdkman/candidates/groovy/current
export GROOVY_HOME="$HOME/.sdkman/candidates/groovy/current"
set -eux
${BUCK_PEX_LOCATION} test --num-threads=$BUCK_NUM_THREADS --all --filter '^(?!(com.facebook.buck.android|com.facebook.buck.jvm.java)).*[Ii]ntegration.*'
Expand Down Expand Up @@ -563,10 +563,9 @@ jobs:
- run:
# There is an issue with python in macos 10.14.x. this step is a work around and should be removed later.
# https://stackoverflow.com/questions/59269208/errorrootcode-for-hash-md5-was-not-found-not-able-to-use-any-hg-mercurial-co
name: Uninstall Python2
# Python2 was EOL on 1/1/2020, it does not work with Xcode 10.3.0
name: Reinstall Python2
command: |
brew uninstall python@2
brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/86a44a0a552c673a05f11018459c9f5faae3becc/Formula/python@2.rb
- run:
<<: *run_ant_build
- run:
Expand All @@ -577,7 +576,7 @@ jobs:
cd "${BUCKROOT}"
export PATH="${ANDROID_SDK}/tools/bin:${PATH}"
export PATH="$(pyenv root)/shims:${PATH}"
export "GROOVY_HOME=$HOME/.sdkman/candidates/groovy/current"
export GROOVY_HOME="$HOME/.sdkman/candidates/groovy/current"
export JAVA_HOME=`/usr/libexec/java_home`
export PATH="${JAVA_HOME}/bin:${PATH}"
set -ex
Expand Down
2 changes: 1 addition & 1 deletion python-dsl/buck_parser/buck.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def invoke(self, *args, **kwargs):
# Optimistically hope that name is the first arg. It generally is...
name = args[0]
raise IncorrectArgumentsException(
self.func.func_name, name, missing_args, extra_args
self.func.__name__, name, missing_args, extra_args
)
raise

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TARGETS = {
"macos": ["-Wl,-flat_namespace,-undefined,suppress"],
}

for target, flags in TARGETS.iteritems():
for target, flags in TARGETS.items():
cxx_binary(
name = "binary_matches_default_exactly_" + target,
srcs = [
Expand Down

0 comments on commit 8c3ca7c

Please sign in to comment.