fix mac universal2 build (#89)

This commit is contained in:
QP Hou 2021-10-11 18:32:31 -07:00 committed by GitHub
parent 7776462d3c
commit b382249d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 12 deletions

View File

@ -41,7 +41,7 @@ jobs:
run: cargo test
- name: Trim cache
run: |
cargo install --force cargo-cache
which cargo-cache || cargo install cargo-cache
cargo cache trim -l 1G
simd_test:
@ -71,7 +71,46 @@ jobs:
run: cargo test --features simd
- name: Trim cache
run: |
cargo install --force cargo-cache
which cargo-cache || cargo install cargo-cache
cargo cache trim -l 1G
# cross compile from x86 mac to arm64, this is to make sure universal2
# release will build without error
mac_cross_build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: mac-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
restore-keys: |
mac-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
mac-${{ runner.os }}-cargo-
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-${{ env.RUST_TC_NIGHTLY_VER }}
target: aarch64-apple-darwin
profile: minimal
default: true
- name: Build binary - universal2
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: '10.9'
run: |
# set SDKROOT for C dependencies
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
cd roapi-http && \
cargo build --bin roapi-http --target aarch64-apple-darwin
- name: Trim cache
run: |
which cargo-cache || cargo install cargo-cache
cargo cache trim -l 1G
docker_build:

12
Cargo.lock generated
View File

@ -585,7 +585,7 @@ dependencies = [
[[package]]
name = "columnq-cli"
version = "0.1.2"
version = "0.1.3"
dependencies = [
"anyhow",
"clap",
@ -2224,7 +2224,7 @@ dependencies = [
[[package]]
name = "roapi-http"
version = "0.4.2"
version = "0.4.3"
dependencies = [
"actix-cors",
"actix-http",
@ -2743,18 +2743,18 @@ checksum = "dc725476a1398f0480d56cd0ad381f6f32acf2642704456f8f59a35df464b59a"
[[package]]
name = "snmalloc-rs"
version = "0.2.27"
version = "0.2.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f5a6194d59b08fc87381e7c8a04ab4ab9967282b00f409bb742e08f3514ed0b"
checksum = "36acaace2719c972eab3ef6a6b3aee4495f0bf300f59715bb9cff6c5acf4ae20"
dependencies = [
"snmalloc-sys",
]
[[package]]
name = "snmalloc-sys"
version = "0.2.27"
version = "0.2.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9518813a25ab2704a6df4968f609aa6949705409b6a854dcc87018d12961cbc8"
checksum = "35a7e6e7d5fe756bee058ddedefc7e0a9f9c8dbaa9401b48ed3c17d6578e40b5"
dependencies = [
"cmake",
]

View File

@ -1,6 +1,6 @@
[package]
name = "columnq-cli"
version = "0.1.2"
version = "0.1.3"
homepage = "https://github.com/roapi/roapi"
license = "MIT"
readme = "README.md"
@ -14,7 +14,7 @@ path = "src/main.rs"
[dependencies]
columnq = { path = "../columnq", version = "0", default-features = false }
# for datafusion optimization
snmalloc-rs = { version = "0.2", features= ["cache-friendly"], optional = true }
snmalloc-rs = { version = "0.2", optional = true }
serde_json = "*"
log = "0"

View File

@ -1,6 +1,6 @@
[package]
name = "roapi-http"
version = "0.4.2"
version = "0.4.3"
authors = ["QP Hou <dave2008713@gmail.com>"]
homepage = "https://github.com/roapi/roapi"
license = "MIT"
@ -17,7 +17,7 @@ path = "src/main.rs"
[dependencies]
columnq = { path = "../columnq", version = "0", default-features = false }
# for datafusion optimization
snmalloc-rs = { version = "0.2", features= ["cache-friendly"], optional = true }
snmalloc-rs = { version = "0.2", optional = true }
# all actix dependencies are patched to use git source until actix-web 4.x lands
actix-web = "4.0.0-beta.4"