refactor: Use the linkstamps from linker_inputs instead of from cc_linking_context for to support upcoming CcInfo changes (#3075)

This change allows Bazel to remove linkstamp from CcLinkingContext.

The change is a no-op.

Co-authored-by: Richard Levasseur <richardlev@gmail.com>
Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
diff --git a/python/private/py_executable.bzl b/python/private/py_executable.bzl
index 9927975..30f18b5 100644
--- a/python/private/py_executable.bzl
+++ b/python/private/py_executable.bzl
@@ -1578,7 +1578,11 @@
         feature_configuration,
         requested_features,
         cc_toolchain):
-    linkstamps = py_internal.linking_context_linkstamps(cc_info.linking_context)
+    linkstamps = [
+        py_internal.linkstamp_file(linkstamp)
+        for linker_input in cc_info.linking_context.linker_inputs.to_list()
+        for linkstamp in linker_input.linkstamps
+    ]
 
     partially_disabled_thin_lto = (
         cc_common.is_enabled(
@@ -1602,10 +1606,7 @@
             for input in cc_info.linking_context.linker_inputs.to_list()
             for flag in input.user_link_flags
         ],
-        linkstamps = [
-            py_internal.linkstamp_file(linkstamp)
-            for linkstamp in linkstamps.to_list()
-        ],
+        linkstamps = linkstamps,
         build_info_artifacts = _get_build_info(ctx, cc_toolchain) if linkstamps else [],
         features = requested_features,
         is_test_target_partially_disabled_thin_lto = is_test and partially_disabled_thin_lto,