Skip to content

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Mar 7, 2025

Description:

Update CrossPythonMigrator for v1 recipes. Unfortunately, this yields
a bit suboptimal output, as it does not combine conditions:

    - if: build_platform != target_platform
      then: python
    - if: build_platform != target_platform
      then: cross-python_${{ target_platform }}
    - if: build_platform != target_platform
      then: cython

That said, addressing this would increase the divergency between v0
and v1 code in the migrator, and conda-recipe-manager convert suffers
from the same issue. I think a better way forward would be to write
a dedicated v1 recipe migrator that combines adjacent conditions.

Checklist:

  • Pydantic model updated or no update needed

Cross-refs, links to issues, etc:

Part of bug #3642

mgorny added 3 commits March 7, 2025 15:44
`CrossPythonMigrator` is not actually using anything
from `CrossCompilationMigratorBase`, besides `post_migration` attribute,
and calling the superclass `filter()` method yields incorrect results.
Make the class inherit `MiniMigrator` instead to make it more consistent
with other minimigrators.
Update `CrossPythonMigrator` for v1 recipes.  Unfortunately, this yields
a bit suboptimal output, as it does not combine conditions:

```yaml
    - if: build_platform != target_platform
      then: python
    - if: build_platform != target_platform
      then: cross-python_${{ target_platform }}
    - if: build_platform != target_platform
      then: cython
```

That said, addressing this would increase the divergency between v0
and v1 code in the migrator, and `conda-recipe-manager convert` suffers
from the same issue.  I think a better way forward would be to write
a dedicated v1 recipe migrator that combines adjacent conditions.

Part of bug regro#3642
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.04%. Comparing base (141732a) to head (f80d060).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
conda_forge_tick/migrators/cross_compile.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3832      +/-   ##
==========================================
+ Coverage   77.03%   77.04%   +0.01%     
==========================================
  Files         138      138              
  Lines       15394    15406      +12     
==========================================
+ Hits        11859    11870      +11     
- Misses       3535     3536       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@isuruf
Copy link
Member

isuruf commented Mar 7, 2025

For v1 recipes shouldn't we be using - if: build_platform != host_platform? We decided on autotools convention of build, host, target

cc @wolfv

@mgorny
Copy link
Contributor Author

mgorny commented Mar 7, 2025

For v1 recipes shouldn't we be using - if: build_platform != host_platform? We decided on autotools convention of build, host, target

cc @wolfv

I see only build_platform and target_platform in https://rattler.build/v0.27.0/selectors/; also in https://conda.org/learn/ceps/cep-0014

@beckermr
Copy link
Contributor

beckermr commented Mar 7, 2025

The CEPs we have actually don't define what variables are allowed versus not in the selectors as far as I know.

@mgorny
Copy link
Contributor Author

mgorny commented Mar 17, 2025

Updated this one to use host_platform as well. I'll submit a pull request to update rattler-build docs as well.

@mgorny
Copy link
Contributor Author

mgorny commented Mar 24, 2025

@beckermr, gentle ping. Is there anything left blocking this PR?

@beckermr beckermr enabled auto-merge March 25, 2025 15:42
@beckermr beckermr added this pull request to the merge queue Mar 25, 2025
Merged via the queue into regro:main with commit f7a2d6f Mar 25, 2025
9 checks passed
@beckermr beckermr mentioned this pull request Apr 7, 2025
33 tasks
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.

3 participants