Skip to content

Rename Target::OS's OSX to MacOS, deprecate the old name - #9451

Open
abadams wants to merge 3 commits into
mainfrom
abadams/macos
Open

abadams wants to merge 3 commits into
mainfrom
abadams/macos

Conversation

@abadams

@abadams abadams commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Halide's Target::OS used the increasingly out-of-date string/enum name osx for macOS. This renames the canonical form to MacOS/"macos" throughout the codebase.
  • Target::OSX is kept as a [[deprecated]] alias enumerator equal to Target::MacOS, so old C++ code still compiles but gets a -Wdeprecated-declarations warning.
  • Target string parsing still accepts "osx" as an alias for "macos", but emits a user_warning when it does, and Target::to_string() now always prints "macos".
  • Updated the Python binding (hl.TargetOS.OSX) similarly: kept as a deprecated alias, following the same pattern used for TailStrategy::Predicate.
  • Updated CMake helpers (HalideTargetHelpers.cmake, HalideGeneratorHelpers.cmake), the autoscheduler/packaging CMakeLists that referenced -osx triples, and docs, so host-detected macOS targets now come out as -macos end-to-end.
  • Swept all internal uses of Target::OSX/hl.TargetOS.OSX (tests, tutorials, codegen) over to the new MacOS name so nothing in-tree triggers the new deprecation warning.

In the future, using the deprecated OSX/"osx" spelling could be made a hard error, but for now it's just deprecated.

Test plan

  • g++ -fsyntax-only sanity checks on all touched .cpp/.h files (no LLVM-linked build available in this environment)
  • Verified Target::OSX now triggers -Wdeprecated-declarations
  • Verified std::map iteration order makes to_string() print "macos" (not "osx") for the parsed/host target
  • ctest -R correctness_target (please run in CI / on a full build)

Halide's Target::OS used the increasingly-out-of-date "osx" string and
enum name for macOS. Rename the canonical name to MacOS/"macos"
everywhere internally, while keeping OSX/"osx" working as a deprecated
alias: the enum still defines OSX (marked [[deprecated]]) equal to
MacOS, and target string parsing still accepts "osx" but emits a
user_warning and prints "macos" back out.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@alexreinking alexreinking left a comment

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.

LGTM with one possible enhancement

Comment thread python_bindings/halide/src/halide_/PyEnums.cpp
Wrap the pybind11-registered TargetOS.OSX class attribute with a
descriptor in halide/__init__.py so accessing it raises a
DeprecationWarning pointing at TargetOS.MacOS, matching the C++-side
[[deprecated]] attribute on Target::OSX.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mcourteaux

mcourteaux commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

I actually wouldn't mind seeing Target:macOS and Target::iOS, to be honest. But perhaps clang-tidy is going to not like proper capitalization...

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.06%. Comparing base (4c5525c) to head (3771224).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/CPlusPlusMangle.cpp 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9451      +/-   ##
==========================================
- Coverage   70.12%   70.06%   -0.06%     
==========================================
  Files         261      261              
  Lines       79818    79937     +119     
  Branches    19445    19479      +34     
==========================================
+ Hits        55972    56009      +37     
- Misses      17991    18077      +86     
+ Partials     5855     5851       -4     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Move the deprecation shim below the module imports (E402) and name TargetOS
explicitly rather than relying on the star import (F405).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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