Skip to content

Commit f867cd3

Browse files
dzbarskyfmeum
authored andcommitted
Remove orig_srcs
1 parent 2d22666 commit f867cd3

File tree

6 files changed

+9
-25
lines changed

6 files changed

+9
-25
lines changed

go/private/actions/archive.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_d
171171

172172
# GoSource fields
173173
srcs = as_tuple(source.srcs),
174-
orig_srcs = as_tuple(source.orig_srcs),
175174
_cover = source.cover,
176175
_embedsrcs = as_tuple(source.embedsrcs),
177176
_x_defs = tuple(source.x_defs.items()),

go/private/context.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def _new_library(go, name = None, importpath = None, resolver = None, importable
216216
def _merge_embed(source, embed):
217217
s = get_source(embed)
218218
source["srcs"] = s.srcs + source["srcs"]
219-
source["orig_srcs"] = s.orig_srcs + source["orig_srcs"]
220219
source["embedsrcs"] = source["embedsrcs"] + s.embedsrcs
221220
source["cover"] = depset(transitive = [source["cover"], s.cover])
222221
source["deps"] = source["deps"] + s.deps
@@ -267,7 +266,6 @@ def _library_to_source(go, attr, library, coverage_instrumented):
267266
"library": library,
268267
"mode": go.mode,
269268
"srcs": srcs,
270-
"orig_srcs": srcs,
271269
"embedsrcs": embedsrcs,
272270
"cover": depset(attr_srcs) if coverage_instrumented else depset(),
273271
"x_defs": {},

go/private/rules/test.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ def _recompile_external_deps(go, external_source, internal_archive, library_labe
672672
library = library,
673673
mode = go.mode,
674674
srcs = as_list(arc_data.srcs),
675-
orig_srcs = as_list(arc_data.orig_srcs),
676675
cover = arc_data._cover,
677676
embedsrcs = as_list(arc_data._embedsrcs),
678677
x_defs = dict(arc_data._x_defs),

go/private/tools/path.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def _go_path_impl(ctx):
5757
pkg = struct(
5858
importpath = importpath,
5959
dir = "src/" + pkgpath,
60-
srcs = as_list(archive.orig_srcs),
60+
srcs = as_list(archive.srcs),
6161
runfiles = archive.runfiles,
6262
embedsrcs = as_list(archive._embedsrcs),
6363
pkgs = {mode: archive.file},

go/providers.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ method. In general, only rules_go should need to build or handle these.
129129
+--------------------------------+-----------------------------------------------------------------+
130130
| The sources to compile into the archive. |
131131
+--------------------------------+-----------------------------------------------------------------+
132-
| :param:`orig_srcs` | :type:`list of File` |
133-
+--------------------------------+-----------------------------------------------------------------+
134-
| The original source files this library is based on. This may differ from |
135-
| :param:`srcs` if processing tools such as cgo or cover are applied. |
136-
+--------------------------------+-----------------------------------------------------------------+
137132
| :param:`embedsrcs` | :type:`list of File` |
138133
+--------------------------------+-----------------------------------------------------------------+
139134
| Files that may be embedded into the compiled package using ``//go:embed`` |
@@ -266,10 +261,6 @@ rule. Instead, it's referenced in the ``data`` field of GoArchive_.
266261
| The .go sources compiled into the archive. May have been generated or |
267262
| transformed with tools like cgo and cover. |
268263
+--------------------------------+-----------------------------------------------------------------+
269-
| :param:`orig_srcs` | :type:`tuple of File` |
270-
+--------------------------------+-----------------------------------------------------------------+
271-
| The unmodified sources provided to the rule, including .go, .s, .h, .c files. |
272-
+--------------------------------+-----------------------------------------------------------------+
273264
| :param:`runfiles` | :type:`runfiles` |
274265
+--------------------------------+-----------------------------------------------------------------+
275266
| Data files that should be available at runtime to binaries and tests built |

go/tools/gopackagesdriver/aspect.bzl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,20 @@ def file_path(f):
5050
return paths.join(prefix, f.path)
5151

5252
def _go_archive_to_pkg(archive):
53+
go_files = [
54+
file_path(src)
55+
for src in archive.data.srcs
56+
if src.path.endswith(".go")
57+
]
5358
return struct(
5459
ID = str(archive.data.label),
5560
PkgPath = archive.data.importpath,
5661
ExportFile = file_path(archive.data.export_file),
57-
GoFiles = [
58-
file_path(src)
59-
for src in archive.data.orig_srcs
60-
if src.path.endswith(".go")
61-
],
62-
CompiledGoFiles = [
63-
file_path(src)
64-
for src in archive.data.srcs
65-
if src.path.endswith(".go")
66-
],
62+
GoFiles = go_files,
63+
CompiledGoFiles = go_files,
6764
OtherFiles = [
6865
file_path(src)
69-
for src in archive.data.orig_srcs
66+
for src in archive.data.srcs
7067
if not src.path.endswith(".go")
7168
],
7269
Imports = {

0 commit comments

Comments
 (0)