-
-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a multi-call binary ('uni') to have only one build step (#987)
This increases installation size, but should decrease build time as symbols and optimizations can be shared more. Once deduplication of generics has happened, these wins should increase even more. However, as it probably increases compile times for CI as it will take longer to build each binary with different compile time flags. Thus I just leave the `uni.rs` file for reference.
- Loading branch information
Showing
4 changed files
with
35 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
#![deny(unsafe_code, rust_2018_idioms)] | ||
|
||
mod plumbing; | ||
mod shared; | ||
|
||
use anyhow::Result; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! An experiment to see how a multi-call binary could look like. | ||
//! For CI this would mean longer compile times though as it rebuilds `gix` | ||
//! with varying compile flags, which also means that it recompiles all source or `ein`. | ||
//! | ||
//! However, doing this could be interesting for distribution if the files are hard-linked | ||
//! instead of copied, which is why it is left here. | ||
#![deny(unsafe_code, rust_2018_idioms)] | ||
|
||
use anyhow::{bail, Result}; | ||
|
||
mod plumbing; | ||
mod porcelain; | ||
|
||
#[cfg(feature = "pretty-cli")] | ||
fn main() -> Result<()> { | ||
match std::env::current_exe()? | ||
.file_stem() | ||
.and_then(|stem| stem.to_str()) | ||
.unwrap_or("gix") | ||
{ | ||
"gix" => plumbing::main(), | ||
"ein" => porcelain::main(), | ||
unknown => bail!("Executable named '{unknown}' cannot be launched. Exe must be named either `gix` or `ein`."), | ||
} | ||
} | ||
|
||
#[cfg(not(feature = "pretty-cli"))] | ||
compile_error!("Please set 'pretty-cli' feature flag"); |