build: python 3 compatibility #7723

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2016_03_build_python_3 changing 11 files +135 −129
  1. laanwj commented at 6:00 PM on March 20, 2016: member

    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 #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.

  2. laanwj added the label Build system on Mar 20, 2016
  3. laanwj force-pushed on Mar 20, 2016
  4. laanwj force-pushed on Mar 20, 2016
  5. laanwj commented at 11:01 AM on March 21, 2016: member

    Ping @theuni

  6. MarcoFalke commented at 12:19 PM on March 21, 2016: member

    Looks good. Concept ACK 40a9d86

  7. jonasschnelli commented at 12:45 PM on March 21, 2016: contributor

    Concept ACK.

    Why not use !/usr/bin/env python as interpreter? IMO we should at least remove /usr/bin/python2 and use /usr/bin/python (https://github.com/bitcoin/bitcoin/pull/7723/files#diff-d403511be890783565b1e2d164beec8aR1).

  8. laanwj force-pushed on Mar 21, 2016
  9. laanwj commented at 1:00 PM on March 21, 2016: member

    Why not use !/usr/bin/env python as interpreter?

    Interpeter shouldn't matter anymore because all usages invoke the explicitly located python executable. (could even remove it, in principle)

  10. theuni commented at 4:51 AM on March 22, 2016: member

    @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:

    contrib/macdeploy/custom_dsstore.py
    contrib/macdeploy/macdeployqtplus
    

    Those both get hit via make deploy

  11. laanwj commented at 7:47 AM on March 23, 2016: member
    contrib/macdeploy/custom_dsstore.py
    contrib/macdeploy/macdeployqtplus
    

    Right, good catch, will have a look at those.

  12. laanwj force-pushed on Mar 23, 2016
  13. laanwj commented at 10:09 AM on March 23, 2016: member

    @cfields see b40e365c2a24019e2b3e2651510874d0cecf2ae3 Works in python2 at least, haven't tested w/ python3 yet, I don't have a macosx dev environment set up.

  14. laanwj commented at 11:43 AM on March 23, 2016: member

    Works in python2 at least, haven't tested w/ python3 yet, I don't have a macosx dev environment set up.

    Ok, tested by temporarily changing the detection to only 'see' python3. It passed.

  15. laanwj force-pushed on Mar 23, 2016
  16. in contrib/macdeploy/macdeployqtplus:None in b40e365c2a outdated
     574 | @@ -575,7 +575,7 @@ if len(config.fancy) == 1:
     575 |      if fancy.has_key("background_picture"):
    


    MarcoFalke commented at 3:19 PM on March 28, 2016:

    Nit: there is no has_key in py3


    laanwj commented at 7:22 AM on March 29, 2016:

    Good catch

  17. MarcoFalke commented at 3:20 PM on March 28, 2016: member

    utACK b40e365

  18. build: python 3 compatibility
    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 #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.
    18f05c765c
  19. laanwj force-pushed on Mar 29, 2016
  20. laanwj commented at 3:21 PM on March 29, 2016: member

    Squashed b875273, b40e365 and cb01698 into 18f05c7

  21. laanwj merged this on Mar 29, 2016
  22. laanwj closed this on Mar 29, 2016

  23. laanwj referenced this in commit 5131005e5b on Mar 29, 2016
  24. laanwj referenced this in commit de0fcd3a99 on Apr 3, 2016
  25. laanwj referenced this in commit 4f688682ed on Apr 3, 2016
  26. theuni referenced this in commit 35cbd5f409 on Apr 21, 2016
  27. theuni referenced this in commit d96a9ed0cd on Apr 21, 2016
  28. theuni referenced this in commit a6666b25c7 on Apr 21, 2016
  29. pstratem referenced this in commit 38915ae58e on May 1, 2016
  30. ChoHag referenced this in commit 7b01ce254c on Jun 28, 2016
  31. MarcoFalke referenced this in commit 6e5e5abba6 on Aug 15, 2016
  32. codablock referenced this in commit 973632091b on Sep 16, 2017
  33. codablock referenced this in commit 14ee19bf89 on Sep 19, 2017
  34. codablock referenced this in commit b4feccfa59 on Sep 19, 2017
  35. codablock referenced this in commit fa48694cab on Dec 9, 2017
  36. codablock referenced this in commit a9a209f586 on Dec 19, 2017
  37. codablock referenced this in commit 1f8ca7546e on Dec 20, 2017
  38. codablock referenced this in commit 542507a32b on Dec 29, 2017
  39. codablock referenced this in commit bc659c3e6e on Jan 8, 2018
  40. lateminer referenced this in commit f6d63b9123 on Jan 12, 2018
  41. michelvankessel referenced this in commit 0f1f65f9e3 on Jan 4, 2019
  42. andvgal referenced this in commit 7016e131ac on Jan 6, 2019
  43. lateminer referenced this in commit 2178b1cfa7 on Jan 22, 2019
  44. CryptoCentric referenced this in commit 637b0d3d67 on Feb 15, 2019
  45. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me