Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hack/build-cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ if [[ "${OS_BUILD_RELEASE_ARCHIVES-}" != "n" ]]; then
os::build::release_sha
else
# Place binaries only
OS_BUILD_PLATFORMS=("${platforms[@]+"${platforms[@]}"}") \
os::build::place_bins "${OS_CROSS_COMPILE_BINARIES[@]}"
OS_BUILD_PLATFORMS=("${image_platforms[@]+"${image_platforms[@]}"}") \
os::build::place_bins "${OS_IMAGE_COMPILE_BINARIES[@]}"
OS_BUILD_PLATFORMS=("${platforms[@]+"${platforms[@]}"}")
os::build::place_bins "${OS_CROSS_COMPILE_BINARIES[@]}"
OS_BUILD_PLATFORMS=("${image_platforms[@]+"${image_platforms[@]}"}")
os::build::place_bins "${OS_IMAGE_COMPILE_BINARIES[@]}"
fi

if [[ "${OS_GIT_TREE_STATE:-dirty}" == "clean" ]]; then
Expand Down
18 changes: 13 additions & 5 deletions hack/lib/build/binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,18 @@ function os::build::place_bins() {
fi
done

# Link binaries that we want to link (eg. oc->kubectl)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we care about the link, when we'll copy it over a few lines below?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvmd, I haven't seen the dest being different for both.

local suffix=""
if [[ $platform == "windows/amd64" ]]; then
suffix=".exe"
fi
for linkname in "${OC_BINARY_COPY[@]}"; do
local src="${OS_OUTPUT_BINPATH}/${platform}/oc${suffix}"
if [[ -f "${src}" ]]; then
ln -f "$src" "${OS_OUTPUT_BINPATH}/${platform}/${linkname}${suffix}"
fi
done

# If no release archive was requested, we're done.
if [[ "${OS_RELEASE_ARCHIVE-}" == "" ]]; then
continue
Expand All @@ -342,14 +354,10 @@ function os::build::place_bins() {
done

# Create binary copies where specified.
local suffix=""
if [[ $platform == "windows/amd64" ]]; then
suffix=".exe"
fi
for linkname in "${OC_BINARY_COPY[@]}"; do
local src="${release_binpath}/oc${suffix}"
if [[ -f "${src}" ]]; then
ln "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}"
cp -f "${release_binpath}/oc${suffix}" "${release_binpath}/${linkname}${suffix}"
fi
done

Expand Down