In the past, the most restrictive compiler on relevant platforms in terms
of C support was the Microsoft Visual C++ compiler & toolset (together known
as MSVC; it has a complicated version scheme) [MSVC].
Up until Visual Studio 2013, each MSVC version came with
an updated C Runtime (CRT) library that was incompatible with the previous
ones.
This lack of compatibility of the Application Binary Interface (ABI) meant
that all projects wanting to communicate across this interface (e.g. calling a
function from a shared library) needed to be (re)compiled with the same MSVC
version. The long support of CPython 2.7 meant that python itself was stuck
for a long time with VS 2008 (in order not to break the ABI in patch
releases), and thus SciPy was stuck on that version as well.
The use of VS 2008 (which doesn’t have support for C99) to compile builds for
CPython 2.7 meant for a long time that C code in SciPy has had to conform
to the earlier C90 standard for the language and standard library. After
dropping support for CPython 2.7 in SciPy 1.3.x, that restriction was finally
lifted (though only gradually at first).
With the introduction of the “Universal C Runtime” [UCRT] since the
release of Visual Studio 2015, the ABI of C Runtime has been stable, which
means that the restriction of having to use the same compiler version for
SciPy as for the underlying CPython version is no longer applicable. This
stability is not indefinite though: Microsoft has been planning an
ABI-breaking release - across the compiler resp. C/C++ standard libraries -
(tentatively called “vNext”) for quite a while, but so far it is unclear
when this will arrive. Once that happens, SciPy will again be restricted to
at most the last ABI-compatible Visual Studio release (currently VS 2022)
until all CPython versions supported according to NEP29 have been built
upstream with vNext-compatible compilers.
More specifically, there is a distinction between the Microsoft Visual
Studio version and the version of the targeted “toolset”, which is defined
as “The Microsoft C++ compiler, linker, standard libraries, and related
utilities”. Each version of Visual Studio comes with a default version of the
MSVC toolset (for example VS2017 with vc141, VS2019 with vc142), but it is
possible to target older toolsets even in newer versions of Visual Studio.
Due to the nature of compilers (i.e. split into frontend and backend), it
depends whether the limiting factor for supporting a given feature (e.g. in C)
is due to the version of Visual Studio or the toolset, but in general the
latter is a harder barrier and thus the effective lower bound.
This is due to the fact that while the ABI stays compatible between toolset
versions (until vNext), all linking operations must use a toolset at least
as new as the one used to build any of the involved artefacts, meaning that
toolset version bumps tend to be “infectious”, as in: requiring all consuming
libraries to also bump their toolset (and probably compiler) version. This is
more of an issue for NumPy than SciPy, as the latter has only a small C API
and is compiled against by far fewer projects than NumPy. Additionally, using
a newer toolset means that users of libraries that compile C++ code (as SciPy
does) might also need a newer Microsoft Visual C++ Redistributable, which
might have to be distributed to them.
Summing up, the minimal requirement for the MSVC compiler resp. toolset per
SciPy version was determined predominantly by the oldest supported CPython
version at the time. The first SciPy version to raise the minimal requirement
beyond that was SciPy 1.9, due to the inclusion of the HiGHS submodule, which
does not compile with vc141 (and the aggressive removal of VS2017 in public CI
making it infeasible to keep ensuring that everything everywhere works with
non-default toolset versions).