Skip to content
Open
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
19 changes: 14 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
workspace: ['Cargo.toml', 'fuzz/Cargo.toml', 'cli/Cargo.toml', 'cli/clite/Cargo.toml']
os: [ubuntu-latest, macOS-latest, windows-latest]
rustalias: [stable, nightly, msrv]
workspace: ['Cargo.toml', 'fuzz/Cargo.toml']
Expand Down Expand Up @@ -58,14 +59,18 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
workspace: ['Cargo.toml', 'fuzz/Cargo.toml']
workspace: ['Cargo.toml', 'fuzz/Cargo.toml', 'cli/Cargo.toml', 'cli/clite/Cargo.toml']
feature_flag:
- "--all-features"
- "--no-default-features"
- ""
- "--no-default-features --features zip/deflate-flate2-zlib-rs"
- "--no-default-features --features zip/deflate-zopfli"
name: 'Miri ${{ matrix.feature_flag }} ${{ matrix.workspace }}'
include:
# Break out a separate test shard for specific dependencies on their own.
- feature_flag: "--no-default-features --features deflate-flate2-zlib-rs"
workspace: 'Cargo.toml'
- feature_flag: "--no-default-features --features deflate-zopfli"
workspace: 'Cargo.toml'
name: 'Miri ${{ matrix.feature_flag }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -102,6 +107,10 @@ jobs:
run: cargo fmt --all -- --check
- name: fmt fuzz
run: cargo fmt --all --manifest-path ${{ github.workspace }}/fuzz/Cargo.toml -- --check
- name: fmt cli
run: cargo fmt --all --manifest-path ${{ github.workspace }}/cli/Cargo.toml -- --check
- name: fmt clite
run: cargo fmt --all --manifest-path ${{ github.workspace }}/cli/clite/Cargo.toml -- --check

check_minimal_versions:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
Expand All @@ -126,7 +135,7 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
workspace: ['Cargo.toml', 'fuzz/Cargo.toml']
workspace: ['Cargo.toml', 'fuzz/Cargo.toml', 'cli/Cargo.toml', 'cli/clite/Cargo.toml']
feature_flag: ["--all-features", "--no-default-features", ""]
name: 'Style and docs ${{ matrix.feature_flag }} ${{ matrix.workspace }}'
runs-on: ubuntu-latest
Expand Down
70 changes: 70 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[package]
name = "zip-cli"
version = "0.0.1"
authors = [
"Danny McClanahan <dmcC2@hypnicjerk.ai>",
]
license = "MIT"
repository = "https: //github.com/zip-rs/zip2.git"
keywords = ["zip", "archive", "compression", "cli"]
categories = ["command-line-utilities", "compression", "filesystem", "development-tools::build-utils"]
# This field is not as important as in the top-level library API, but as there:
# Any change to rust-version must be reflected also in `README.md` and `.github/workflows/ci.yaml`.
# The MSRV policy is documented in `README.md`.
rust-version = "1.83.0"
description = """
Binary for creation and manipulation of zip files.

This package can enable or disable certain dependencies during the build and install process with
cargo features.
"""
edition = "2021"

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[lib]

[[bin]]
name = "zip-cli"

[dependencies.zip]
path = ".."
default-features = false

[features]
aes-crypto = ["zip/aes-crypto"]
bzip2 = ["zip/bzip2"]
chrono = ["zip/chrono"]
_deflate-any = ["zip/_deflate-any"]
deflate64 = ["zip/deflate64"]
deflate = ["zip/deflate"]
deflate-flate2 = ["zip/deflate-flate2"]
deflate-flate2-zlib-rs = ["zip/deflate-flate2-zlib-rs"]
deflate-flate2-zlib = ["zip/deflate-flate2-zlib"]
deflate-zopfli = ["zip/deflate-zopfli"]
lzma = ["zip/lzma"]
ppmd = ["zip/ppmd"]
time = ["zip/time"]
xz = ["zip/xz"]
zstd = ["zip/zstd"]

# Generate a highly featureful binary by default.
default = [
"aes-crypto",
"bzip2",
"deflate64",
"deflate",
"lzma",
"ppmd",
"time",
"xz",
"zstd",
]

[profile.release]
strip = true
lto = true
opt-level = 3
codegen-units = 1
66 changes: 66 additions & 0 deletions cli/clite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[package]
name = "zip-clite"
version = "0.0.1"
authors = [
"Danny McClanahan <dmcC2@hypnicjerk.ai>",
]
license = "MIT"
repository = "https://github.com/zip-rs/zip2.git"
keywords = ["zip", "archive", "compression", "cli"]
categories = ["command-line-utilities", "compression", "filesystem", "development-tools::build-utils"]
# This field is not as important as in the top-level library API, but as there:
# Any change to rust-version must be reflected also in `README.md` and `.github/workflows/ci.yaml`.
# The MSRV policy is documented in `README.md`.
rust-version = "1.83.0"
description = """
Binary for creation and manipulation of zip files.

This distribution is created to be intentionally very small and easy to audit. It has reduced
functionality, builds to optimize for size, and only bundles in support for a Rust
DEFLATE implementation.
"""
edition = "2021"

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "zip-clite"

# NB: This is not a dependency on the top-level `zip` crate, but the `zip-cli` crate (which mirrors
# the declared features from `zip`). We do not use its `main.rs` entry point, but rely upon
# `lib.rs`, which was specifically designed to minimize the amount of code specific to
# `zip-clite`.
[dependencies.zip-cli]
path = ".."
default-features = false

[features]
aes-crypto = ["zip-cli/aes-crypto"]
bzip2 = ["zip-cli/bzip2"]
chrono = ["zip-cli/chrono"]
_deflate-any = ["zip-cli/_deflate-any"]
deflate64 = ["zip-cli/deflate64"]
deflate = ["zip-cli/deflate"]
deflate-flate2 = ["zip-cli/deflate-flate2"]
deflate-flate2-zlib-rs = ["zip-cli/deflate-flate2-zlib-rs"]
deflate-flate2-zlib = ["zip-cli/deflate-flate2-zlib"]
deflate-zopfli = ["zip-cli/deflate-zopfli"]
lzma = ["zip-cli/lzma"]
ppmd = ["zip-cli/ppmd"]
time = ["zip-cli/time"]
xz = ["zip-cli/xz"]
zstd = ["zip-cli/zstd"]

# Only bring in the pure-Rust DEFLATE implementation by default.
default = [
"deflate-flate2",
"deflate-flate2-zlib-rs",
]

[profile.release]
strip = true
lto = true
opt-level = "s"
codegen-units = 1
5 changes: 5 additions & 0 deletions cli/clite/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use zip_cli::shared_main;

fn main() {
shared_main()
}
Loading