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
build: python 3 compatibility #7723
Conversation
076dab8
to
40a9d86
Compare
Ping @theuni |
Looks good. Concept ACK 40a9d86 |
Concept ACK. Why not use |
40a9d86
to
b875273
Compare
Interpeter shouldn't matter anymore because all usages invoke the explicitly located python executable. |
@laanwj Aha, clever fix :) I'm not well-versed in python2/python3 to comment on the compat there, but concept ack for sure. Looks like some of the mac deploy scripts are missing, though:
Those both get hit via |
Right, good catch, will have a look at those. |
9cd0105
to
b40e365
Compare
@cfields see b40e365c2a24019e2b3e2651510874d0cecf2ae3 |
Ok, tested by temporarily changing the detection to only 'see' python3. It passed. |
bff30d0
to
b40e365
Compare
@@ -575,7 +575,7 @@ if len(config.fancy) == 1: | |||
if fancy.has_key("background_picture"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: there is no has_key
in py3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
utACK b40e365 |
Ubuntu 16.04 "xenial xerus" does not come with Python 2.x by default. It is possible to install a python-2.7 package, but this has its own problem: no `python` or `python2` symlink (see bitcoin#7717). This fixes the following scripts to work with python 3: - `make check` (bctest,py, bitcoin-util-test.py) - `make translate` (extract_strings_qt.py) - `make symbols-check` (symbol-check.py) - `make security-check` (security-check.py) Explicitly call the python commands using $(PYTHON) instead of relying on the interpreter line at the top of the scripts.
cb01698
to
18f05c7
Compare
Squashed b875273, b40e365 and cb01698 into 18f05c7 |
18f05c7 build: python 3 compatibility (Wladimir J. van der Laan)
This fixes the gitian MacOSX build, it was broken in bitcoin#7723. The patch to `native_mac_alias` should probably make it upstream.
This fixes the gitian MacOSX build, it was broken in bitcoin#7723. The patch to `native_mac_alias` should probably make it upstream.
This fixes the gitian MacOSX build, it was broken in bitcoin#7723. The patch to `native_mac_alias` should probably make it upstream.
7b01ce2 Favour python over python2 as per PR #7723 (Matthew King) 873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
18f05c7 build: python 3 compatibility (Wladimir J. van der Laan)
This fixes the gitian MacOSX build, it was broken in bitcoin#7723. The patch to `native_mac_alias` should probably make it upstream.
…n/env) 7b01ce2 Favour python over python2 as per PR bitcoin#7723 (Matthew King) 873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
This fixes the gitian MacOSX build, it was broken in bitcoin#7723. The patch to `native_mac_alias` should probably make it upstream.
…n/env) 7b01ce2 Favour python over python2 as per PR bitcoin#7723 (Matthew King) 873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
This fixes the gitian MacOSX build, it was broken in bitcoin#7723. The patch to `native_mac_alias` should probably make it upstream.
Tests: Use portable #! in python scripts (/usr/bin/env) 7b01ce2 Favour python over python2 as per PR bitcoin#7723 (Matthew King) 873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
Ubuntu 16.04 "xenial xerus" does not come with Python 2.x by default. It is possible to install a python-2.7 package, but this has its own problem: no
python
orpython2
symlink (see #7717).This fixes the following scripts to work with python 3:
make check
(bctest,py, bitcoin-util-test.py)make translate
(extract_strings_qt.py)make symbols-check
(symbol-check.py)make security-check
(security-check.py)make deploy
for OS X (custom_dsstore.py, macdeployqtplus)Explicitly call the python commands using $(PYTHON) (detected by autoconf) instead of relying on the interpreter line at the top of the scripts.
Python 2.x compatibility should be unaffected. For the build system I think it's good to have both Python2 and Python3 compatibility. This is not necessary for the other python scripts, such as the RPC tests. For practical reasons it's ok to have an explicit Python 2.7 dependency for those - though we'll have to document that.