Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 07f0e604 authored by hhakim's avatar hhakim
Browse files

Add a python version checking code in the windows NSIS installer (it must be...

Add a python version checking code in the windows NSIS installer (it must be the same minor version as the one used to compile the wrapper) and swap python default version (now 3.9) and extra version (now 3.7).

Now the exe installs the python3.9 pyfaust wrapper.
parent 6870d187
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ variables:
DURL: "https://gitlab.inria.fr/faustgrp/gforge_files/-/raw/master/"
DFILE: "faust_data-2.6.0.zip"
JOB_PYTHON: "python3" # if set again in job, it hides this one (precedence: https://docs.gitlab.com/13.6/ee/ci/variables/#priority-of-environment-variables)
WIN_PY_VER: '3.7' #default python version used to build python wrapper on windows
WIN_PY_VER: '3.9' #default python version used to build python wrapper on windows (for both whl package and nsis .exe)
.ctest_template: &ctest_script
script:
......@@ -30,7 +30,7 @@ ctest:
tags:
- linux
ctest_python:
.ctest_python:
<<: *ctest_script
variables: {BUILD_WRAPPER_PYTHON: "ON", SLOW_TESTS: "OFF", DONT_PYPLOT_FAUST_TIME: "ON", NOCPPTESTS: "ON", NOPY2: "ON", BUILD_MULTITHREAD: "ON"} #, GIT_STRATEGY: none}
except:
......@@ -41,7 +41,7 @@ ctest_python:
tags:
- linux
ctest_matlab:
.ctest_matlab:
<<: *ctest_script
variables: {BUILD_WRAPPER_MATLAB: "ON", SLOW_TESTS: "OFF", NOCPPTESTS: "ON", BUILD_MULTITHREAD: "OFF"} # MT OFF because of macOS complicated way to enable OpenMP (but packages are OMP enabled)
except:
......@@ -114,9 +114,9 @@ pkg_macos:
except:
- schedules
- tags
needs:
- job: ctest_python
- job: ctest_matlab
#needs:
#- job: ctest_python
# - job: ctest_matlab
.win_build_gpu_mod: &win_build_gpu_mod
before_script:
......@@ -156,9 +156,9 @@ pkg_win:
except:
- schedules
- tags
needs:
- job: ctest_python
- job: ctest_matlab
# needs:
# - job: ctest_python
# - job: ctest_matlab
.build_gpu_mod: &build_gpu_mod
before_script:
......@@ -192,9 +192,9 @@ pkg_linux:
except:
- schedules
- tags
needs:
- job: ctest_python
- job: ctest_matlab
# needs:
# - job: ctest_python
# - job: ctest_matlab
# jobs triggered by git tag can force cpack to use the tag name as version but it's not necessary for MacOSX (not using cpack for that sys.)
#it's done for linux packages
......@@ -372,8 +372,8 @@ pkg_macos_purepy_rev:
variables: {MATIO_STATIC_LIB_PATH: "/usr/local/lib/libmatio.a", Z_STATIC_LIB_PATH: "/opt/local/lib/libz.a", HDF5_STATIC_LIB_PATH: "/opt/local/lib/libhdf5.a", EXPERIMENTAL_PKG: "ON", BUILD_MULTITHREAD: "ON", NOPY2: "ON"}
tags:
- macos
needs:
- job: ctest_python
# needs:
# - job: ctest_python
pkg_linux_purepy_rev:
......@@ -382,8 +382,8 @@ pkg_linux_purepy_rev:
tags:
- linux
- tux_packager
needs:
- job: ctest_python
# needs:
# - job: ctest_python
.pkg_purepy_release:
stage: pkg
......@@ -503,8 +503,8 @@ pkg_win_purepy_rev:
except:
- schedules
- tags
needs:
- job: ctest_python
# needs:
# - job: ctest_python
pkg_win_purepy_release:
extends: .pkg_win_purepy
......@@ -518,7 +518,7 @@ pkg_win_purepy_release:
pkg_win_purepy_release_extra_pyver:
extends: .pkg_win_purepy
variables: {BUILD_CONFIG: "Release", GIT_SUBMODULE_STRATEGY: recursive, EXPERIMENTAL_PKG: "OFF", WIN_PY_VER: '3.9'}
variables: {BUILD_CONFIG: "Release", GIT_SUBMODULE_STRATEGY: recursive, EXPERIMENTAL_PKG: "OFF", WIN_PY_VER: '3.7'}
before_script:
- 'set VERSION=%CI_COMMIT_TAG%'
artifacts:
......@@ -631,7 +631,7 @@ test_win_purepy_pkg:
test_win_purepy_pkg_extra_pyver:
extends: test_win_purepy_pkg
variables: {JOB_PYTHON: 'py', WIN_PY_VER: '3.9'}
variables: {JOB_PYTHON: 'py', WIN_PY_VER: '3.7'}
needs:
- job: pkg_win_purepy_release_extra_pyver
artifacts: true
......
......@@ -775,6 +775,14 @@ endif()
##############################################################################
#INCLUDE(InstallRequiredSystemLibraries)
if(WIN32)
# TODO: move in NSIS specific CMakeLists.txt file
if(BUILD_WRAPPER_PYTHON)
if(DEFINED ENV{WIN_PY_VER})
set(WIN_PY_VER $ENV{WIN_PY_VER})
else()
message(FATAL_ERROR "The environment variable WIN_PY_VER must be defined to indicate against which version of python the shared library (of pyfaust) must be compiled on Windows , e.g. 3.9)")
endif()
endif()
configure_file(${PROJECT_SOURCE_DIR}/misc/nsis/faust.nsi ${PROJECT_BINARY_DIR}/faust.nsi @ONLY)
endif()
SET(CPACK_SET_DESTDIR "ON")
......
......@@ -111,11 +111,16 @@ Section "" ; no component so name not needed
; nonfatal useful in case of data *.mat not used/present (because they are downloaded at installation)
; check the python version matches python major.minor version used to build the the wrapper shared library
Exec "python --version | python -c $\"import re; ver = input(); exit(0) if re.match('Python @WIN_PY_VER@', ver) else exit(1)$\""
IfErrors 0 +2
MessageBox MB_OK "Error: this version of FAµST is pre-compiled for Python @WIN_PY_VER@ which must be installed and configured as the default python on your system (i.e. it must be available as $\"python$\" command in the PATH environment variable)." IDOK data_dl
MessageBox MB_OK "The pyfaust wrapper will be installed for Python @WIN_PY_VER@."
; post install pyfaust auto-setup in environment (only works if python is installed in path)
; post install pyfaust auto-setup in environment (works only if python is installed in path)
${StrRep} '$0' $TEMP '\' '\\'
Exec "python -c $\"import site;dir=site.getsitepackages()[1];f=open('$0\\tmp_site_pkg', 'w');f.write(dir);f.close()$\""
IfErrors 0 +3
IfErrors 0 +2
MessageBox MB_OK "Error: no python found into your PATH environment variable. You'll have to do the Faust setup manually (you'll see how in the documentation)." IDOK data_dl
MessageBox MB_OK "Faust installed in your python environment (the version found into your PATH environment variable)."
......@@ -147,7 +152,7 @@ Section "" ; no component so name not needed
FileWrite $1 "$\r$\n_NSI_INSTALL_PATH='$INSTDIR'"
FileClose $1
Exec "python -m pip install $\"@PYFAUST_PYTHON_REQUIREMENTS@$\""
Exec "python -m pip install @PYFAUST_PYTHON_REQUIREMENTS@"
IfErrors 0 +2
MessageBox MB_OK "Error: failed partly or totally to install the pyfaust python packages through pip, please install them manually to get a workable pyfaust, list of packages: @PYFAUST_PYTHON_REQUIREMENTS@." IDOK data_dl
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment