From e0cea5bf660e5b684bf099598e7cf321fb8d84c5 Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 10:33:25 -0500 Subject: [PATCH 1/8] Update rust compiler version in CI --- .github/workflows/build.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b17c483d..bcb4329f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: - name: Install Rust old stable with incremental compilation uses: actions-rs/toolchain@v1 with: - toolchain: 1.66.0 + toolchain: 1.67.0 profile: minimal default: true diff --git a/README.md b/README.md index 9197fbc2..55f6879c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![](https://img.shields.io/github/workflow/status/spruceid/didkit/ci)](https://github.com/spruceid/didkit/actions?query=workflow%3Aci+branch%3Amain) [![](https://img.shields.io/badge/Docker-19.03.x-blue)](https://www.docker.com/) [![](https://img.shields.io/badge/Rust-v1.51.0-orange)](https://www.rust-lang.org/) [![](https://img.shields.io/badge/ssi-v0.1-green)](https://www.github.com/spruceid/ssi) [![](https://img.shields.io/badge/License-Apache--2.0-green)](https://github.com/spruceid/didkit/blob/main/LICENSE) [![](https://img.shields.io/twitter/follow/spruceid?label=Follow&style=social)](https://twitter.com/spruceid) +[![](https://img.shields.io/github/workflow/status/spruceid/didkit/ci)](https://github.com/spruceid/didkit/actions?query=workflow%3Aci+branch%3Amain) [![](https://img.shields.io/badge/Docker-19.03.x-blue)](https://www.docker.com/) [![](https://img.shields.io/badge/ssi-v0.1-green)](https://www.github.com/spruceid/ssi) [![](https://img.shields.io/badge/License-Apache--2.0-green)](https://github.com/spruceid/didkit/blob/main/LICENSE) [![](https://img.shields.io/twitter/follow/spruceid?label=Follow&style=social)](https://twitter.com/spruceid) Check out the DIDKit documentation [here](https://spruceid.dev/didkit/didkit/). From 34b31b55fa457cf9f9243019af0716630c4987ac Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 10:46:41 -0500 Subject: [PATCH 2/8] Update CI rust version to 1.70 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcb4329f..cad6baba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: - name: Install Rust old stable with incremental compilation uses: actions-rs/toolchain@v1 with: - toolchain: 1.67.0 + toolchain: 1.70.0 profile: minimal default: true From f2e86f0fbe2ef6f1abcd11a3cdabebe85f86afa0 Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 11:02:09 -0500 Subject: [PATCH 3/8] Update now_ms to now_ns because of SSI update --- http/src/credentials.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/src/credentials.rs b/http/src/credentials.rs index b163e6ef..f05009c3 100644 --- a/http/src/credentials.rs +++ b/http/src/credentials.rs @@ -1,7 +1,7 @@ use anyhow::Context; use axum::{http::StatusCode, Extension, Json}; use didkit::{ - ssi::ldp::{now_ms, Error as LdpError}, + ssi::ldp::{now_ns, Error as LdpError}, ContextLoader, CredentialOrJWT, JWTOrLDPOptions, ProofFormat, VerifiableCredential, VerificationResult, DID_METHODS, }; @@ -42,7 +42,7 @@ pub async fn issue( None => return Err((StatusCode::NOT_FOUND, "Missing key".to_string()).into()), }; if credential.issuance_date.is_none() { - credential.issuance_date = Some(now_ms().into()); + credential.issuance_date = Some(now_ns().into()); } if let Err(e) = credential.validate_unsigned() { return Err((StatusCode::BAD_REQUEST, e.to_string()).into()); From 7b1d00efda14910a347d223d5df300a586341667 Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 11:43:39 -0500 Subject: [PATCH 4/8] Updated Android build tools --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cad6baba..680ee2f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,7 +117,7 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v2 - name: Install NDK - run: sdkmanager --install "build-tools;29.0.3" "ndk;22.0.7026061" "cmdline-tools;latest" + run: sdkmanager --install "build-tools;33.0.2" "ndk;25.2.9519653" "cmdline-tools;latest" - name: Install gcc-multilib run: | sudo apt update From 6911fda928d1f368a74f0431d7142dc4cc638f92 Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 12:12:56 -0500 Subject: [PATCH 5/8] Updated CI command to use new NDK version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 680ee2f3..454e4c1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,7 @@ jobs: sudo apt update sudo apt install gcc-multilib -y - name: Build Android Archive - run: AR_i686_linux_android=$ANDROID_SDK_ROOT/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android/bin/ar PATH=$ANDROID_SDK_ROOT/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android + run: AR_i686_linux_android=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android/bin/ar PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android test_http: runs-on: ubuntu-latest From 297b49ac0c9b907339007db05f9a185c36a5f36b Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 13:00:01 -0500 Subject: [PATCH 6/8] Removed AR environment var, it seems it may not be used anymore --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 454e4c1d..730e0a53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,8 @@ jobs: sudo apt update sudo apt install gcc-multilib -y - name: Build Android Archive - run: AR_i686_linux_android=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android/bin/ar PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android +# run: AR_i686_linux_android=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android/bin/llvm-ar PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android + run: PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android test_http: runs-on: ubuntu-latest From 38c7d068eed7a3c446b1582bd20d663f4237256f Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 14:35:53 -0500 Subject: [PATCH 7/8] Updated the build environment for android to use current tooling recomendations --- .cargo/config | 4 ++-- .github/workflows/build.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.cargo/config b/.cargo/config index 8f2b0338..8fb9b987 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,8 +1,8 @@ [target.i686-linux-android] -linker = "i686-linux-android16-clang" +linker = "i686-linux-android19-clang" [target.armv7-linux-androideabi] -linker = "armv7a-linux-androideabi16-clang" +linker = "armv7a-linux-androideabi19-clang" [target.aarch64-linux-android] linker = "aarch64-linux-android21-clang" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 730e0a53..e2328bf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,8 +123,7 @@ jobs: sudo apt update sudo apt install gcc-multilib -y - name: Build Android Archive -# run: AR_i686_linux_android=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android/bin/llvm-ar PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android - run: PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android + run: AR=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar RANLIB=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib TARGET_CC=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android19-clang PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH cargo build --lib --target i686-linux-android test_http: runs-on: ubuntu-latest From b6bc05719dc0a8564940dd81616bd2b6e9605ab7 Mon Sep 17 00:00:00 2001 From: Charles Shuller Date: Fri, 20 Oct 2023 10:33:25 -0500 Subject: [PATCH 8/8] Update rust compiler versions in CI --- .cargo/config | 4 ++-- .github/workflows/build.yml | 6 +++--- README.md | 2 +- http/src/credentials.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.cargo/config b/.cargo/config index 8f2b0338..8fb9b987 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,8 +1,8 @@ [target.i686-linux-android] -linker = "i686-linux-android16-clang" +linker = "i686-linux-android19-clang" [target.armv7-linux-androideabi] -linker = "armv7a-linux-androideabi16-clang" +linker = "armv7a-linux-androideabi19-clang" [target.aarch64-linux-android] linker = "aarch64-linux-android21-clang" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b17c483d..e2328bf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: - name: Install Rust old stable with incremental compilation uses: actions-rs/toolchain@v1 with: - toolchain: 1.66.0 + toolchain: 1.70.0 profile: minimal default: true @@ -117,13 +117,13 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v2 - name: Install NDK - run: sdkmanager --install "build-tools;29.0.3" "ndk;22.0.7026061" "cmdline-tools;latest" + run: sdkmanager --install "build-tools;33.0.2" "ndk;25.2.9519653" "cmdline-tools;latest" - name: Install gcc-multilib run: | sudo apt update sudo apt install gcc-multilib -y - name: Build Android Archive - run: AR_i686_linux_android=$ANDROID_SDK_ROOT/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android/bin/ar PATH=$ANDROID_SDK_ROOT/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH TARGET_CC=$(which clang) cargo build --lib --target i686-linux-android + run: AR=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar RANLIB=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib TARGET_CC=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android19-clang PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH cargo build --lib --target i686-linux-android test_http: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 9197fbc2..55f6879c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![](https://img.shields.io/github/workflow/status/spruceid/didkit/ci)](https://github.com/spruceid/didkit/actions?query=workflow%3Aci+branch%3Amain) [![](https://img.shields.io/badge/Docker-19.03.x-blue)](https://www.docker.com/) [![](https://img.shields.io/badge/Rust-v1.51.0-orange)](https://www.rust-lang.org/) [![](https://img.shields.io/badge/ssi-v0.1-green)](https://www.github.com/spruceid/ssi) [![](https://img.shields.io/badge/License-Apache--2.0-green)](https://github.com/spruceid/didkit/blob/main/LICENSE) [![](https://img.shields.io/twitter/follow/spruceid?label=Follow&style=social)](https://twitter.com/spruceid) +[![](https://img.shields.io/github/workflow/status/spruceid/didkit/ci)](https://github.com/spruceid/didkit/actions?query=workflow%3Aci+branch%3Amain) [![](https://img.shields.io/badge/Docker-19.03.x-blue)](https://www.docker.com/) [![](https://img.shields.io/badge/ssi-v0.1-green)](https://www.github.com/spruceid/ssi) [![](https://img.shields.io/badge/License-Apache--2.0-green)](https://github.com/spruceid/didkit/blob/main/LICENSE) [![](https://img.shields.io/twitter/follow/spruceid?label=Follow&style=social)](https://twitter.com/spruceid) Check out the DIDKit documentation [here](https://spruceid.dev/didkit/didkit/). diff --git a/http/src/credentials.rs b/http/src/credentials.rs index b163e6ef..f05009c3 100644 --- a/http/src/credentials.rs +++ b/http/src/credentials.rs @@ -1,7 +1,7 @@ use anyhow::Context; use axum::{http::StatusCode, Extension, Json}; use didkit::{ - ssi::ldp::{now_ms, Error as LdpError}, + ssi::ldp::{now_ns, Error as LdpError}, ContextLoader, CredentialOrJWT, JWTOrLDPOptions, ProofFormat, VerifiableCredential, VerificationResult, DID_METHODS, }; @@ -42,7 +42,7 @@ pub async fn issue( None => return Err((StatusCode::NOT_FOUND, "Missing key".to_string()).into()), }; if credential.issuance_date.is_none() { - credential.issuance_date = Some(now_ms().into()); + credential.issuance_date = Some(now_ns().into()); } if let Err(e) = credential.validate_unsigned() { return Err((StatusCode::BAD_REQUEST, e.to_string()).into());