You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9828a2f
Browse filesBrowse the repository at this point in the historyBrowse files
build: consolidate _resolve_toolchain and unify flag set across backends
Closes the audit in NVIDIA#1882. cuda_bindings' and cuda_core's
``_resolve_toolchain`` framework was identical (call
_resolve_toolchain_name, msvc-debug error, _apply_toolchain_env,
tuple return); only the ``extra_compile_args``/``extra_link_args``
choices differed, and NVIDIA#1882 traced that difference to legacy drift,
not intent. Both are now the same function in _build_shared.
Consolidations:
- New ``resolve_toolchain(debug, compile_for_coverage)`` in
``_build_shared.py`` handles the whole workflow (name resolution,
msvc-debug guard, flag assembly, env application, return tuple).
- New ``_build_flags(name, debug, compile_for_coverage)`` in
``_build_shared.py`` carries the unified flag set. Both backends
drop their local copies.
- Both ``build_hooks.py`` import ``resolve_toolchain`` and call it
with just the two switches; no per-package callable is passed.
Flag choices are now the single set:
- Linux ``-std=c++17`` (bindings used ``c++14``)
- MSVC ``/std:c++17`` (bindings had no ``/std:`` at all)
- Non-debug ``-g0 -O2`` (bindings used ``-O3``)
- Debug ``-g -O0 -D _GLIBCXX_ASSERTIONS``
- llvm ``-fuse-ld=lld``
- Coverage ``-DCYTHON_TRACE_NOGIL=1 -DCYTHON_USE_SYS_MONITORING=0``
- Non-debug ``-Wl,--strip-all``
Bindings loses ``-Wno-deprecated-declarations``, ``-fpermissive``,
and ``-fno-var-tracking-assignments`` -- per NVIDIA#1882, these were
legacy leftover with no active justification. CI will surface any
compilation regressions if the Cython-generated C++ actually needs
``-fpermissive``.
Tests: the shared ``ResolveToolchainSharedMixin`` gains
``test_llvm_sets_env_and_flags`` (both backends now assert the same
flags). Per-package ``TestResolveToolchain`` classes are gone;
``test_gnu_keeps_gcc_only_flags`` (bindings) is deleted because the
flags it guarded are gone. Pass counts: 28 bindings (was 29), 59
core (unchanged).
0 commit comments