-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
121 lines (106 loc) · 5.84 KB
/
Copy pathCargo.toml
File metadata and controls
121 lines (106 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
[package]
name = "puregit"
version = "0.0.1"
edition = "2024"
rust-version = "1.88"
authors = ["Karpelès Lab Inc."]
description = "A pure-Rust implementation of git, in the spirit of libgit2, built on purecrypto. Object model, packfiles, refs, and the smart transport over HTTP and SSH — client and server."
license = "MIT OR Apache-2.0"
repository = "https://github.com/KarpelesLab/puregit"
documentation = "https://docs.rs/puregit"
readme = "README.md"
keywords = ["git", "vcs", "packfile", "no-std", "libgit2"]
categories = ["development-tools", "no-std", "parser-implementations"]
# We list every binary explicitly under `[[bin]]` below; turning Cargo's
# `src/bin/` auto-discovery off keeps helper modules from being mistaken for
# standalone binaries (mirrors the puressh layout).
autobins = false
[features]
# The default build is a self-contained, std-backed git engine with the local
# (filesystem) repository operations and the client side of the smart
# transport. The network transports (`http`, `ssh`) and the `server` side are
# additive on top — see below.
#
# The library is split into a `no_std + alloc` CORE (object model, hashing,
# zlib, packfiles, refs, pkt-line, the sans-IO negotiation state machines) and
# a `std` shell (the filesystem VFS, `Repository`, worktree, networking). The
# core never names `std`; everything that touches a socket, a clock, or the
# real filesystem lives behind `std` or a transport feature.
default = ["std", "client"]
# `std` pulls in the standard library: the std-backed `Vfs` implementation
# (`vfs::StdFs`), the on-disk `Repository`, worktree checkout/status, and the
# blocking I/O the transports drive. With `std` off the crate is `no_std` and
# uses only `core` + `alloc` (an allocator is required — git is all
# dynamically-sized buffers, so a pure no-alloc build is not a goal).
std = ["purecrypto/std", "compcol/std"]
# Client-side porcelain/plumbing that does not require a network stack:
# `clone`/`fetch`/`push` orchestration against a pluggable `Transport`, plus
# the local-only operations. Pure-Rust, no extra deps; on by default.
client = []
# Server-side request handlers: `upload-pack` (serves fetch/clone) and
# `receive-pack` (accepts push), driving the same sans-IO negotiation core as
# the client. Transport-agnostic — wire it behind `http`, `ssh`, or a custom
# listener. Off by default. Implies `std` (the handlers operate on a
# `Repository`).
server = ["std"]
# Smart-HTTP(S) transport (the `git-upload-pack` / `git-receive-pack` info-refs
# + service endpoints, protocol v0/v1/v2) built on the pure-Rust `rsurl` HTTP
# client. Optional and off by default so the base build pulls in no HTTP stack;
# enable with `--features http`. Implies `std`.
http = ["std", "dep:rsurl"]
# SSH transport: invoke `git-upload-pack` / `git-receive-pack` on a remote over
# an SSH channel via the pure-Rust `puressh` client. Optional and off by
# default; enable with `--features ssh`. Implies `std`. We take only puressh's
# `client` feature (no server, no PAM, no FFI) to keep the dependency graph
# minimal and free of any compiled-C crate.
ssh = ["std", "dep:puressh"]
# Signature verification: check SSH (`SSHSIG`) commit/tag signatures against the
# signed payload, via `purecrypto`'s Ed25519 and SHA-2. Enables `purecrypto/ec`
# (pure-Rust: bignum + curve25519, no C). Verification is `no_std + alloc`; the
# `Repository` convenience wrapper needs `std`. Off by default.
signing = ["purecrypto/ec", "purecrypto/rsa"]
# A C ABI (`libgit2`-shaped) surface: `#[no_mangle] extern "C"` entry points for
# opening repositories and reading refs/objects from C. Off by default and
# `std`-only. The default `crate-type` stays `["lib"]`, so enabling `ffi` only
# adds the symbols to the rlib; to link the surface from C, build it explicitly
# as a staticlib/cdylib (e.g. `cargo rustc --features ffi --crate-type staticlib`).
ffi = ["std"]
# Build every optional surface — used by CI to guard the feature gating.
full = ["std", "client", "server", "http", "ssh", "ffi", "signing"]
[dependencies]
# All cryptographic primitives come from purecrypto — SHA-1 and SHA-256 for the
# object name (git's content-addressing), with no foreign code in the
# dependency tree. `default-features = false` + `alloc` keeps the core
# `no_std`; the `std` feature layers `purecrypto/std` on top. We take only the
# `hash` feature here; commit/tag *signing* (SSH/PGP) will pull additional
# purecrypto features when that milestone lands.
purecrypto = { version = "0.6.17", default-features = false, features = ["alloc", "hash"] }
# zlib (RFC 1950) is git's on-disk compression for both loose objects and the
# contents of packfiles. `compcol` is our pure-Rust compression collection; we
# take only its `zlib` codec (inflate + deflate) over `alloc`. No `*-sys` C
# crate, so the no-C-toolchain guarantee holds.
compcol = { version = "0.6.6", default-features = false, features = ["alloc", "zlib"] }
# Optional network transports. Kept out of the default build so a consumer who
# only needs the object/pack/ref engine (or who brings their own transport)
# pulls in no HTTP or SSH stack. Both are first-party pure-Rust crates.
rsurl = { version = "0.1", optional = true }
# `multichannel` exposes SharedClient / OwnedChannelStream, whose *owned*
# exec stream lets the SSH transport hold the connection and the channel
# together without a self-referential borrow (see src/transport/ssh.rs).
puressh = { version = "0.0.6", optional = true, default-features = false, features = ["client", "multichannel"] }
[dev-dependencies]
# Hex fixtures for object-id / pack tests.
hex = "0.4"
[lib]
name = "puregit"
# Default builds emit only the rlib. A C ABI surface (staticlib / cdylib) can
# be added later behind an `ffi` feature, as in the sibling crates.
crate-type = ["lib"]
[[bin]]
name = "git"
path = "src/bin/git.rs"
required-features = ["std", "client"]
[profile.release]
lto = "thin"
codegen-units = 1
strip = true