Skip to content

Commit

Permalink
Only enable core features for legacy build
Browse files Browse the repository at this point in the history
  • Loading branch information
mappum committed Jul 31, 2023
1 parent 0b88db8 commit c1fd8d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ fn main() {

let shell = std::env::var("SHELL").unwrap_or("/bin/bash".to_string());
println!("Using shell: {}", shell);

let cargo_features = std::env::var("NOMIC_LEGACY_FEATURES").unwrap_or("full,feat-ibc,testnet".to_string());

let res = std::process::Command::new(shell)
.env_clear()
.env("OUT_DIR", std::env::var("OUT_DIR").unwrap())
.env("PATH", std::env::var("PATH").unwrap())
.env("NOMIC_LEGACY_REV", rev)
.env("CARGO_FEATURES", cargo_features)
.args(["build.sh"])
.spawn()
.unwrap()
Expand Down
7 changes: 4 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BUILD_DIR=$OUT_DIR/nomic
NOMIC_LEGACY_PATH=$OUT_DIR/nomic-$NOMIC_LEGACY_REV

if [ ! -f "$NOMIC_LEGACY_PATH" ]; then
echo "Building legacy nomic at $BUILD_DIR..."
echo "Building legacy nomic at $NOMIC_LEGACY_PATH..."
if [ ! -d "$BUILD_DIR" ]; then
git clone https://github.com/nomic-io/nomic.git $BUILD_DIR
fi
Expand All @@ -17,8 +17,9 @@ if [ ! -f "$NOMIC_LEGACY_PATH" ]; then
git checkout $NOMIC_LEGACY_REV

rustc --version
cargo build --release
mv $BUILD_DIR/target/release/nomic $NOMIC_LEGACY_PATH
echo "Building with features: $CARGO_FEATURES"
cargo build --release --no-default-features --features $CARGO_FEATURES
cp $BUILD_DIR/target/release/nomic $NOMIC_LEGACY_PATH
else
echo "Skipping legacy nomic binary build (already exists at $NOMIC_LEGACY_PATH)"
fi
Expand Down

0 comments on commit c1fd8d3

Please sign in to comment.