Skip to content

Commit

Permalink
Merge pull request containers#2886 from cevich/native_osx_build
Browse files Browse the repository at this point in the history
Native OSX build
  • Loading branch information
openshift-merge-robot authored Jan 22, 2021
2 parents f52762a + 998f98e commit 371e4ca
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 121 deletions.
14 changes: 7 additions & 7 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ env:
CIRRUS_CLONE_DEPTH: 50
# Unless set by in_podman.sh, default to operating outside of a podman container
IN_PODMAN: 'false'
# Not cross-compiling by default
CROSS_TARGET: ""

####
#### Cache-image names to test with
Expand Down Expand Up @@ -176,12 +174,14 @@ cross_build_task:
depends_on:
- unit

env:
matrix:
CROSS_TARGET: cross
osx_instance:
image: 'catalina-base'

setup_script: '${SCRIPT_BASE}/setup.sh |& ${_TIMESTAMP}'
build_script: '${SCRIPT_BASE}/build.sh |& ${_TIMESTAMP}'
script:
- brew install go
- brew install go-md2man
- brew install gpgme
- make cross CGO_ENABLED=0

binary_artifacts:
path: ./bin/*
Expand Down
9 changes: 3 additions & 6 deletions contrib/cirrus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ then
in_podman --rm $IN_PODMAN_NAME $0
else
echo "Compiling buildah (\$GOSRC=$GOSRC)"
showrun make clean ${CROSS_TARGET:-all} ${CROSS_TARGET:+CGO_ENABLED=0 cross}
showrun make clean all

echo "Installing buildah"
mkdir -p bin
if [[ -z "$CROSS_TARGET" ]]
then
showrun make install PREFIX=/usr
showrun ./bin/buildah info
fi
showrun make install PREFIX=/usr
showrun ./bin/buildah info
fi
3 changes: 0 additions & 3 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ else
) > /dev/stderr
fi

# Not cross-compiling by default
CROSS_TARGET="${CROSS_TARGET:-}"

# Essential default paths, many are overridden when executing under Cirrus-CI
# others are duplicated here, to assist in debugging.
GOPATH="${GOPATH:-/var/tmp/go}"
Expand Down
88 changes: 0 additions & 88 deletions contrib/cirrus/lib.sh.t

This file was deleted.

2 changes: 1 addition & 1 deletion contrib/cirrus/logcollector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ case $1 in
# Any not-present packages will be listed as such
$PKG_LST_CMD ${PKG_NAMES[@]} | sort -u
;;
*) die 1 "Warning, $(basename $0) doesn't know how to handle the parameter '$1'"
*) die "Warning, $(basename $0) doesn't know how to handle the parameter '$1'"
esac
21 changes: 9 additions & 12 deletions contrib/cirrus/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,14 @@ if [[ -z "$CONTAINER" ]]; then
warn "I/O scheduler: $(cat /sys/block/sda/queue/scheduler)"
fi

if [[ -z "$CROSS_TARGET" ]]
then
execute_local_registry # checks for existing port 5000 listener
execute_local_registry # checks for existing port 5000 listener

if [[ "$IN_PODMAN" == "true" ]]
then
req_env_vars IN_PODMAN_IMAGE IN_PODMAN_NAME
echo "Setting up image to use for \$IN_PODMAN=true testing"
cd $GOSRC
in_podman $IN_PODMAN_IMAGE $0
showrun podman commit $IN_PODMAN_NAME $IN_PODMAN_NAME
showrun podman rm -f $IN_PODMAN_NAME
fi
if [[ "$IN_PODMAN" == "true" ]]
then
req_env_vars IN_PODMAN_IMAGE IN_PODMAN_NAME
echo "Setting up image to use for \$IN_PODMAN=true testing"
cd $GOSRC
in_podman $IN_PODMAN_IMAGE $0
showrun podman commit $IN_PODMAN_NAME $IN_PODMAN_NAME
showrun podman rm -f $IN_PODMAN_NAME
fi
5 changes: 1 addition & 4 deletions contrib/cirrus/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ then
# Host build environment != container environment
showrun make clean
in_podman --rm $IN_PODMAN_NAME:latest $0 $1
elif [[ -z "$CROSS_TARGET" ]]
then
else
cd $GOSRC

showrun make
Expand Down Expand Up @@ -79,6 +78,4 @@ then
die "First parameter to $(basename $0) not supported: '$1'"
;;
esac
else
echo "Testing a cross-compiled $CROSS_TARGET target not possible on this platform"
fi

0 comments on commit 371e4ca

Please sign in to comment.