Skip to content

Commit eb8ade8

Browse files
authored
Update Go shard to include gofmt (#132)
* Update Go shard to include gofmt * Add gofmt to the PATH * Trim trailing whitespace
1 parent d37e9c4 commit eb8ade8

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

Artifacts.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,25 +2046,25 @@ os = "linux"
20462046

20472047
[["Go.v1.16.3.x86_64-linux-musl.squashfs"]]
20482048
arch = "x86_64"
2049-
git-tree-sha1 = "3a85d82c6b7bb04cc5fd9c206a40071a85a8ab33"
2049+
git-tree-sha1 = "3d6e4e251649e26ee915d1571e5a087fa82e80d1"
20502050
lazy = true
20512051
libc = "musl"
20522052
os = "linux"
20532053

20542054
[["Go.v1.16.3.x86_64-linux-musl.squashfs".download]]
2055-
sha256 = "3c51d29fc653f41c8e4a9fa52444deefc984e146426db7e87065ebb50a129a0a"
2056-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Go-v1.16.3/Go.v1.16.3.x86_64-linux-musl.squashfs.tar.gz"
2055+
sha256 = "a618ec9032151f850febfd7df54d3ccd8298ed6400a9bd67c269f405a3c60c5b"
2056+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Go-v1.16.3+0/Go.v1.16.3.x86_64-linux-musl.squashfs.tar.gz"
20572057

20582058
[["Go.v1.16.3.x86_64-linux-musl.unpacked"]]
20592059
arch = "x86_64"
2060-
git-tree-sha1 = "899505c8af5679696acf1b476a16b5696f5caf24"
2060+
git-tree-sha1 = "c339a184d3baa86ea328ad416eb06e7476f0aa21"
20612061
lazy = true
20622062
libc = "musl"
20632063
os = "linux"
20642064

20652065
[["Go.v1.16.3.x86_64-linux-musl.unpacked".download]]
2066-
sha256 = "a5b4ad9807ad4c16a8df91ebc763d75b766edeed12a83f2f608a38081f53e82e"
2067-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Go-v1.16.3/Go.v1.16.3.x86_64-linux-musl.unpacked.tar.gz"
2066+
sha256 = "05b9524e7ce044da1b2384b6e92a33ec657e728d0d387819629600e334b09fef"
2067+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/Go-v1.16.3+0/Go.v1.16.3.x86_64-linux-musl.unpacked.tar.gz"
20682068

20692069
[["LLVMBootstrap.v11.0.1.x86_64-linux-musl.squashfs"]]
20702070
arch = "x86_64"

src/Runner.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,21 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
200200
vrun \${CCACHE} $(prog) "\${PRE_FLAGS[@]}" "\${ARGS[@]}" "\${POST_FLAGS[@]}"
201201
""")
202202
end
203-
203+
204204
# Helper invocations
205205
target_tool(io::IO, tool::String, args...; kwargs...) = wrapper(io, "/opt/$(target)/bin/$(target)-$(tool)", args...; kwargs...)
206206
llvm_tool(io::IO, tool::String, args...; kwargs...) = wrapper(io, "/opt/$(host_target)/bin/llvm-$(tool)", args...; kwargs...)
207207

208208
# For now this is required for Clang, since apple spells aarch64 as "arm64".
209209
# Should probably be fixed upstream, but will do for now
210210
clang_target_triplet(p::AbstractPlatform) = replace(aatriplet(p), "aarch64" => "arm64")
211-
211+
212212
function clang_flags!(p::AbstractPlatform, flags::Vector{String} = String[])
213213
# Focus the clang targeting laser
214214
append!(flags, [
215215
# Set the `target` for `clang` so it generates the right kind of code
216216
"-target $(clang_target_triplet(p))",
217-
# Set our sysroot to the platform-specific location, dropping compiler ABI annotations
217+
# Set our sysroot to the platform-specific location, dropping compiler ABI annotations
218218
"--sysroot=/opt/$(aatriplet(p))/$(aatriplet(p))/sys-root",
219219
])
220220
# For MacOS and FreeBSD, we don't set `-rtlib`, and FreeBSD is special-cased within the LLVM source tree
@@ -410,7 +410,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
410410
end
411411
end
412412
fc(io::IO, p::AbstractPlatform) = gfortran(io, p)
413-
413+
414414
# Go stuff where we build an environment mapping each time we invoke `go-${target}`
415415
function GOOS(p::AbstractPlatform)
416416
if os(p) == "macos"
@@ -437,6 +437,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
437437
)
438438
return wrapper(io, "/opt/$(host_target)/go/bin/go"; env=env, allow_ccache=false)
439439
end
440+
gofmt(io::IO, p::AbstractPlatform) = wrapper(io, "/opt/$(host_target)/go/bin/gofmt"; allow_ccache=false)
440441

441442
# Rust stuff
442443
function rust_flags!(p::AbstractPlatform, flags::Vector{String} = String[])
@@ -549,7 +550,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
549550
:strip, :install_name_tool, :dlltool, :windres, :winmc, :lipo)
550551
@eval $(tool)(io::IO, p::AbstractPlatform) = $(wrapper)(io, string("/opt/", aatriplet(p), "/bin/", aatriplet(p), "-", $(string(tool))); allow_ccache=false)
551552
end
552-
553+
553554
# c++filt is hard to write in symbols
554555
function cxxfilt(io::IO, p::AbstractPlatform)
555556
if Sys.isapple(p)
@@ -645,6 +646,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
645646
# Generate go stuff
646647
if :go in compilers
647648
write_wrapper(go, p, "$(t)-go")
649+
write_wrapper(gofmt, p, "$(t)-gofmt")
648650
end
649651

650652
# Misc. utilities
@@ -704,7 +706,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
704706
append!(default_tools, ("rustc","rustup","cargo"))
705707
end
706708
if :go in compilers
707-
append!(default_tools, ("go",))
709+
append!(default_tools, ("go", "gofmt"))
708710
end
709711
# Create symlinks for default compiler invocations, invoke target toolchain
710712
for tool in default_tools

0 commit comments

Comments
 (0)