errose28 commented on code in PR #154: URL: https://github.com/apache/ozone-site/pull/154#discussion_r2408755968
########## docs/08-developer-guide/01-build/01-maven.md: ########## @@ -45,6 +45,116 @@ Choose one of the following methods to get the source code: Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs. +### Additional Steps Required For ARM-based Apple Silicon Macs (M1, etc) + +If you are running on an ARM-based Apple Silicon Mac, please perform the additional steps in this section. + +#### Prerequisites + +- [Gradle](https://gradle.org/) - Gradle 7.0 or higher +- [Compatible JVM for gRPC Java v1.71.0](https://github.com/grpc/grpc-java/blob/v1.71.0/README.md) - Compatible JVM for gRPC and Gradle Review Comment: If I'm reading this correctly this is java 8 and higher? That requirement is already listed above. ########## docs/08-developer-guide/01-build/01-maven.md: ########## @@ -45,6 +45,116 @@ Choose one of the following methods to get the source code: Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs. +### Additional Steps Required For ARM-based Apple Silicon Macs (M1, etc) + +If you are running on an ARM-based Apple Silicon Mac, please perform the additional steps in this section. + +#### Prerequisites + +- [Gradle](https://gradle.org/) - Gradle 7.0 or higher +- [Compatible JVM for gRPC Java v1.71.0](https://github.com/grpc/grpc-java/blob/v1.71.0/README.md) - Compatible JVM for gRPC and Gradle + +#### Compile Protobuf version 3.7.1 for ARM-based Mac + +Execute the following commands to compile Protobuf version 3.7.1: + +```bash +PROTOBUF_VERSION="3.7.1" +curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz | tar zx +cd protobuf-${PROTOBUF_VERSION} +./configure --disable-shared +make -j +``` + +Execute the following command to install `protoc` version 3.7.1 to the local Maven repository: + +```bash +mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc +``` + +If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier: + +```bash +cp $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 +``` + +#### Compile and Patch Protobuf version 2.5.0 for ARM-based Mac + +Execute the following commands to compile and patch Protobuf version 2.5.0: + +```bash +cd .. +PROTOBUF_VERSION="2.5.0" +curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz | tar zx +cd protobuf-${PROTOBUF_VERSION} +curl -L -O https://gist.githubusercontent.com/liusheng/64aee1b27de037f8b9ccf1873b82c413/raw/118c2fce733a9a62a03281753572a45b6efb8639/protobuf-2.5.0-arm64.patch +patch -p1 < protobuf-2.5.0-arm64.patch +./configure --disable-shared +make +``` + +Execute the following command to install `protoc` version 2.5.0 to the local Maven repository: + +```bash +mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc +``` + +If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier: + +```bash +cp $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 +``` + +#### Compile Protobuf version 3.19.6 for ARM-based Mac + +Execute the following commands to compile Protobuf version 3.19.6: + +```bash +cd .. +PROTOBUF_VERSION="3.19.6" +curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz +tar xzf protobuf-all-${PROTOBUF_VERSION}.tar.gz +cd protobuf-${PROTOBUF_VERSION} +./configure --disable-shared +make -j +``` + +Execute the following command to install `protoc` version 3.19.6 to the local Maven repository: + +```bash +mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc +``` + +If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier: + +```bash +cp $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 +``` + +#### Compile gRPC version 1.71.0 for ARM-based Mac Review Comment: grpc-java has supported ARM since [1.43.0](https://github.com/grpc/grpc-java/releases/tag/v1.43.0). I don't think we need these steps anymore. ########## docs/08-developer-guide/01-build/01-maven.md: ########## @@ -45,6 +45,116 @@ Choose one of the following methods to get the source code: Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs. +### Additional Steps Required For ARM-based Apple Silicon Macs (M1, etc) + +If you are running on an ARM-based Apple Silicon Mac, please perform the additional steps in this section. + +#### Prerequisites + +- [Gradle](https://gradle.org/) - Gradle 7.0 or higher +- [Compatible JVM for gRPC Java v1.71.0](https://github.com/grpc/grpc-java/blob/v1.71.0/README.md) - Compatible JVM for gRPC and Gradle + +#### Compile Protobuf version 3.7.1 for ARM-based Mac + +Execute the following commands to compile Protobuf version 3.7.1: + +```bash +PROTOBUF_VERSION="3.7.1" +curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz | tar zx +cd protobuf-${PROTOBUF_VERSION} +./configure --disable-shared +make -j +``` + +Execute the following command to install `protoc` version 3.7.1 to the local Maven repository: + +```bash +mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc +``` + +If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier: + +```bash +cp $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 +``` + +#### Compile and Patch Protobuf version 2.5.0 for ARM-based Mac + +Execute the following commands to compile and patch Protobuf version 2.5.0: + +```bash +cd .. +PROTOBUF_VERSION="2.5.0" +curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz | tar zx +cd protobuf-${PROTOBUF_VERSION} +curl -L -O https://gist.githubusercontent.com/liusheng/64aee1b27de037f8b9ccf1873b82c413/raw/118c2fce733a9a62a03281753572a45b6efb8639/protobuf-2.5.0-arm64.patch Review Comment: I'm pretty sure I followed @smengcl [patch](https://gist.github.com/smengcl/6a269f44d909ef9245a9ad8c7c6d41e0#file-ozone-m1-md) to build proto 2.5 on arm, which could be included directly here since it is smaller than this linked patch file. It would be good not depend on links outside of Apache as part of our official documentation. Again, try this out locally to see if it works for you. ########## docs/08-developer-guide/01-build/01-maven.md: ########## @@ -45,6 +45,116 @@ Choose one of the following methods to get the source code: Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs. +### Additional Steps Required For ARM-based Apple Silicon Macs (M1, etc) + +If you are running on an ARM-based Apple Silicon Mac, please perform the additional steps in this section. + +#### Prerequisites + +- [Gradle](https://gradle.org/) - Gradle 7.0 or higher +- [Compatible JVM for gRPC Java v1.71.0](https://github.com/grpc/grpc-java/blob/v1.71.0/README.md) - Compatible JVM for gRPC and Gradle + +#### Compile Protobuf version 3.7.1 for ARM-based Mac + +Execute the following commands to compile Protobuf version 3.7.1: + +```bash +PROTOBUF_VERSION="3.7.1" +curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION}.tar.gz | tar zx +cd protobuf-${PROTOBUF_VERSION} +./configure --disable-shared +make -j +``` + +Execute the following command to install `protoc` version 3.7.1 to the local Maven repository: + +```bash +mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc +``` + +If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier: + +```bash +cp $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 +``` + +#### Compile and Patch Protobuf version 2.5.0 for ARM-based Mac + +Execute the following commands to compile and patch Protobuf version 2.5.0: + +```bash +cd .. +PROTOBUF_VERSION="2.5.0" +curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz | tar zx +cd protobuf-${PROTOBUF_VERSION} +curl -L -O https://gist.githubusercontent.com/liusheng/64aee1b27de037f8b9ccf1873b82c413/raw/118c2fce733a9a62a03281753572a45b6efb8639/protobuf-2.5.0-arm64.patch +patch -p1 < protobuf-2.5.0-arm64.patch +./configure --disable-shared +make +``` + +Execute the following command to install `protoc` version 2.5.0 to the local Maven repository: + +```bash +mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=${PROTOBUF_VERSION} -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=src/protoc +``` + +If you are running Maven 3.9.x or higher, execute the following command. This command is not needed for 3.8.x or earlier: + +```bash +cp $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 Review Comment: Is this supposed to be a `cp` or an `mv`? Do we need both files at the end of it? ########## docs/08-developer-guide/01-build/01-maven.md: ########## @@ -45,6 +45,116 @@ Choose one of the following methods to get the source code: Apache Ozone uses [Maven](https://maven.apache.org/) as its build system. The build process compiles the source code, runs tests, and creates deployable artifacts. The project supports various build configurations to accommodate different development and deployment needs. +### Additional Steps Required For ARM-based Apple Silicon Macs (M1, etc) + +If you are running on an ARM-based Apple Silicon Mac, please perform the additional steps in this section. + +#### Prerequisites + +- [Gradle](https://gradle.org/) - Gradle 7.0 or higher +- [Compatible JVM for gRPC Java v1.71.0](https://github.com/grpc/grpc-java/blob/v1.71.0/README.md) - Compatible JVM for gRPC and Gradle + +#### Compile Protobuf version 3.7.1 for ARM-based Mac Review Comment: Do we still need these steps for protobuf 3.x? According to [this](https://github.com/protocolbuffers/protobuf/issues/8695) it looks like protobuf 3.17.3 and above support arm out of the box. Hadoop 3 protobuf version was increased [beyond this](https://github.com/apache/ozone/blob/12a43fe212a6191bde7f95ce1855f9b49d4e32f5/pom.xml#L198) earlier this year and is no longer at 3.7.1. I think the only manual protobuf steps we need are for 2.5 in hadoop2, but double check on your machine by removing these artifacts and building. -- 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]
