Skip to content

Commit

Permalink
feat: Add max-pure build option to build without C dependencies (Gi…
Browse files Browse the repository at this point in the history
…toxideLabs#592)

As opposed to the `small` option, it comes with all the features but
avoids anything written in C (as far as we know), which should make
building easier as it should only invoke the Rust compiler.
  • Loading branch information
Byron committed Nov 14, 2022
1 parent 04ee38c commit 223be81
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
matrix:
# build: [ linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc ]
build: [ linux, macos, win-msvc, win-gnu, win32-msvc ]
feature: [ "small", "lean", "max" ]
feature: [ "small", "lean", "max", "max-pure" ]
include:
- build: linux
os: ubuntu-18.04
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ lean = ["fast", "pretty-cli", "http-client-curl", "gitoxide-core-tools", "gitoxi
## It uses, however, a fully asynchronous networking implementation which can serve a real-world example on how to implement custom async transports.
lean-async = ["fast", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-async-client", "prodash-render-line"]

## As small as it can possibly be, no threading, no fast sha1, log based progress only, rust based zlib implementation.
## As small as it can possibly be, no threading, no fast sha1, line progress only, rust based zlib implementation.
## no networking, local operations only.
small = ["pretty-cli", "git-features/rustsha1", "git-features/zlib-rust-backend", "prodash-render-line", "atty" ]

## Makes the crate execute as fast as possible without pulling in C libraries, while keeping everything else minimal akin to the `small` build.
max-pure = ["pretty-cli", "git-features/rustsha1", "git-features/zlib-rust-backend", "prodash-render-line", "prodash-render-tui", "git-repository/max-performance-safe", "http-client-curl", "gitoxide-core-blocking-client", "gitoxide-core-tools", "prodash/render-line-autoconfigure" ]

#! ### `gitoxide-core` Configuration

## A way to enable all `gitoxide-core` tools found in `gix tools`
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ doc: ## Run cargo doc on all crates
clippy: ## Run cargo clippy on all crates
cargo clippy --all --tests --examples
cargo clippy --all --no-default-features --features small
cargo clippy --all --no-default-features --features max-pure
cargo clippy --all --no-default-features --features lean-async --tests

check-msrv: ## run cargo msrv to validate the current msrv requirements, similar to what CI does
Expand Down Expand Up @@ -171,12 +172,14 @@ continuous-unit-tests: ## run all unit tests whenever something changes
watchexec -w src $(MAKE) unit-tests

jtt = target/debug/jtt
journey-tests: always ## run journey tests (max)
journey-tests: always ## run journey tests (max + pure)
cargo build
cargo build --package git-testtools --bin jtt
./tests/journey.sh target/debug/ein target/debug/gix $(jtt) max
cargo build --no-default-features --features max-pure
./tests/journey.sh target/debug/ein target/debug/gix $(jtt) max

journey-tests-small: always ## run journey tests (lean-cli)
journey-tests-small: always ## run journey tests (small)
cargo build --no-default-features --features small
cd tests/tools && cargo build
./tests/journey.sh target/debug/ein target/debug/gix $(jtt) small
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ cargo install --git https://github.com/Byron/gitoxide gitoxide
#### How to deal with build failures

On some platforms, installation may fail due to lack of tools required by `C` toolchains. This can generally be avoided by installation
with `cargo install gitoxide --no-default-features --features small`.
with `cargo install gitoxide --no-default-features --features max-pure`.

What follows is a list of known failures.

Expand Down

0 comments on commit 223be81

Please sign in to comment.