Skip to content

Commit

Permalink
i#2626: Force python3 for aarch64 codec gen (#6914)
Browse files Browse the repository at this point in the history
Previously we selected the default python interpreter to run the codec
this *usually* found python3 but on some systems would resolve to
python2 and cause the codec generator to fail. This change enforces
python3 as a requirement

issue: #2626
  • Loading branch information
joshua-warburton authored Aug 15, 2024
1 parent 50f4e6e commit 0481c48
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions core/ir/aarch64/codec.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/python
#!/usr/bin/env python3

# **********************************************************
# Copyright (c) 2021 Google, Inc. All rights reserved.
# Copyright (c) 2016 - 2023 ARM Limited. All rights reserved.
# Copyright (c) 2016 - 2024 ARM Limited. All rights reserved.
# **********************************************************

# Redistribution and use in source and binary forms, with or without
Expand Down
10 changes: 5 additions & 5 deletions make/CMake_aarch64_gen_codec.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# **********************************************************
# Copyright (c) 2020-2021 Google, Inc. All rights reserved.
# Copyright (c) 2018-2022 Arm Limited All rights reserved.
# Copyright (c) 2018-2024 Arm Limited All rights reserved.
# **********************************************************

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -30,9 +30,9 @@
# DAMAGE.

# Commands to automatically create the codec files from core/arch/aarch64/codec.txt.
find_package(PythonInterp)
find_package(Python3)

if (NOT PYTHONINTERP_FOUND)
if (NOT PYTHON3_FOUND)
message(FATAL_ERROR "Python interpreter not found")
endif ()

Expand Down Expand Up @@ -63,7 +63,7 @@ set(AARCH64_CODEC_GEN_SRCS
set_source_files_properties(${AARCH64_CODEC_GEN_SRCS} PROPERTIES GENERATED true)

execute_process(
COMMAND ${PYTHON_EXECUTABLE}
COMMAND ${PYTHON3_EXECUTABLE}
"${PROJECT_SOURCE_DIR}/make/aarch64_check_codec_order.py"
"${PROJECT_SOURCE_DIR}/core/ir/aarch64"
"${PROJECT_BINARY_DIR}"
Expand Down Expand Up @@ -91,7 +91,7 @@ add_custom_command(
${PROJECT_SOURCE_DIR}/core/ir/${ARCH_NAME}/codec_v87.txt
${PROJECT_SOURCE_DIR}/core/ir/${ARCH_NAME}/codec_sve.txt
${PROJECT_SOURCE_DIR}/core/ir/${ARCH_NAME}/codec_sve2.txt
COMMAND ${PYTHON_EXECUTABLE}
COMMAND ${PYTHON3_EXECUTABLE}
ARGS ${PROJECT_SOURCE_DIR}/core/ir/${ARCH_NAME}/codec.py
${PROJECT_SOURCE_DIR}/core/ir/${ARCH_NAME}
${PROJECT_BINARY_DIR}
Expand Down
4 changes: 2 additions & 2 deletions make/aarch64_check_codec_order.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# **********************************************************
# Copyright (c) 2022-2023 Arm Limited All rights reserved.
# Copyright (c) 2022-2024 Arm Limited All rights reserved.
# **********************************************************

# Redistribution and use in source and binary forms, with or without
Expand Down

0 comments on commit 0481c48

Please sign in to comment.