Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ sqlite_materializer_state = true
# Persist the dep-file cache too, so local actions still hit it after a daemon restart.
sqlite_dep_file_state = true
defer_write_actions = true
# Unpack http_archive downloads in Buck itself rather than with the host's tar, gzip and xz.
extract_archives_in_daemon = true

[buck2_resource_control]
# A host without a systemd user manager, such as a container, runs the daemon without cgroups.
Expand Down
14 changes: 1 addition & 13 deletions go/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,7 @@ def _go_toolchains_impl(actions: AnalysisActions, arch: str, snapshot: ArtifactV
fail("go.releases {}: the snapshot contains no {} archive for {}".format(target, release, arch))
download = actions.declare_output(release + ".tar.gz")
actions.download_file(download.as_output(), archive["url"], sha256 = archive["sha256"], size_bytes = archive["size"])
root = actions.declare_output(release, dir = True)

# TODO: Unpack with ctx.actions.extract_archive once the pinned buck2 has it, so that the build
# doesn't need the host's tar.
# GNU tar applies --strip-components after it removes a leading slash. With
# --strip-components=1, a member named go//home/user/.bashrc is written to /home/user/.bashrc.
# A plain extraction keeps every member inside the output, and the Go root is its go/ directory.
actions.run(
cmd_args("/bin/sh", "-c", 'mkdir -p "$1" && tar -xzf "$2" -C "$1"', "sh", root.as_output(), download),
category = "go_unpack",
identifier = release,
)
toolchains[release] = root.project("go")
toolchains[release] = actions.extract_archive(release, download, strip_prefix = "go")
return [GoToolchainsInfo(toolchains = toolchains)]

_go_toolchains = dynamic_actions(
Expand Down
Loading