Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
57d60ece
Commit
57d60ece
authored
Apr 03, 2018
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't support `go build` any more.
Given run-in-gopath.sh, I can't see why we need it. It is slower and produces no better results.
parent
46146f6f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
35 deletions
+8
-35
golang.sh
hack/lib/golang.sh
+8
-35
No files found.
hack/lib/golang.sh
View file @
57d60ece
...
@@ -438,7 +438,7 @@ kube::golang::build_kube_toolchain() {
...
@@ -438,7 +438,7 @@ kube::golang::build_kube_toolchain() {
# Try and replicate the native binary placement of go install without
# Try and replicate the native binary placement of go install without
# calling go install.
# calling go install.
kube::golang::out
put_filenam
e_for_binary
()
{
kube::golang::out
fil
e_for_binary
()
{
local
binary
=
$1
local
binary
=
$1
local
platform
=
$2
local
platform
=
$2
local
output_path
=
"
${
KUBE_GOPATH
}
/bin"
local
output_path
=
"
${
KUBE_GOPATH
}
/bin"
...
@@ -454,7 +454,6 @@ kube::golang::output_filename_for_binary() {
...
@@ -454,7 +454,6 @@ kube::golang::output_filename_for_binary() {
kube::golang::build_binaries_for_platform
()
{
kube::golang::build_binaries_for_platform
()
{
local
platform
=
$1
local
platform
=
$1
local
use_go_build
=
${
2
-
}
local
-a
statics
=()
local
-a
statics
=()
local
-a
nonstatics
=()
local
-a
nonstatics
=()
...
@@ -472,48 +471,25 @@ kube::golang::build_binaries_for_platform() {
...
@@ -472,48 +471,25 @@ kube::golang::build_binaries_for_platform() {
fi
fi
done
done
if
[[
-n
${
use_go_build
:-}
]]
;
then
for
binary
in
"
${
statics
[@]
:+
${
statics
[@]
}}
"
;
do
kube::log::info
" go build
${
binary
}
"
local
outfile
=
$(
kube::golang::output_filename_for_binary
"
${
binary
}
"
"
${
platform
}
"
)
CGO_ENABLED
=
0 go build
-o
"
${
outfile
}
"
\
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
-gcflags
"
${
gogcflags
}
"
\
-ldflags
"
${
goldflags
}
"
\
"
${
binary
}
"
done
for
binary
in
"
${
nonstatics
[@]
:+
${
nonstatics
[@]
}}
"
;
do
kube::log::info
" go build
${
binary
}
"
local
outfile
=
$(
kube::golang::output_filename_for_binary
"
${
binary
}
"
"
${
platform
}
"
)
go build
-o
"
${
outfile
}
"
\
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
-gcflags
"
${
gogcflags
}
"
\
-ldflags
"
${
goldflags
}
"
\
"
${
binary
}
"
done
else
# Use go install.
if
[[
"
${#
statics
[@]
}
"
!=
0
]]
;
then
if
[[
"
${#
statics
[@]
}
"
!=
0
]]
;
then
CGO_ENABLED
=
0 go
install
-installsuffix
static
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
CGO_ENABLED
=
0 go
install
-installsuffix
static
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
-gcflags
"
${
gogcflags
}
"
\
-gcflags
"
${
gogcflags
}
"
\
-ldflags
"
${
goldflags
}
"
\
-ldflags
"
${
goldflags
}
"
\
"
${
statics
[@]
:+
${
statics
[@]
}}
"
"
${
statics
[@]
:+
${
statics
[@]
}}
"
fi
fi
if
[[
"
${#
nonstatics
[@]
}
"
!=
0
]]
;
then
if
[[
"
${#
nonstatics
[@]
}
"
!=
0
]]
;
then
go
install
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
go
install
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
-gcflags
"
${
gogcflags
}
"
\
-gcflags
"
${
gogcflags
}
"
\
-ldflags
"
${
goldflags
}
"
\
-ldflags
"
${
goldflags
}
"
\
"
${
nonstatics
[@]
:+
${
nonstatics
[@]
}}
"
"
${
nonstatics
[@]
:+
${
nonstatics
[@]
}}
"
fi
fi
fi
for
test
in
"
${
tests
[@]
:+
${
tests
[@]
}}
"
;
do
for
test
in
"
${
tests
[@]
:+
${
tests
[@]
}}
"
;
do
local
outfile
=
$(
kube::golang::output_filename_for_binary
"
${
test
}
"
\
local
outfile
=
$(
kube::golang::outfile_for_binary
"
${
test
}
"
"
${
platform
}
"
)
"
${
platform
}
"
)
local
testpkg
=
"
$(
dirname
${
test
})
"
local
testpkg
=
"
$(
dirname
${
test
})
"
mkdir
-p
"
$(
dirname
${
outfile
})
"
mkdir
-p
"
$(
dirname
${
outfile
})
"
go
test
-c
\
go
test
-c
\
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
-gcflags
"
${
gogcflags
}
"
\
-gcflags
"
${
gogcflags
}
"
\
...
@@ -575,14 +551,11 @@ kube::golang::build_binaries() {
...
@@ -575,14 +551,11 @@ kube::golang::build_binaries() {
goldflags
=
"
${
GOLDFLAGS
:-}
$(
kube::version::ldflags
)
"
goldflags
=
"
${
GOLDFLAGS
:-}
$(
kube::version::ldflags
)
"
gogcflags
=
"
${
GOGCFLAGS
:-}
"
gogcflags
=
"
${
GOGCFLAGS
:-}
"
local
use_go_build
local
-a
targets
=()
local
-a
targets
=()
local
arg
local
arg
for
arg
;
do
for
arg
;
do
if
[[
"
${
arg
}
"
==
"--use_go_build"
]]
;
then
if
[[
"
${
arg
}
"
==
-
*
]]
;
then
use_go_build
=
true
elif
[[
"
${
arg
}
"
==
-
*
]]
;
then
# Assume arguments starting with a dash are flags to pass to go.
# Assume arguments starting with a dash are flags to pass to go.
goflags+
=(
"
${
arg
}
"
)
goflags+
=(
"
${
arg
}
"
)
else
else
...
@@ -634,9 +607,9 @@ kube::golang::build_binaries() {
...
@@ -634,9 +607,9 @@ kube::golang::build_binaries() {
local
platform
local
platform
for
platform
in
"
${
platforms
[@]
}
"
;
do
(
for
platform
in
"
${
platforms
[@]
}
"
;
do
(
kube::golang::set_platform_envs
"
${
platform
}
"
kube::golang::set_platform_envs
"
${
platform
}
"
kube::log::status
"
${
platform
}
:
go
build started"
kube::log::status
"
${
platform
}
: build started"
kube::golang::build_binaries_for_platform
${
platform
}
${
use_go_build
:-}
kube::golang::build_binaries_for_platform
${
platform
}
kube::log::status
"
${
platform
}
:
go
build finished"
kube::log::status
"
${
platform
}
: build finished"
)
&>
"/tmp//
${
platform
//\//_
}
.build"
&
)
&>
"/tmp//
${
platform
//\//_
}
.build"
&
done
done
...
@@ -655,7 +628,7 @@ kube::golang::build_binaries() {
...
@@ -655,7 +628,7 @@ kube::golang::build_binaries() {
kube::log::status
"Building go targets for
${
platform
}
:"
"
${
targets
[@]
}
"
kube::log::status
"Building go targets for
${
platform
}
:"
"
${
targets
[@]
}
"
(
(
kube::golang::set_platform_envs
"
${
platform
}
"
kube::golang::set_platform_envs
"
${
platform
}
"
kube::golang::build_binaries_for_platform
${
platform
}
${
use_go_build
:-}
kube::golang::build_binaries_for_platform
${
platform
}
)
)
done
done
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment