Skip to content

Commit

Permalink
Merge branch 'master' into nydusd
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangliu authored Jun 15, 2023
2 parents f5c08fc + b4c76cf commit af879e0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ jobs:
key: ${{ runner.os }}-cargo-${{ matrix.arch }}
- name: build
run: |
declare -A rust_target_map=( ["amd64"]="x86_64-apple-darwin" ["arm64"]="aarch64-apple-darwin")
RUST_TARGET=${rust_target_map[${{ matrix.arch }}]}
cargo install --version 0.2.4 cross
rustup target add ${RUST_TARGET}
rustup component add rustfmt clippy
make -e INSTALL_DIR_PREFIX=. install
make -e RUST_TARGET_STATIC=$RUST_TARGET -e CARGO=cross static-release
sudo mv target/$RUST_TARGET/release/nydusd nydusd
sudo cp -r misc/configs .
sudo chown -R $(id -un):$(id -gn) . ~/.cargo/
- name: store-artifacts
Expand Down Expand Up @@ -147,7 +152,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64]
arch: [amd64, arm64]
os: [darwin]
needs: [nydus-macos]
steps:
Expand Down
6 changes: 5 additions & 1 deletion rafs/src/builder/core/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ impl Blob {
header.set_separate_blob(true);
};

let mut compressor = compress::Algorithm::Zstd;
let mut compressor = if ctx.conversion_type.is_to_ref() {
compress::Algorithm::Zstd
} else {
ctx.compressor
};
let (compressed_data, compressed) = compress::compress(ci_data, compressor)
.with_context(|| "failed to compress blob chunk info array".to_string())?;
if !compressed {
Expand Down
2 changes: 1 addition & 1 deletion rafs/src/metadata/md_v5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl RafsSuper {
self.meta.sb_size = sb.sb_size();
self.meta.chunk_size = sb.block_size();
self.meta.flags = RafsSuperFlags::from_bits(sb.flags())
.ok_or_else(|| einval!(format!("invalid super flags {:x}", sb.flags())))?;
.ok_or_else(|| einval!(format!("invalid super flags 0x{:x}", sb.flags())))?;
info!("RAFS v5 super block features: {}", self.meta.flags);

self.meta.inodes_count = sb.inodes_count();
Expand Down
2 changes: 1 addition & 1 deletion rafs/src/metadata/md_v6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl RafsSuper {
self.meta.inodes_count = sb.inodes_count();

self.meta.flags = RafsSuperFlags::from_bits(ext_sb.flags())
.ok_or_else(|| einval!(format!("invalid RAFS flags {:x}", ext_sb.flags())))?;
.ok_or_else(|| einval!(format!("invalid RAFS flags 0x{:x}", ext_sb.flags())))?;
info!("RAFS features: {}", self.meta.flags);

self.meta.prefetch_table_entries = ext_sb.prefetch_table_size() / size_of::<u32>() as u32;
Expand Down

0 comments on commit af879e0

Please sign in to comment.