Skip to content

Commit

Permalink
Set CONDA_BLD_PATH when using pixi during osx build (#2148)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadim authored Nov 26, 2024
1 parent fed4299 commit 0e1d50f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
1 change: 1 addition & 0 deletions conda_smithy/templates/azure-pipelines-win.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
displayName: Run Windows build
env:
MINIFORGE_HOME: $(MINIFORGE_HOME)
CONDA_BLD_PATH: $(CONDA_BLD_PATH)
PYTHONUNBUFFERED: 1
CONFIG: $(CONFIG)
CI: azure
Expand Down
1 change: 1 addition & 0 deletions conda_smithy/templates/build_steps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export PYTHONUNBUFFERED=1
export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}"
export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support"
export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml"
{#- We are not handling CONDA_BLD_PATH here because it's already set in the condarc below #}

cat >~/.condarc <<CONDARC
Expand Down
2 changes: 1 addition & 1 deletion conda_smithy/templates/pixi.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ conda-smithy = "*"
build-locally = "python ./build-locally.py"
smithy = "conda-smithy"
rerender = "conda-smithy rerender"
lint = "conda-smithy lint {{ recipe_dir}}"
lint = "conda-smithy lint {{ recipe_dir }}"

[environments]
smithy = ["smithy"]
9 changes: 5 additions & 4 deletions conda_smithy/templates/run_osx_build.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ source .scripts/logging_utils.sh

set -xe

MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3}
MINIFORGE_HOME=${MINIFORGE_HOME%/} # remove trailing slash
MINIFORGE_HOME="${MINIFORGE_HOME:-${HOME}/miniforge3}"
MINIFORGE_HOME="${MINIFORGE_HOME%/}" # remove trailing slash
export CONDA_BLD_PATH="${CONDA_BLD_PATH:-${MINIFORGE_HOME}/conda-bld}"

{%- if conda_install_tool == "micromamba" %}

Expand Down Expand Up @@ -35,7 +36,7 @@ rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true
( endgroup "Provisioning base env with micromamba" ) 2> /dev/null
{%- elif conda_install_tool == "pixi" %}
( startgroup "Provisioning base env with pixi" ) 2> /dev/null
mkdir -p ${MINIFORGE_HOME}
mkdir -p "${MINIFORGE_HOME}"
curl -fsSL https://pixi.sh/install.sh | bash
export PATH="~/.pixi/bin:$PATH"
arch=$(uname -m)
Expand Down Expand Up @@ -164,7 +165,7 @@ else
{%- else %}
{{ BUILD_CMD }} --recipe ./{{ recipe_dir }} \
-m ./.ci_support/${CONFIG}.yaml \
--output-dir ${MINIFORGE_HOME}/conda-bld ${EXTRA_CB_OPTIONS:-} \
${EXTRA_CB_OPTIONS:-} \
--target-platform "${HOST_PLATFORM}" \
--extra-meta flow_run_id="$flow_run_id" \
--extra-meta remote_url="$remote_url" \
Expand Down
3 changes: 3 additions & 0 deletions conda_smithy/templates/run_win_build.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ if "%MINIFORGE_HOME%"=="" set "MINIFORGE_HOME=%USERPROFILE%\Miniforge3"
:: Remove trailing backslash, if present
if "%MINIFORGE_HOME:~-1%"=="\" set "MINIFORGE_HOME=%MINIFORGE_HOME:~0,-1%"

{#- NOTE: We are NOT setting a default CONDA_BLD_PATH here; that's done in conda-forge-ci-setup #}

{%- if conda_install_tool == "micromamba" %}
call :start_group "Provisioning base env with micromamba"
set "MAMBA_ROOT_PREFIX=%MINIFORGE_HOME%-micromamba-%RANDOM%"
Expand All @@ -49,6 +51,7 @@ if !errorlevel! neq 0 exit /b !errorlevel!
echo Removing %MAMBA_ROOT_PREFIX%
del /S /Q "%MAMBA_ROOT_PREFIX%" >nul
del /S /Q "%MICROMAMBA_TMPDIR%" >nul
call :end_group
{%- elif conda_install_tool == "pixi" %}
call :start_group "Provisioning base env with pixi"
echo Installing pixi
Expand Down
24 changes: 24 additions & 0 deletions news/pixi_osx_conda_bld_path.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Ensure ``CONDA_BLD_PATH`` is properly exported in macOS. (#2145 via #2148)
* Close logging group for ``micromamba`` installs in Windows. (#2148)

**Security:**

* <news item>

0 comments on commit 0e1d50f

Please sign in to comment.