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
807eb6b2
Unverified
Commit
807eb6b2
authored
Sep 27, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #69003 from dims/ensure-reproducible-builds-pass-epoch-env-var
Ensure reproducible builds - support for SOURCE_DATE_EPOCH with docke…
parents
43a9e08e
d9cfd771
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
common.sh
build/common.sh
+1
-0
golang.sh
hack/lib/golang.sh
+8
-3
No files found.
build/common.sh
View file @
807eb6b2
...
@@ -600,6 +600,7 @@ function kube::build::run_build_command_ex() {
...
@@ -600,6 +600,7 @@ function kube::build::run_build_command_ex() {
--env
"GOFLAGS=
${
GOFLAGS
:-}
"
--env
"GOFLAGS=
${
GOFLAGS
:-}
"
--env
"GOLDFLAGS=
${
GOLDFLAGS
:-}
"
--env
"GOLDFLAGS=
${
GOLDFLAGS
:-}
"
--env
"GOGCFLAGS=
${
GOGCFLAGS
:-}
"
--env
"GOGCFLAGS=
${
GOGCFLAGS
:-}
"
--env
"SOURCE_DATE_EPOCH=
${
SOURCE_DATE_EPOCH
:-}
"
)
)
if
[[
-n
"
${
DOCKER_CGROUP_PARENT
:-}
"
]]
;
then
if
[[
-n
"
${
DOCKER_CGROUP_PARENT
:-}
"
]]
;
then
...
...
hack/lib/golang.sh
View file @
807eb6b2
...
@@ -557,6 +557,7 @@ kube::golang::build_some_binaries() {
...
@@ -557,6 +557,7 @@ kube::golang::build_some_binaries() {
fi
fi
else
else
V
=
2 kube::log::info
"Coverage is disabled."
V
=
2 kube::log::info
"Coverage is disabled."
kube::log::status
"go install"
"
${
build_args
[@]
}
"
"
$@
"
go
install
"
${
build_args
[@]
}
"
"
$@
"
go
install
"
${
build_args
[@]
}
"
"
$@
"
fi
fi
}
}
...
@@ -586,6 +587,7 @@ kube::golang::build_binaries_for_platform() {
...
@@ -586,6 +587,7 @@ kube::golang::build_binaries_for_platform() {
-installsuffix
static
-installsuffix
static
${
goflags
:+
"
${
goflags
[@]
}
"
}
${
goflags
:+
"
${
goflags
[@]
}
"
}
-gcflags
"
${
gogcflags
:-}
"
-gcflags
"
${
gogcflags
:-}
"
-asmflags
"
${
goasmflags
:-}
"
-ldflags
"
${
goldflags
:-}
"
-ldflags
"
${
goldflags
:-}
"
)
)
CGO_ENABLED
=
0 kube::golang::build_some_binaries
"
${
statics
[@]
}
"
CGO_ENABLED
=
0 kube::golang::build_some_binaries
"
${
statics
[@]
}
"
...
@@ -595,6 +597,7 @@ kube::golang::build_binaries_for_platform() {
...
@@ -595,6 +597,7 @@ kube::golang::build_binaries_for_platform() {
build_args
=(
build_args
=(
${
goflags
:+
"
${
goflags
[@]
}
"
}
${
goflags
:+
"
${
goflags
[@]
}
"
}
-gcflags
"
${
gogcflags
:-}
"
-gcflags
"
${
gogcflags
:-}
"
-asmflags
"
${
goasmflags
:-}
"
-ldflags
"
${
goldflags
:-}
"
-ldflags
"
${
goldflags
:-}
"
)
)
kube::golang::build_some_binaries
"
${
nonstatics
[@]
}
"
kube::golang::build_some_binaries
"
${
nonstatics
[@]
}
"
...
@@ -608,6 +611,7 @@ kube::golang::build_binaries_for_platform() {
...
@@ -608,6 +611,7 @@ kube::golang::build_binaries_for_platform() {
go
test
-c
\
go
test
-c
\
${
goflags
:+
"
${
goflags
[@]
}
"
}
\
${
goflags
:+
"
${
goflags
[@]
}
"
}
\
-gcflags
"
${
gogcflags
:-}
"
\
-gcflags
"
${
gogcflags
:-}
"
\
-asmflags
"
${
goasmflags
:-}
"
\
-ldflags
"
${
goldflags
:-}
"
\
-ldflags
"
${
goldflags
:-}
"
\
-o
"
${
outfile
}
"
\
-o
"
${
outfile
}
"
\
"
${
testpkg
}
"
"
${
testpkg
}
"
...
@@ -661,10 +665,11 @@ kube::golang::build_binaries() {
...
@@ -661,10 +665,11 @@ kube::golang::build_binaries() {
host_platform
=
$(
kube::golang::host_platform
)
host_platform
=
$(
kube::golang::host_platform
)
# Use eval to preserve embedded quoted strings.
# Use eval to preserve embedded quoted strings.
local
goflags goldflags gogcflags
local
goflags goldflags go
asmflags go
gcflags
eval
"goflags=(
${
GOFLAGS
:-}
)"
eval
"goflags=(
${
GOFLAGS
:-}
)"
goldflags
=
"
${
GOLDFLAGS
:-}
$(
kube::version::ldflags
)
"
goldflags
=
"
${
GOLDFLAGS
:-}
-s -w
$(
kube::version::ldflags
)
"
gogcflags
=
"
${
GOGCFLAGS
:-}
"
goasmflags
=
"-trimpath=
${
KUBE_ROOT
}
"
gogcflags
=
"
${
GOGCFLAGS
:-}
-trimpath=
${
KUBE_ROOT
}
"
local
-a
targets
=()
local
-a
targets
=()
local
arg
local
arg
...
...
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