Skip to content

Commit 2b44ff7

Browse files
committed
hack/lib: dedup os::util::host_platform and os::build::host_platform
1 parent 8a3204c commit 2b44ff7

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

CONTRIBUTING.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ $ hack/env make release
137137
In order to make use of the binaries from your shell, add the build output
138138
directory to the `$PATH`:
139139
----
140-
$ export PATH="${PATH}:$( source hack/lib/init.sh; echo "${OS_OUTPUT_BINPATH}/$( os::util::host_platform )/" )"
140+
$ export PATH="${PATH}:$( source hack/lib/init.sh; echo "${OS_OUTPUT_BINPATH}/$( os::build::host_platform )/" )"
141141
----
142142

143143
See more information in https://github.com/openshift/origin/blob/master/HACKING.md#building-on-non-linux-systems[`HACKING.md`]

hack/lib/cleanup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ readonly -f os::cleanup::find_cache_alterations
292292
function os::cleanup::dump_pprof_output() {
293293
if go tool -n pprof >/dev/null 2>&1 && [[ -s cpu.pprof ]]; then
294294
os::log::info "[CLEANUP] \`pprof\` output logged to $( os::util::repository_relative_path "${LOG_DIR}/pprof.out" )"
295-
go tool pprof -text "./_output/local/bin/$(os::util::host_platform)/openshift" cpu.pprof >"${LOG_DIR}/pprof.out" 2>&1
295+
go tool pprof -text "./_output/local/bin/$(os::build::host_platform)/openshift" cpu.pprof >"${LOG_DIR}/pprof.out" 2>&1
296296
fi
297297
}
298298
readonly -f os::cleanup::dump_pprof_output

hack/lib/util/environment.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ readonly -f os::util::environment::setup_all_server_vars
104104
function os::util::environment::update_path_var() {
105105
local prefix
106106
if os::util::find::system_binary 'go' >/dev/null 2>&1; then
107-
prefix+="${OS_OUTPUT_BINPATH}/$(os::util::host_platform):"
107+
prefix+="${OS_OUTPUT_BINPATH}/$(os::build::host_platform):"
108108
fi
109109
if [[ -n "${GOPATH:-}" ]]; then
110110
prefix+="${GOPATH}/bin:"

hack/lib/util/misc.sh

-15
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,6 @@ function os::util::curl_etcd() {
190190
fi
191191
}
192192

193-
# os::util::host_platform determines what the host OS and architecture
194-
# are, as Golang sees it. The go tool chain does some slightly different
195-
# things when the target platform matches the host platform.
196-
#
197-
# Globals:
198-
# None
199-
# Arguments:
200-
# None
201-
# Returns:
202-
# None
203-
function os::util::host_platform() {
204-
echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
205-
}
206-
readonly -f os::util::host_platform
207-
208193
# os::util::list_go_src_files lists files we consider part of our project
209194
# source code, useful for tools that iterate over source to provide vet-
210195
# ting or linting, etc.

0 commit comments

Comments
 (0)