tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

build-l10n.sh (2586B)


      1 #! /bin/bash -vex
      2 
      3 set -x -e
      4 
      5 echo "running as" $(id)
      6 
      7 ####
      8 # Taskcluster friendly wrapper for performing fx desktop l10n repacks via mozharness.
      9 # Based on ./build-linux.sh
     10 ####
     11 
     12 # Inputs, with defaults
     13 
     14 : MOZHARNESS_SCRIPT             ${MOZHARNESS_SCRIPT}
     15 : MOZHARNESS_CONFIG             ${MOZHARNESS_CONFIG}
     16 : MOZHARNESS_CONFIG_PATHS       ${MOZHARNESS_CONFIG_PATHS}
     17 : MOZHARNESS_ACTIONS            ${MOZHARNESS_ACTIONS}
     18 : MOZHARNESS_OPTIONS            ${MOZHARNESS_OPTIONS}
     19 
     20 : TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/builds/worker/tooltool-cache}
     21 
     22 : MOZ_SCM_LEVEL                 ${MOZ_SCM_LEVEL:=1}
     23 
     24 : MOZ_SCM_LEVEL                 ${MOZ_SCM_LEVEL:=1}
     25 
     26 : WORKSPACE                     ${WORKSPACE:=/builds/worker/workspace}
     27 : MOZ_OBJDIR                    ${MOZ_OBJDIR:=$WORKSPACE/obj-build}
     28 
     29 set -v
     30 
     31 fail() {
     32    echo # make sure error message is on a new line
     33    echo "[build-l10n.sh:error]" "${@}"
     34    exit 1
     35 }
     36 
     37 export MOZ_CRASHREPORTER_NO_REPORT=1
     38 export TINDERBOX_OUTPUT=1
     39 
     40 # test required parameters are supplied
     41 if [[ -z ${MOZHARNESS_SCRIPT} ]]; then fail "MOZHARNESS_SCRIPT is not set"; fi
     42 if [[ -z "${MOZHARNESS_CONFIG}" && -z "${EXTRA_MOZHARNESS_CONFIG}" ]]; then fail "MOZHARNESS_CONFIG or EXTRA_MOZHARNESS_CONFIG is not set"; fi
     43 
     44 # set up mozharness configuration, via command line, env, etc.
     45 
     46 # $TOOLTOOL_CACHE bypasses mozharness completely and is read by tooltool_wrapper.sh to set the
     47 # cache.  However, only some mozharness scripts use tooltool_wrapper.sh, so this may not be
     48 # entirely effective.
     49 export TOOLTOOL_CACHE
     50 
     51 export MOZ_OBJDIR
     52 
     53 config_path_cmds=""
     54 for path in ${MOZHARNESS_CONFIG_PATHS}; do
     55    config_path_cmds="${config_path_cmds} --extra-config-path ${GECKO_PATH}/${path}"
     56 done
     57 
     58 # support multiple, space delimited, config files
     59 config_cmds=""
     60 for cfg in $MOZHARNESS_CONFIG; do
     61  config_cmds="${config_cmds} --config ${cfg}"
     62 done
     63 
     64 # if MOZHARNESS_ACTIONS is given, only run those actions (completely overriding default_actions
     65 # in the mozharness configuration)
     66 if [ -n "$MOZHARNESS_ACTIONS" ]; then
     67    actions=""
     68    for action in $MOZHARNESS_ACTIONS; do
     69        actions="$actions --$action"
     70    done
     71 fi
     72 
     73 # if MOZHARNESS_OPTIONS is given, append them to mozharness command line run
     74 if [ -n "$MOZHARNESS_OPTIONS" ]; then
     75    options=""
     76    for option in $MOZHARNESS_OPTIONS; do
     77        options="$options --$option"
     78    done
     79 fi
     80 
     81 cd /builds/worker
     82 
     83 $GECKO_PATH/mach python -- \
     84  $GECKO_PATH/testing/${MOZHARNESS_SCRIPT} \
     85  ${config_path_cmds} \
     86  ${config_cmds} \
     87  $actions \
     88  $options \
     89  --log-level=debug \
     90  --work-dir=$WORKSPACE \