Skip to content

Commit cf89368

Browse files
committed
osx build job in circle - cross-compiling is a PITA, let's not bother
maintaining it (But leave the osxcross code in place, it works locally for me.)
1 parent 2877113 commit cf89368

File tree

3 files changed

+66
-11
lines changed

3 files changed

+66
-11
lines changed

.circleci/config.yml

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ jobs:
5050
command: sudo apt install -y clang gcc-mingw-w64-x86-64 llvm-4.0-dev musl-tools
5151
- run:
5252
name: install-rust-deps
53-
command: rustup target add x86_64-apple-darwin && rustup target add x86_64-unknown-linux-musl && rustup target add x86_64-pc-windows-gnu
54-
- run:
55-
name: install osxcross-with-clang
56-
command: curl -O https://dark-osxcross-files.storage.googleapis.com/osxcross-with-clang.tar.gz && tar --strip-components=1 -xf osxcross-with-clang.tar.gz && rm osxcross-with-clang.tar.gz
53+
command: rustup target add x86_64-unknown-linux-musl && rustup target add x86_64-pc-windows-gnu
5754
- run:
5855
name: Build all targets
5956
command: PATH=bin:$PATH ./build --release
@@ -63,7 +60,46 @@ jobs:
6360
- target/
6461
- run:
6562
name: prep-artifacts
66-
command: mkdir artifacts && cp target/x86_64-apple-darwin/release/dark-cli artifacts/dark-cli-apple && cp target/x86_64-unknown-linux-musl/release/dark-cli artifacts/dark-cli-linux && cp target/x86_64-pc-windows-gnu/release/dark-cli.exe artifacts/dark-cli.exe
63+
command: mkdir artifacts && cp target/x86_64-unknown-linux-musl/release/dark-cli artifacts/dark-cli-linux && cp target/x86_64-pc-windows-gnu/release/dark-cli.exe artifacts/dark-cli.exe
64+
- store_artifacts:
65+
path:
66+
artifacts
67+
- save_cache:
68+
name: Cargo.lock cache
69+
paths:
70+
- target
71+
key: v1-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
72+
build-osx:
73+
macos:
74+
xcode: "11.0.0"
75+
steps:
76+
- checkout
77+
- run:
78+
name: Install rustup
79+
command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
80+
- run:
81+
name: Version information
82+
command: source ~/.cargo/env; rustc --version; cargo --version; rustup --version
83+
- run:
84+
name: Calculate dependencies
85+
command: source ~/.cargo/env; cargo generate-lockfile
86+
- restore_cache:
87+
name: Cargo.lock cache
88+
keys:
89+
- v1-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
90+
- run:
91+
name: install-rust-deps
92+
command: source ~/.cargo/env; rustup target add x86_64-apple-darwin
93+
- run:
94+
name: Build all targets
95+
command: source ~/.cargo/env; ln -s $(which clang) ~/.cargo/bin/x86_64-apple-darwin15-clang ; ./build-osx --release
96+
- persist_to_workspace:
97+
root: .
98+
paths:
99+
- target/
100+
- run:
101+
name: prep-artifacts
102+
command: mkdir artifacts && cp target/x86_64-apple-darwin/release/dark-cli artifacts/dark-cli-apple
67103
- store_artifacts:
68104
path:
69105
artifacts
@@ -78,3 +114,4 @@ workflows:
78114
jobs:
79115
- test
80116
- build
117+
- build-osx

build

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ if [[ ! -z "${DEV}" ]]; then
2828
esac
2929
else
3030
cargo build --target x86_64-unknown-linux-gnu ${RELEASE}
31-
if [[ -f ./bin/x86_64-apple-darwin15-clang ]]; then
32-
export PATH=./bin:$PATH
33-
else
34-
export PATH=../../target/bin:$PATH
35-
fi
36-
cargo build --target x86_64-apple-darwin ${RELEASE}
3731
cargo build --target x86_64-pc-windows-gnu ${RELEASE}
3832
cargo build --target x86_64-unknown-linux-musl --features vendored ${RELEASE}
3933
fi

build-osx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
RELEASE=""
6+
DEV=""
7+
for i in "$@"; do
8+
case "${i}" in
9+
--release)
10+
RELEASE="${i}"
11+
shift
12+
;;
13+
esac
14+
done
15+
16+
17+
set -x
18+
19+
if [[ ! -f $(which x86_64-apple-darwin15-clang) ]]; then
20+
echo "No x86_64-apple-darwin15-clang found; you probably want to symlink to /usr/bin/clang"
21+
exit 1
22+
fi
23+
24+
cargo build --target x86_64-apple-darwin ${RELEASE}

0 commit comments

Comments
 (0)