Skip to content

Commit c1fc31f

Browse files
committed
Fix to comment out JAVA SHIM code for ppc64le arch
The JAVA SHIM is currently broken on architectures other than x86_64. Hence commenting it out as an interim fix. Also, using hyperledger/fabric-baseimage as base image for javaenv as it is generally applicacable to all platforms. Change-Id: If95385b790a6d874ff04480fbf713a5bd6d9ba1d Signed-off-by: Srirama Sharma <[email protected]>
1 parent e4a9b47 commit c1fc31f

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

core/chaincode/shim/java/javabuild.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@
1818
#
1919
set -e
2020
PARENTDIR=$(pwd)
21+
ARCH=`uname -m`
2122

22-
gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle clean
23-
gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle build
24-
cp -r ${PARENTDIR}/core/chaincode/shim/java/build/libs /root/
23+
if [ x$ARCH != xx86_64 ]
24+
then
25+
apt-get update && apt-get install openjdk-8-jdk -y
26+
echo "FIXME: Java Shim code needs work on ppc64le. Commenting it for now."
27+
else
28+
add-apt-repository ppa:openjdk-r/ppa -y
29+
apt-get update && apt-get install openjdk-8-jdk -y
30+
update-java-alternatives -s java-1.8.0-openjdk-amd64
31+
gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle clean
32+
gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle build
33+
cp -r ${PARENTDIR}/core/chaincode/shim/java/build/libs /root/
34+
fi

images/javaenv/Dockerfile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:8
1+
FROM hyperledger/fabric-baseimage
22
RUN wget https://services.gradle.org/distributions/gradle-2.12-bin.zip -P /tmp --quiet
33
RUN unzip -qo /tmp/gradle-2.12-bin.zip -d /opt && rm /tmp/gradle-2.12-bin.zip
44
RUN ln -s /opt/gradle-2.12/bin/gradle /usr/bin

scripts/goUnitTests.sh

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ GO_LDFLAGS=$2
77

88
BASEIMAGE="hyperledger/fabric-peer"
99
IMAGE=$BASEIMAGE
10+
ARCH=`uname -m`
1011

1112
if [ "$TAG" != "" ]
1213
then
@@ -25,6 +26,13 @@ PKGS=`go list github.com/hyperledger/fabric/... | grep -v /vendor/ | \
2526
grep -v /examples/chaincode/go/asset_management | \
2627
grep -v /examples/chaincode/go/utxo | \
2728
grep -v /examples/chaincode/go/rbac_tcerts_no_attrs`
29+
30+
if [ x$ARCH == xppc64le -o x$ARCH == xs390x ]
31+
then
32+
PKGS=`echo $PKGS | sed 's@'github.com/hyperledger/fabric/core/chaincode/platforms/java/test'@@g'`
33+
PKGS=`echo $PKGS | sed 's@'github.com/hyperledger/fabric/core/chaincode/platforms/java'@@g'`
34+
fi
35+
2836
echo "DONE!"
2937

3038
echo -n "Starting peer.."

scripts/provision/host.sh

+7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ apt-get install --yes tcl tclx tcllib
3939
apt-get install --yes npm
4040

4141
# Install JDK 1.8 for Java chaincode development
42+
ARCH=`uname -m`
43+
if [ x$ARCH == xx86_64 ]
44+
then
4245
add-apt-repository ppa:openjdk-r/ppa -y
46+
fi
4347
apt-get update && apt-get install openjdk-8-jdk -y
4448

4549
# Download Gradle and create sym link
@@ -54,5 +58,8 @@ curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache
5458
| tar -xzC /usr/share/maven --strip-components=1 \
5559
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
5660

61+
if [ x$ARCH == xx86_64 ]
62+
then
5763
# Set the default JDK to 1.8
5864
update-java-alternatives -s java-1.8.0-openjdk-amd64
65+
fi

0 commit comments

Comments
 (0)