Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass --extra-meta for rattler-build #2037

Merged
merged 5 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions conda_smithy/templates/build_steps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ ulimit -n 1024
# make the build number clobber
make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"

{% if test == "native" -%}
{% if test == "native" and conda_build_tool != "rattler-build" -%}
if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then
EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test"
fi
{%- elif test == "native_and_emulated" -%}
{%- elif test == "native_and_emulated" and conda_build_tool != "rattler-build" -%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct? If we need --no-test then this is going to be missing in the rattler-build case, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially it was disabled by me, but now that --no-test is working for rattler-build I need to remove this check

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this looks wrong.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted these changes.

if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${HOST_PLATFORM}" != linux-* ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then
EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test"
fi
Expand Down Expand Up @@ -115,7 +115,12 @@ else

{%- else %}

{{ BUILD_CMD }} --recipe "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" ${EXTRA_CB_OPTIONS:-}
{{ BUILD_CMD }} --recipe "${RECIPE_ROOT}" \
-m "${CI_SUPPORT}/${CONFIG}.yaml" \
${EXTRA_CB_OPTIONS:-} \
--extra-meta flow_run_id="${flow_run_id:-}" \
--extra-meta remote_url="${remote_url:-}" \
--extra-meta sha="${sha:-}"

{%- endif %}
( startgroup "Inspecting artifacts" ) 2> /dev/null
Expand Down
9 changes: 7 additions & 2 deletions conda_smithy/templates/run_osx_build.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then
echo "rattler-build does not currently support debug mode"
{%- endif %}
else
{% if test in ["native", "native_and_emulated"] %}
{% if test in ["native", "native_and_emulated"] and conda_build_tool != "rattler-build" %}
if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then
EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test"
fi
Expand All @@ -118,7 +118,12 @@ else

{%- else %}

{{ BUILD_CMD }} --recipe ./{{ recipe_dir }} -m ./.ci_support/${CONFIG}.yaml --output-dir ${MINIFORGE_HOME}/conda-bld ${EXTRA_CB_OPTIONS:-}
{{ BUILD_CMD }} --recipe ./{{ recipe_dir }} \
-m ./.ci_support/${CONFIG}.yaml \
--output-dir ${MINIFORGE_HOME}/conda-bld ${EXTRA_CB_OPTIONS:-} \
--extra-meta flow_run_id="$flow_run_id" \
--extra-meta remote_url="$remote_url" \
--extra-meta sha="$sha"

{%- endif %}

Expand Down
10 changes: 7 additions & 3 deletions conda_smithy/templates/run_win_build.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ if EXIST LICENSE.txt (
copy LICENSE.txt "{{ recipe_dir }}\\recipe-scripts-license.txt"
)

{%- if test == "native" %}
{%- if test == "native" and conda_build_tool != "rattler-build" %}
if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] (
set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test"
)
{%- endif %}
{%- if test == "native_and_emulated" %}
{%- if test == "native_and_emulated" and conda_build_tool != "rattler-build" %}
if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] (
if [%CROSSCOMPILING_EMULATOR%] == [] (
set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test"
Expand All @@ -70,7 +70,11 @@ if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] (
{%- endif %}

if NOT [%flow_run_id%] == [] (
set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%"
{%- if conda_build_tool == "rattler-build" %}
set "EXTRA_CB_OPTIONS= --extra-meta flow_run_id=%flow_run_id% --extra-meta remote_url=%remote_url% --extra-meta sha=%sha%"
{%- else %}
set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%"
{%- endif %}
)

call :end_group
Expand Down
Loading