mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 02:56:18 +00:00
ci: build for old glibc (#232)
* build(deps): shadow_rs * ci(build): build for old glibc * ci: simplify all
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
name: "setup"
|
||||||
|
|
||||||
|
description: "setup environment for rustfs"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
rust-version:
|
||||||
|
required: true
|
||||||
|
default: "stable"
|
||||||
|
cache-shared-key:
|
||||||
|
required: true
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install system dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y \
|
||||||
|
libdbus-1-dev \
|
||||||
|
libwayland-dev \
|
||||||
|
libwebkit2gtk-4.1-dev \
|
||||||
|
libxdo-dev
|
||||||
|
|
||||||
|
- uses: arduino/setup-protoc@v3
|
||||||
|
with:
|
||||||
|
version: "27.0"
|
||||||
|
|
||||||
|
- uses: Nugine/setup-flatc@v1
|
||||||
|
with:
|
||||||
|
version: "24.3.25"
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@master
|
||||||
|
with:
|
||||||
|
toolchain: ${{ inputs.rust-version }}
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
cache-on-failure: true
|
||||||
|
shared-key: ${{ inputs.cache-shared-key }}
|
||||||
|
|
||||||
|
- uses: mlugg/setup-zig@v1
|
||||||
|
- uses: taiki-e/install-action@cargo-zigbuild
|
||||||
@@ -21,7 +21,5 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: taiki-e/install-action@v2
|
- uses: taiki-e/install-action@cargo-audit
|
||||||
with:
|
|
||||||
tool: cargo-audit
|
|
||||||
- run: cargo audit -D warnings
|
- run: cargo audit -D warnings
|
||||||
|
|||||||
+24
-21
@@ -12,33 +12,36 @@ jobs:
|
|||||||
build-rustfs:
|
build-rustfs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
variant:
|
||||||
|
- { profile: dev, target: x86_64-unknown-linux-gnu, glibc: "default" }
|
||||||
|
- { profile: release, target: x86_64-unknown-linux-gnu, glibc: "default" }
|
||||||
|
- { profile: release, target: x86_64-unknown-linux-gnu, glibc: "2.31" }
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
with:
|
||||||
version: "27.0"
|
cache-shared-key: rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }}
|
||||||
|
|
||||||
- uses: Nugine/setup-flatc@v1
|
- name: Build
|
||||||
with:
|
|
||||||
version: "24.3.25"
|
|
||||||
|
|
||||||
- name: Build binaries
|
|
||||||
run: |
|
run: |
|
||||||
touch rustfs/build.rs
|
./scripts/build.py \
|
||||||
cargo build -p rustfs --bins
|
--profile ${{ matrix.variant.profile }} \
|
||||||
|
--target ${{ matrix.variant.target }} \
|
||||||
touch rustfs/build.rs
|
--glibc ${{ matrix.variant.glibc }}
|
||||||
cargo build -p rustfs --bins --release
|
|
||||||
|
|
||||||
mkdir -p target/artifacts
|
|
||||||
mv ./target/debug/rustfs ./target/artifacts/rustfs.debug.x86_64-unknown-linux-gnu
|
|
||||||
mv ./target/release/rustfs ./target/artifacts/rustfs.release.x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rustfs
|
name: rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }}
|
||||||
path: ./target/artifacts/*
|
path: ./target/artifacts/*
|
||||||
|
|
||||||
|
merge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-rustfs
|
||||||
|
steps:
|
||||||
|
- uses: actions/upload-artifact/merge@v4
|
||||||
|
with:
|
||||||
|
name: rustfs
|
||||||
|
delete-merged: true
|
||||||
|
|||||||
@@ -37,33 +37,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install system dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y \
|
|
||||||
libdbus-1-dev \
|
|
||||||
libwayland-dev \
|
|
||||||
libwebkit2gtk-4.1-dev \
|
|
||||||
libxdo-dev
|
|
||||||
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
version: "27.0"
|
|
||||||
|
|
||||||
- uses: Nugine/setup-flatc@v1
|
|
||||||
with:
|
|
||||||
version: "24.3.25"
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
- uses: dtolnay/rust-toolchain@nightly
|
|
||||||
with:
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
cache-on-failure: true
|
|
||||||
shared-key: "develop"
|
|
||||||
|
|
||||||
- name: Format
|
- name: Format
|
||||||
run: cargo fmt --all --check
|
run: cargo fmt --all --check
|
||||||
|
|||||||
+35
-10
@@ -37,14 +37,7 @@ jobs:
|
|||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: ./.github/actions/setup
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
version: "27.0"
|
|
||||||
- uses: Nugine/setup-flatc@v1
|
|
||||||
with:
|
|
||||||
version: "24.3.25"
|
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
@@ -53,7 +46,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Install s3s-e2e
|
- name: Install s3s-e2e
|
||||||
run: |
|
run: |
|
||||||
cargo install s3s-e2e --git https://github.com/Nugine/s3s.git
|
mkdir -p target/s3s-e2e
|
||||||
|
cargo install s3s-e2e \
|
||||||
|
--git https://github.com/Nugine/s3s.git \
|
||||||
|
--target-dir target/s3s-e2e \
|
||||||
|
--force
|
||||||
s3s-e2e --version
|
s3s-e2e --version
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
@@ -70,7 +67,35 @@ jobs:
|
|||||||
export RUST_BACKTRACE=full
|
export RUST_BACKTRACE=full
|
||||||
s3s-e2e
|
s3s-e2e
|
||||||
killall rustfs
|
killall rustfs
|
||||||
|
mint:
|
||||||
|
needs: skip-check
|
||||||
|
if: needs.skip-check.outputs.should_skip != 'true'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
|
- name: Build binaries
|
||||||
|
run: |
|
||||||
|
touch rustfs/build.rs
|
||||||
|
cargo build -p rustfs --bins --release
|
||||||
|
|
||||||
|
- name: run this rustfs server
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p /data/rustfs
|
||||||
|
sudo nohup ./target/release/rustfs /data/rustfs &
|
||||||
|
|
||||||
|
- name: run mint test task
|
||||||
|
run: |
|
||||||
|
ps aux | grep rustfs
|
||||||
|
SERVER_ADDRESS=$(ifconfig eth0 | awk 'NR==2 { print $2 }')
|
||||||
|
docker run -e SERVER_ENDPOINT=${SERVER_ADDRESS}:9000 \
|
||||||
|
-e ACCESS_KEY=rustfsadmin \
|
||||||
|
-e SECRET_KEY=rustfsadmin \
|
||||||
|
-e ENABLE_HTTPS=0 \
|
||||||
|
minio/mint
|
||||||
|
|
||||||
### Temporarily disabled because it is not working
|
### Temporarily disabled because it is not working
|
||||||
# e2e:
|
# e2e:
|
||||||
# # See this url if required matrix jobs are hanging
|
# # See this url if required matrix jobs are hanging
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
name: mint-test
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "main" ]
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
mintest:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
timeout-minutes: 30
|
|
||||||
steps:
|
|
||||||
- name: install protoc
|
|
||||||
run: |
|
|
||||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-linux-x86_64.zip
|
|
||||||
unzip protoc-27.0-linux-x86_64.zip -d protoc3
|
|
||||||
mv protoc3/bin/* /usr/local/bin/
|
|
||||||
chmod +x /usr/local/bin/protoc
|
|
||||||
rm -rf protoc-27.0-linux-x86_64.zip protoc3
|
|
||||||
|
|
||||||
- name: install flatc
|
|
||||||
run: |
|
|
||||||
wget https://github.com/google/flatbuffers/releases/download/v24.3.25/Linux.flatc.binary.g++-13.zip
|
|
||||||
unzip Linux.flatc.binary.g++-13.zip
|
|
||||||
mv flatc /usr/local/bin/
|
|
||||||
chmod +x /usr/local/bin/flatc
|
|
||||||
rm -rf Linux.flatc.binary.g++-13.zip
|
|
||||||
|
|
||||||
- name: checkout source code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: rust-toolchain
|
|
||||||
uses: actions-rs/toolchain@v1.0.6
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
|
|
||||||
- name: cache rust dependencies
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
|
|
||||||
- name: cargo build & release
|
|
||||||
run: cargo build --release
|
|
||||||
|
|
||||||
- name: run this rustfs server
|
|
||||||
run: |
|
|
||||||
sudo mkdir -p /data/rustfs
|
|
||||||
sudo nohup ./target/release/rustfs /data/rustfs &
|
|
||||||
|
|
||||||
- name: run mint test task
|
|
||||||
run: |
|
|
||||||
ps aux | grep rustfs
|
|
||||||
SERVER_ADDRESS=$(ifconfig eth0 | awk 'NR==2 { print $2 }')
|
|
||||||
docker run -e SERVER_ENDPOINT=${SERVER_ADDRESS}:9000 \
|
|
||||||
-e ACCESS_KEY=rustfsadmin \
|
|
||||||
-e SECRET_KEY=rustfsadmin \
|
|
||||||
-e ENABLE_HTTPS=0 \
|
|
||||||
minio/mint
|
|
||||||
|
|
||||||
Generated
-80
@@ -996,12 +996,6 @@ dependencies = [
|
|||||||
"syn 2.0.98",
|
"syn 2.0.98",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "const_fn"
|
|
||||||
version = "0.4.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2f8a2ca5ac02d09563609681103aada9e1777d54fc57a5acd7a41404f9c93b6e"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "const_format"
|
name = "const_format"
|
||||||
version = "0.2.34"
|
version = "0.2.34"
|
||||||
@@ -2547,19 +2541,6 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "git2"
|
|
||||||
version = "0.20.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3fda788993cc341f69012feba8bf45c0ba4f3291fcc08e214b4d5a7332d88aff"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags 2.8.0",
|
|
||||||
"libc",
|
|
||||||
"libgit2-sys",
|
|
||||||
"log",
|
|
||||||
"url",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glib"
|
name = "glib"
|
||||||
version = "0.18.5"
|
version = "0.18.5"
|
||||||
@@ -3487,18 +3468,6 @@ dependencies = [
|
|||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libgit2-sys"
|
|
||||||
version = "0.18.0+1.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"libc",
|
|
||||||
"libz-sys",
|
|
||||||
"pkg-config",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libloading"
|
name = "libloading"
|
||||||
version = "0.7.4"
|
version = "0.7.4"
|
||||||
@@ -3554,18 +3523,6 @@ dependencies = [
|
|||||||
"x11",
|
"x11",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libz-sys"
|
|
||||||
version = "1.1.21"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"libc",
|
|
||||||
"pkg-config",
|
|
||||||
"vcpkg",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.4.15"
|
version = "0.4.15"
|
||||||
@@ -5866,10 +5823,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "6ec14cc798c29f4bf74a6c4299c657c04d4e9fba03875c1f0eec569af03aed89"
|
checksum = "6ec14cc798c29f4bf74a6c4299c657c04d4e9fba03875c1f0eec569af03aed89"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"git2",
|
|
||||||
"is_debug",
|
"is_debug",
|
||||||
"time",
|
"time",
|
||||||
"tzdb",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -6835,35 +6790,6 @@ version = "1.18.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
|
checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tz-rs"
|
|
||||||
version = "0.6.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "33851b15c848fad2cf4b105c6bb66eb9512b6f6c44a4b13f57c53c73c707e2b4"
|
|
||||||
dependencies = [
|
|
||||||
"const_fn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tzdb"
|
|
||||||
version = "0.6.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1b580f6b365fa89f5767cdb619a55d534d04a4e14c2d7e5b9a31e94598687fb1"
|
|
||||||
dependencies = [
|
|
||||||
"iana-time-zone",
|
|
||||||
"tz-rs",
|
|
||||||
"tzdb_data",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tzdb_data"
|
|
||||||
version = "0.1.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d4471adcfcbd3052e8c5b5890a04a559837444b3be26b9cbbd622063171cec9d"
|
|
||||||
dependencies = [
|
|
||||||
"tz-rs",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uds_windows"
|
name = "uds_windows"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
@@ -6986,12 +6912,6 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
|
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "vcpkg"
|
|
||||||
version = "0.2.15"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version-compare"
|
name = "version-compare"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ s3s = { git = "https://github.com/Nugine/s3s.git", rev = "529c8933a11528c506d5fb
|
|||||||
"tower",
|
"tower",
|
||||||
] }
|
] }
|
||||||
s3s-policy = { git = "https://github.com/Nugine/s3s.git", rev = "529c8933a11528c506d5fbf7c4c2ab155db37dfe" }
|
s3s-policy = { git = "https://github.com/Nugine/s3s.git", rev = "529c8933a11528c506d5fbf7c4c2ab155db37dfe" }
|
||||||
|
shadow-rs = { version = "0.38.0", default-features = false }
|
||||||
serde = { version = "1.0.217", features = ["derive"] }
|
serde = { version = "1.0.217", features = ["derive"] }
|
||||||
serde_json = "1.0.138"
|
serde_json = "1.0.138"
|
||||||
tempfile = "3.16.0"
|
tempfile = "3.16.0"
|
||||||
|
|||||||
+2
-2
@@ -61,7 +61,7 @@ url.workspace = true
|
|||||||
admin = { path = "../api/admin" }
|
admin = { path = "../api/admin" }
|
||||||
axum.workspace = true
|
axum.workspace = true
|
||||||
matchit = "0.8.6"
|
matchit = "0.8.6"
|
||||||
shadow-rs = "0.38.0"
|
shadow-rs.workspace = true
|
||||||
const-str = { version = "0.6.1", features = ["std", "proc"] }
|
const-str = { version = "0.6.1", features = ["std", "proc"] }
|
||||||
atoi = "2.0.0"
|
atoi = "2.0.0"
|
||||||
serde_urlencoded = "0.7.1"
|
serde_urlencoded = "0.7.1"
|
||||||
@@ -90,5 +90,5 @@ hyper-util = { version = "0.1.10", features = [
|
|||||||
] }
|
] }
|
||||||
transform-stream = "0.3.1"
|
transform-stream = "0.3.1"
|
||||||
netif = "0.1.6"
|
netif = "0.1.6"
|
||||||
shadow-rs = "0.38.0"
|
shadow-rs.workspace = true
|
||||||
# pin-utils = "0.1.0"
|
# pin-utils = "0.1.0"
|
||||||
|
|||||||
Executable
+75
@@ -0,0 +1,75 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
from dataclasses import dataclass
|
||||||
|
import argparse
|
||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class CliArgs:
|
||||||
|
profile: str
|
||||||
|
target: str
|
||||||
|
glibc: str
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def parse():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("--profile", type=str, required=True)
|
||||||
|
parser.add_argument("--target", type=str, required=True)
|
||||||
|
parser.add_argument("--glibc", type=str, required=True)
|
||||||
|
args = parser.parse_args()
|
||||||
|
return CliArgs(args.profile, args.target, args.glibc)
|
||||||
|
|
||||||
|
|
||||||
|
def shell(cmd: str):
|
||||||
|
print(cmd, flush=True)
|
||||||
|
subprocess.run(cmd, shell=True, check=True)
|
||||||
|
|
||||||
|
|
||||||
|
def main(args: CliArgs):
|
||||||
|
use_zigbuild = False
|
||||||
|
use_old_glibc = False
|
||||||
|
|
||||||
|
if args.glibc and args.glibc != "default":
|
||||||
|
use_zigbuild = True
|
||||||
|
use_old_glibc = True
|
||||||
|
|
||||||
|
cmd = ["cargo", "build"]
|
||||||
|
if use_zigbuild:
|
||||||
|
cmd = ["cargo", " zigbuild"]
|
||||||
|
|
||||||
|
cmd.extend(["--profile", args.profile])
|
||||||
|
|
||||||
|
if use_old_glibc:
|
||||||
|
cmd.extend(["--target", f"{args.target}.{args.glibc}"])
|
||||||
|
else:
|
||||||
|
cmd.extend(["--target", args.target])
|
||||||
|
|
||||||
|
cmd.extend(["-p", "rustfs"])
|
||||||
|
cmd.extend(["--bins"])
|
||||||
|
|
||||||
|
shell("touch rustfs/build.rs") # refresh build info for rustfs
|
||||||
|
shell(" ".join(cmd))
|
||||||
|
|
||||||
|
if args.profile == "dev":
|
||||||
|
profile_dir = "debug"
|
||||||
|
elif args.profile == "release":
|
||||||
|
profile_dir = "release"
|
||||||
|
else:
|
||||||
|
profile_dir = args.profile
|
||||||
|
|
||||||
|
bin_path = Path(f"target/{args.target}/{profile_dir}/rustfs")
|
||||||
|
|
||||||
|
bin_name = f"rustfs.{args.profile}.{args.target}"
|
||||||
|
if use_old_glibc:
|
||||||
|
bin_name += f".glibc{args.glibc}"
|
||||||
|
bin_name += ".bin"
|
||||||
|
|
||||||
|
out_path = Path(f"target/artifacts/{bin_name}")
|
||||||
|
|
||||||
|
out_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
out_path.hardlink_to(bin_path)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main(CliArgs.parse())
|
||||||
Reference in New Issue
Block a user