build-l10n.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #! /bin/bash -vex
  2. set -x -e
  3. echo "running as" $(id)
  4. . /home/worker/scripts/xvfb.sh
  5. ####
  6. # Taskcluster friendly wrapper for performing fx desktop l10n repacks via mozharness.
  7. # Based on ./build-linux.sh
  8. ####
  9. # Inputs, with defaults
  10. : MOZHARNESS_SCRIPT ${MOZHARNESS_SCRIPT}
  11. : MOZHARNESS_CONFIG ${MOZHARNESS_CONFIG}
  12. : MOZHARNESS_ACTIONS ${MOZHARNESS_ACTIONS}
  13. : MOZHARNESS_OPTIONS ${MOZHARNESS_OPTIONS}
  14. : TOOLTOOL_CACHE ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
  15. : NEED_XVFB ${NEED_XVFB:=false}
  16. : WORKSPACE ${WORKSPACE:=/home/worker/workspace}
  17. set -v
  18. fail() {
  19. echo # make sure error message is on a new line
  20. echo "[build-l10n.sh:error]" "${@}"
  21. exit 1
  22. }
  23. export MOZ_OBJDIR=obj-firefox
  24. export TINDERBOX_OUTPUT=1
  25. # Ensure that in tree libraries can be found
  26. export LIBRARY_PATH=$LIBRARY_PATH:$WORKSPACE/src/obj-firefox:$WORKSPACE/src/gcc/lib64
  27. # test required parameters are supplied
  28. if [[ -z ${MOZHARNESS_SCRIPT} ]]; then fail "MOZHARNESS_SCRIPT is not set"; fi
  29. if [[ -z ${MOZHARNESS_CONFIG} ]]; then fail "MOZHARNESS_CONFIG is not set"; fi
  30. cleanup() {
  31. local rv=$?
  32. cleanup_xvfb
  33. exit $rv
  34. }
  35. trap cleanup EXIT INT
  36. # run XVfb in the background, if necessary
  37. if $NEED_XVFB; then
  38. start_xvfb '1024x768x24' 2
  39. fi
  40. # set up mozharness configuration, via command line, env, etc.
  41. # $TOOLTOOL_CACHE bypasses mozharness completely and is read by tooltool_wrapper.sh to set the
  42. # cache. However, only some mozharness scripts use tooltool_wrapper.sh, so this may not be
  43. # entirely effective.
  44. export TOOLTOOL_CACHE
  45. # support multiple, space delimited, config files
  46. config_cmds=""
  47. for cfg in $MOZHARNESS_CONFIG; do
  48. config_cmds="${config_cmds} --config ${cfg}"
  49. done
  50. # if MOZHARNESS_ACTIONS is given, only run those actions (completely overriding default_actions
  51. # in the mozharness configuration)
  52. if [ -n "$MOZHARNESS_ACTIONS" ]; then
  53. actions=""
  54. for action in $MOZHARNESS_ACTIONS; do
  55. actions="$actions --$action"
  56. done
  57. fi
  58. # if MOZHARNESS_OPTIONS is given, append them to mozharness command line run
  59. # e.g. enable-pgo
  60. if [ -n "$MOZHARNESS_OPTIONS" ]; then
  61. options=""
  62. for option in $MOZHARNESS_OPTIONS; do
  63. options="$options --$option"
  64. done
  65. fi
  66. cd /home/worker
  67. python2.7 $WORKSPACE/build/src/testing/${MOZHARNESS_SCRIPT} \
  68. --disable-mock \
  69. --revision ${GECKO_HEAD_REV} \
  70. $actions \
  71. $options \
  72. ${config_cmds} \
  73. --log-level=debug \
  74. --work-dir=$WORKSPACE/build \