Bazel: Implement C++ Starlark API

Created on 2 Feb 2018  路  5Comments  路  Source: bazelbuild/bazel

Description of the problem / feature request:

The API should expose to Skylark from Java the logic for the creation of compilation and linking actions.

Feature requests: what underlying problem are you trying to solve with this feature?

The main problem to solve is inter-operability between different rules/languages that have dependencies on C++ code.

Design doc:https://docs.google.com/document/d/1cRRdHOPTTUXBbq9Cj9hk_WLnPqsGtAoQynYd7TKBQI8/edit?disco=AAAACkgMw7E

P1 team-Rules-CPP feature request

Most helpful comment

All 5 comments

Bazel@HEAD now accepts --experimental_enable_cc_skylark_api that will enable the current WIP version of the API. It's only for experimenting at this point, we break it daily, and we will not support users using it yet. But feedback is more than welcomed.

Is there a better way to traverse the API than print(dir(ctx.attr.cc_lib.cc))?

Would like to see if it better fits https://github.com/bazelbuild/rules_rust/pull/108

Hey @oquenchil . How to pass data to LinkBuildVariables of cc_common.link? For example, interface_library name?

CcModule.java:290

        /* interfaceLibraryBuilder= */ null,
        /* interfaceLibraryOutput= */ null,

Currently it is being calculated to "ignored", producing command line like (Windows):
/IMPLIB:ignored

Repro case is here:
https://groups.google.com/forum/#!topic/bazel-discuss/I-yvg7xbbG0

Also, dynamic libraries in create_linking_context_from_compilation_outputs are not being generated on Windows:
CcModule.java:1435

            .setShouldCreateDynamicLibrary(
                !disallowDynamicLibraries
                    && !featureConfiguration
                        .getFeatureConfiguration()
                        .isEnabled(CppRuleClasses.TARGETS_WINDOWS))
Was this page helpful?
0 / 5 - 0 ratings