From daaa3155b8be21ae29a2948de7ee8028ae7ebb4e Mon Sep 17 00:00:00 2001 From: jaimergp Date: Fri, 9 Aug 2024 09:27:17 +0200 Subject: [PATCH] Add workaround to prevent crash on Windows when the `SSLKEYLOGFILE` environment variable is set (#89) * add a workaround for SSLKEYLOGFILE * only windows * Add GHA artifacts * add news * pre-commit --- .github/workflows/tests.yml | 10 +++++++++- news/89-openssl-applink | 19 +++++++++++++++++++ src/entry_point.py | 6 ++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 news/89-openssl-applink diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 092bc30..79d1580 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,8 @@ jobs: subdir: osx-arm64 - os: windows-latest subdir: win-64 + env: + PYTHONUNBUFFERED: "1" steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: conda-incubator/setup-miniconda@v3 @@ -53,6 +55,12 @@ jobs: CONDA_BLD_PATH: ${{ runner.temp }}/bld run: conda build recipe --override-channels -c conda-forge + - uses: actions/upload-artifact@v4 + if: github.event_name == 'pull_request' + with: + name: conda-standalone-${{ matrix.subdir }} + path: ${{ runner.temp }}/bld/${{ matrix.subdir }}/conda-standalone-*.* + - name: Upload package to anaconda.org shell: bash -el {0} if: github.event_name == 'push' && github.ref == 'refs/heads/main' @@ -72,7 +80,7 @@ jobs: --label="${ANACONDA_ORG_LABEL}" \ ${CONDA_BLD_PATH}/${{ matrix.subdir }}/conda-standalone-*.* echo "Uploaded the following files:" - basename -a ${CONDA_BLD_PATH}/pkgs/${{ matrix.subdir }}/conda-standalone-*.* + basename -a ${CONDA_BLD_PATH}/${{ matrix.subdir }}/conda-standalone-*.* echo "Use this command to try out the build:" echo " conda install -c ${ANACONDA_ORG_CHANNEL}/label/${ANACONDA_ORG_LABEL} conda-standalone" diff --git a/news/89-openssl-applink b/news/89-openssl-applink new file mode 100644 index 0000000..b7cf17a --- /dev/null +++ b/news/89-openssl-applink @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* Add workaround to prevent crash on Windows when the `SSLKEYLOGFILE` environment variable is set. (#86 via #89). + +### Deprecations + +* + +### Docs + +* + +### Other + +* diff --git a/src/entry_point.py b/src/entry_point.py index a48332c..86328ca 100755 --- a/src/entry_point.py +++ b/src/entry_point.py @@ -12,6 +12,12 @@ from multiprocessing import freeze_support from pathlib import Path +if os.name == "nt" and "SSLKEYLOGFILE" in os.environ: + # This causes a crash with requests 2.32+ on Windows + # Root cause is 'urllib3.util.ssl_.create_urllib3_context()' + # See https://github.com/conda/conda-standalone/issues/86 + del os.environ["SSLKEYLOGFILE"] + def _create_dummy_executor(*args, **kwargs): "use this for debugging, because ProcessPoolExecutor isn't pdb/ipdb friendly"