Skip to content

Commit fd2b868

Browse files
committed
Partially address the review comments
Signed-off-by: Michał Górny <mgorny@quansight.com>
1 parent 9d0ca5e commit fd2b868

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

docs/maintainer/infrastructure.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,12 @@ is to ensure that packages stay compatible with each other. This is due to how c
502502
packages have a so-called [Application Binary Interface](../glossary.md#abi)
503503
(ABI), and how changes in the compiler infrastructure may break this ABI, leading
504504
to crashes, miscalculations, etc. Generally speaking, using a consistent compiler
505-
version greatly reduces the risk of ABI breaks.
505+
setup greatly reduces the risk of ABI breaks.
506506

507507
### Using compilers in feedstocks
508508

509-
Each set of compilers is split into two kinds of packages: the implementation packages
510-
that install the compiler itself, and an _activation_ package that installs scripts
509+
There are two kinds of compiler-related packages in Conda-forge: implementation packages
510+
that install the compiler itself, and _activation_ packages that install scripts
511511
that set the build environment to use the respective compiler by default. These
512512
scripts set up a number of standard environment variables such as `CC`, and perform
513513
setup actions for the common build systems such as CMake and Meson.
@@ -567,14 +567,18 @@ for feedstocks, we try to keep the compilers in their various versions
567567
working also for direct usage in Conda environments. In fact, we also provide a few
568568
convenience packages to install the respective compilers. For example, [compilers feedstock
569569
](https://github.com/conda-forge/compilers-feedstock) provides packages installing the same
570-
C, C++ and Fortran compilers as normally used in build environments.
570+
C, C++ and Fortran compilers as normally used in build environments, along with their
571+
activation scripts.
571572

572573
For example, to install a C++ compiler, one could invoke:
573574

574575
```bash
575576
conda install cxx-compiler
576577
```
577578

579+
Please note that these packages must not be used in feedstock; instead the macros
580+
listed in `Using compilers in feedstocks`\_ must be used.
581+
578582
### Compilers supplied by conda-forge
579583

580584
Currently conda-forge providers compilers for the following languages, that
@@ -588,9 +592,23 @@ can be specified as arguments to the `{{ compiler(...) }}` macro:
588592
- `rust`; see [Rust packages](/docs/maintainer/example_recipes/rust/)
589593
- `go-cgo` and `go-nocgo`; see [Go packages](/docs/maintainer/example_recipes/go/)
590594

595+
There exists an alternative, MinGW-based, compiler stack on Windows:
596+
597+
- `m2w64_c` for the C compiler
598+
- `m2w64_cxx` for the C++ compiler
599+
- `m2w64_fortran` for the Fortran compiler
600+
601+
However, it is falling out
602+
of use now that most projects will natively support compilation also with MSVC, in addition
603+
to several complications arising from mixing compiler stacks.
604+
605+
Furthermore, compiler names can also be passed explicitly to the `compiler()` macro,
606+
for example `compiler('clang')` or `compiler('gcc')`, in which case they override
607+
the platform defaults.
608+
591609
The authoritative source of the current compilers and versions for various languages
592-
and platforms is the [conda_build_config.yaml](https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/master/recipe/conda_build_config.yaml)
593-
in the [conda-forge/conda-forge-pinning-feedstock](https://github.com/conda-forge/conda-forge-pinning-feedstock)
610+
and platforms is the [conda_build_config.yaml](https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/master/recipe/conda_build_config.yaml) file
611+
in the [conda-forge/conda-forge-pinning-feedstock](https://github.com/conda-forge/conda-forge-pinning-feedstock) repository
594612
as described in [Globally pinned packages](pinning_deps.md#globally-pinned-packages).
595613

596614
The default C and C++ compilers are GCC on Linux, Clang on macOS and VS2022
@@ -659,7 +677,8 @@ For such ABI-compatible upgrades, similar but looser principles apply:
659677

660678
The compiler activation and implementation packages are built by two separate
661679
feedstocks, with a few exceptions. The activation packages install scripts
662-
into `/etc/conda/activate.d` and `/etc/conda/deactivate.d` directories. These
680+
into `/etc/conda/activate.d` and `/etc/conda/deactivate.d` directories, which
681+
are invoked automatically by the conda-build tool when those environments are activated. These
663682
scripts are then used by the build tool to respectively prepare for building
664683
with the given compiler, and clean up afterwards. The implementation packages
665684
install the compilers themselves. More details can be found in the [Anaconda compiler tools
@@ -695,11 +714,6 @@ Windows (MSVC + Flang):
695714
(we cannot redistribute the actual MSVC compilers due to licensing constraints)
696715
- [Fortran] Activation & Implementation: https://github.com/conda-forge/flang-feedstock
697716

698-
There exists an alternative, MinGW-based, compiler stack on Windows, which is available
699-
with a `m2w64_` prefix (e.g. `{{ compiler('m2w64_c') }}`). However, it is falling out
700-
of use now that most projects will natively support compilation also with MSVC, in addition
701-
to several complications arising from mixing compiler stacks.
702-
703717
Additionally, there is a possibility to use `clang` as a compiler on Linux & Windows:
704718

705719
- Activation (Linux): https://github.com/conda-forge/ctng-compiler-activation-feedstock/

0 commit comments

Comments
 (0)