Skip to content

Sync build configuration with Memray#330

Merged
godlygeek merged 2 commits into
bloomberg:mainfrom
godlygeek:sync_build_flags_with_memray
Jul 12, 2026
Merged

Sync build configuration with Memray#330
godlygeek merged 2 commits into
bloomberg:mainfrom
godlygeek:sync_build_flags_with_memray

Conversation

@godlygeek

Copy link
Copy Markdown
Contributor

Remove some unnecessary differences between PyStack's and Memray's CMake and scikit-build-core configurations.

  • Start setting CMAKE_CXX_VISIBILITY_PRESET to hidden to avoid unintentionally exposing symbols from our extension module that could potentially conflict with other modules.
  • Ensure that directories searched for shared libraries are added to the RPATH with CMAKE_INSTALL_RPATH_USE_LINK_PATH.
  • Ensure that the Python version we find includes a configuration for building extension modules that against the stable ABI.
  • Build with -Wall to enable extra warnings.
  • Pass -D_FILE_OFFSET_BITS=64 to opt into 64-bit file IO APIs even on 32-bit platforms. This currently doesn't have any effect, since we only build for 64-bit platforms, but it would be needed if we ever added i686 support, and matching Memray will make maintenance cheaper.
  • Enable extra debugging in the C++ STL for debug builds.
  • Build with link time optimizations enabled for CMake release mode builds.
  • Optimize for debugging in CMake debug builds.
  • Require scikit-build-core 0.9 or newer.
  • Enable extra logging during builds.
  • Avoid stripping debug info from the built extension module.
  • Automatically build in debug mode rather than release mode when passing the -e / --editable flag to pip install.

- Start setting `CMAKE_CXX_VISIBILITY_PRESET` to `hidden` to avoid
  unintentionally exposing symbols from our extension module that could
  potentially conflict with other modules.
- Ensure that directories searched for shared libraries are added to the
  RPATH with `CMAKE_INSTALL_RPATH_USE_LINK_PATH`.
- Ensure that the Python version we find includes a configuration for
  building extension modules that against the stable ABI.
- Build with -Wall to enable extra warnings.
- Pass `-D_FILE_OFFSET_BITS=64` to opt into 64-bit file IO APIs even on
  32-bit platforms. This currently doesn't have any effect, since we
  only build for 64-bit platforms, but it would be needed if we ever
  added i686 support, and matching Memray will make maintenance cheaper.
- Enable extra debugging in the C++ STL for debug builds.
- Build with link time optimizations enabled for CMake release mode
  builds.
- Optimize for debugging in CMake debug builds.
- Require `scikit-build-core` 0.9 or newer.
- Enable extra logging during builds.
- Avoid stripping debug info from the built extension module.
- Automatically build in debug mode rather than release mode when
  passing the `-e` / `--editable` flag to `pip install`.

Signed-off-by: Matt Wozniski <godlygeek@gmail.com>
@godlygeek godlygeek force-pushed the sync_build_flags_with_memray branch from 756868a to 5e2a46e Compare July 12, 2026 07:26
@codecov-commenter

codecov-commenter commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.63%. Comparing base (4d4ef00) to head (7f15501).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #330      +/-   ##
==========================================
- Coverage   77.93%   77.63%   -0.30%     
==========================================
  Files          56       57       +1     
  Lines        5988     6601     +613     
  Branches      631      628       -3     
==========================================
+ Hits         4667     5125     +458     
- Misses       1321     1476     +155     
Flag Coverage Δ
cpp 77.63% <ø> (-0.30%) ⬇️
python 77.63% <ø> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@godlygeek godlygeek enabled auto-merge (rebase) July 12, 2026 18:43
@godlygeek godlygeek disabled auto-merge July 12, 2026 18:46
This function is exposed by our extension module, but never used by any
of our Python modules.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@godlygeek godlygeek force-pushed the sync_build_flags_with_memray branch from 4749ad7 to 7f15501 Compare July 12, 2026 18:47
@godlygeek godlygeek enabled auto-merge (rebase) July 12, 2026 18:49
@godlygeek godlygeek merged commit c200f09 into bloomberg:main Jul 12, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants