Skip to content

Commit

Permalink
fix: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmuente committed Sep 17, 2021
1 parent d4b15c6 commit 0e54834
Showing 1 changed file with 3 additions and 39 deletions.
42 changes: 3 additions & 39 deletions ci/build.sh
Expand Up @@ -31,42 +31,6 @@ else
cd "$SRC_DIR"
fi

info "Installing additional linkers"
case ${RUSTTARGET} in
"x86_64-pc-windows-gnu") ;;

"x86_64-unknown-linux-musl") ;;

"x86_64-unknown-linux-gnu")
error "x86_64-unknown-linux-gnu is not supported: please use x86_64-unknown-linux-musl for a statically linked c library"
exit 1
;;

"wasm32-wasi") ;;
"wasm32-unknown-emscripten")
mkdir -p .cargo
cat > .cargo/config.toml << EOF
[target.wasm32-unknown-emscripten]
linker = "/usr/lib/emscripten-fastcomp/bin/clang"
ar = "/usr/lib/emscripten-fastcomp/bin/llvm-ar"
EOF
;;

"x86_64-apple-darwin")
mkdir -p .cargo
cat > .cargo/config.toml << EOF
[target.x86_64-apple-darwin]
linker = "/opt/osxcross/target/bin/x86_64-apple-darwin14-clang"
ar = "/opt/osxcross/target/bin/x86_64-apple-darwin14-ar"
EOF
;;

*)
error "${RUSTTARGET} is not supported"
exit 1
;;
esac

BINARIES="$(cargo read-manifest | jq -r ".targets[] | select(.kind[] | contains(\"bin\")) | .name")"

OUTPUT_LIST=""
Expand All @@ -76,9 +40,9 @@ for BINARY in $BINARIES; do
if [ -x "./build.sh" ]; then
OUTPUT=$(./build.sh "${CMD_PATH}" "${OUTPUT_DIR}")
else
rustup target add "$RUSTTARGET"
cargo build --release --target "$RUSTTARGET" --bin "$BINARY"
OUTPUT=$(find "target/${RUSTTARGET}/release/" -maxdepth 1 -type f -executable \( -name "${BINARY}" -o -name "${BINARY}.*" \) -print0 | xargs -0)
rustup target add x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu --bin "$BINARY"
OUTPUT=$(find "target/x86_64-unknown-linux-gnu/release/" -maxdepth 1 -type f -executable \( -name "${BINARY}" -o -name "${BINARY}.*" \) -print0 | xargs -0)
fi

info "$OUTPUT"
Expand Down

0 comments on commit 0e54834

Please sign in to comment.