Skip to content

Commit

Permalink
Remove Python2 fallback and only advertise Python3 in the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed Dec 17, 2020
1 parent 978eb3b commit 5e31e22
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 50 deletions.
15 changes: 1 addition & 14 deletions clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )

if(LLVM_INCLUDE_TESTS)
find_package(Python3 COMPONENTS Interpreter)
if(NOT Python3_Interpreter_FOUND)
message(WARNING "Python3 not found, using python2 as a fallback")
find_package(Python2 COMPONENTS Interpreter REQUIRED)
if(Python2_VERSION VERSION_LESS 2.7)
message(SEND_ERROR "Python 2.7 or newer is required")
endif()

# Treat python2 as python3
add_executable(Python3::Interpreter IMPORTED)
set_target_properties(Python3::Interpreter PROPERTIES
IMPORTED_LOCATION ${Python2_EXECUTABLE})
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
endif()
find_package(Python3 REQUIRED COMPONENTS Interpreter)

# Check prebuilt llvm/utils.
if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}
Expand Down
2 changes: 1 addition & 1 deletion clang/tools/scan-build-py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Should be working on UNIX operating systems.
Prerequisites
-------------

1. **python** interpreter (version 2.7, 3.2, 3.3, 3.4, 3.5).
1. **python** interpreter (version 3.6 or later).


How to use
Expand Down
4 changes: 2 additions & 2 deletions clang/tools/scan-build/bin/set-xcode-analyzer
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# This one has the scripting bridge enabled.

import sys
if sys.version_info < (2, 7):
print "set-xcode-analyzer requires Python 2.7 or later"
if sys.version_info < (3, 6):
print "set-xcode-analyzer requires Python 3.6 or later"
sys.exit(1)

import os
Expand Down
15 changes: 1 addition & 14 deletions lld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include(CheckAtomic)

if(LLVM_INCLUDE_TESTS)
find_package(Python3 COMPONENTS Interpreter)
if(NOT Python3_Interpreter_FOUND)
message(WARNING "Python3 not found, using python2 as a fallback")
find_package(Python2 COMPONENTS Interpreter REQUIRED)
if(Python2_VERSION VERSION_LESS 2.7)
message(SEND_ERROR "Python 2.7 or newer is required")
endif()

# Treat python2 as python3
add_executable(Python3::Interpreter IMPORTED)
set_target_properties(Python3::Interpreter PROPERTIES
IMPORTED_LOCATION ${Python2_EXECUTABLE})
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
endif()
find_package(Python3 REQUIRED COMPONENTS Interpreter)

# Check prebuilt llvm/utils.
if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}
Expand Down
2 changes: 1 addition & 1 deletion lldb/docs/resources/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ commands below.
> yum install libedit-devel libxml2-devel ncurses-devel python-devel swig
> sudo apt-get install build-essential subversion swig python3-dev libedit-dev libncurses5-dev
> pkg install swig python
> pkgin install swig python27 cmake ninja-build
> pkgin install swig python36 cmake ninja-build
> brew install swig cmake ninja

Note that there's an `incompatibility
Expand Down
15 changes: 1 addition & 14 deletions llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -708,20 +708,7 @@ set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER FALSE CACHE BOOL

include(HandleLLVMOptions)

find_package(Python3 COMPONENTS Interpreter)
if(NOT Python3_Interpreter_FOUND)
message(WARNING "Python3 not found, using python2 as a fallback")
find_package(Python2 COMPONENTS Interpreter REQUIRED)
if(Python2_VERSION VERSION_LESS 2.7)
message(SEND_ERROR "Python 2.7 or newer is required")
endif()

# Treat python2 as python3
add_executable(Python3::Interpreter IMPORTED)
set_target_properties(Python3::Interpreter PROPERTIES
IMPORTED_LOCATION ${Python2_EXECUTABLE})
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
endif()
find_package(Python3 REQUIRED COMPONENTS Interpreter)

######

Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/GettingStarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Package Version Notes
=========================================================== ============ ==========================================
`CMake <http://cmake.org/>`__ >=3.13.4 Makefile/workspace generator
`GCC <http://gcc.gnu.org/>`_ >=5.1.0 C/C++ compiler\ :sup:`1`
`python <http://www.python.org/>`_ >=2.7 Automated test suite\ :sup:`2`
`python <http://www.python.org/>`_ >=3.6 Automated test suite\ :sup:`2`
`zlib <http://zlib.net>`_ >=1.2.3.4 Compression library\ :sup:`3`
`GNU Make <http://savannah.gnu.org/projects/make>`_ 3.79, 3.79.1 Makefile/build processor\ :sup:`4`
=========================================================== ============ ==========================================
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/GettingStartedVS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You will also need the `CMake <http://www.cmake.org/>`_ build system since it
generates the project files you will use to build with.

If you would like to run the LLVM tests you will need `Python
<http://www.python.org/>`_. Version 2.7 and newer are known to work. You will
<http://www.python.org/>`_. Version 3.6 and newer are known to work. You will
need `GnuWin32 <http://gnuwin32.sourceforge.net/>`_ tools, too.

Do not install the LLVM directory tree into a path containing spaces (e.g.
Expand Down
1 change: 0 additions & 1 deletion llvm/docs/HowToBuildOnARM.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ on the ARMv6 and ARMv7 architectures and may be inapplicable to older chips.
Use Ninja instead of Make: "-G Ninja"
Build with assertions on: "-DLLVM_ENABLE_ASSERTIONS=True"
Force Python2: "-DPYTHON_EXECUTABLE=/usr/bin/python2"
Local (non-sudo) install path: "-DCMAKE_INSTALL_PREFIX=$HOME/llvm/install"
CPU flags: "DCMAKE_C_FLAGS=-mcpu=cortex-a15" (same for CXX_FLAGS)
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/TestingGuide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Requirements
============

In order to use the LLVM testing infrastructure, you will need all of the
software required to build LLVM, as well as `Python <http://python.org>`_ 2.7 or
software required to build LLVM, as well as `Python <http://python.org>`_ 3.6 or
later.

LLVM Testing Infrastructure Organization
Expand Down

0 comments on commit 5e31e22

Please sign in to comment.