Starlarkify GoWrapCcInfo provider and remove its native implementation
Changed getter of native provider with its corresponding starlarkified version.
Deleted go_wrap_cc_info function since it’s not needed anymore in Starlark (see the comment in GoWrapCcHelperApi.java).
PiperOrigin-RevId: 453979367
Change-Id: Ieb59b9c963ca9f54067599534b69dc135bfe5450
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/GoogleLegacyStubs.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/GoogleLegacyStubs.java
index 10af61a..2fac7fb 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/GoogleLegacyStubs.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/GoogleLegacyStubs.java
@@ -27,7 +27,6 @@
import com.google.devtools.build.lib.starlarkbuildapi.cpp.FeatureConfigurationApi;
import com.google.devtools.build.lib.starlarkbuildapi.cpp.GoCcLinkParamsInfoApi;
import com.google.devtools.build.lib.starlarkbuildapi.cpp.GoWrapCcHelperApi;
-import com.google.devtools.build.lib.starlarkbuildapi.cpp.GoWrapCcInfoApi;
import com.google.devtools.build.lib.starlarkbuildapi.cpp.PyCcLinkParamsProviderApi;
import com.google.devtools.build.lib.starlarkbuildapi.cpp.PyWrapCcHelperApi;
import com.google.devtools.build.lib.starlarkbuildapi.cpp.PyWrapCcInfoApi;
@@ -200,12 +199,6 @@
return null;
}
- @Override
- public GoWrapCcInfoApi<FileApi> getGoWrapCcInfo(
- StarlarkRuleContextApi<ConstraintValueInfoApi> starlarkRuleContext,
- CcInfoApi<FileApi> ccInfo) {
- return null;
- }
@Override
public GoCcLinkParamsInfoApi getGoCcLinkParamsProvider(
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/GoWrapCcHelperApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/GoWrapCcHelperApi.java
index 800088f..5a8ade6 100644
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/GoWrapCcHelperApi.java
+++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/GoWrapCcHelperApi.java
@@ -106,19 +106,6 @@
CcInfoT ccInfo);
@StarlarkMethod(
- name = "go_wrap_cc_info",
- doc = "",
- documented = false,
- parameters = {
- @Param(name = "ctx", positional = false, named = true),
- @Param(name = "cc_info", positional = false, named = true),
- })
- // TODO(b/113797843): GoWrapCcInfo is not written in Starlark because several native rules use it.
- public GoWrapCcInfoApi<FileT> getGoWrapCcInfo(
- StarlarkRuleContextT starlarkRuleContext, CcInfoT ccInfo)
- throws EvalException, InterruptedException;
-
- @StarlarkMethod(
name = "go_cc_link_params_provider",
doc = "",
documented = false,
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/GoWrapCcInfoApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/GoWrapCcInfoApi.java
deleted file mode 100644
index 3f44fbc..0000000
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/GoWrapCcInfoApi.java
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2019 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.lib.starlarkbuildapi.cpp;
-
-import com.google.devtools.build.docgen.annot.DocCategory;
-import com.google.devtools.build.lib.starlarkbuildapi.FileApi;
-import com.google.devtools.build.lib.starlarkbuildapi.core.ProviderApi;
-import com.google.devtools.build.lib.starlarkbuildapi.core.StructApi;
-import net.starlark.java.annot.StarlarkBuiltin;
-import net.starlark.java.annot.StarlarkMethod;
-
-/**
- * Provider returned by go_wrap_cc rules that encapsulates C++ information.
- *
- * <p>The provider wrapped is CcInfo. Go SWIG have C++ dependencies that will have to be linked
- * later, however, we don't want C++ targets to be able to depend on Go SWIG, only Python targets
- * should be able to do so. Therefore, we wrap the C++ providers in a different provider which C++
- * rules do not recognize.
- */
-@StarlarkBuiltin(
- name = "GoWrapCcInfo",
- documented = false,
- category = DocCategory.PROVIDER,
- doc = "")
-public interface GoWrapCcInfoApi<FileT extends FileApi> extends StructApi {
-
- @StarlarkMethod(name = "cc_info", structField = true, documented = false, doc = "")
- CcInfoApi<FileT> getCcInfo();
-
- /** Provider for GoWrapCcInfo objects. */
- @StarlarkBuiltin(name = "Provider", doc = "", documented = false)
- public interface Provider extends ProviderApi {}
-}