Auto install any dependencies (#174)

next
Sayan 3 years ago committed by GitHub
parent ce9d830b5a
commit c2030d676e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -180,11 +180,6 @@ jobs:
rustup target add ${{ matrix.rust }}
if: env.IS_MD_FILE == 'false'
- name: Install 32-bit tools (Linux)
run: |
sudo apt update && sudo apt install gcc-multilib -y
if: runner.os == 'Linux'
- name: Run Tests
run: make test
env:
@ -263,10 +258,6 @@ jobs:
${{ matrix.rust }}-target-
if: env.IS_MD_FILE == 'false'
- name: Install MUSL tools
run: sudo apt-get update && sudo apt-get install musl-tools -y
if: runner.os == 'Linux'
- name: Install Rust
run: |
rustup default stable

@ -1,6 +1,20 @@
ADDITIONAL_SOFTWARE=
TARGET_ARG =
ifneq ($(origin TARGET),undefined)
TARGET_ARG +=--target ${TARGET}
ifeq ($(TARGET),x86_64-unknown-linux-musl)
# we need musl-tools for 64-bit musl targets
ADDITIONAL_SOFTWARE += sudo apt-get update && sudo apt install musl-tools -y
endif
ifeq ($(TARGET),i686-unknown-linux-gnu)
# we need gcc-multilib on 32-bit linux targets
ADDITIONAL_SOFTWARE += sudo apt-get update && sudo apt install gcc-multilib -y
endif
endif
# display a message if no additional packages are required for this target
ifeq ($(ADDITIONAL_SOFTWARE),)
ADDITIONAL_SOFTWARE += echo "info: No additional software required for this target"
endif
BUILD_VERBOSE = cargo build --verbose $(TARGET_ARG)
@ -41,22 +55,27 @@ ifneq ($(OS),Windows_NT)
START_COMMAND += &
endif
build:
.pre:
@echo "===================================================================="
@echo "Installing any additional dependencies"
@echo "===================================================================="
@$(ADDITIONAL_SOFTWARE)
build: .pre
@echo "===================================================================="
@echo "Building all binaries in debug mode (unoptimized)"
@echo "===================================================================="
@$(BUILD_COMMAND)
build-server:
.build-server: .pre
@echo "===================================================================="
@echo "Building server binary in debug mode (unoptimized)"
@echo "===================================================================="
@$(BUILD_SERVER_COMMAND)
release:
release: .pre
@echo "===================================================================="
@echo "Building all binaries in release mode (optimized)"
@echo "===================================================================="
cargo build --release --verbose $(TARGET_ARG)
test: build-server
test: .build-server
@echo "===================================================================="
@echo "Starting database server in background"
@echo "===================================================================="

Loading…
Cancel
Save