#!/bin/bash # Define your features features_list="avro bson json5 flexbuffers postcard messagepack ron lexpr pickle cbor json query-string yaml toml" features=($features_list) # Function to compile with specified features compile_features() { feature_string=$(IFS=,; echo "$1") printf "($2 of $3) - Compiling with features: $feature_string" | tee -a compile_status.log cargo build --no-default-features --features "$feature_string" &> build_logs/"$feature_string".log local status=$? if [ $status -eq 0 ]; then echo " - Success..." | tee -a compile_status.log echo "$feature_string: SUCCESS" >> compile_status.log else echo " - Failed..." | tee -a compile_status.log echo "$feature_string: FAILED" >> compile_status.log exit 1 fi } # Generate all combinations of features generate_combinations() { local -n combis=$1 # Name reference to the result array local num_combinations=$((1 << ${#features[@]})) for ((i=1; i compile_status.log echo "-------------------------------------" >> compile_status.log mkdir -p build_logs # Compile for each combination stored in combinations array total=${#combinations[@]} count=1 for combo in "${combinations[@]}"; do compile_features "$combo" $count $total ((count++)) done # Print status report echo "Compilation results:" cat compile_status.log } init $1