errose28 commented on PR #154:
URL: https://github.com/apache/ozone-site/pull/154#issuecomment-3378410742
I tried this out from scratch and was able to build Ozone on my m1 macbook
by only patching protobuf 2.5. Here are the steps I followed:
- Rename my current `.m2` directory to `.m2.old` so it is not used
- Clone the apache Ozone repo fresh into a new directory with the latest
master branch checked out.
- Attempt to build: `mvn -DskipTests=true -Dmaven.javadoc.skip=true
--threads 2.0C clean package`
- Fails trying to get protobuf 2.5
- Do the following steps, which are a mix of @smengcl's older
[guide](https://gist.github.com/smengcl/6a269f44d909ef9245a9ad8c7c6d41e0#file-ozone-m1-md)
and the steps in this PR:
```
PROTOBUF_VERSION="2.5.0"
curl -LO
https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
tar xzf protobuf-2.5.0.tar.gz
cd protobuf-${PROTOBUF_VERSION}
vim src/google/protobuf/stubs/platform_macros.h
# Append the following after line 59:
#elif defined(__arm64__)
#define GOOGLE_PROTOBUF_ARCH_ARM 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
./configure --disable-shared
make -j
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc
-Dversion=2.5.0 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc
# It failed without the following command since I'm using Maven 3.9.1
mv
$HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64
$HOME/.m2/repository/com/google/protobuf/protoc/${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-aarch_64.exe
```
- Build again: `mvn -DskipTests=true -Dmaven.javadoc.skip=true --threads
2.0C clean package`
- This time success
@fmorg-git do you recall if you had to do any extra setup related to docker
images for running acceptance tests locally? In my local setup I had built an
arm version of the ozone-runner image since it used to be that one was not
available, but it looks like we have those on [docker
hub](https://hub.docker.com/r/apache/ozone-runner/tags) now.
Also, if proto 2.5 is the only thing requiring manual intervention, let's
add a note in these docs that it is for hadoop 2 support, in case people are
wondering why they need to deal with such an old version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]