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

add MACOSX_DEPLOYMENT_TARGET to same zip as c_stdlib_version #5669

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

h-vetinari
Copy link
Member

@h-vetinari h-vetinari requested a review from a team as a code owner March 23, 2024 23:14
@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

Copy link
Member

@mbargull mbargull left a comment

Choose a reason for hiding this comment

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

We should simplify this and not impose CUDA-related restrictions to non-CUDA configs.

@beckermr
Copy link
Member

I don't follow your request @mbargull. Can you be a bit more explicit about what you mean?

FWIW, I think the cuda restrictions on the compilers that were here (and might still be) should go away once we move the min cuda version high enough. I forget the details. Others probably recall them.

@beckermr
Copy link
Member

Also I suspect the issue you are objecting too should be in another PR, not this one. We're just trying to get stdlib running and don't want to do a bunch of other stuff at the same time.

@mbargull
Copy link
Member

I don't follow your request @mbargull. Can you be a bit more explicit about what you mean?

I'm confused; GitHub swallowed my code comment/suggestion... let me retype this. Then things should be clearer.

@@ -165,6 +165,7 @@ zip_keys:
- cxx_compiler_version # [unix]
- fortran_compiler_version # [unix]
- c_stdlib_version # [unix]
- MACOSX_DEPLOYMENT_TARGET # [osx]
Copy link
Member

Choose a reason for hiding this comment

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

There's no need to put the c_stdlib_version (and related keys) into this zip key.
This tight coupling is only needed for the CUDA stuff.
We should do something like

+  -                             # [osx]
+    - c_stdlib_version          # [osx]
+    - MACOSX_DEPLOYMENT_TARGET  # [osx]
+# For CUDA, c_stdlib_version/cdt_name is zipped below with the compilers.
+  -                             # [linux and os.environ.get("CF_CUDA_ENABLED", "False") != "True"]
+    - c_stdlib_version          # [linux and os.environ.get("CF_CUDA_ENABLED", "False") != "True"]
+    - cdt_name                  # [linux and os.environ.get("CF_CUDA_ENABLED", "False") != "True"]
   -                             # [unix]
     - c_compiler_version        # [unix]
     - cxx_compiler_version      # [unix]
     - fortran_compiler_version  # [unix]
-    - c_stdlib_version          # [unix]
-    - MACOSX_DEPLOYMENT_TARGET  # [osx]
+    - c_stdlib_version          # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - cdt_name                  # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - cuda_compiler             # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - cuda_compiler_version     # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - docker_image              # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True" and os.environ.get("BUILD_PLATFORM", "").startswith("linux-")]

or

+# For CUDA, c_stdlib_version/cdt_name is zipped below with the compilers.
+  -                             # [osx or (linux and os.environ.get("CF_CUDA_ENABLED", "False") != "True")]
+    - c_stdlib_version          # [osx or (linux and os.environ.get("CF_CUDA_ENABLED", "False") != "True")]
+    - MACOSX_DEPLOYMENT_TARGET  # [osx]
+    - cdt_name                  # [linux and os.environ.get("CF_CUDA_ENABLED", "False") != "True"]
   -                             # [unix]
     - c_compiler_version        # [unix]
     - cxx_compiler_version      # [unix]
     - fortran_compiler_version  # [unix]
-    - c_stdlib_version          # [unix]
-    - MACOSX_DEPLOYMENT_TARGET  # [osx]
+    - c_stdlib_version          # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - cdt_name                  # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - cuda_compiler             # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - cuda_compiler_version     # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
     - docker_image              # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True" and os.environ.get("BUILD_PLATFORM", "").startswith("linux-")]

