Skip to content

fix the internal archive to include all of the original dependencies #4405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions go/private/rules/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ def _recompile_external_deps(go, external_go_info, internal_archive, library_lab
# Pass internal dependencies that need to be recompiled down to the builder to check if the internal archive
# tries to import any of the dependencies. If there is, that means that there is a dependency cycle.
need_recompile_deps = []
original_internal_deps = internal_go_info.deps
for archive in internal_go_info.deps:
dep_data = archive.data
if not need_recompile[dep_data.label]:
Expand All @@ -672,13 +673,14 @@ def _recompile_external_deps(go, external_go_info, internal_archive, library_lab

# Build a map from labels to possibly recompiled GoArchives.
label_to_archive = {}
i = 0
for label in dep_list:
i += 1

# If this library is the internal archive, use the recompiled version.
if label == internal_archive.data.label:
label_to_archive[label] = internal_archive
# ensure the internal archive has all of the orignal dependencies including the recompiled ones.
internal_attrs = structs.to_dict(internal_archive)
internal_attrs["direct"] = [label_to_archive[archive.data.label] for archive in original_internal_deps]
internal_archive = GoArchive(**internal_attrs)
label_to_archive[internal_archive.data.label] = internal_archive
continue

# If this is a library embedded into the internal test archive,
Expand Down