From 4fc3bfe521044d838c8dcc7eeeccd608f323467b Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Wed, 17 Aug 2022 19:49:03 +0200 Subject: [PATCH] Fix CI. --- .github/workflows/build_test_armhf.yml | 4 ---- nfstream/engine/scripts/build.sh | 2 +- nfstream/engine/scripts/build_windows.sh | 2 +- setup.py | 27 ++++++++++++------------ 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_test_armhf.yml b/.github/workflows/build_test_armhf.yml index 73f347a..58229a8 100644 --- a/.github/workflows/build_test_armhf.yml +++ b/.github/workflows/build_test_armhf.yml @@ -32,10 +32,6 @@ jobs: ${{ matrix.python-version }} -m pip install --upgrade pip ${{ matrix.python-version }} -m pip install -r dev_requirements.txt - - name: Prepare - run: | - ${{ matrix.python-version }} prepare.py - - name: Build run: | ${{ matrix.python-version }} setup.py build diff --git a/nfstream/engine/scripts/build.sh b/nfstream/engine/scripts/build.sh index f6d37ed..7ef2716 100755 --- a/nfstream/engine/scripts/build.sh +++ b/nfstream/engine/scripts/build.sh @@ -50,7 +50,7 @@ build_libpcap build_libndpi echo "" echo "---------------------------------------------------------------------------------------------------------------" -echo "Prepare engine_cc" +echo "Preprocessing engine_cc headers" echo "---------------------------------------------------------------------------------------------------------------" cd .. gcc -DNDPI_LIB_COMPILATION -DNDPI_CFFI_PREPROCESSING -DNDPI_CFFI_PREPROCESSING_EXCLUDE_PACKED -E -x c -P -C /tmp/nfstream_build/usr/include/ndpi/ndpi_typedefs.h > /tmp/nfstream_build/ndpi_cdefinitions.h diff --git a/nfstream/engine/scripts/build_windows.sh b/nfstream/engine/scripts/build_windows.sh index 0e445e6..262851c 100755 --- a/nfstream/engine/scripts/build_windows.sh +++ b/nfstream/engine/scripts/build_windows.sh @@ -42,7 +42,7 @@ setup_npcap build_libndpi echo "" echo "---------------------------------------------------------------------------------------------------------------" -echo "Prepare engine_cc" +echo "Preprocessing engine_cc headers" echo "---------------------------------------------------------------------------------------------------------------" cd .. gcc -DNDPI_LIB_COMPILATION -DNDPI_CFFI_PREPROCESSING -DNDPI_CFFI_PREPROCESSING_EXCLUDE_PACKED -E -x c -P -C /tmp/nfstream_build/mingw64/include/ndpi/ndpi_typedefs.h > /tmp/nfstream_build/ndpi_cdefinitions.h diff --git a/setup.py b/setup.py index dda2249..c49b065 100644 --- a/setup.py +++ b/setup.py @@ -49,20 +49,19 @@ else: class BuildPyCommand(build_py): """ Custom build command to compile lib_engine dependencies.""" def run(self): - if not self.dry_run: - if os.name != 'posix': # Windows case - os.environ["MSYSTEM"] = "MINGW64" - msys = os.getenv("MSYS2_PATH") - if msys is None: - os.environ["MSYS2_PATH"] = "C:/msys64" - msys = os.getenv("MSYS2_PATH") - build_script_command = r"""'{}'""".format(str(BUILD_SCRIPT_PATH) + "_windows.sh") - subprocess.check_call(["{msys}/usr/bin/bash".format(msys=msys).replace("/", "\\"), - "-l", - build_script_command, ENGINE_PATH], - shell=True) - else: # Linux, MacOS - subprocess.check_call([str(BUILD_SCRIPT_PATH) + ".sh"], shell=True) + if os.name != 'posix': # Windows case + os.environ["MSYSTEM"] = "MINGW64" + msys = os.getenv("MSYS2_PATH") + if msys is None: + os.environ["MSYS2_PATH"] = "C:/msys64" + msys = os.getenv("MSYS2_PATH") + build_script_command = r"""'{}'""".format(str(BUILD_SCRIPT_PATH) + "_windows.sh") + subprocess.check_call(["{msys}/usr/bin/bash".format(msys=msys).replace("/", "\\"), + "-l", + build_script_command, ENGINE_PATH], + shell=True) + else: # Linux, MacOS + subprocess.check_call([str(BUILD_SCRIPT_PATH) + ".sh"], shell=True) build_py.run(self)