Skip to content

Pass --target-platform with --variant-config to rattler-build - #6274

Open
mgorny wants to merge 5 commits into
conda-forge:mainfrom
mgorny:v1-target-platform
Open

Pass --target-platform with --variant-config to rattler-build#6274
mgorny wants to merge 5 commits into
conda-forge:mainfrom
mgorny:v1-target-platform

Conversation

@mgorny

@mgorny mgorny commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description:

When calling rattler-build and we know the target platform, pass it explicitly via --target-platform even if --variant-config is being passed. Rattler-build does not support reading the target platform from variant config, and this is causing v1 recipes without linux-64 support to fail:

 │ ⚠ warning Setting 'target_platform' in a variant config file is not supported and will be ignored. Please use the '--target-platform' command-line flag to specify the target platform.

Additionally:

  • fix BaseRawURL to correctly infer filename from the ci_support_* values, fixing platform/arch guessing
  • remove skip: win from some v1 recipe tests where this breaks the assumptions made in the test harness

Checklist:

  • Pydantic model updated or no update needed

Cross-refs, links to issues, etc:

Fixes #6272

mgorny added 3 commits June 26, 2026 15:39
When calling `rattler-build` and we know the target platform, pass it
explicitly via `--target-platform` even if `--variant-config` is being
passed.  Rattler-build does not support reading the target platform
from variant config, and this is causing v1 recipes without `linux-64`
support to fail:

```
 │ ⚠ warning Setting 'target_platform' in a variant config file is not supported and will be ignored. Please use the '--target-platform' command-line flag to specify the target platform.
```

Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
@mgorny

mgorny commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Looks like the tests are failing because the test logic is processing all the recipes with CI support YAML for [linux-64, osx-64, win-64] irrespective of what's actually supported by the recipe.

@mgorny

mgorny commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Uh, some tests also apparently pass junk there:

FAILED tests/test_upstream_versions.py::test_latest_version_stackvana_v1 - subprocess.CalledProcessError: Command '['rattler-build', 'build', '--render-only', '--variant-config', '/tmp/tmpxcviado2/conda_build_config.yaml', '--target-platform', '-64']' returned non-zero exit status 2.

Signed-off-by: Michał Górny <mgorny@quansight.com>
@mgorny

mgorny commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Uh, some tests also apparently pass junk there:

FAILED tests/test_upstream_versions.py::test_latest_version_stackvana_v1 - subprocess.CalledProcessError: Command '['rattler-build', 'build', '--render-only', '--variant-config', '/tmp/tmpxcviado2/conda_build_config.yaml', '--target-platform', '-64']' returned non-zero exit status 2.

Okay, here the logic is actually buggy and it strips one underscore too few.

@mgorny
mgorny force-pushed the v1-target-platform branch from c82972e to b75f537 Compare June 26, 2026 15:09
Remove the `win` os `skip`s from some v1 test recipes to fix problems
with the test harness.  The tests are being run against synthesized
`.ci_support` support for three platforms (`linux-64, `osx-64` and
`win-64`), irrespective of what platforms are supported by the recipe.
Given that the `skip`s are not really crucial to the tests themselves,
removing them is the simplest solution to avoid the problem.

Signed-off-by: Michał Górny <mgorny@quansight.com>
@mgorny

mgorny commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

I think all the remaining test failures are flakiness / network timeouts.

@mgorny
mgorny marked this pull request as ready for review June 26, 2026 15:39
@jaimergp
jaimergp requested a review from beckermr June 26, 2026 21:35
Comment thread conda_forge_tick/utils.py
target_platform_flags = (
[]
if platform_arch is None or variant_config_flags
if platform_arch is None or platform_arch == "noarch"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if platform_arch is None or platform_arch == "noarch"
if platform_arch in (None, "noarch") or variant_config_flags

Better? Not sure what variant_config_flags is supposed to be checking here though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. platform_arch in (None, "noarch") is what I've tried first but mypy doesn't seem to be able to cope with it.
  2. variant_config_flags avoids passing --target-platform if we have a variant config. Removing this condition is the main point of this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ugh, mypy. Alright then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot failure when v1 recipe does not support linux_64 (pyobjc-framework-quartz)

2 participants