build fixes

This commit is contained in:
2025-12-02 19:25:19 +01:00
parent dac0b12fca
commit 69bf009d58
4 changed files with 41 additions and 16 deletions

View File

@@ -14,6 +14,11 @@ YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Extract version from Cargo.toml
VERSION=$(grep -m1 '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "Version: $VERSION"
echo ""
# Create dist directory
DIST_DIR="dist"
mkdir -p "$DIST_DIR"
@@ -37,17 +42,21 @@ build_with_cross() {
echo -e "${BLUE}=== Building for $name ===${NC}"
echo -e "${YELLOW}Target: $target${NC}"
# Clean build artifacts to avoid GLIBC mismatch with build scripts
echo -e "${YELLOW}Cleaning build artifacts...${NC}"
cargo clean --release --target "$target"
if cross build --release --target "$target"; then
echo -e "${GREEN}✓ Build successful for $name${NC}"
# Copy binary to dist directory
# Copy binary to dist directory with version
if [[ "$target" == *"windows"* ]]; then
cp "target/$target/release/rlogg.exe" "$DIST_DIR/rlogg-$name.exe"
echo -e "${GREEN}✓ Binary: $DIST_DIR/rlogg-$name.exe${NC}"
cp "target/$target/release/rlogg.exe" "$DIST_DIR/rlogg-$VERSION-$name.exe"
echo -e "${GREEN}✓ Binary: $DIST_DIR/rlogg-$VERSION-$name.exe${NC}"
else
cp "target/$target/release/rlogg" "$DIST_DIR/rlogg-$name"
strip "$DIST_DIR/rlogg-$name" 2>/dev/null || true
echo -e "${GREEN}✓ Binary: $DIST_DIR/rlogg-$name${NC}"
cp "target/$target/release/rlogg" "$DIST_DIR/rlogg-$VERSION-$name"
strip "$DIST_DIR/rlogg-$VERSION-$name" 2>/dev/null || true
echo -e "${GREEN}✓ Binary: $DIST_DIR/rlogg-$VERSION-$name${NC}"
fi
return 0
else
@@ -63,9 +72,9 @@ build_native() {
if cargo build --release; then
echo -e "${GREEN}✓ Build successful for Linux${NC}"
cp "target/release/rlogg" "$DIST_DIR/rlogg-linux-x86_64"
strip "$DIST_DIR/rlogg-linux-x86_64" 2>/dev/null || true
echo -e "${GREEN}✓ Binary: $DIST_DIR/rlogg-linux-x86_64${NC}"
cp "target/release/rlogg" "$DIST_DIR/rlogg-$VERSION-linux-x86_64"
strip "$DIST_DIR/rlogg-$VERSION-linux-x86_64" 2>/dev/null || true
echo -e "${GREEN}✓ Binary: $DIST_DIR/rlogg-$VERSION-linux-x86_64${NC}"
return 0
else
echo -e "${RED}✗ Build failed for Linux${NC}"