mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 05:08:36 +02:00
There was quite a bit of discussion of this in `#build` on IRC, and the consensus was that geckodriver should be built as a stand-alone Rust crate and not as part of Firefox/Gecko (say, as a new --enable-project target). This follows that approach, and the expression, modeled off of cbindgen but updated to cross compile from a Linux host to all targets, is pretty straight-forward. A sparse profile would be nice, but the way that the Gecko Cargo workspace works means that the profile must accumulate Rust code from many locations. If we want to, eventually testing/geckodriver can be removed from the top-level Rust workspace, the geckodriver-signing tasks migrated to these toolchain tasks, consumers migrated to the signing tasks, and geckodriver removed from the "common" test archive. Differential Revision: https://phabricator.services.mozilla.com/D43646 --HG-- rename : taskcluster/scripts/misc/vs-setup.sh => taskcluster/scripts/misc/vs-setup32.sh extra : moz-landing-system : lando
46 lines
1 KiB
Bash
Executable file
46 lines
1 KiB
Bash
Executable file
#!/bin/bash
|
|
set -x -e -v
|
|
|
|
# Needed by osx-cross-linker.
|
|
export TARGET="$1"
|
|
|
|
case "$(uname -s)" in
|
|
Linux)
|
|
COMPRESS_EXT=xz
|
|
;;
|
|
MINGW*)
|
|
UPLOAD_DIR=$PWD/public/build
|
|
COMPRESS_EXT=bz2
|
|
|
|
. $GECKO_PATH/taskcluster/scripts/misc/vs-setup.sh
|
|
|
|
export CC=clang-cl
|
|
;;
|
|
esac
|
|
|
|
cd $GECKO_PATH
|
|
|
|
if [ -n "$TOOLTOOL_MANIFEST" ]; then
|
|
. taskcluster/scripts/misc/tooltool-download.sh
|
|
fi
|
|
|
|
# OSX cross builds are a bit harder
|
|
if [ "$TARGET" == "x86_64-apple-darwin" ]; then
|
|
export PATH="$MOZ_FETCHES_DIR/llvm-dsymutil/bin:$PATH"
|
|
export PATH="$MOZ_FETCHES_DIR/cctools/bin:$PATH"
|
|
export RUSTFLAGS="-C linker=$GECKO_PATH/taskcluster/scripts/misc/osx-cross-linker"
|
|
fi
|
|
|
|
export PATH="$(cd $MOZ_FETCHES_DIR && pwd)/rustc/bin:$PATH"
|
|
|
|
cd $MOZ_FETCHES_DIR/cbindgen
|
|
|
|
cargo build --verbose --release --target "$TARGET"
|
|
|
|
mkdir cbindgen
|
|
cp target/$TARGET/release/cbindgen* cbindgen/
|
|
tar -acf cbindgen.tar.$COMPRESS_EXT cbindgen
|
|
mkdir -p $UPLOAD_DIR
|
|
cp cbindgen.tar.$COMPRESS_EXT $UPLOAD_DIR
|
|
|
|
. $GECKO_PATH/taskcluster/scripts/misc/vs-cleanup.sh
|