Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRYPTO-172: Add support for Linux-riscv64 #264

Merged
merged 23 commits into from
Nov 4, 2023

Commits on Oct 30, 2023

  1. Add support for Linux-riscv64

    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
    luhenry committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    b2785f4 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2023

  1. Revert maven version bump

    luhenry committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    2a68c3e View commit details
    Browse the repository at this point in the history
  2. Add linux-riscv64 docker-based testing

    Run with docker compose -f src/docker/docker-compose.yaml run crypto-riscv64-test
    luhenry committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    e827a92 View commit details
    Browse the repository at this point in the history
  3. It's been tested on linux-riscv64

    ```
    $> 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] ------------------------------------------------------------------------
    ```
    luhenry committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    2fc4e2e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    736f5f6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    58ea881 View commit details
    Browse the repository at this point in the history
  6. Reduce verbosity

    luhenry committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    294977f View commit details
    Browse the repository at this point in the history
  7. Reduce verbosity even further

    luhenry committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    c2bdc6f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    930a836 View commit details
    Browse the repository at this point in the history
  9. Downgrade JNA version to 5.12

    JNA 5.13 on linux-riscv64 introduces dependency on GLIBC 2.34. It's been
    reported at java-native-access/jna#1557.
    luhenry committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    332fcac View commit details
    Browse the repository at this point in the history
  10. Fix bad package name

    luhenry committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    28c4884 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2023

  1. review

    luhenry committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    616e12b View commit details
    Browse the repository at this point in the history
  2. review

    luhenry committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    d0be99f View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2023

  1. Remove JNA version downgrade

    It's been fixed in JNA with java-native-access/jna#1558. Now we just need to wait for a release.
    luhenry committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    7c146c5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f087df9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    54bc9a8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    27b1197 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    57b2c97 View commit details
    Browse the repository at this point in the history
  6. review

    luhenry committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    9de357b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7db0236 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2023

  1. Fix indentation

    sebbASF authored Nov 3, 2023
    Configuration menu
    Copy the full SHA
    19644b6 View commit details
    Browse the repository at this point in the history
  2. Try again to insert a tab

    sebbASF authored Nov 3, 2023
    Configuration menu
    Copy the full SHA
    5e6ad7f View commit details
    Browse the repository at this point in the history
  3. Trim down aarch64 and riscv64 docker images to speed up CI

    It's now taking ~110s vs ~360s previously on my machine
    luhenry committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    4c69119 View commit details
    Browse the repository at this point in the history