You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "luhenry (via GitHub)" <gi...@apache.org> on 2023/10/30 10:26:36 UTC
[PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
luhenry opened a new pull request, #264:
URL: https://github.com/apache/commons-crypto/pull/264
Java supports RISC-V since version 19. Given Apache Common Crypto is a commonly used library in the Java ecosystem, it's important for it to support RISC-V as well.
This patch adds the linux-riscv64 target similarly to linux-aarch64.
I've verified it builds with `docker compose -f src/docker/docker-compose.yaml run crypto src/docker/build.sh`.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1787633288
> @sebbASF I've added testing on GitHub Actions for linux-aarch64 and linux-riscv64. You'll note I had to downgrade JNA to 5.12 because of [java-native-access/jna#1557](https://github.com/java-native-access/jna/issues/1557).
BTW: well done for finding out how to do that!
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1792630166
> Do we need the full JDK and the dev version of libssl?
I've trimmed it down to `openjdk-17-jre-headless` coming from ubuntu packages and not a specific PPA, but I needed to keep `libssl-dev` as `libssl1.1` only installs `libcrypto.so.1.1` while the native commons-crypto library links against `libcrypto.so`, leading to a linker issue.
Overall, it goes from ~360s to ~110s locally. Let's see how much faster it goes on GHA.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1787347518
@sebbASF I've added testing on GitHub Actions for linux-aarch64 and linux-riscv64. You'll note I had to downgrade JNA to 5.12 because of https://github.com/java-native-access/jna/issues/1557.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1380362846
##########
src/docker/Dockerfile:
##########
@@ -30,6 +30,8 @@ RUN apt-get update && apt-get --assume-yes install software-properties-common \
&& apt-get --assume-yes install libssl-dev \
&& apt-get --assume-yes install gcc-aarch64-linux-gnu \
&& apt-get --assume-yes install g++-aarch64-linux-gnu \
+ && apt-get --assume-yes install gcc-riscv64-linux-gnu \
+ && apt-get --assume-yes install g++-riscv64-linux-gnu \
Review Comment:
I thought riscv64 was built in one of the other Docker images, but I see now it is only for testing.
However it looks as though the native builds are run twice, once for each platform in the matrix.
Is that intended?
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1379858178
##########
pom.xml:
##########
@@ -206,6 +206,12 @@ The following provides more details on the included cryptographic software:
<target.name>linux-aarch64</target.name>
</properties>
</profile>
+ <profile>
+ <id>linux-riscv64</id>
+ <properties>
+ <target.name>linux-riscv64</target.name>
+ </properties>
+ </profile>
Review Comment:
To be 100% clear, it's not because we reference it here that JNA version 5.12.0 will be used either as a dependency to commons-crypto on linux-riscv64 only (given a single package is built and distributed, based on the linux-x86_64 build), either on CI or on anyone else's machine and deployment. Even if we add it here, and commons-crypto ships now with a dependency on 5.13.0, commons-crypto on linux-riscv64 will _not_ work out-of-the-box. We are doing all these 5.12.0 downgrade for CI purposes only. Luckily, that issue affects linux-riscv64 only and no other platform.
There are two possible fixes:
1. the proper one: JNA ships version 5.13.1 or 5.14.0 with the linux-riscv64 not depending on GLIBC 2.34, __and__ everyone depending on JNA (directly or transitively) upgrading to JNA 5.14.0+.
2. the workaround: anyone depending on commons-crypto manually cuts the commons-crypto -> JNA dependency and manually references JNA version 5.12.0 in their own pom.xml.
I expect the proper fix to be acceptable as things tend to converge long term, and anyone depending on JNA directly or transitively can easily override the version of JNA in their own pom.xml.
So once JNA 5.13.1 or 5.14.0 has shipped, we should remove that 5.12.0 downgrade for CI purposes, and to make sure commons-crypto keeps track of upstream JNA.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1787183598
I've added a docker container to run the test and ran it successfully:
```
$> docker compose -f src/docker/docker-compose.yaml run crypto-riscv64-test
WARN[0000] Found orphan containers ([docker-cross-compile-riscv64-build-run-397c7aebdada docker-cross-compile-riscv64-runtime-setup-1 docker-cross-compile-riscv64-build-run-93a982a05cdc docker-cross-compile-riscv64-build-run-7dc6a41f1d5b docker-cross-compile-riscv64-build-run-644e853cbf55 docker-cross-compile-riscv64-build-run-3b09454dc280]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 1/1
! crypto-riscv64-test Warning 2.0s
[+] Building 303.7s (9/9) FINISHED docker-container:festive_mccarthy
=> [crypto-riscv64-test internal] load build definition from Dockerfile.riscv64 0.0s
=> => transferring dockerfile: 1.97kB 0.0s
=> [crypto-riscv64-test internal] load metadata for docker.io/riscv64/ubuntu:20.04 0.7s
=> [crypto-riscv64-test internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [crypto-riscv64-test 1/4] FROM docker.io/riscv64/ubuntu:20.04@sha256:c0e96f609e5f128bdb6d24d21d3bf 0.0s
=> => resolve docker.io/riscv64/ubuntu:20.04@sha256:c0e96f609e5f128bdb6d24d21d3bf0a9af6f17234976fa574dad7146 0.0s
=> [crypto-riscv64-test 2/4] RUN apt-get update && apt-get --assume-yes install software-properties-common 274.2s
=> [crypto-riscv64-test 3/4] RUN curl -L https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven- 1.0s
=> [crypto-riscv64-test 4/4] WORKDIR /home/crypto 0.0s
=> [crypto-riscv64-test] exporting to docker image format 27.7s
=> => exporting layers 17.4s
=> => exporting manifest sha256:9068927ccfbc46788ec15578541ebc06302b538d4ed75e308b694e1132dd55fd 0.0s
=> => exporting config sha256:27adda314855e324670f04d2cc656b48c19879ccf16b9e4f32f32cd273bb3319 0.0s
=> => sending tarball 10.2s
=> [crypto-riscv64-test crypto-riscv64-test] importing to docker 9.1s
Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /opt/maven
Java version: 21-ea, vendor: Private Build, runtime: /usr/lib/jvm/java-21-openjdk-riscv64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.2.0-35-generic", arch: "riscv64", family: "unix"
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< org.apache.commons:commons-crypto >------------------
[INFO] Building Apache Commons Crypto 1.2.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-surefire-plugin:3.1.2:test (default-cli) @ commons-crypto ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.commons.crypto.CryptoTest
OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/commons-crypto-1e590661-aa26-4da1-b5c2-8d721ca08d18-libcommons-crypto.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.095 s -- in org.apache.commons.crypto.CryptoTest
[INFO] Running org.apache.commons.crypto.OsInfoTest
Linux/riscv64
Linux
riscv64
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.663 s -- in org.apache.commons.crypto.OsInfoTest
[INFO] Running org.apache.commons.crypto.utils.UtilsTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.159 s -- in org.apache.commons.crypto.utils.UtilsTest
[INFO] Running org.apache.commons.crypto.utils.EnumTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 s -- in org.apache.commons.crypto.utils.EnumTest
[INFO] Running org.apache.commons.crypto.jna.CtrCryptoJnaStreamTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.60 s -- in org.apache.commons.crypto.jna.CtrCryptoJnaStreamTest
[INFO] Running org.apache.commons.crypto.jna.CtrNoPaddingCipherJnaStreamTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.532 s -- in org.apache.commons.crypto.jna.CtrNoPaddingCipherJnaStreamTest
[INFO] Running org.apache.commons.crypto.jna.OpenSslJnaTest
Apache Commons Crypto OpenSslJna: enabled = true, version = 0x1010106F
OpenSSLVersion(0): OpenSSL 1.1.1f 31 Mar 2020
OpenSSLVersion(1): compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -fdebug-prefix-map=/build/openssl-zF9Nk8/openssl-1.1.1f=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
OpenSSLVersion(2): built on: Tue Oct 10 09:03:48 2023 UTC
OpenSSLVersion(3): platform: debian-riscv64
OpenSSLVersion(4): OPENSSLDIR: "/usr/lib/ssl"
OpenSSLVersion(5): ENGINESDIR: "/usr/lib/riscv64-linux-gnu/engines-1.1"
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.394 s -- in org.apache.commons.crypto.jna.OpenSslJnaTest
[INFO] Running org.apache.commons.crypto.jna.OpenSslJnaCipherTest
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.447 s -- in org.apache.commons.crypto.jna.OpenSslJnaCipherTest
[INFO] Running org.apache.commons.crypto.jna.CbcNoPaddingCipherJnaStreamTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.448 s -- in org.apache.commons.crypto.jna.CbcNoPaddingCipherJnaStreamTest
[INFO] Running org.apache.commons.crypto.jna.PositionedCryptoInputStreamJnaTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.210 s -- in org.apache.commons.crypto.jna.PositionedCryptoInputStreamJnaTest
[INFO] Running org.apache.commons.crypto.jna.OpenSslNativeJnaTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.300 s -- in org.apache.commons.crypto.jna.OpenSslNativeJnaTest
[INFO] Running org.apache.commons.crypto.jna.OpenSslJnaCryptoRandomTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.24 s -- in org.apache.commons.crypto.jna.OpenSslJnaCryptoRandomTest
[INFO] Running org.apache.commons.crypto.jna.CbcPkcs5PaddingCipherJnaStreamTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.609 s -- in org.apache.commons.crypto.jna.CbcPkcs5PaddingCipherJnaStreamTest
[INFO] Running org.apache.commons.crypto.cipher.CryptoCipherTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.328 s -- in org.apache.commons.crypto.cipher.CryptoCipherTest
[INFO] Running org.apache.commons.crypto.cipher.OpenSslCipherTest
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.684 s -- in org.apache.commons.crypto.cipher.OpenSslCipherTest
[INFO] Running org.apache.commons.crypto.cipher.CryptoCipherFactoryTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 s -- in org.apache.commons.crypto.cipher.CryptoCipherFactoryTest
[INFO] Running org.apache.commons.crypto.cipher.OpenSslCommonModeTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 s -- in org.apache.commons.crypto.cipher.OpenSslCommonModeTest
[INFO] Running org.apache.commons.crypto.cipher.GcmCipherTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.431 s -- in org.apache.commons.crypto.cipher.GcmCipherTest
[INFO] Running org.apache.commons.crypto.cipher.JceCipherTest
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.126 s -- in org.apache.commons.crypto.cipher.JceCipherTest
[INFO] Running org.apache.commons.crypto.stream.CbcPkcs5PaddingCipherStreamTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.579 s -- in org.apache.commons.crypto.stream.CbcPkcs5PaddingCipherStreamTest
[INFO] Running org.apache.commons.crypto.stream.output.StreamOutputTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.037 s -- in org.apache.commons.crypto.stream.output.StreamOutputTest
[INFO] Running org.apache.commons.crypto.stream.CbcNoPaddingCipherStreamTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.528 s -- in org.apache.commons.crypto.stream.CbcNoPaddingCipherStreamTest
[INFO] Running org.apache.commons.crypto.stream.input.ChannelInputTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s -- in org.apache.commons.crypto.stream.input.ChannelInputTest
[INFO] Running org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.747 s -- in org.apache.commons.crypto.stream.PositionedCryptoInputStreamTest
[INFO] Running org.apache.commons.crypto.stream.CtrNoPaddingCipherStreamTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.471 s -- in org.apache.commons.crypto.stream.CtrNoPaddingCipherStreamTest
[INFO] Running org.apache.commons.crypto.stream.CtrCryptoStreamTest
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.703 s -- in org.apache.commons.crypto.stream.CtrCryptoStreamTest
[INFO] Running org.apache.commons.crypto.random.OpenSslCryptoRandomTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.651 s -- in org.apache.commons.crypto.random.OpenSslCryptoRandomTest
[INFO] Running org.apache.commons.crypto.random.CryptoRandomFactoryTest
[INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.530 s -- in org.apache.commons.crypto.random.CryptoRandomFactoryTest
[INFO] Running org.apache.commons.crypto.random.JavaCryptoRandomTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 19.79 s -- in org.apache.commons.crypto.random.JavaCryptoRandomTest
[INFO] Running org.apache.commons.crypto.random.OsCryptoRandomTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.594 s -- in org.apache.commons.crypto.random.OsCryptoRandomTest
[INFO] Running org.apache.commons.crypto.NativeCodeLoaderTest
[WARNING] Tests run: 5, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 1.206 s -- in org.apache.commons.crypto.NativeCodeLoaderTest
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 141, Failures: 0, Errors: 0, Skipped: 3
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:18 min
[INFO] Finished at: 2023-10-31T13:04:26Z
[INFO] ------------------------------------------------------------------------
```
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1790931832
> The cross-builds now seem to be working, though they do take a long time.
> Are they doing more than they need?
The step that takes the longest is setting up the java and openssl packages on the aarch64/riscv64 docker images. (ex: https://github.com/apache/commons-crypto/actions/runs/6733654561/job/18304390181#step:4:6004, 6 out of 10 minutes just on that step). This docker image _could_ be cached by pushing it to the repo's docker repository. I've seen that done as part of https://github.com/uraimo/run-on-arch-action.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1377888434
##########
src/docker/Dockerfile:
##########
@@ -23,30 +23,32 @@ ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ENV MAVEN_HOME=/opt/maven
ENV PATH=${MAVEN_HOME}/bin:${PATH}
# Install 64-bit dependencies and tooling.
-RUN apt-get update && apt-get --assume-yes install software-properties-common \
+RUN apt-get update && apt-get -y -qq install software-properties-common \
&& add-apt-repository ppa:openjdk-r/ppa && apt-get update \
- && apt-get --assume-yes install openjdk-8-jdk \
- && apt-get --assume-yes install build-essential \
- && apt-get --assume-yes install libssl-dev \
- && apt-get --assume-yes install gcc-aarch64-linux-gnu \
- && apt-get --assume-yes install g++-aarch64-linux-gnu \
- && apt-get --assume-yes install mingw-w64 \
- && apt-get --assume-yes install wget \
- && apt-get --assume-yes install dos2unix \
+ && apt-get -y -qq install openjdk-8-jdk \
+ build-essential \
+ libssl-dev \
+ gcc-aarch64-linux-gnu \
+ g++-aarch64-linux-gnu \
+ gcc-riscv64-linux-gnu \
+ g++-riscv64-linux-gnu \
+ mingw-w64 \
+ curl \
+ dos2unix \
# Bug workaround see https://github.com/docker-library/openjdk/issues/19.
&& /var/lib/dpkg/info/ca-certificates-java.postinst configure
# Install 32-bit dependencies and tooling.
RUN dpkg --add-architecture i386 && apt-get update \
- && apt-get --assume-yes install libssl-dev:i386 \
- && apt-get --assume-yes install gcc-arm-linux-gnueabi \
- && apt-get --assume-yes install g++-arm-linux-gnueabi \
- && apt-get --assume-yes install gcc-arm-linux-gnueabihf \
- && apt-get --assume-yes install g++-arm-linux-gnueabihf
+ && apt-get -y -qq install libssl-dev:i386 \
+ gcc-arm-linux-gnueabi \
+ g++-arm-linux-gnueabi \
+ gcc-arm-linux-gnueabihf \
+ g++-arm-linux-gnueabihf
# Do this separately to make upgrades easier
-RUN wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \
-&& tar xf apache-maven-*.tar.gz -C /opt && ln -s /opt/apache-maven-3.8.8 /opt/maven
+RUN curl -L https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \
+ | tar xzf - -C /opt && ln -s /opt/apache-maven-3.8.8 /opt/maven
Review Comment:
Please don't make unrelated changes to the Dockerfile. It makes it very hard to see what has actually changed.
##########
pom.xml:
##########
@@ -133,7 +133,7 @@ The following provides more details on the included cryptographic software:
<japicmp.skip>false</japicmp.skip>
<commons.release.isDistModule>true</commons.release.isDistModule>
- <jna.version>5.13.0</jna.version>
+ <jna.version>5.12.0</jna.version>
Review Comment:
This should be done by overriding jna.version on the Maven command line.
##########
src/site/xdoc/index.xml:
##########
@@ -84,6 +84,7 @@ limitations under the License.
<li>debian-amd64; OpenSSL 1.1.1g</li>
<li>debian-arm64; OpenSSL 1.1.1f</li>
<li>linux-aarch64; OpenSSL 1.0.2k-fips</li>
+ <li>linux-riscv64; OpenSSL 1.1.1f</li>
Review Comment:
That section is for version 1.1.0; please remove this change.
##########
src/docker/Dockerfile.riscv64:
##########
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file creates a Docker image for use in building various native binaries
+# for Linux 64-bit and 32-bit, and Windows 64-bit and 32-bit.
+# See the README for further details.
Review Comment:
Is this Docker file referenced in the README?
##########
src/docker/Dockerfile.aarch64:
##########
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file creates a Docker image for use in building various native binaries
+# for Linux 64-bit and 32-bit, and Windows 64-bit and 32-bit.
+# See the README for further details.
Review Comment:
Is this Docker file referenced in the README?
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1379990998
##########
.github/workflows/maven.yml:
##########
@@ -136,3 +136,24 @@ jobs:
OPENSSL_HOME: "C:\\Miniconda\\Library"
run: |
mvn --show-version --batch-mode --no-transfer-progress clean test-compile -Pbenchmark
+
+ build-cross:
+ strategy:
+ matrix:
+ include:
+ - platform: aarch64
+ - platform: riscv64
+ build_params: "-Djna.version=5.12.0" # See https://github.com/java-native-access/jna/issues/1557
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ persist-credentials: false
+ - uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
+ with:
+ platforms: ${{ matrix.platform }}
+ - run: |
+ # Build package
+ docker compose -f src/docker/docker-compose.yaml run crypto src/docker/build.sh ${{ matrix.build_params }}
+ # Run on platform
+ docker compose -f src/docker/docker-compose.yaml run crypto-${{ matrix.platform }}-test
Review Comment:
I think you need the jna.version override here as well (or maybe instead of the build step)
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1380295199
##########
src/docker/docker-compose.yaml:
##########
@@ -17,8 +17,41 @@ version: '3'
services:
crypto:
image: commons-crypto
- build: .
+ build:
+ context: .
+ dockerfile: Dockerfile
# mount the source and Maven repo
volumes:
- ../..:/home/crypto
- ~/.m2/repository:/root/.m2/repository
+
+ crypto-aarch64: &crypto-aarch64
+ image: commons-crypto:aarch64
+ platform: linux/arm64/v8
+ build:
+ context: .
+ dockerfile: Dockerfile.aarch64
+ # mount the source and Maven repo
+ volumes:
+ - ../..:/home/crypto
+ - ~/.m2/repository:/root/.m2/repository
+
+ crypto-aarch64-test:
+ <<: *crypto-aarch64
+ command: bash -xc "mvn -V -B -ntp surefire:test"
+
+ crypto-riscv64: &crypto-riscv64
+ image: commons-crypto:riscv64
+ platform: linux/riscv64
+ build:
+ context: .
+ dockerfile: Dockerfile.riscv64
+ # mount the source and Maven repo
+ volumes:
+ - ../..:/home/crypto
+ - ~/.m2/repository:/root/.m2/repository
+
+ crypto-riscv64-test:
Review Comment:
Is this still used?
##########
src/docker/docker-compose.yaml:
##########
@@ -17,8 +17,41 @@ version: '3'
services:
crypto:
image: commons-crypto
- build: .
+ build:
+ context: .
+ dockerfile: Dockerfile
# mount the source and Maven repo
volumes:
- ../..:/home/crypto
- ~/.m2/repository:/root/.m2/repository
+
+ crypto-aarch64: &crypto-aarch64
+ image: commons-crypto:aarch64
+ platform: linux/arm64/v8
+ build:
+ context: .
+ dockerfile: Dockerfile.aarch64
+ # mount the source and Maven repo
+ volumes:
+ - ../..:/home/crypto
+ - ~/.m2/repository:/root/.m2/repository
+
+ crypto-aarch64-test:
+ <<: *crypto-aarch64
+ command: bash -xc "mvn -V -B -ntp surefire:test"
Review Comment:
Is this still used?
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1787383324
I would not rollback JNA for ALL configurations just because one has special requirements, just downgrade in that case.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1787396628
> I would not rollback JNA for ALL configurations just because one has special requirements, just downgrade in that case.
It's a build-time dependency with the commons-crypto being the same across all platforms. I'm afraid there is not an easy way to specify per-arch dependency in that case. I'll keep monitoring the JNA linux-riscv64 issue and update anything here whenever there is an update (that we merge this PR with the downgrade, or that we wait to merge that PR)
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1793411674
@sebbASF Thank you for the review and continuous feedback as well! :)
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1380330598
##########
src/docker/Dockerfile:
##########
@@ -30,6 +30,8 @@ RUN apt-get update && apt-get --assume-yes install software-properties-common \
&& apt-get --assume-yes install libssl-dev \
&& apt-get --assume-yes install gcc-aarch64-linux-gnu \
&& apt-get --assume-yes install g++-aarch64-linux-gnu \
+ && apt-get --assume-yes install gcc-riscv64-linux-gnu \
+ && apt-get --assume-yes install g++-riscv64-linux-gnu \
Review Comment:
Is this needed, given that riscv64 is cross-built in a separate image?
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1379858178
##########
pom.xml:
##########
@@ -206,6 +206,12 @@ The following provides more details on the included cryptographic software:
<target.name>linux-aarch64</target.name>
</properties>
</profile>
+ <profile>
+ <id>linux-riscv64</id>
+ <properties>
+ <target.name>linux-riscv64</target.name>
+ </properties>
+ </profile>
Review Comment:
To be 100% clear, it's not because we reference it here that JNA version 5.12.0 will be used either as a dependency to commons-crypto on linux-riscv64 only (given a single package is built and distributed, based on the linux-x86_64 build), either on CI or on anyone else's machine and deployment. Even if we add it here, and commons-crypto ships now with a dependency on 5.13.0, commons-crypto on linux-riscv64 will _not_ work out-of-the-box. We are doing all these 5.12.0 downgrade for CI purposes only. Luckily, that issue affects linux-riscv64 only and no other platform.
There are two possible fixes:
1. the proper one: JNA ships version 5.13.1 or 5.14.0 with the linux-riscv64 not depending on GLIBC 2.34. __And__ everyone depending on JNA (directly or transitively) upgrading to JNA 5.14.0+.
2. the workaround: anyone depending on commons-crypto manually cuts the commons-crypto -> JNA dependency and manually references JNA version 5.12.0 in their won pom.xml.
I expect the proper fix to be acceptable as things tend to converge long term, and anyone depending on JNA directly or transitively can easily override the version of JNA in their own pom.xml.
So once JNA 5.13.1 or 5.14.0 has shipped, we should remove that 5.12.0 downgrade for CI purposes, and to make sure commons-crypto keeps track of upstream JNA.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1790910852
The cross-builds now seem to be working, though they do take a long time.
Are they doing more than they need?
Also it looks like they don't only build the native files for their own architectures.
They probably need their own build.sh files, or build.sh needs a parameter to control which native files are built
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1787652460
## [Codecov](https://app.codecov.io/gh/apache/commons-crypto/pull/264?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#264](https://app.codecov.io/gh/apache/commons-crypto/pull/264?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (28c4884) into [master](https://app.codecov.io/gh/apache/commons-crypto/commit/32f9e1847717d94567d6f56ae7ca2ee2df57a403?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (32f9e18) will **not change** coverage.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #264 +/- ##
=========================================
Coverage 74.80% 74.80%
Complexity 438 438
=========================================
Files 38 38
Lines 1818 1818
Branches 178 178
=========================================
Hits 1360 1360
Misses 348 348
Partials 110 110
```
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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: notifications-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1378512829
##########
src/docker/build.sh:
##########
@@ -25,10 +25,11 @@ cd /home/crypto # must agree with virtual mount in docker-compose.yaml
cp /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl
# Run the 64-bit builds.
-mvn -V package -Drat.skip
+mvn -V -B -ntp clean package -Drat.skip -Djna.version=5.12.0
Review Comment:
The override should only be done for the riscv64 build.
Also the unconditional override must be reverted.
Might be better to include the override in the linux-riscv64 profile.
Wherever it is done, there needs to be a comment as to why it is needed.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1379858178
##########
pom.xml:
##########
@@ -206,6 +206,12 @@ The following provides more details on the included cryptographic software:
<target.name>linux-aarch64</target.name>
</properties>
</profile>
+ <profile>
+ <id>linux-riscv64</id>
+ <properties>
+ <target.name>linux-riscv64</target.name>
+ </properties>
+ </profile>
Review Comment:
To be 100% clear, it's not because we reference it here that JNA version 5.12.0 will be used either as a dependency to commons-crypto on linux-riscv64 only (given a single package is built and distributed, based on the linux-x86_64 build), either on CI or on anyone else's machine and deployment. Even if we add it here, and commons-crypto ships now with a dependency on 5.13.0, commons-crypto on linux-riscv64 will _not_ work out-of-the-box. We are doing all these 5.12.0 downgrade for CI purposes only. Luckily, that issue affects linux-riscv64 only and no other platform.
There are two possible fixes:
1. the proper one: JNA ships version 5.13.1 or 5.14.0 with the linux-riscv64 not depending on GLIBC 2.34, __and__ everyone depending on JNA (directly or transitively) upgrading to JNA 5.14.0+.
2. the workaround: anyone depending on commons-crypto manually cuts the commons-crypto -> JNA dependency and manually references JNA version 5.12.0 in their won pom.xml.
I expect the proper fix to be acceptable as things tend to converge long term, and anyone depending on JNA directly or transitively can easily override the version of JNA in their own pom.xml.
So once JNA 5.13.1 or 5.14.0 has shipped, we should remove that 5.12.0 downgrade for CI purposes, and to make sure commons-crypto keeps track of upstream JNA.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1793410602
Thanks for your patience dedication getting this together!
Any further tweaks can be made in the main repo
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1379823206
##########
pom.xml:
##########
@@ -206,6 +206,12 @@ The following provides more details on the included cryptographic software:
<target.name>linux-aarch64</target.name>
</properties>
</profile>
+ <profile>
+ <id>linux-riscv64</id>
+ <properties>
+ <target.name>linux-riscv64</target.name>
+ </properties>
+ </profile>
Review Comment:
I think this now needs to override the jna.version property.
Please add a note as to why it is needed
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1381806066
##########
src/docker/Dockerfile:
##########
@@ -30,6 +30,8 @@ RUN apt-get update && apt-get --assume-yes install software-properties-common \
&& apt-get --assume-yes install libssl-dev \
&& apt-get --assume-yes install gcc-aarch64-linux-gnu \
&& apt-get --assume-yes install g++-aarch64-linux-gnu \
+ && apt-get --assume-yes install gcc-riscv64-linux-gnu \
+ && apt-get --assume-yes install g++-riscv64-linux-gnu \
Review Comment:
That's just to simplify the build, and the time gained would be minimal anyway.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1379884627
##########
pom.xml:
##########
@@ -206,6 +206,12 @@ The following provides more details on the included cryptographic software:
<target.name>linux-aarch64</target.name>
</properties>
</profile>
+ <profile>
+ <id>linux-riscv64</id>
+ <properties>
+ <target.name>linux-riscv64</target.name>
+ </properties>
+ </profile>
Review Comment:
To demonstrate that, an example to highlight the difference.
1. You build normally on a linux-x86_64 machine, and referencing JNA version 5.13.0
```
$> docker compose -f src/docker/docker-compose.yaml run crypto src/docker/build.sh
```
2. If you try running the tests normally, it will fail:
```
$> docker compose -f src/docker/docker-compose.yaml run crypto-riscv64 mvn -V -B -ntp surefire:test
[...]
[ERROR] org.apache.commons.crypto.jna.CbcNoPaddingCipherJnaStreamTest.testReadWrite -- Time elapsed: 0.022 s <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.crypto.jna.OpenSslNativeJna
at org.apache.commons.crypto.jna.OpenSslJna.isEnabled(OpenSslJna.java:89)
at org.apache.commons.crypto.jna.AbstractCipherJnaStreamTest.init(AbstractCipherJnaStreamTest.java:37)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /root/.cache/JNA/temp/jna6069377359221932581.tmp: /lib/riscv64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /root/.cache/JNA/temp/jna6069377359221932581.tmp) [in thread "main"]
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2418)
at java.base/java.lang.Runtime.load0(Runtime.java:852)
at java.base/java.lang.System.load(System.java:2021)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1045)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015)
at com.sun.jna.Native.<clinit>(Native.java:221)
at com.sun.jna.NativeLibrary.<clinit>(NativeLibrary.java:90)
at org.apache.commons.crypto.jna.OpenSslNativeJna.<clinit>(OpenSslNativeJna.java:59)
... 5 more
```
3. But if you override the JNA version (even though it doesn't rebuild! it's only a run-time dependency), it succeeds:
```
$> docker compose -f src/docker/docker-compose.yaml run crypto-riscv64 mvn -V -B -ntp surefire:test -Djna.version=5.12.0
```
`surefire:test` doesn't rebuild anything, and only makes sure that the right packages are on the CLASSPATH.
That can be reproduced by any user of commons-crypto by specifying a newer version of JNA directly. That would obviously be useful _only_ for the linux-riscv64 case, every other platforms "just works" because they don't have that issue.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1785402540
I don't know, that's why I asked. I assume there is some GH documentation on which architectures are available.
If risc64 is not available as a test host, then this needs to be documented, as it means the combination has not been tested.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1785382208
@sebbASF I couldn't find how the test is run on linux-aarch64. Where could I find it?
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1376342977
##########
src/docker/Dockerfile:
##########
@@ -45,8 +47,8 @@ RUN dpkg --add-architecture i386 && apt-get update \
&& apt-get --assume-yes install g++-arm-linux-gnueabihf
# Do this separately to make upgrades easier
-RUN wget https://dlcdn.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz \
-&& tar xf apache-maven-*.tar.gz -C /opt && ln -s /opt/apache-maven-3.8.7 /opt/maven
+RUN wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \
+&& tar xf apache-maven-*.tar.gz -C /opt && ln -s /opt/apache-maven-3.8.8 /opt/maven
Review Comment:
This change does not seem to be related to the PR.
Please raise a separate PR for such changes.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#issuecomment-1791005969
> > The cross-builds now seem to be working, though they do take a long time.
> > Are they doing more than they need?
>
> The step that takes the longest is setting up the java and openssl packages on the aarch64/riscv64 docker images. (ex: https://github.com/apache/commons-crypto/actions/runs/6733654561/job/18304390181#step:4:6004, 6 out of 10 minutes just on that step). This docker image _could_ be cached by pushing it to the repo's docker repository. I've seen that done as part of https://github.com/uraimo/run-on-arch-action.
Do we need the full JDK and the dev version of libssl?
Installing only the JVM and standard libssl might speed things up.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF merged PR #264:
URL: https://github.com/apache/commons-crypto/pull/264
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1380194244
##########
.github/workflows/maven.yml:
##########
@@ -136,3 +136,24 @@ jobs:
OPENSSL_HOME: "C:\\Miniconda\\Library"
run: |
mvn --show-version --batch-mode --no-transfer-progress clean test-compile -Pbenchmark
+
+ build-cross:
+ strategy:
+ matrix:
+ include:
+ - platform: aarch64
+ - platform: riscv64
+ build_params: "-Djna.version=5.12.0" # See https://github.com/java-native-access/jna/issues/1557
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ persist-credentials: false
+ - uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
+ with:
+ platforms: ${{ matrix.platform }}
+ - run: |
+ # Build package
+ docker compose -f src/docker/docker-compose.yaml run crypto src/docker/build.sh ${{ matrix.build_params }}
+ # Run on platform
+ docker compose -f src/docker/docker-compose.yaml run crypto-${{ matrix.platform }}-test
Review Comment:
I put it here _instead_ of the build step. I also left a comment at https://github.com/apache/commons-crypto/pull/264/commits/27b1197ffc44bbc03c2dc605f423c54de5e1885e#diff-5dbf1a803ecc13ff945a08ed3eb09149a83615e83f15320550af8e3a91976446R146 to link back to why the override.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CRYPTO-172: Add support for Linux-riscv64 [commons-crypto]
Posted by "luhenry (via GitHub)" <gi...@apache.org>.
luhenry commented on code in PR #264:
URL: https://github.com/apache/commons-crypto/pull/264#discussion_r1380335281
##########
src/docker/Dockerfile:
##########
@@ -30,6 +30,8 @@ RUN apt-get update && apt-get --assume-yes install software-properties-common \
&& apt-get --assume-yes install libssl-dev \
&& apt-get --assume-yes install gcc-aarch64-linux-gnu \
&& apt-get --assume-yes install g++-aarch64-linux-gnu \
+ && apt-get --assume-yes install gcc-riscv64-linux-gnu \
+ && apt-get --assume-yes install g++-riscv64-linux-gnu \
Review Comment:
This Dockerfile is referenced by [`src/docker/docker-compose.yaml`](https://github.com/apache/commons-crypto/pull/264/files#diff-a24c82f935acd3ecf6920e0147bd0f8d171c10687789ed202ef960063c52c2fb), and CI uses that `src/docker/docker-compose.yaml` to run [`src/docker/build.sh`](https://github.com/apache/commons-crypto/pull/264/files#diff-810d630fb6f62bdcc13127f70e147a23857dbeaf1daa6552173279939e4bd57d), which itself is going to call `mvn package` which triggers the cross-compilation for all targets. `gcc-riscv64-linux-gnu` and `g++-riscv64-linux-gnu` is thus required to be in this Dockerfile, or it will be missing when building the package on CI.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org