prefix-dev / rattler-build

rattler-build is a universal package builder for Windows, macOS and Linux
https://prefix-dev.github.io/rattler-build
BSD 3-Clause "New" or "Revised" License
209 stars 45 forks source link

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

Open eunos-1128 opened 2 weeks ago

eunos-1128 commented 2 weeks ago

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?

wolfv commented 2 weeks ago

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

wolfv commented 2 weeks ago

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

h-vetinari commented 2 weeks ago

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 commented 2 weeks ago

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.

eunos-1128 commented 2 weeks ago

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.

wolfv commented 2 weeks ago

I think I understand what happens:

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

eunos-1128 commented 2 weeks ago

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

wolfv commented 2 weeks ago

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...

eunos-1128 commented 2 weeks ago

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?

wolfv commented 2 weeks ago

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. :)