From 7234ddcf5195e717c8fbca76df907b7ff82e9a35 Mon Sep 17 00:00:00 2001 From: beckermr Date: Mon, 24 Jun 2024 15:08:28 -0500 Subject: [PATCH 01/30] ci: use latest osx sdk and see what happens --- .github/workflows/tests.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 37fb169862..0155b2b398 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -337,11 +337,7 @@ jobs: needs: changes if: github.event_name == 'schedule' || needs.changes.outputs.code == 'true' - # Old macOS needed for old SDK (see xcode step below) - # This is needed for some MACOSX_DEPLOYMENT_TARGET tests - # We could also install SDKs from a external provider in the future - # if we want to update this runner to a non-deprecated version - runs-on: macos-11 + runs-on: macos-latest defaults: run: # https://github.com/conda-incubator/setup-miniconda#use-a-default-shell @@ -385,9 +381,6 @@ jobs: condarc-file: .github/condarc run-post: false # skip post cleanup - - name: Xcode Install - run: sudo xcode-select --switch /Applications/Xcode_11.7.app - - name: Conda Install run: > conda install From a9315033a5660377364498110405c9f023ea6bb8 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Mon, 24 Jun 2024 15:13:48 -0500 Subject: [PATCH 02/30] Update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 9bc5272e8c..2726b59495 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,7 @@ filterwarnings = [ # ignore conda-index error "ignore::PendingDeprecationWarning:conda_index", "ignore::DeprecationWarning:conda_index", + "ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning", ] markers = [ "serial: execute test serially (to avoid race conditions)", From 949c5645861e53b1e2e156f9c93d398d59f53166 Mon Sep 17 00:00:00 2001 From: beckermr Date: Mon, 24 Jun 2024 15:41:20 -0500 Subject: [PATCH 03/30] test: ensure glob file test can run on osx-arm --- tests/test-recipes/metadata/always_include_files_glob/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-recipes/metadata/always_include_files_glob/meta.yaml b/tests/test-recipes/metadata/always_include_files_glob/meta.yaml index 4851ba7bc8..e9467eee12 100644 --- a/tests/test-recipes/metadata/always_include_files_glob/meta.yaml +++ b/tests/test-recipes/metadata/always_include_files_glob/meta.yaml @@ -23,7 +23,7 @@ requirements: # installed. - {{ compiler('c') }} # [linux or osx] host: - - libpng 1.6.34.* + - libpng 1.6.39.* outputs: - name: subpackage From 9785427a0ad6b1cc833704bf2394257ceef3c8f7 Mon Sep 17 00:00:00 2001 From: beckermr Date: Mon, 24 Jun 2024 15:50:03 -0500 Subject: [PATCH 04/30] test: try to run under rosetta emulating intel --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0155b2b398..bacf719f63 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -408,6 +408,8 @@ jobs: --cov=conda_build -n auto -m "${{ env.PYTEST_MARKER }}" + env: + CONDA_SUBDIR: osx-64 - name: Upload Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 From 9498b0c2d049f829f4204b0f8937e5e18016967e Mon Sep 17 00:00:00 2001 From: beckermr Date: Mon, 24 Jun 2024 15:56:59 -0500 Subject: [PATCH 05/30] test: try a recent python --- tests/cli/test_main_build.py | 4 ++-- tests/test_api_skeleton.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/cli/test_main_build.py b/tests/cli/test_main_build.py index ed56cabceb..bcd2ba6ef5 100644 --- a/tests/cli/test_main_build.py +++ b/tests/cli/test_main_build.py @@ -320,11 +320,11 @@ def test_no_force_upload( @pytest.mark.slow def test_conda_py_no_period(testing_workdir, testing_metadata, monkeypatch): - monkeypatch.setenv("CONDA_PY", "36") + monkeypatch.setenv("CONDA_PY", "311") testing_metadata.meta["requirements"] = {"host": ["python"], "run": ["python"]} api.output_yaml(testing_metadata, "meta.yaml") outputs = api.build(testing_workdir, notest=True) - assert any("py36" in output for output in outputs) + assert any("py311" in output for output in outputs) def test_build_skip_existing( diff --git a/tests/test_api_skeleton.py b/tests/test_api_skeleton.py index 963312ee44..f8dec32e49 100644 --- a/tests/test_api_skeleton.py +++ b/tests/test_api_skeleton.py @@ -387,7 +387,7 @@ def test_list_skeletons(): def test_pypi_with_entry_points(tmp_path: Path): - api.skeletonize("planemo", repo="pypi", python_version="3.7", output_dir=tmp_path) + api.skeletonize("planemo", repo="pypi", python_version="3.11", output_dir=tmp_path) assert (tmp_path / "planemo").is_dir() @@ -411,7 +411,7 @@ def test_pypi_with_extra_specs(tmp_path: Path, testing_config): "pypi", extra_specs=extra_specs, version="0.1.24", - python="3.6", + python="3.11", config=testing_config, output_dir=tmp_path, ) @@ -434,7 +434,7 @@ def test_pypi_with_version_inconsistency(tmp_path: Path, testing_config): "pypi", extra_specs=extra_specs, version="0.0.10", - python="3.6", + python="3.11", config=testing_config, output_dir=tmp_path, ) From 7d6d87497e558c43c86c465b4ea4bf15cdddd098 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Mon, 24 Jun 2024 16:03:44 -0500 Subject: [PATCH 06/30] Update .github/workflows/tests.yml --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bacf719f63..0155b2b398 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -408,8 +408,6 @@ jobs: --cov=conda_build -n auto -m "${{ env.PYTEST_MARKER }}" - env: - CONDA_SUBDIR: osx-64 - name: Upload Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 From 30be095c2992683e15b4caaabd4522e38025e960 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Mon, 24 Jun 2024 16:49:26 -0500 Subject: [PATCH 07/30] test: use intel macs for now --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0155b2b398..e505e52e19 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -337,7 +337,10 @@ jobs: needs: changes if: github.event_name == 'schedule' || needs.changes.outputs.code == 'true' - runs-on: macos-latest + # we still need intel macs so we are stuck on macos-13 (not -14 or -latest) + # the issue is that there are recipes that depend on packages + # that do not exist for osx-arm64 - see #5388 + runs-on: macos-13 defaults: run: # https://github.com/conda-incubator/setup-miniconda#use-a-default-shell From 17c42f125d0b5150006d7efef9d1821c5f97db6c Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Tue, 25 Jun 2024 05:41:51 -0500 Subject: [PATCH 08/30] ci: use 13.3 SDK --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e505e52e19..ee5752c1ce 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -383,7 +383,10 @@ jobs: with: condarc-file: .github/condarc run-post: false # skip post cleanup - + # this step installs the 13.3 SDK + # see https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md + - name: Xcode Install + run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app - name: Conda Install run: > conda install From e13d7f7606d705403af5ccdccb5e5724d20483cf Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Tue, 25 Jun 2024 05:42:22 -0500 Subject: [PATCH 09/30] style: spacing --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee5752c1ce..2db36113c1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -387,6 +387,7 @@ jobs: # see https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md - name: Xcode Install run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app + - name: Conda Install run: > conda install From 854636013e3ce825fde53007a265261f060363b8 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Tue, 25 Jun 2024 05:42:45 -0500 Subject: [PATCH 10/30] style: spacing --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2db36113c1..8b7c2d3b4e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -383,6 +383,7 @@ jobs: with: condarc-file: .github/condarc run-post: false # skip post cleanup + # this step installs the 13.3 SDK # see https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md - name: Xcode Install From d73cb02cd2479a8da98eb8aa1ef02c1eee7bc349 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Tue, 25 Jun 2024 05:44:49 -0500 Subject: [PATCH 11/30] doc: add changelog entry --- news/5387-ci-osx-sdk | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 news/5387-ci-osx-sdk diff --git a/news/5387-ci-osx-sdk b/news/5387-ci-osx-sdk new file mode 100644 index 0000000000..4508270c15 --- /dev/null +++ b/news/5387-ci-osx-sdk @@ -0,0 +1,3 @@ +### Other + +* Updated the CI to use the OSX 13.3 SDK From a99f0b153b0e5cbda8b39ce1931f794fe5ddcb54 Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 06:00:19 -0500 Subject: [PATCH 12/30] ci: stop after first several failures to debug --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8b7c2d3b4e..33327189d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -416,6 +416,7 @@ jobs: --cov=conda_build -n auto -m "${{ env.PYTEST_MARKER }}" + --maxfail=5 - name: Upload Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 From 0f7738adfec4439899e7244914523367109ea20e Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 06:48:38 -0500 Subject: [PATCH 13/30] fix: try using 11.3 sdk --- .github/workflows/tests.yml | 16 +++++++++++++--- tests/conftest.py | 15 ++------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 33327189d3..91d077d0c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -375,7 +375,9 @@ jobs: - name: Cache Conda uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: - path: ~/conda_pkgs_dir + path: | + ~/conda_pkgs_dir + ~/macosx_sdks key: cache-${{ env.HASH }} - name: Setup Miniconda @@ -387,7 +389,15 @@ jobs: # this step installs the 13.3 SDK # see https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md - name: Xcode Install - run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app + run: | + # sudo xcode-select --switch /Applications/Xcode_14.3.1.app + if [ ! -d ~/macosx_sdks ]; then mkdir ~/macosx_sdks; fi + if [ ! -d ~/macosx_sdks/MacOSX11.3.sdk ]; then + curl -L --output MacOSX11.3.sdk.tar.xz "https://github.com/alexey-lysiuk/macos-sdk/releases/download/11.3/MacOSX11.3.tar.xz" + sdk_sha256=cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 + echo "${sdk_sha256} *MacOSX11.3.sdk.tar.xz" | shasum -a 256 -c + tar -xf MacOSX11.3.sdk.tar.xz -C ~/macosx_sdks + fi - name: Conda Install run: > @@ -416,7 +426,7 @@ jobs: --cov=conda_build -n auto -m "${{ env.PYTEST_MARKER }}" - --maxfail=5 + --maxfail=3 - name: Upload Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 diff --git a/tests/conftest.py b/tests/conftest.py index 465cab6fcc..175ac63236 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -205,22 +205,11 @@ def variants_conda_build_sysroot(monkeypatch, request): return {} monkeypatch.setenv( - "CONDA_BUILD_SYSROOT", - subprocess.run( - ["xcrun", "--sdk", "macosx", "--show-sdk-path"], - check=True, - capture_output=True, - text=True, - ).stdout.strip(), + "CONDA_BUILD_SYSROOT", os.path.expanduser("~/macosx_sdks/MacOSX11.3.sdk") ) monkeypatch.setenv( "MACOSX_DEPLOYMENT_TARGET", - subprocess.run( - ["xcrun", "--sdk", "macosx", "--show-sdk-version"], - check=True, - capture_output=True, - text=True, - ).stdout.strip(), + "11.3", ) return request.param From 9f0d19e10cab3b1f37c1d3519ff63307834ce1ef Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 06:52:09 -0500 Subject: [PATCH 14/30] fix: wrong compression on sdk --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 91d077d0c6..8f04631b7d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -393,10 +393,10 @@ jobs: # sudo xcode-select --switch /Applications/Xcode_14.3.1.app if [ ! -d ~/macosx_sdks ]; then mkdir ~/macosx_sdks; fi if [ ! -d ~/macosx_sdks/MacOSX11.3.sdk ]; then - curl -L --output MacOSX11.3.sdk.tar.xz "https://github.com/alexey-lysiuk/macos-sdk/releases/download/11.3/MacOSX11.3.tar.xz" + curl -L --output MacOSX11.3.sdk.tar.bz2 "https://github.com/alexey-lysiuk/macos-sdk/releases/download/11.3/MacOSX11.3.tar.bz2" sdk_sha256=cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 - echo "${sdk_sha256} *MacOSX11.3.sdk.tar.xz" | shasum -a 256 -c - tar -xf MacOSX11.3.sdk.tar.xz -C ~/macosx_sdks + echo "${sdk_sha256} *MacOSX11.3.sdk.tar.bz2" | shasum -a 256 -c + tar -xf MacOSX11.3.sdk.tar.bz2 -C ~/macosx_sdks fi - name: Conda Install From d33cc00bcac46c1bca173c04c776428141b93c98 Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 06:56:15 -0500 Subject: [PATCH 15/30] fix: wrong sha --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f04631b7d..829ee8260d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -394,7 +394,7 @@ jobs: if [ ! -d ~/macosx_sdks ]; then mkdir ~/macosx_sdks; fi if [ ! -d ~/macosx_sdks/MacOSX11.3.sdk ]; then curl -L --output MacOSX11.3.sdk.tar.bz2 "https://github.com/alexey-lysiuk/macos-sdk/releases/download/11.3/MacOSX11.3.tar.bz2" - sdk_sha256=cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 + sdk_sha256=d6604578f4ee3090d1c3efce1e5c336ecfd7be345d046c729189d631ea3b8ec6 echo "${sdk_sha256} *MacOSX11.3.sdk.tar.bz2" | shasum -a 256 -c tar -xf MacOSX11.3.sdk.tar.bz2 -C ~/macosx_sdks fi From abd3d965d357d593ddc2b2d2625688cdd37c2c7f Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 07:16:49 -0500 Subject: [PATCH 16/30] ci: point xcode at correct SDK --- .github/workflows/tests.yml | 4 ++++ tests/conftest.py | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 829ee8260d..36a577a1f3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -398,6 +398,10 @@ jobs: echo "${sdk_sha256} *MacOSX11.3.sdk.tar.bz2" | shasum -a 256 -c tar -xf MacOSX11.3.sdk.tar.bz2 -C ~/macosx_sdks fi + echo "SDKROOT=~/macosx_sdks/MacOSX11.3.sdk" >> $GITHUB_ENV + export SDKROOT=~/macosx_sdks/MacOSX11.3.sdk + echo "SDKROOT in xcode is:" + xcrun --sdk macosx --show-sdk-path - name: Conda Install run: > diff --git a/tests/conftest.py b/tests/conftest.py index 175ac63236..465cab6fcc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -205,11 +205,22 @@ def variants_conda_build_sysroot(monkeypatch, request): return {} monkeypatch.setenv( - "CONDA_BUILD_SYSROOT", os.path.expanduser("~/macosx_sdks/MacOSX11.3.sdk") + "CONDA_BUILD_SYSROOT", + subprocess.run( + ["xcrun", "--sdk", "macosx", "--show-sdk-path"], + check=True, + capture_output=True, + text=True, + ).stdout.strip(), ) monkeypatch.setenv( "MACOSX_DEPLOYMENT_TARGET", - "11.3", + subprocess.run( + ["xcrun", "--sdk", "macosx", "--show-sdk-version"], + check=True, + capture_output=True, + text=True, + ).stdout.strip(), ) return request.param From c5049cdd78c98eda8a350c3a8e6ce5d469ea05af Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 07:24:06 -0500 Subject: [PATCH 17/30] fix: use SDKROOT --- .github/workflows/tests.yml | 2 ++ tests/conftest.py | 15 ++------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36a577a1f3..a9d513c29d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -431,6 +431,8 @@ jobs: -n auto -m "${{ env.PYTEST_MARKER }}" --maxfail=3 + env: + CONDA_BUILD_SYSROOT: ${{ env.SDKROOT }} - name: Upload Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 diff --git a/tests/conftest.py b/tests/conftest.py index 465cab6fcc..175ac63236 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -205,22 +205,11 @@ def variants_conda_build_sysroot(monkeypatch, request): return {} monkeypatch.setenv( - "CONDA_BUILD_SYSROOT", - subprocess.run( - ["xcrun", "--sdk", "macosx", "--show-sdk-path"], - check=True, - capture_output=True, - text=True, - ).stdout.strip(), + "CONDA_BUILD_SYSROOT", os.path.expanduser("~/macosx_sdks/MacOSX11.3.sdk") ) monkeypatch.setenv( "MACOSX_DEPLOYMENT_TARGET", - subprocess.run( - ["xcrun", "--sdk", "macosx", "--show-sdk-version"], - check=True, - capture_output=True, - text=True, - ).stdout.strip(), + "11.3", ) return request.param From 214fad8635862fb023e8f9031d0ccadec655e205 Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 15:27:27 -0500 Subject: [PATCH 18/30] ci: try 10.15 sdk --- .github/workflows/tests.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a9d513c29d..83569917b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -386,20 +386,26 @@ jobs: condarc-file: .github/condarc run-post: false # skip post cleanup - # this step installs the 13.3 SDK - # see https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md - - name: Xcode Install + - name: SDK Download run: | + echo "SDK_DIR=${HOME}/macosx_sdks" >> "$GITHUB_ENV" + export SDK_DIR=${HOME}/macosx_sdks + echo "MACOSX_SDK_VERSION=10.15" >> "$GITHUB_ENV" + export MACOSX_SDK_VERSION=10.15 + echo "SDKROOT=${SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk" >> "$GITHUB_ENV" + export SDKROOT=${SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk + # sudo xcode-select --switch /Applications/Xcode_14.3.1.app - if [ ! -d ~/macosx_sdks ]; then mkdir ~/macosx_sdks; fi - if [ ! -d ~/macosx_sdks/MacOSX11.3.sdk ]; then - curl -L --output MacOSX11.3.sdk.tar.bz2 "https://github.com/alexey-lysiuk/macos-sdk/releases/download/11.3/MacOSX11.3.tar.bz2" - sdk_sha256=d6604578f4ee3090d1c3efce1e5c336ecfd7be345d046c729189d631ea3b8ec6 + + if [ ! -d ${SDK_DIR} ]; then mkdir ${SDK_DIR}; fi + if [ ! -d ${SDKROOT} ]; then + url="https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" + curl -L --output MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz "${url}" + sdk_sha256=ac75d9e0eb619881f5aa6240689fce862dcb8e123f710032b7409ff5f4c3d18b echo "${sdk_sha256} *MacOSX11.3.sdk.tar.bz2" | shasum -a 256 -c - tar -xf MacOSX11.3.sdk.tar.bz2 -C ~/macosx_sdks + echo "${sdk_sha256} *MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" | shasum -a 256 -c + tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz -C "${SDK_DIR}" fi - echo "SDKROOT=~/macosx_sdks/MacOSX11.3.sdk" >> $GITHUB_ENV - export SDKROOT=~/macosx_sdks/MacOSX11.3.sdk echo "SDKROOT in xcode is:" xcrun --sdk macosx --show-sdk-path @@ -430,7 +436,7 @@ jobs: --cov=conda_build -n auto -m "${{ env.PYTEST_MARKER }}" - --maxfail=3 + --maxfail=2 env: CONDA_BUILD_SYSROOT: ${{ env.SDKROOT }} From 95f43a83ca0c159148ed5e0b3d3ab2e77ce7f907 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Tue, 25 Jun 2024 15:28:24 -0500 Subject: [PATCH 19/30] fix: extra sha check --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83569917b9..d523c0154d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -402,7 +402,6 @@ jobs: url="https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" curl -L --output MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz "${url}" sdk_sha256=ac75d9e0eb619881f5aa6240689fce862dcb8e123f710032b7409ff5f4c3d18b - echo "${sdk_sha256} *MacOSX11.3.sdk.tar.bz2" | shasum -a 256 -c echo "${sdk_sha256} *MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" | shasum -a 256 -c tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz -C "${SDK_DIR}" fi From 419050e7b47afe02db866c65f746b15d71c9ef1e Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Tue, 25 Jun 2024 15:39:12 -0500 Subject: [PATCH 20/30] fix: make sure tests point to new SDK --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 175ac63236..7b909dc828 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -205,11 +205,11 @@ def variants_conda_build_sysroot(monkeypatch, request): return {} monkeypatch.setenv( - "CONDA_BUILD_SYSROOT", os.path.expanduser("~/macosx_sdks/MacOSX11.3.sdk") + "CONDA_BUILD_SYSROOT", os.environ["SDKROOT"]) ) monkeypatch.setenv( "MACOSX_DEPLOYMENT_TARGET", - "11.3", + os.environ["MACOSX_SDK_VERSION"], ) return request.param From 044c4fb1c9a6d814303c3ce576946c7b06e89536 Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 15:43:04 -0500 Subject: [PATCH 21/30] fix: python syntax error --- tests/conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7b909dc828..00af5d196c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -205,7 +205,8 @@ def variants_conda_build_sysroot(monkeypatch, request): return {} monkeypatch.setenv( - "CONDA_BUILD_SYSROOT", os.environ["SDKROOT"]) + "CONDA_BUILD_SYSROOT", + os.environ["SDKROOT"], ) monkeypatch.setenv( "MACOSX_DEPLOYMENT_TARGET", From e3bf5ab146544f75b2f364fb6618bbfc4c05712e Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 23:24:35 -0500 Subject: [PATCH 22/30] debug: testing setting sdkroot and conda_build_sysroot by default --- .github/workflows/tests.yml | 24 +++++++++++++++--------- conda_build/environ.py | 4 ++++ tests/conftest.py | 6 +++++- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d523c0154d..f54458444f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -388,25 +388,27 @@ jobs: - name: SDK Download run: | - echo "SDK_DIR=${HOME}/macosx_sdks" >> "$GITHUB_ENV" - export SDK_DIR=${HOME}/macosx_sdks + echo "MACOSX_SDK_DIR=${HOME}/macosx_sdks" >> "$GITHUB_ENV" + export MACOSX_SDK_DIR=${HOME}/macosx_sdks echo "MACOSX_SDK_VERSION=10.15" >> "$GITHUB_ENV" export MACOSX_SDK_VERSION=10.15 - echo "SDKROOT=${SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk" >> "$GITHUB_ENV" - export SDKROOT=${SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk + echo "MACOSX_SDK_ROOT=${MACOSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk" >> "$GITHUB_ENV" + export MACOSX_SDK_ROOT=${MACOSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk # sudo xcode-select --switch /Applications/Xcode_14.3.1.app - if [ ! -d ${SDK_DIR} ]; then mkdir ${SDK_DIR}; fi - if [ ! -d ${SDKROOT} ]; then + if [ ! -d ${MACOSX_SDK_DIR} ]; then mkdir ${MACOSX_SDK_DIR}; fi + if [ ! -d ${MACOSX_SDK_ROOT} ]; then url="https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" curl -L --output MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz "${url}" sdk_sha256=ac75d9e0eb619881f5aa6240689fce862dcb8e123f710032b7409ff5f4c3d18b echo "${sdk_sha256} *MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" | shasum -a 256 -c - tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz -C "${SDK_DIR}" + tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz -C "${MACOSX_SDK_DIR}" fi echo "SDKROOT in xcode is:" xcrun --sdk macosx --show-sdk-path + echo "MACOSX_SDK_ROOT is:" + echo ${MACOSX_SDK_ROOT} - name: Conda Install run: > @@ -435,9 +437,13 @@ jobs: --cov=conda_build -n auto -m "${{ env.PYTEST_MARKER }}" - --maxfail=2 + -x + -k test_rpath_unix env: - CONDA_BUILD_SYSROOT: ${{ env.SDKROOT }} + MACOSX_SDK_ROOT: ${{ env.MACOSX_SDK_ROOT }} + MACOSX_SDK_VERSION: ${{ env.MACOSX_SDK_VERSION }} + SDKROOT: ${{ env.MACOSX_SDK_ROOT }} + CONDA_BUILD_SYSROOT: ${{ env.MACOSX_SDK_ROOT }} - name: Upload Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 diff --git a/conda_build/environ.py b/conda_build/environ.py index 3113ec7f8a..6309bb9ed5 100644 --- a/conda_build/environ.py +++ b/conda_build/environ.py @@ -723,6 +723,10 @@ def osx_vars(m, get_default, prefix): get_default("MACOSX_DEPLOYMENT_TARGET", MACOSX_DEPLOYMENT_TARGET) get_default("BUILD", BUILD) + # FIXME - MRB hack to figure out testing on osx + get_default("CONDA_BUILD_SYSROOT") + get_default("SDKROOT") + @lru_cache(maxsize=None) def _machine_and_architecture(): diff --git a/tests/conftest.py b/tests/conftest.py index 00af5d196c..642917c225 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -206,7 +206,11 @@ def variants_conda_build_sysroot(monkeypatch, request): monkeypatch.setenv( "CONDA_BUILD_SYSROOT", - os.environ["SDKROOT"], + os.environ["MACOSX_SDK_ROOT"], + ) + monkeypatch.setenv( + "SDKROOT", + os.environ["MACOSX_SDK_ROOT"], ) monkeypatch.setenv( "MACOSX_DEPLOYMENT_TARGET", From 32a0e782b6dac488a2a7af6ed614bc1c3b0c1601 Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 23:42:47 -0500 Subject: [PATCH 23/30] test: set osx info --- conda_build/environ.py | 4 ---- tests/conftest.py | 24 +++++++++++++----------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/conda_build/environ.py b/conda_build/environ.py index 6309bb9ed5..3113ec7f8a 100644 --- a/conda_build/environ.py +++ b/conda_build/environ.py @@ -723,10 +723,6 @@ def osx_vars(m, get_default, prefix): get_default("MACOSX_DEPLOYMENT_TARGET", MACOSX_DEPLOYMENT_TARGET) get_default("BUILD", BUILD) - # FIXME - MRB hack to figure out testing on osx - get_default("CONDA_BUILD_SYSROOT") - get_default("SDKROOT") - @lru_cache(maxsize=None) def _machine_and_architecture(): diff --git a/tests/conftest.py b/tests/conftest.py index 642917c225..97c2debd1a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -159,8 +159,16 @@ def testing_metadata(request, testing_config): d["about"]["summary"] = "a test package" d["about"]["tags"] = ["a", "b"] d["about"]["identifiers"] = "a" - testing_config.variant = get_default_variant(testing_config) - testing_config.variants = [testing_config.variant] + + var_dict = get_default_variant(testing_config) + if on_mac: + if "CONDA_BUILD_SYSROOT" in os.environ: + var_dict["CONDA_BUILD_SYSROOT"] = [os.environ["CONDA_BUILD_SYSROOT"]] + if "SDKROOT" in os.environ: + var_dict["SDKROOT"] = [os.environ["SDKROOT"]] + + testing_config.variant = var_dict + testing_config.variants = [var_dict] return MetaData.fromdict(d, config=testing_config) @@ -204,17 +212,11 @@ def variants_conda_build_sysroot(monkeypatch, request): if not on_mac: return {} - monkeypatch.setenv( - "CONDA_BUILD_SYSROOT", - os.environ["MACOSX_SDK_ROOT"], - ) - monkeypatch.setenv( - "SDKROOT", - os.environ["MACOSX_SDK_ROOT"], - ) monkeypatch.setenv( "MACOSX_DEPLOYMENT_TARGET", - os.environ["MACOSX_SDK_VERSION"], + os.path.basename(os.environ["CONDA_BUILD_SYSROOT"]) + .replace("MacOSX", "") + .replace(".sdk", ""), ) return request.param From 3261d1001f71e41e9e14fedd1d24881cf35ff5fb Mon Sep 17 00:00:00 2001 From: beckermr Date: Tue, 25 Jun 2024 23:56:55 -0500 Subject: [PATCH 24/30] fix: set variants in default config, not metadata --- .github/workflows/tests.yml | 2 -- tests/conftest.py | 26 +++++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f54458444f..4ae88621c3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -440,8 +440,6 @@ jobs: -x -k test_rpath_unix env: - MACOSX_SDK_ROOT: ${{ env.MACOSX_SDK_ROOT }} - MACOSX_SDK_VERSION: ${{ env.MACOSX_SDK_VERSION }} SDKROOT: ${{ env.MACOSX_SDK_ROOT }} CONDA_BUILD_SYSROOT: ${{ env.MACOSX_SDK_ROOT }} diff --git a/tests/conftest.py b/tests/conftest.py index 97c2debd1a..8303c32874 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -105,7 +105,19 @@ def boolify(v): exit_on_verify_error=exit_on_verify_error_default, conda_pkg_format=conda_pkg_format_default, ) - result = Config(variant=None, **testing_config_kwargs) + + if on_mac: + var_dict = {} + if "CONDA_BUILD_SYSROOT" in os.environ: + var_dict["CONDA_BUILD_SYSROOT"] = [os.environ["CONDA_BUILD_SYSROOT"]] + if "SDKROOT" in os.environ: + var_dict["SDKROOT"] = [os.environ["SDKROOT"]] + if not var_dict: + var_dict = None + else: + var_dict = None + + result = Config(variant=var_dict, **testing_config_kwargs) result._testing_config_kwargs = testing_config_kwargs assert result.no_rewrite_stdout_env is False assert result._src_cache_root is None @@ -159,16 +171,8 @@ def testing_metadata(request, testing_config): d["about"]["summary"] = "a test package" d["about"]["tags"] = ["a", "b"] d["about"]["identifiers"] = "a" - - var_dict = get_default_variant(testing_config) - if on_mac: - if "CONDA_BUILD_SYSROOT" in os.environ: - var_dict["CONDA_BUILD_SYSROOT"] = [os.environ["CONDA_BUILD_SYSROOT"]] - if "SDKROOT" in os.environ: - var_dict["SDKROOT"] = [os.environ["SDKROOT"]] - - testing_config.variant = var_dict - testing_config.variants = [var_dict] + testing_config.variant = get_default_variant(testing_config) + testing_config.variants = [get_default_variant(testing_config)] return MetaData.fromdict(d, config=testing_config) From e827df8e00c6e94a98c0a34bd4b6ff7ae3638a0e Mon Sep 17 00:00:00 2001 From: beckermr Date: Wed, 26 Jun 2024 00:03:22 -0500 Subject: [PATCH 25/30] fix: clean up debug stuff --- .github/workflows/tests.yml | 8 -------- tests/conftest.py | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ae88621c3..0a745afe06 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -395,8 +395,6 @@ jobs: echo "MACOSX_SDK_ROOT=${MACOSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk" >> "$GITHUB_ENV" export MACOSX_SDK_ROOT=${MACOSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk - # sudo xcode-select --switch /Applications/Xcode_14.3.1.app - if [ ! -d ${MACOSX_SDK_DIR} ]; then mkdir ${MACOSX_SDK_DIR}; fi if [ ! -d ${MACOSX_SDK_ROOT} ]; then url="https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" @@ -405,10 +403,6 @@ jobs: echo "${sdk_sha256} *MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" | shasum -a 256 -c tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz -C "${MACOSX_SDK_DIR}" fi - echo "SDKROOT in xcode is:" - xcrun --sdk macosx --show-sdk-path - echo "MACOSX_SDK_ROOT is:" - echo ${MACOSX_SDK_ROOT} - name: Conda Install run: > @@ -437,8 +431,6 @@ jobs: --cov=conda_build -n auto -m "${{ env.PYTEST_MARKER }}" - -x - -k test_rpath_unix env: SDKROOT: ${{ env.MACOSX_SDK_ROOT }} CONDA_BUILD_SYSROOT: ${{ env.MACOSX_SDK_ROOT }} diff --git a/tests/conftest.py b/tests/conftest.py index 8303c32874..ea9ad2e895 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -172,7 +172,7 @@ def testing_metadata(request, testing_config): d["about"]["tags"] = ["a", "b"] d["about"]["identifiers"] = "a" testing_config.variant = get_default_variant(testing_config) - testing_config.variants = [get_default_variant(testing_config)] + testing_config.variants = [testing_config.variant] return MetaData.fromdict(d, config=testing_config) From 6c7a8ba44c8c9d9f601cdacb4027b9d2ea88e2f8 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Wed, 26 Jun 2024 00:24:35 -0500 Subject: [PATCH 26/30] fix: clean up changes not needed --- news/5387-ci-osx-sdk | 2 +- tests/cli/test_main_build.py | 4 ++-- .../metadata/always_include_files_glob/meta.yaml | 2 +- tests/test_api_skeleton.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/news/5387-ci-osx-sdk b/news/5387-ci-osx-sdk index 4508270c15..d732ed9644 100644 --- a/news/5387-ci-osx-sdk +++ b/news/5387-ci-osx-sdk @@ -1,3 +1,3 @@ ### Other -* Updated the CI to use the OSX 13.3 SDK +* Updated the CI to download the MacOSX 10.15 SDK. diff --git a/tests/cli/test_main_build.py b/tests/cli/test_main_build.py index bcd2ba6ef5..ed56cabceb 100644 --- a/tests/cli/test_main_build.py +++ b/tests/cli/test_main_build.py @@ -320,11 +320,11 @@ def test_no_force_upload( @pytest.mark.slow def test_conda_py_no_period(testing_workdir, testing_metadata, monkeypatch): - monkeypatch.setenv("CONDA_PY", "311") + monkeypatch.setenv("CONDA_PY", "36") testing_metadata.meta["requirements"] = {"host": ["python"], "run": ["python"]} api.output_yaml(testing_metadata, "meta.yaml") outputs = api.build(testing_workdir, notest=True) - assert any("py311" in output for output in outputs) + assert any("py36" in output for output in outputs) def test_build_skip_existing( diff --git a/tests/test-recipes/metadata/always_include_files_glob/meta.yaml b/tests/test-recipes/metadata/always_include_files_glob/meta.yaml index e9467eee12..4851ba7bc8 100644 --- a/tests/test-recipes/metadata/always_include_files_glob/meta.yaml +++ b/tests/test-recipes/metadata/always_include_files_glob/meta.yaml @@ -23,7 +23,7 @@ requirements: # installed. - {{ compiler('c') }} # [linux or osx] host: - - libpng 1.6.39.* + - libpng 1.6.34.* outputs: - name: subpackage diff --git a/tests/test_api_skeleton.py b/tests/test_api_skeleton.py index f8dec32e49..963312ee44 100644 --- a/tests/test_api_skeleton.py +++ b/tests/test_api_skeleton.py @@ -387,7 +387,7 @@ def test_list_skeletons(): def test_pypi_with_entry_points(tmp_path: Path): - api.skeletonize("planemo", repo="pypi", python_version="3.11", output_dir=tmp_path) + api.skeletonize("planemo", repo="pypi", python_version="3.7", output_dir=tmp_path) assert (tmp_path / "planemo").is_dir() @@ -411,7 +411,7 @@ def test_pypi_with_extra_specs(tmp_path: Path, testing_config): "pypi", extra_specs=extra_specs, version="0.1.24", - python="3.11", + python="3.6", config=testing_config, output_dir=tmp_path, ) @@ -434,7 +434,7 @@ def test_pypi_with_version_inconsistency(tmp_path: Path, testing_config): "pypi", extra_specs=extra_specs, version="0.0.10", - python="3.11", + python="3.6", config=testing_config, output_dir=tmp_path, ) From 9afd22f4804f6d81bf0cc09b45b885efd9beb6d4 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Wed, 26 Jun 2024 00:26:26 -0500 Subject: [PATCH 27/30] debug: try ci without SDKROOT --- .github/workflows/tests.yml | 2 +- tests/conftest.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a745afe06..83d8e55cb1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -432,7 +432,7 @@ jobs: -n auto -m "${{ env.PYTEST_MARKER }}" env: - SDKROOT: ${{ env.MACOSX_SDK_ROOT }} + # SDKROOT: ${{ env.MACOSX_SDK_ROOT }} CONDA_BUILD_SYSROOT: ${{ env.MACOSX_SDK_ROOT }} - name: Upload Coverage diff --git a/tests/conftest.py b/tests/conftest.py index ea9ad2e895..72fc3b22e4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -110,8 +110,8 @@ def boolify(v): var_dict = {} if "CONDA_BUILD_SYSROOT" in os.environ: var_dict["CONDA_BUILD_SYSROOT"] = [os.environ["CONDA_BUILD_SYSROOT"]] - if "SDKROOT" in os.environ: - var_dict["SDKROOT"] = [os.environ["SDKROOT"]] + # if "SDKROOT" in os.environ: + # var_dict["SDKROOT"] = [os.environ["SDKROOT"]] if not var_dict: var_dict = None else: From 6d4550730fe0da79ad565e09086a8426e3f0fc8d Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Wed, 26 Jun 2024 07:04:47 -0500 Subject: [PATCH 28/30] fix: no need to set the SDKROOT --- .github/workflows/tests.yml | 1 - tests/conftest.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83d8e55cb1..badc12fd03 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -432,7 +432,6 @@ jobs: -n auto -m "${{ env.PYTEST_MARKER }}" env: - # SDKROOT: ${{ env.MACOSX_SDK_ROOT }} CONDA_BUILD_SYSROOT: ${{ env.MACOSX_SDK_ROOT }} - name: Upload Coverage diff --git a/tests/conftest.py b/tests/conftest.py index 72fc3b22e4..0f67eeaeaf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -110,8 +110,6 @@ def boolify(v): var_dict = {} if "CONDA_BUILD_SYSROOT" in os.environ: var_dict["CONDA_BUILD_SYSROOT"] = [os.environ["CONDA_BUILD_SYSROOT"]] - # if "SDKROOT" in os.environ: - # var_dict["SDKROOT"] = [os.environ["SDKROOT"]] if not var_dict: var_dict = None else: From 83e2ecca4cb8a7d20bd6f9b22a9aa4db298a3744 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Wed, 26 Jun 2024 07:06:38 -0500 Subject: [PATCH 29/30] refactor: simpler code --- tests/conftest.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0f67eeaeaf..ee57b3d5bd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -106,12 +106,10 @@ def boolify(v): conda_pkg_format=conda_pkg_format_default, ) - if on_mac: - var_dict = {} - if "CONDA_BUILD_SYSROOT" in os.environ: - var_dict["CONDA_BUILD_SYSROOT"] = [os.environ["CONDA_BUILD_SYSROOT"]] - if not var_dict: - var_dict = None + if on_mac and "CONDA_BUILD_SYSROOT" in os.environ: + var_dict = { + "CONDA_BUILD_SYSROOT": [os.environ["CONDA_BUILD_SYSROOT"]], + } else: var_dict = None From cbe5d3a9d614e689c4cd42d096c279a1c019f983 Mon Sep 17 00:00:00 2001 From: beckermr Date: Wed, 26 Jun 2024 07:15:22 -0500 Subject: [PATCH 30/30] refactor: keep old behavior for future testing --- tests/conftest.py | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ee57b3d5bd..cd66dddb97 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -212,12 +212,35 @@ def variants_conda_build_sysroot(monkeypatch, request): if not on_mac: return {} - monkeypatch.setenv( - "MACOSX_DEPLOYMENT_TARGET", - os.path.basename(os.environ["CONDA_BUILD_SYSROOT"]) - .replace("MacOSX", "") - .replace(".sdk", ""), - ) + # if we do not speciy a custom sysroot, we get what the + # current SDK has + if "CONDA_BUILD_SYSROOT" not in os.environ: + monkeypatch.setenv( + "CONDA_BUILD_SYSROOT", + subprocess.run( + ["xcrun", "--sdk", "macosx", "--show-sdk-path"], + check=True, + capture_output=True, + text=True, + ).stdout.strip(), + ) + + mdt = subprocess.run( + ["xcrun", "--sdk", "macosx", "--show-sdk-version"], + check=True, + capture_output=True, + text=True, + ).stdout.strip() + else: + # custom sysroots always have names like MacOSX.sdk + mdt = ( + os.path.basename(os.environ["CONDA_BUILD_SYSROOT"]) + .replace("MacOSX", "") + .replace(".sdk", "") + ) + + monkeypatch.setenv("MACOSX_DEPLOYMENT_TARGET", mdt) + return request.param