(Sorry, GitHub UI didn't allow me to put this into a proper suggestion since it touches things outside of this "hunk".)

Copy link
Member

Choose a reason for hiding this comment

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

I see. Let's make a new PR for that. We've had trouble with these zips and proper rendering. It'll be easier to test as two steps.

Copy link
Member

Choose a reason for hiding this comment

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

If you want.. That PR would then be a requisite for this PR then; i.e., we should not zip MACOSX_DEPLOYMENT_TARGET with the compiler versions in any case.

Copy link
Member

@beckermr beckermr Mar 24, 2024

Choose a reason for hiding this comment

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

The macosx deployment target being set explicitly will be deprecated behavior after stdlib is done. The zipping here is to allow for a transition period as far as I understand it.

@beckermr
Copy link
Member

Ah good but please move this to another pr. We are doing two unrelated things here. I'm happy to help with the cuda stuff elsewhere. It will be easier to debug issues if we work on one thing at a time.

@beckermr
Copy link
Member

I don't follow why precisely the extra changes are needed but I'm happy to defer to @h-vetinari and @mbargull to make the call.

@mbargull
Copy link
Member

See gh-5672.
After merging that PR, the change for this PR would be just to add

  -                             # [osx]
    - c_stdlib_version          # [osx]
    - MACOSX_DEPLOYMENT_TARGET  # [osx]

for macOS.

@mbargull
Copy link
Member

mbargull commented Mar 24, 2024

I don't follow why precisely the extra changes are needed

We impose artificial restrictions if we zip sysroot_linux*/MACOSX_DEPLOYMENT_TARGET with the compiler versions.
Meaning, previously, we'd only need such coupling for CUDA-related parts -- and that need doesn't change whether we use explicit c_stdlib packages or not.
^-- That is the conceptual rationale.
In addition, by avoiding this large zip key for cases for which it is not needed, we can also avoid issues/constraints we may run into due to too tight coupling.

@h-vetinari
Copy link
Member Author

In #5592, I had said that I want to avoid putting c_stdlib_version into the compiler-zip, but AFAIU it turned out to be necessary because we needed to zip it with cdt_name for the CUDA world. This was further iterated in #5607. If we're able to peel the stdlib out of that zip again, all the better, but AFAIU we need to make sure that CUDA builds opt into glibc 2.17.

@h-vetinari
Copy link
Member Author

Closing this as obsolete. Thanks for your help @mbargull! 🙏

@h-vetinari h-vetinari closed this Mar 25, 2024
@h-vetinari h-vetinari reopened this Mar 25, 2024
@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I was trying to look for recipes to lint for you, but it appears we have a merge conflict.
Please try to merge or rebase with the base branch to resolve this conflict.

Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug.

@h-vetinari
Copy link
Member Author

After merging that PR, the change for this PR would be just to add [...]

Ah, I had missed that bit, sorry. Coming right up.

Suggested-By: Marcel Bargull <marcel.bargull@udo.edu>
@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@h-vetinari
Copy link
Member Author

This PR now breaks the current state of conda-forge/conda-smithy#1889, for reasons I don't fully understand

  File "[...]\dev\conda-forge\conda-smithy\conda_smithy\configure_feedstock.py", line 615, in _collapse_subpackage_variants
    used_key_values = conda_build.variants.list_of_dicts_to_dict_of_lists(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\miniforge\envs\smithy-dev\Lib\site-packages\conda_build\variants.py", line 634, in list_of_dicts_to_dict_of_lists
    values = list(zip(*set(zip(*(squished[key] for key in group)))))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\miniforge\envs\smithy-dev\Lib\site-packages\conda_build\variants.py", line 634, in <genexpr>
    values = list(zip(*set(zip(*(squished[key] for key in group)))))
                                 ~~~~~~~~^^^^^
KeyError: 'c_stdlib_version'

@mbargull
Copy link
Member

Querying this: https://github.com/search?q=org%3Aconda-forge%20path%3A%2F(%5E%7C%5C%2F)conda_build_config%5C.yaml%24%2F%20MACOSX_DEPLOYMENT_TARGET&type=code
we do have cases like https://github.com/conda-forge/cctools-and-ld64-feedstock/blob/522ce9e43aae12b7601e40034fc5d757cb21fe10/recipe/conda_build_config.yaml#L30
which

  • has multiple entries for MACOSX_DEPLOYMENT_TARGET,
  • has MACOSX_DEPLOYMENT_TARGET as part of another zip key.

Both of which will break once we put MACOSX_DEPLOYMENT_TARGET in a zip key here.
We should address this before merging this.

@h-vetinari
Copy link
Member Author

This PR now breaks the current state of conda-forge/conda-smithy#1889, for reasons I don't fully understand

This is fixed now as of the last commit in that PR.

Both of which will break once we put MACOSX_DEPLOYMENT_TARGET in a zip key here.
We should address this before merging this.

Extending your query a bit, there are very few cases that have multiple values of MACOSX_DEPLOYMENT_TARGET defined, and all but cctools are split between x86_64 and arm64. I'll happily fix the cctools one, it's a feedstock I maintain anyway, so this shouldn't be a blocker here.

@mbargull
Copy link
Member

Extending your query a bit, there are very few cases that have multiple values of MACOSX_DEPLOYMENT_TARGET defined, and all but cctools are split between x86_64 and arm64. I'll happily fix the cctools one, it's a feedstock I maintain anyway, so this shouldn't be a blocker here.

Sounds good. Since you are a maintainer there, then I consider this as being "addressed" since "at least one member of all affected parties has been notified" ;).

Is this good to merge then? (I think yes; feel free to merge if you agree.)

@h-vetinari h-vetinari merged commit f974928 into conda-forge:main Mar 25, 2024
4 checks passed
@h-vetinari h-vetinari deleted the osx branch March 25, 2024 09:19
@h-vetinari
Copy link
Member Author

I'll happily fix the cctools one, it's a feedstock I maintain anyway, so this shouldn't be a blocker here.

So I tried doing this in conda-forge/cctools-and-ld64-feedstock#68, but I'm beginning to wonder now if the zip here makes sense at all, in the sense that it only zips singleton values, but we cannot anymore do something like cctools was doing, because now that c_stdlib_version / MACOSX_DEPLOYMENT_TARGET are in a zip, they cannot be added to other zips anymore.

So I wonder what we gain from this PR after all? Yes, it allows us to be sure that c_stdlib_version / MACOSX_DEPLOYMENT_TARGET are in sync in terms of zip-length, but that isn't even a requirement anymore for conda-forge/conda-smithy#1889 after the processing was moved to the variants themselves.

Overall I think it does more harm than good, and we should revert it...

@beckermr
Copy link
Member

Go for it!

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