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

chore: deprecated rust-crypto crate and use md5 #1044

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/test_compiler_base.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: build-and-test-compiler-base
on: ["push", "pull_request"]
on:
push:
paths:
- 'compiler_base/**'
pull_request:
paths:
- 'compiler_base/**'

jobs:
check-fmt:
name: Test
Expand Down
170 changes: 80 additions & 90 deletions kclvm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kclvm/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ ahash = "0.7.2"
toml = "0.5.8"
ron = "0.7.0"
chrono = "0.4.19"
rust-crypto = "0.2.36"
glob = "0.3.0"
fslock = "0.2.1"
pathdiff = "0.2.1"
Expand All @@ -25,3 +24,4 @@ kclvm-utils = {path = "../utils"}
kclvm-ast = {path = "../ast"}
dirs = "5.0.0"
pcre2 = "0.2.4"
md-5 = "0.8.0"
7 changes: 3 additions & 4 deletions kclvm/config/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
extern crate chrono;
use super::modfile::KCL_FILE_SUFFIX;
use anyhow::Result;
use crypto::digest::Digest;
use crypto::md5::Md5;
use fslock::LockFile;
use kclvm_utils::pkgpath::{parse_external_pkg_name, rm_external_pkg_name};
use md5::{Digest, Md5};
use serde::{de::DeserializeOwned, Serialize};
use std::collections::HashMap;
use std::error;
Expand All @@ -21,7 +20,7 @@ const CACHE_INFO_FILENAME: &str = "info";
const KCL_SUFFIX_PATTERN: &str = "*.k";
pub const KCL_CACHE_PATH_ENV_VAR: &str = "KCL_CACHE_PATH";

pub type CacheInfo = String;
pub type CacheInfo = Vec<u8>;
pub type Cache = HashMap<String, CacheInfo>;

#[allow(dead_code)]
Expand Down Expand Up @@ -237,7 +236,7 @@ fn get_cache_info(path_str: &str) -> CacheInfo {
md5.input(buf.as_slice());
}
}
md5.result_str()
md5.result().to_vec()
}

pub fn get_pkg_realpath_from_pkgpath(root: &str, pkgpath: &str) -> String {
Expand Down
Loading