fix(build): Cross Build enviroment bug fixes (#264)

- Adding typecasting to make compilation work under MAC build environment

- Using go env variable instead of uname for determining platform

Signed-off-by: praveengt <praveen.gt@flipkart.com>
This commit is contained in:
praveengt 2020-12-21 11:52:36 +05:30 committed by GitHub
parent 2906d39d94
commit 0e3098920c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 15 deletions

View file

@ -66,13 +66,6 @@ if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
exit 1 exit 1
fi fi
if [ "$UNAME" = "Darwin" ] ; then
XC_OS="darwin"
elif [ "$UNAME" = "Linux" ] ; then
XC_OS="linux"
fi
if [ -z "${PNAME}" ]; if [ -z "${PNAME}" ];
then then
echo "Project name not defined" echo "Project name not defined"
@ -90,11 +83,8 @@ echo "==> Removing old directory..."
rm -rf bin/${PNAME}/* rm -rf bin/${PNAME}/*
mkdir -p bin/${PNAME}/ mkdir -p bin/${PNAME}/
# If its dev mode, only build for ourself XC_OS=$(go env GOOS)
if [[ "${DEV}" ]]; then XC_ARCH=$(go env GOARCH)
XC_OS=$(go env GOOS)
XC_ARCH=$(go env GOARCH)
fi
# Build! # Build!
echo "==> Building ${CTLNAME} using $(go version)... " echo "==> Building ${CTLNAME} using $(go version)... "

View file

@ -373,9 +373,9 @@ func (ns *node) NodeGetVolumeStats(
var usage []*csi.VolumeUsage var usage []*csi.VolumeUsage
usage = append(usage, &csi.VolumeUsage{ usage = append(usage, &csi.VolumeUsage{
Unit: csi.VolumeUsage_BYTES, Unit: csi.VolumeUsage_BYTES,
Total: int64(sfs.Blocks) * sfs.Bsize, Total: int64(sfs.Blocks) * int64(sfs.Bsize),
Used: int64(sfs.Blocks-sfs.Bfree) * sfs.Bsize, Used: int64(sfs.Blocks-sfs.Bfree) * int64(sfs.Bsize),
Available: int64(sfs.Bavail) * sfs.Bsize, Available: int64(sfs.Bavail) * int64(sfs.Bsize),
}) })
usage = append(usage, &csi.VolumeUsage{ usage = append(usage, &csi.VolumeUsage{
Unit: csi.VolumeUsage_INODES, Unit: csi.VolumeUsage_INODES,