From 1dc3a068531d58e74a852fdfdcc1bd5a54327f07 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 19 Jul 2021 01:32:24 +0200 Subject: [PATCH] Fix Windows package build The package was built with a libpq 11, found along the path in the PHP dir. And with the libiconv found in the Git directory. All very worrying. So, add to the PATH the Postgres bin directory and deal with the delvewheel exception of libiconv (mentioned in https://github.com/adang1345/delvewheel/issues/13). Also fix confusion about where does this stuff run and where is the server. There is no Docker image here, so we can start the server from the workflow steps and access it from cibiuldwheel on localhost. --- .github/workflows/packages.yml | 32 +++++++++++++----------- tools/build/wheel_windows_before_all.ps1 | 4 --- 2 files changed, 18 insertions(+), 18 deletions(-) delete mode 100755 tools/build/wheel_windows_before_all.ps1 diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 54e5269cf..b1ba335c6 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -68,8 +68,8 @@ jobs: strategy: matrix: - pyver: [cp36, cp37, cp38, cp39] arch: [x86_64, i686, ppc64le, aarch64] + pyver: [cp36, cp37, cp38, cp39] steps: - uses: actions/checkout@v2 @@ -92,7 +92,7 @@ jobs: CIBW_BUILD: ${{matrix.pyver}}-manylinux_${{matrix.arch}} CIBW_ARCHS_LINUX: auto aarch64 ppc64le CIBW_BEFORE_ALL_LINUX: ./tools/build/wheel_linux_before_all.sh - CIBW_BEFORE_TEST: pip install ./psycopg[test] + CIBW_TEST_REQUIRES: ./psycopg[test] CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes CIBW_ENVIRONMENT: >- PSYCOPG_IMPL=binary @@ -124,9 +124,9 @@ jobs: strategy: matrix: - pyver: [cp36, cp37, cp38, cp39] - arch: [x86_64] # These archs require an Apple M1 runner: [arm64, universal2] + arch: [x86_64] + pyver: [cp36, cp37, cp38, cp39] steps: - uses: actions/checkout@v2 @@ -142,7 +142,7 @@ jobs: CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}} CIBW_ARCHS_MACOS: x86_64 arm64 universal2 CIBW_BEFORE_ALL_MACOS: ./tools/build/wheel_macos_before_all.sh - CIBW_BEFORE_TEST: pip install ./psycopg[test] + CIBW_TEST_REQUIRES: ./psycopg[test] CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes CIBW_ENVIRONMENT: >- PSYCOPG_IMPL=binary @@ -159,13 +159,19 @@ jobs: strategy: matrix: - pyver: [cp36, cp37, cp38, cp39] - arch: [win_amd64] # Might want to add win32, untested at the moment. + arch: [win_amd64] + pyver: [cp36, cp37, cp38, cp39] steps: - uses: actions/checkout@v2 + - name: Start PostgreSQL service for test + run: | + $PgSvc = Get-Service "postgresql*" + Set-Service $PgSvc.Name -StartupType manual + $PgSvc.Start() + - name: Create the binary package source tree run: python3 ./tools/build/copy_to_binary.py @@ -176,17 +182,15 @@ jobs: env: CIBW_BUILD: ${{matrix.pyver}}-${{matrix.arch}} CIBW_ARCHS_WINDOWS: AMD64 x86 - CIBW_BEFORE_ALL_WINDOWS: >- - powershell.exe tools\build\wheel_windows_before_all.ps1 - CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" + CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >- - delvewheel repair -w {dest_dir} {wheel} - CIBW_BEFORE_TEST: pip install ./psycopg[test] + delvewheel repair -w {dest_dir} --no-mangle libiconv-2.dll {wheel} + CIBW_TEST_REQUIRES: ./psycopg[test] CIBW_TEST_COMMAND: pytest {project}/tests -m "not slow" --color yes CIBW_ENVIRONMENT_WINDOWS: >- PSYCOPG_IMPL=binary - PSYCOPG_TEST_DSN='host=127.0.0.1 user=postgres' - PG_CONFIG='C:\Program Files\PostgreSQL\13\bin\pg_config.exe' + PATH="C:\\Program Files\\PostgreSQL\\13\\bin;$PATH" + PSYCOPG_TEST_DSN="host=127.0.0.1 user=postgres" - uses: actions/upload-artifact@v2 with: diff --git a/tools/build/wheel_windows_before_all.ps1 b/tools/build/wheel_windows_before_all.ps1 deleted file mode 100755 index e7bffe3d3..000000000 --- a/tools/build/wheel_windows_before_all.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -# Start PostgreSQL service for test -$PgSvc = Get-Service "postgresql*" -Set-Service $PgSvc.Name -StartupType manual -$PgSvc.Start() -- 2.47.3