From ea6e3e7008fa8ecce0a4f49c0492103f4009de3a Mon Sep 17 00:00:00 2001 From: messense Date: Sun, 30 Oct 2022 18:09:02 +0800 Subject: [PATCH] debug --- .github/workflows/test.yml | 14 ++++++++++++-- src/compile.rs | 1 + test-crates/pyo3-mixed-py-subdir/Cargo.lock | 7 +++---- test-crates/pyo3-mixed-py-subdir/Cargo.toml | 3 +++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1bd6d256e..1d7325efd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }} matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: [ windows-latest ] runs-on: ${{ matrix.os }} env: RUST_BACKTRACE: '1' @@ -39,6 +39,11 @@ jobs: - uses: actions/setup-python@v4 with: python-version: "3.10" + - run: | + ls C:\hostedtoolcache\windows\Python\3.10.8\x64 + ls C:\hostedtoolcache\windows\Python\3.10.8\x64\libs + python3 --version + if: matrix.os == 'windows-latest' - name: Install cffi and virtualenv run: pip install cffi virtualenv ziglang~=0.9.0 twine - uses: actions-rs/toolchain@v1 @@ -86,7 +91,12 @@ jobs: key: test-crates-${{ runner.os }}-${{ steps.rustup.outputs.rustc_hash }}-${{ hashFiles('test-crates/*/Cargo.lock') }} - name: cargo test - run: cargo nextest run --features password-storage + run: cargo nextest run --features password-storage develop_pyo3_mixed + - run: | + test-crates\venvs\develop-pyo3-mixed-py-subdir-cpython\Scripts\python.exe --version + test-crates\venvs\develop-pyo3-mixed-py-subdir-cpython\Scripts\python.exe -c 'import sys; print(sys.base_prefix)' + test-crates\venvs\develop-pyo3-mixed-py-subdir-cpython\Scripts\python.exe -m sysconfig + if: always() - uses: actions/setup-python@v4 with: python-version: "pypy-3.7" diff --git a/src/compile.rs b/src/compile.rs index deadf505c..a39746e6d 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -345,6 +345,7 @@ fn compile_target( if let Some(interpreter) = python_interpreter { // Target python interpreter isn't runnable when cross compiling if interpreter.runnable { + println!("Python exe: {}", interpreter.executable.display()); if bindings_crate.is_bindings("pyo3") || bindings_crate.is_bindings("pyo3-ffi") || (matches!(bindings_crate, BridgeModel::BindingsAbi3(_, _)) diff --git a/test-crates/pyo3-mixed-py-subdir/Cargo.lock b/test-crates/pyo3-mixed-py-subdir/Cargo.lock index ee6f69a34..c9308c44b 100644 --- a/test-crates/pyo3-mixed-py-subdir/Cargo.lock +++ b/test-crates/pyo3-mixed-py-subdir/Cargo.lock @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "parking_lot" @@ -109,8 +109,7 @@ dependencies = [ [[package]] name = "pyo3-build-config" version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0708c9ed01692635cbf056e286008e5a2927ab1a5e48cdd3aeb1ba5a6fef47" +source = "git+https://github.com/messense/pyo3.git?branch=debug#6e3ca87a737326b61f80ef04b13550d2f95181b6" dependencies = [ "once_cell", "target-lexicon", diff --git a/test-crates/pyo3-mixed-py-subdir/Cargo.toml b/test-crates/pyo3-mixed-py-subdir/Cargo.toml index 239d1d233..7dd23477b 100644 --- a/test-crates/pyo3-mixed-py-subdir/Cargo.toml +++ b/test-crates/pyo3-mixed-py-subdir/Cargo.toml @@ -16,3 +16,6 @@ crate-type = ["cdylib"] [package.metadata.maturin] python-source = "python" name = "pyo3_mixed_py_subdir._pyo3_mixed" + +[patch.crates-io] +pyo3-build-config = { git = "https://github.com/messense/pyo3.git", branch = "debug" }