Skip to content

Fix PCH visibility settings. - #9455

Open
mcourteaux wants to merge 2 commits into
mainfrom
mcourteaux/fix-pch-test
Open

mcourteaux wants to merge 2 commits into
mainfrom
mcourteaux/fix-pch-test

Conversation

@mcourteaux

@mcourteaux mcourteaux commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

This was required on my x86 macOS machine with clang.

Comment thread test/CMakeLists.txt Outdated
Comment on lines +11 to +19
# The PCH must be compiled with the same visibility settings as the targets
# that reuse it (via REUSE_FROM, applied in add_halide_test()) -- otherwise
# Clang rejects the PCH with "default visibility for functions and variables
# differs in PCH file vs. current file".
set_target_properties(_test_internal
PROPERTIES
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN TRUE
)

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.

We should rather set this:

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)

at the top of this file and then remove the analogous block from add_halide_test in HalideTestHelpers.cmake.

This is similar to how the autoscheduler build does it. While we're here, we should change the other instances of CMAKE_VISIBILITY_INLINES_HIDDEN to say TRUE rather than ON or YES for consistency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Feel free to commit here what you think is best. I'm not sure I understand fully.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll have Claude interpret this. I'm a bit tired.

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.01%. Comparing base (4c5525c) to head (c0abf35).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9455      +/-   ##
==========================================
- Coverage   70.12%   70.01%   -0.11%     
==========================================
  Files         261      261              
  Lines       79818    79938     +120     
  Branches    19445    19478      +33     
==========================================
  Hits        55972    55972              
- Misses      17991    18071      +80     
- Partials     5855     5895      +40     

☔ 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 visibility settings needed for PCH reuse to directory-scoped
variables in test/CMakeLists.txt, matching how the autoscheduler build
sets them, and drop the now-redundant per-target visibility settings
in add_halide_test(). Also normalize CMAKE_VISIBILITY_INLINES_HIDDEN
to TRUE for consistency.

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

Copy link
Copy Markdown
Contributor Author

@alexreinking Claude did it. PTAL.

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.

2 participants