Skip to content

Commit

Permalink
Expose some builtin cc starlark symbols
Browse files Browse the repository at this point in the history
RELNOTES: Exposed `CcSharedLibraryInfo` to Starlark builtins.
PiperOrigin-RevId: 454171911
Change-Id: I3cb72086f8a48a9f6ef738304b782ab0d99109c6
  • Loading branch information
c-parsons authored and copybara-github committed Jun 10, 2022
1 parent c9b2417 commit c2d50de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import com.google.devtools.build.lib.starlarkbuildapi.cpp.CcBootstrap;
import com.google.devtools.build.lib.util.ResourceFileLoader;
import java.io.IOException;
import net.starlark.java.eval.Starlark;

/**
* Rules for C++ support in Bazel.
Expand All @@ -63,6 +64,7 @@ private CcRules() {
public void init(ConfiguredRuleClassProvider.Builder builder) {
GraphNodeAspect graphNodeAspect = new GraphNodeAspect();
builder.addConfigurationFragment(CppConfiguration.class);
builder.addStarlarkAccessibleTopLevels("CcSharedLibraryInfo", Starlark.NONE);
builder.addBuildInfoFactory(new CppBuildInfo());

builder.addNativeAspectClass(graphNodeAspect);
Expand Down
3 changes: 2 additions & 1 deletion src/main/starlark/builtins_bzl/common/exports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
load("@_builtins//:common/cc/cc_import.bzl", "cc_import")
load("@_builtins//:common/cc/cc_binary_wrapper.bzl", "cc_binary")
load("@_builtins//:common/cc/cc_test.bzl", cc_test = "cc_test_wrapper")
load("@_builtins//:common/cc/experimental_cc_shared_library.bzl", "cc_shared_library", "cc_shared_library_permissions")
load("@_builtins//:common/cc/experimental_cc_shared_library.bzl", "CcSharedLibraryInfo", "cc_shared_library", "cc_shared_library_permissions")
load("@_builtins//:common/objc/objc_import.bzl", "objc_import")
load("@_builtins//:common/objc/objc_library.bzl", "objc_library")
load("@_builtins//:common/objc/apple_static_library.bzl", "apple_static_library")
Expand All @@ -34,6 +34,7 @@ exported_toplevels = {
# that builtins injection is working properly. Its built-in value is
# "original value".
"_builtins_dummy": "overridden value",
"CcSharedLibraryInfo": CcSharedLibraryInfo,
"proto_common_do_not_use": proto_common_do_not_use,
}

Expand Down

0 comments on commit c2d50de

Please sign in to comment.