[Piglit] [PATCH] Do we really need python 2.7?

Matěj Cepl mcepl at redhat.com
Wed Jan 7 08:36:00 PST 2015


From: Matěj Cepl <mcepl at cepl.eu>

Hi,

I am in the process of struggle to build piglit from the master
(commit 4adb082) on RHEL-6 (we would like to continue to use it
for testing).

When I tried just naively build our RHEL-7/Fedora 20+ package on
EL-6 configuration failed because it complained it is missing
python 2.6. Which is a bit strange, because of course, RHEL-6
does contain python 2.6. So, I went digging to find out where
this message comes from and I have discovered this interesting
piece of code:

    # Check for presence of Python 2.6 or greater.
    foreach(python_cmd python2 python)
            execute_process(
                    COMMAND ${python_cmd} -c \
                        "import sys; assert '2.7' <= sys.version < '3'"
                    OUTPUT_QUIET
                    ERROR_QUIET
                    RESULT_VARIABLE python_version_check_error_code)
            if(python_version_check_error_code EQUAL 0)
                    set(python ${python_cmd})
                    break()
            endif(python_version_check_error_code EQUAL 0)
    endforeach(python_cmd)

    if(NOT DEFINED python)
            message(FATAL_ERROR "python version 2.x (where x >= 6) required")
    endif(NOT DEFINED python)

First obviously this code lies. Either we really care about
python 2.7 and we should declare our loyalities openly, or piglit
can be working with python 2.6 (which I hope) and then that '2.7'
is just a typo.

Which one it is? How difficult it would be to switch piglit to
python 2.6? I hope not that difficult (as there were not that
many changes between 2.6 and 2.7). Does anybody know?

And of course, when I apply just the attached patch I get to yet
another problem: freeglut (RHEL-6 has freeglut-2.6.0). But let's
walk this minefield one mine at the time.

Best,

Matěj

---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6fb6c8a..d2f2f0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -190,7 +190,7 @@ ENDIF()
 # Check for presence of Python 2.6 or greater.
 foreach(python_cmd python2 python)
 	execute_process(
-		COMMAND ${python_cmd} -c "import sys; assert '2.7' <= sys.version < '3'"
+		COMMAND ${python_cmd} -c "import sys; assert '2.6' <= sys.version < '3'"
 		OUTPUT_QUIET
 		ERROR_QUIET
 		RESULT_VARIABLE python_version_check_error_code)
-- 
1.8.3.1



More information about the Piglit mailing list