rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

`MACOSX_DEPLOYMENT_TARGET` does not work with `c_stdlib_version` set in the build of a package for MacOS

Open eunos-1128 opened this issue 1 year ago • 10 comments

I encountered an issue where the build of a package for MacOS failed because MACOSX_DEPLOYMENT_TARGET was not set to the same version, even though c_stdlib_version was set in the conda_build_config.yaml.

conda-forge recipe I used

I don't know exactly why, but is this a kind of bug?

eunos-1128 avatar Oct 13 '24 18:10 eunos-1128

Maybe @h-vetinari can comment on wether we need to set both values or if one should be enough. I am not sure!

wolfv avatar Oct 13 '24 19:10 wolfv

I believe you need to set both. But I am verifying with @h-vetinari and others. Thanks for testing!

wolfv avatar Oct 13 '24 19:10 wolfv

No, it should be enough to set just c_stdlib_version. We have logic in smithy that will still populate both values in the variant config though, because the CI setup still relies on MACOSX_DEPLOYMENT_TARGET.

We did update the logic in staged-recipes as well (which isn't using the general ci setup), I'd have to take a look what goes wrong there

h-vetinari avatar Oct 13 '24 21:10 h-vetinari

Did you open a PR for this already? I cannot find it on https://github.com/conda-forge/staged-recipes. It's possible that local builds are missing the logic I mentioned, but it should definitely be there for the actual CI runs.

h-vetinari avatar Oct 13 '24 22:10 h-vetinari

I've had opened https://github.com/conda-forge/staged-recipes/pull/27710, but changed to conda-build instead of rattler-build due to this error.

eunos-1128 avatar Oct 14 '24 08:10 eunos-1128

I think I understand what happens:

  • staged-recipes detects the conda_build_config.yaml fine, and writes the additional deployment target key by appending to the conda_build_config.yaml file.
  • rattler-build does not automatically use the conda_build_config.yaml file though, so it's not picked up.

rattler-build would automatically use the variants.yaml but then we run into additional problems by having to support two formats.

wolfv avatar Oct 14 '24 08:10 wolfv

Even when I used variants.yaml instead of conda_build_config.yaml, it didn't work.

eunos-1128 avatar Oct 14 '24 09:10 eunos-1128

Yes, with variants.yaml the problem is that in staged-recipes the automation only looks at conda_build_config.yaml so it will never "magically" add the MACOS_DEPLOYMENT_TARGET...

wolfv avatar Oct 14 '24 09:10 wolfv

I see.

No, it should be enough to set just c_stdlib_version. We have logic in smithy that will still populate both values in the variant config though, because the CI setup still relies on MACOSX_DEPLOYMENT_TARGET.

We did update the logic in staged-recipes as well (which isn't using the general ci setup), I'd have to take a look what goes wrong there

This means the problem ie fixed now?

eunos-1128 avatar Oct 14 '24 09:10 eunos-1128

It's not fixed yet. We either need to support variants.yaml in conda-forge, or we need to support conda_build_config.yaml in rattler-build. :)

wolfv avatar Oct 14 '24 10:10 wolfv

We support conda_build_config.yaml files now, so I think this is fixed.

wolfv avatar May 11 '25 08:05 wolfv

@wolfv

It seems to work with feedstocks.

https://github.com/conda-forge/cb-clipboard-feedstock/blob/main/recipe/variants.yaml

However, in conda-forge/staged-recipes repo seems not able to pick up the c_stdlib_version in both variants.yaml and conda_build_config.yaml.

https://github.com/conda-forge/staged-recipes/pull/29354/commits/38c652c179c33e11ce08c5f3aba18ac26dc876a5

eunos-1128 avatar Jun 22 '25 08:06 eunos-1128