Skip to content

Commit 993e3c5

Browse files
authored
Merge pull request #1547 from wolfv/libcpp_disable_availability
add _LIBCPP_DISABLE_AVAILABILITY docs
2 parents 919f07b + 47636d9 commit 993e3c5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/maintainer/knowledge_base.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,32 @@ Note that this requires ``conda>=4.8``. If you want to support older conda versi
10731073
the requirement should be changed from ``run`` to ``run_constrained``. Note that
10741074
``conda<4.8`` will ignore the condition if it's a ``run_constrained`` on ``__osx``.
10751075

1076+
Newer C++ features with old SDK
1077+
-------------------------------
1078+
1079+
The libc++ library uses Clang availability annotations to mark certain symbols as
1080+
unavailable when targeting versions of macOS that ship with a system libc++
1081+
that do not contain them. Clang always assumes that the system libc++ is used.
1082+
1083+
The conda-forge build infrastructure targets macOS 10.9 and some newer C++ features
1084+
such as ``fs::path`` are marked as unavailable on that platform, so the build aborts:
1085+
1086+
.. code-block:: sh
1087+
1088+
...
1089+
error: 'path' is unavailable: introduced in macOS 10.15
1090+
...
1091+
note: 'path' has been explicitly marked unavailable here
1092+
class _LIBCPP_TYPE_VIS path {
1093+
1094+
However, since conda-forge ships its own (modern) libcxx we can ignore these checks
1095+
because these symbols are in fact available. To do so, add
1096+
``_LIBCPP_DISABLE_AVAILABILITY`` to the defines. For example
1097+
1098+
.. code-block:: sh
1099+
1100+
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
1101+
10761102
10771103
PyPy builds
10781104
===========

0 commit comments

Comments
 (0)