From ba13b5cc7f86fe525851c005f8bc61f2db96604b Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 21:19:16 -0700 Subject: [PATCH 01/13] add more tools and dependencies --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe763f2..af593e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,13 +59,21 @@ jobs: update: true install: >- mingw-w64-x86_64-git + mingw-w64-x86_64-toolchain mingw-w64-x86_64-autotools mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-python-pip + python-setuptools mingw-w64-x86_64-python-pytest mingw-w64-x86_64-ninja + git + automake1.16 + automake-wrapper + autoconf + libtool + make - name: Install build tools (macos-latest) if: matrix.sys.os == 'macos-latest' From 994d4ed02bea5fb457b6f5882a563056fa6df830 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 21:24:25 -0700 Subject: [PATCH 02/13] sigh --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af593e1..35c96da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,6 @@ jobs: with: update: true install: >- - mingw-w64-x86_64-git mingw-w64-x86_64-toolchain mingw-w64-x86_64-autotools mingw-w64-x86_64-cmake From d2866bf8c44972e065a5c4692ea9835871ee93ef Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 21:32:02 -0700 Subject: [PATCH 03/13] dump version information too --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35c96da..c922896 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,9 +86,13 @@ jobs: - name: Check build tools run: | which cmake + cmake --version which make + make --version which autoreconf + autoreconf --version which python + python --version - name: Install package run: python -m pip install -e .[test] From 1ede8cb4e6875a8b96e0146849cb08e869f7d0ae Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 21:36:03 -0700 Subject: [PATCH 04/13] maybe a path issue? --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c922896..1db8ac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,8 +95,15 @@ jobs: python --version - name: Install package + if: matrix.sys.os != 'windows-latest' run: python -m pip install -e .[test] + - name: Install package + if: matrix.sys.os == 'windows-latest' + run: | + export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH" + python -m pip install -e .[test] + - name: Uninstall magic (linux) if: matrix.sys.os == 'ubuntu-latest' run: | From 6d6b566b96ac1b23f91c6d74f0390ecfc5755c84 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 21:38:47 -0700 Subject: [PATCH 05/13] see if this works better --- CMakeLists.txt | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c32344f..4ea9a66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,29 @@ set(CMAKE_MACOSX_RPATH 1) set(libmagic_PREFIX libmagic) +find_program(AUTORECONF NAMES autoreconf) +if (NOT AUTORECONF) + message(FATAL_ERROR "Autoreconf not found") +else() + message(STATUS "Found autoreconf: ${AUTORECONF}") +endif() + +find_program(MAKE_EXE NAMES make gmake nmake) +if (NOT MAKE_EXE) + message(FATAL_ERROR "make not found") +else() + message(STATUS "Found make: ${MAKE_EXE}") +endif() + + +find_program(AUTORECONF NAMES autoreconf) +if (NOT AUTORECONF) + message(FATAL_ERROR "autoreconf not found") +else() + message(STATUS "Found autoreconf: ${AUTORECONF}") +endif() + + include(GNUInstallDirs) include(ExternalProject) ExternalProject_Add(libmagic @@ -14,7 +37,7 @@ ExternalProject_Add(libmagic GIT_TAG FILE5_41 PREFIX ${libmagic_PREFIX} BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND autoreconf -f -i && ./configure --prefix= --libdir=/${CMAKE_INSTALL_LIBDIR} --datadir=/${CMAKE_INSTALL_DATADIR} + CONFIGURE_COMMAND ${AUTORECONF} -f -i && ./configure --prefix= --libdir=/${CMAKE_INSTALL_LIBDIR} --datadir=/${CMAKE_INSTALL_DATADIR} BUILD_COMMAND ${MAKE_EXE} INSTALL_COMMAND ${MAKE_EXE} ) From cfe0018ce7180a699e2f065c4415a767f2aa2ab6 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 21:40:29 -0700 Subject: [PATCH 06/13] check cmake build --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1db8ac2..c773f65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,6 +94,11 @@ jobs: which python python --version + - name: Check CMake configuration + run: | + cmake -S . -B build + rm -rf build + - name: Install package if: matrix.sys.os != 'windows-latest' run: python -m pip install -e .[test] From 8d4eaa2d36170183b40d4500f48e3a08d8ee9cb2 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 21:45:07 -0700 Subject: [PATCH 07/13] what --- CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ea9a66..8ffdeed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,13 +7,6 @@ set(CMAKE_MACOSX_RPATH 1) set(libmagic_PREFIX libmagic) -find_program(AUTORECONF NAMES autoreconf) -if (NOT AUTORECONF) - message(FATAL_ERROR "Autoreconf not found") -else() - message(STATUS "Found autoreconf: ${AUTORECONF}") -endif() - find_program(MAKE_EXE NAMES make gmake nmake) if (NOT MAKE_EXE) message(FATAL_ERROR "make not found") From 37bd012101873eb575850deb1249fd49228476cc Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 22:15:02 -0700 Subject: [PATCH 08/13] fix it --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ffdeed..4971050 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ ExternalProject_Add(libmagic BUILD_IN_SOURCE 1 CONFIGURE_COMMAND ${AUTORECONF} -f -i && ./configure --prefix= --libdir=/${CMAKE_INSTALL_LIBDIR} --datadir=/${CMAKE_INSTALL_DATADIR} BUILD_COMMAND ${MAKE_EXE} - INSTALL_COMMAND ${MAKE_EXE} + INSTALL_COMMAND ${MAKE_EXE} install ) if(SKBUILD) From 8da32c1aad2dfaf5b28c28b1ce0fe38af503da01 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 22:31:52 -0700 Subject: [PATCH 09/13] ok??? --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c773f65..3b7f513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,8 @@ jobs: - name: Install package if: matrix.sys.os == 'windows-latest' run: | + dir D:/a/_temp/msys64/usr/bin/ + ls D:/a/_temp/msys64/usr/bin/ export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH" python -m pip install -e .[test] From cb907aef99fe281ef17d4a64f78bc56ca5107328 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 22:40:49 -0700 Subject: [PATCH 10/13] sigh --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b7f513..47f9889 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,7 @@ jobs: automake1.16 automake-wrapper autoconf + autoconf-wrapper libtool make @@ -107,7 +108,6 @@ jobs: if: matrix.sys.os == 'windows-latest' run: | dir D:/a/_temp/msys64/usr/bin/ - ls D:/a/_temp/msys64/usr/bin/ export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH" python -m pip install -e .[test] From 954bac6013de36addc30df852a4a5517db9f29dd Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 23:20:37 -0700 Subject: [PATCH 11/13] maybe needs .exe --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47f9889..821a73d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,6 +109,7 @@ jobs: run: | dir D:/a/_temp/msys64/usr/bin/ export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH" + export GHA_WINDOWS=yes python -m pip install -e .[test] - name: Uninstall magic (linux) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4971050..520eddd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,11 @@ else() message(STATUS "Found autoreconf: ${AUTORECONF}") endif() +if(DEFINED ENV{GHA_WINDOWS}) + set(AUTORECONF "${AUTORECONF}.exe") + message(STATUS "Setting to: ${AUTORECONF}") +endif() + include(GNUInstallDirs) include(ExternalProject) From d634a638e4e8cab4818329e7397c3213dfe79e4f Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 23:32:55 -0700 Subject: [PATCH 12/13] Revert "maybe needs .exe" This reverts commit 954bac6013de36addc30df852a4a5517db9f29dd. --- .github/workflows/ci.yml | 1 - CMakeLists.txt | 5 ----- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 821a73d..47f9889 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,6 @@ jobs: run: | dir D:/a/_temp/msys64/usr/bin/ export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH" - export GHA_WINDOWS=yes python -m pip install -e .[test] - name: Uninstall magic (linux) diff --git a/CMakeLists.txt b/CMakeLists.txt index 520eddd..4971050 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,11 +22,6 @@ else() message(STATUS "Found autoreconf: ${AUTORECONF}") endif() -if(DEFINED ENV{GHA_WINDOWS}) - set(AUTORECONF "${AUTORECONF}.exe") - message(STATUS "Setting to: ${AUTORECONF}") -endif() - include(GNUInstallDirs) include(ExternalProject) From dccfd57f2d0c059c2f1c536fa3f9c0ed04243877 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Tue, 22 Mar 2022 23:33:29 -0700 Subject: [PATCH 13/13] drop the path export for a second --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47f9889..3e71574 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,8 +107,7 @@ jobs: - name: Install package if: matrix.sys.os == 'windows-latest' run: | - dir D:/a/_temp/msys64/usr/bin/ - export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH" + #export PATH="/mingw64/bin:/usr/bin:/bin:/usr/local/bin:/opt/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH" python -m pip install -e .[test] - name: Uninstall magic (linux)