Skip to content

Commit 0558843

Browse files
Revert "Windows compile time info"
1 parent 4a84aa7 commit 0558843

File tree

3 files changed

+5
-74
lines changed

3 files changed

+5
-74
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
/dind-*.rc
1414
/os-version-defs
1515
/.make/
16-
/cmd/oc/oc.syso
1716
*.swp
1817
.vimrc
1918
.vagrant-openshift.json*

hack/lib/build/binaries.sh

+2-68
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,6 @@ os::build::internal::build_binaries() {
219219
local_ldflags+=" -s"
220220
fi
221221

222-
#Add Windows File Properties/Version Info and Icon Resource for oc.exe
223-
if [[ "$platform" == "windows/amd64" ]]; then
224-
os::build::generate_windows_versioninfo
225-
fi
226-
227222
if [[ ${#nonstatics[@]} -gt 0 ]]; then
228223
GOOS=${platform%/*} GOARCH=${platform##*/} go install \
229224
-pkgdir "${OS_OUTPUT_PKGDIR}/${platform}" \
@@ -239,10 +234,6 @@ os::build::internal::build_binaries() {
239234
fi
240235
fi
241236

242-
if [[ "$platform" == "windows/amd64" ]]; then
243-
rm ${OS_ROOT}/cmd/oc/oc.syso
244-
fi
245-
246237
for test in "${tests[@]:+${tests[@]}}"; do
247238
local outfile="${OS_OUTPUT_BINPATH}/${platform}/$(basename ${test})"
248239
# disabling cgo allows use of delve
@@ -258,64 +249,7 @@ os::build::internal::build_binaries() {
258249
}
259250
readonly -f os::build::build_binaries
260251

261-
# Generates the .syso file used to add compile-time VERSIONINFO metadata to the
262-
# Windows binary.
263-
function os::build::generate_windows_versioninfo() {
264-
os::util::ensure::gopath_binary_exists 'goversioninfo'
265-
os::build::version::get_vars
266-
local major="${OS_GIT_MAJOR}"
267-
local minor="${OS_GIT_MINOR%+}"
268-
local patch="${OS_GIT_PATCH}"
269-
local windows_versioninfo_file=`mktemp --suffix=".versioninfo.json"`
270-
cat <<EOF >"${windows_versioninfo_file}"
271-
{
272-
"FixedFileInfo":
273-
{
274-
"FileVersion": {
275-
"Major": ${major},
276-
"Minor": ${minor},
277-
"Patch": ${patch}
278-
},
279-
"ProductVersion": {
280-
"Major": ${major},
281-
"Minor": ${minor},
282-
"Patch": ${patch}
283-
},
284-
"FileFlagsMask": "3f",
285-
"FileFlags ": "00",
286-
"FileOS": "040004",
287-
"FileType": "01",
288-
"FileSubType": "00"
289-
},
290-
"StringFileInfo":
291-
{
292-
"Comments": "",
293-
"CompanyName": "Red Hat, Inc.",
294-
"InternalName": "openshift client",
295-
"FileVersion": "${OS_GIT_VERSION}",
296-
"InternalName": "oc",
297-
"LegalCopyright": "© Red Hat, Inc. Licensed under the Apache License, Version 2.0",
298-
"LegalTrademarks": "",
299-
"OriginalFilename": "oc.exe",
300-
"PrivateBuild": "",
301-
"ProductName": "OpenShift Client",
302-
"ProductVersion": "${OS_GIT_VERSION}",
303-
"SpecialBuild": ""
304-
},
305-
"VarFileInfo":
306-
{
307-
"Translation": {
308-
"LangID": "0409",
309-
"CharsetID": "04B0"
310-
}
311-
}
312-
}
313-
EOF
314-
goversioninfo -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
315-
}
316-
readonly -f os::build::generate_windows_versioninfo
317-
318-
# Generates the set of target packages, binaries, and platforms to build for.
252+
# Generates the set of target packages, binaries, and platforms to build for.
319253
# Accepts binaries via $@, and platforms via OS_BUILD_PLATFORMS, or defaults to
320254
# the current platform.
321255
function os::build::export_targets() {
@@ -599,4 +533,4 @@ function os::build::commit_range() {
599533

600534
echo "$1"
601535
}
602-
readonly -f os::build::commit_range
536+
readonly -f os::build::commit_range

hack/lib/build/version.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ function os::build::version::openshift_vars() {
4040
# Try to match the "git describe" output to a regex to try to extract
4141
# the "major" and "minor" versions and whether this is the exact tagged
4242
# version or whether the tree is between two tagged versions.
43-
if [[ "${OS_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)(\.[0-9]+)*([-].*)?$ ]]; then
43+
if [[ "${OS_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)*([-].*)?$ ]]; then
4444
OS_GIT_MAJOR=${BASH_REMATCH[1]}
4545
OS_GIT_MINOR=${BASH_REMATCH[2]}
46-
OS_GIT_PATCH=${BASH_REMATCH[3]}
47-
if [[ -n "${BASH_REMATCH[5]}" ]]; then
46+
if [[ -n "${BASH_REMATCH[4]}" ]]; then
4847
OS_GIT_MINOR+="+"
4948
fi
5049
fi
@@ -112,11 +111,10 @@ OS_GIT_TREE_STATE='${OS_GIT_TREE_STATE-}'
112111
OS_GIT_VERSION='${OS_GIT_VERSION-}'
113112
OS_GIT_MAJOR='${OS_GIT_MAJOR-}'
114113
OS_GIT_MINOR='${OS_GIT_MINOR-}'
115-
OS_GIT_PATCH='${OS_GIT_PATCH-}'
116114
KUBE_GIT_COMMIT='${KUBE_GIT_COMMIT-}'
117115
KUBE_GIT_VERSION='${KUBE_GIT_VERSION-}'
118116
ETCD_GIT_VERSION='${ETCD_GIT_VERSION-}'
119117
ETCD_GIT_COMMIT='${ETCD_GIT_COMMIT-}'
120118
EOF
121119
}
122-
readonly -f os::build::version::save_vars
120+
readonly -f os::build::version::save_vars

0 commit comments

Comments
 (0)