Skip to content

Conversation

@webknjaz
Copy link
Member

@webknjaz webknjaz commented Oct 15, 2025

This patch modifies the build backend to dynamically enable Cython line tracing only when explicitly requested via the with-cython-tracing=true config setting. Previously, having linetrace = "True" in pyproject.toml was making our PyPI-published wheels slower.

Now, line tracing is opt-in:

  • Regular builds: pip install . (no line tracing)

  • Tracing builds: pip install . --config-setting=with-cython-tracing=true

    (enables line tracing)

When tracing is requested, the build backend automatically adds the linetrace=True and profile=True Cython directives and sets the appropriate C compiler flags.

Resolves #767

ISSUE TYPE
  • Packaging Pull Request
BLOCKERS

@packit-as-a-service

This comment was marked as outdated.

webknjaz added a commit to webknjaz/ansible--pylibssh that referenced this pull request Oct 15, 2025
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 15, 2025
@webknjaz webknjaz force-pushed the packaging/debug-symbols-only-if-asked branch from 0f43a97 to 4c29a37 Compare October 15, 2025 23:38
webknjaz added a commit to webknjaz/ansible--pylibssh that referenced this pull request Oct 15, 2025
webknjaz added a commit to webknjaz/ansible--pylibssh that referenced this pull request Oct 19, 2025
@webknjaz webknjaz force-pushed the packaging/debug-symbols-only-if-asked branch from 4c29a37 to edf0f3e Compare October 19, 2025 00:24
This patch modifies the build backend to dynamically enable Cython
line tracing only when explicitly requested via the
`with-cython-tracing=true` config setting. Previously, having
`linetrace = "True"` in `pyproject.toml` was making our PyPI-published
wheels slower.

Now, line tracing is opt-in:
- Regular builds: `pip install .`
  (no line tracing)
- Tracing builds:
  `pip install . --config-setting=with-cython-tracing=true`

  (enables line tracing)

When tracing is requested, the build backend automatically adds the
`linetrace=True` and `profile=True` Cython directives and sets the
appropriate C compiler flags.

Resolves ansible#767
@webknjaz webknjaz force-pushed the packaging/debug-symbols-only-if-asked branch from edf0f3e to f8121c5 Compare October 20, 2025 12:53
@webknjaz
Copy link
Member Author

webknjaz commented Oct 20, 2025

With f8121c5 (MUST BE REVERTED BEFORE MERGING), it's visible that the artifact sizes differ. However, to measure the performance properly, we need to integrate #729 first. So I'm considering this PR blocked until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TODO] Ensure release builds don't include debug symbols

1 participant