github.com/0xKiwi/rules_go@v0.24.3/tests/core/cgo/README.rst (about)

     1  .. _#2067: https://github.com/bazelbuild/rules_go/issues/2067
     2  .. _#2622: https://github.com/bazelbuild/rules_go/issues/2622
     3  
     4  Basic cgo functionality
     5  =======================
     6  
     7  opts_test
     8  ---------
     9  
    10  Checks that different sets of options are passed to C and C++ sources in a
    11  ``go_library`` with ``cgo = True``.
    12  
    13  dylib_test
    14  ----------
    15  
    16  Checks that Go binaries can link against dynamic C libraries. Some libraries
    17  (especially those provided with ``cc_import``) may only have dynamic versions,
    18  and we should be able to link against them and find them at run-time.
    19  
    20  dylib_test
    21  ----------
    22  
    23  Checks that Go binaries can link against dynamic C libraries that are only
    24  available as a versioned shared library, like ``libfoo.so.1``.
    25  
    26  cc_libs_test
    27  ------------
    28  
    29  Checks that Go binaries that include cgo code may or may not link against
    30  libstdc++, depending on how they're linked. This tests several binaries:
    31  
    32  * ``pure_bin`` - built in ``"pure"`` mode, should not depend on libstdc++.
    33  * ``c_srcs`` - has no C++ code in sources, should not depend on libstdc++.
    34  * ``cc_srcs`` - has some C++ code in sources, should depend on libstdc++.
    35  * ``cc_deps`` - depends on a ``cc_library``, should depend on libstdc++
    36    because we don't know what's in it.
    37  
    38  race_test
    39  ---------
    40  
    41  Checks that cgo code in a binary with ``race = "on"`` is compiled in race mode.
    42  Verifies #1592.
    43  
    44  tag_test
    45  --------
    46  
    47  Checks that sources with ``// +build cgo`` are built when cgo is enabled
    48  (whether or not ``cgo = True`` is set), and sources with ``// +build !cgo``
    49  are only built in pure mode.
    50  
    51  cdeps_link_test
    52  ---------------
    53  
    54  Checks that libraries in ``cdeps`` are linked into the generated ``_cgo_.o``
    55  executable used to produce ``_cgo_imports.go``. Verifies `#2067`_.
    56  
    57  split_import_test
    58  -----------------
    59  
    60  Checks that when a package with ``cdeps`` is recompiled due to a split test,
    61  the input files from ``cdeps`` are included in the recompilation and are passed
    62  to the linker. Verifies `#2622`_.