Skip to content

Commit

Permalink
context: s/crosstool/cc_toolchain_files/
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Jul 9, 2024
1 parent 634fc28 commit c53e32c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go/private/actions/compilepkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def emit_compilepkg(
execution_requirements = SUPPORTS_PATH_MAPPING_REQUIREMENT
if cgo:
inputs.extend(cgo_inputs.to_list()) # OPT: don't expand depset
inputs.extend(go.crosstool)
inputs.extend(go.cc_toolchain_files)
env["CC"] = go.cgo_tools.c_compiler_path
if cppopts:
args.add("-cppflags", quote_opts(cppopts))
Expand Down
2 changes: 1 addition & 1 deletion go/private/actions/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def emit_link(
inputs_transitive = [
archive.libs,
archive.cgo_deps,
as_set(go.crosstool),
as_set(go.cc_toolchain_files),
as_set(go.sdk.tools),
as_set(go.stdlib.libs),
]
Expand Down
4 changes: 2 additions & 2 deletions go/private/actions/stdlib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _build_stdlib_list_json(go):

inputs = go.sdk_files
if not go.mode.pure:
inputs += go.crosstool
inputs += go.cc_toolchain_files

go.actions.run(
inputs = inputs,
Expand Down Expand Up @@ -144,7 +144,7 @@ def _build_stdlib(go):
go.sdk.headers +
go.sdk.tools +
[go.sdk.go, go.sdk.package_list, go.sdk.root_file] +
go.crosstool)
go.cc_toolchain_files)

if go.mode.pgoprofile:
args.add("-pgoprofile", go.mode.pgoprofile)
Expand Down
8 changes: 4 additions & 4 deletions go/private/context.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,11 @@ def go_context(ctx, attr = None):
env["GOARM"] = mode.arm

if not cgo_context_info:
crosstool = []
cc_toolchain_files = []
cgo_tools = None
else:
env.update(cgo_context_info.env)
crosstool = cgo_context_info.crosstool
cc_toolchain_files = cgo_context_info.cc_toolchain_files

# Add C toolchain directories to PATH.
# On ARM, go tool link uses some features of gcc to complete its work,
Expand Down Expand Up @@ -584,7 +584,7 @@ def go_context(ctx, attr = None):
actions = ctx.actions,
exe_extension = goos_to_extension(mode.goos),
shared_extension = goos_to_shared_extension(mode.goos),
crosstool = crosstool,
cc_toolchain_files = cc_toolchain_files,
package_list = toolchain.sdk.package_list,
importpath = importpath,
importmap = importmap,
Expand Down Expand Up @@ -846,7 +846,7 @@ def _cgo_context_data_impl(ctx):
)

return [CgoContextInfo(
crosstool = cc_toolchain.all_files.to_list(),
cc_toolchain_files = cc_toolchain.all_files.to_list(),
tags = tags,
env = env,
cgo_tools = struct(
Expand Down
2 changes: 1 addition & 1 deletion go/toolchains.rst
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ Fields
| The suffix to use for shared libraries in this build mode. Mostly used when |
| generating output filenames of binary rules. |
+--------------------------------+-----------------------------------------------------------------+
| :param:`crosstool` | :type:`list of File` |
| :param:`cc_toolchain_files` | :type:`list of File` |
+--------------------------------+-----------------------------------------------------------------+
| The files you need to add to the inputs of an action in order to use the cc toolchain. |
+--------------------------------+-----------------------------------------------------------------+
Expand Down

0 comments on commit c53e32c

Please sign in to comment.