diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2019-07-27 22:33:56 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2019-07-28 02:40:19 -0400 |
commit | 38012be5bddbcec27030cb099d4c4237af776e6f (patch) | |
tree | 6fee1488557bc7cef0c62181c9a34c9f0a983a87 | |
parent | c3a7343edc9e4e71bc2b2168e134f5f3189f3270 (diff) |
squashme - binary build
-rwxr-xr-x | branding-dev-build/branding-dev-build.sh | 122 |
1 files changed, 52 insertions, 70 deletions
diff --git a/branding-dev-build/branding-dev-build.sh b/branding-dev-build/branding-dev-build.sh index 6ad2012..b4c3d00 100755 --- a/branding-dev-build/branding-dev-build.sh +++ b/branding-dev-build/branding-dev-build.sh @@ -1,4 +1,5 @@ #!/bin/bash +#!/bin/bash # 'branding-dev-build.sh' pre-compiled binary builds for front-end dev # 'bootstrap.py' from: @@ -16,97 +17,76 @@ readonly USE_GIT=0 # git support requires 'git-cinnabar', per the Artifact_build readonly CWD=${PWD} readonly BINARY_BUILD_SRCDIR=${CWD}/sources readonly BINARY_BUILD_OBJDIR=${CWD}/mozbuild -readonly CID_FILE=${BINARY_BUILD_SRCDIR}/UPSTREAM_CID +readonly CID_FILENAME='UPSTREAM_CID' +readonly CID_FILE=${CWD}/${CID_FILENAME} readonly MOZCONFIG_FILE=${BINARY_BUILD_SRCDIR}/.mozconfig -readonly PARSE_CID_CMD='$(head --bytes=40 '${CID_FILE}' 2> /dev/null)' +readonly BOOTSTRAP_BASE_CMD='python2 ./bootstrap.py --application-choice=browser_artifact_mode' readonly COMMIT_MSG='nobody $(date +%F-%H-%M-%S)' +readonly PARSE_CID_CMD='$(head --bytes=40 '${CID_FILE}' 2> /dev/null)' +readonly VALIDATE_CMD='[[ "${PARSE_CID_CMD}" =~ ^[0-9a-f]{40}$ ]]' readonly TIMESTAMP_REGEX='s|.*"nobody ([0-9-]{19})"|\1|' -readonly PATCH_FILE=${CWD}'/${timestamp}.patch' -(( ${USE_GIT} )) && readonly BOOTSTRAP_CMD='python2 ./bootstrap.py --vcs=git' || \ - readonly BOOTSTRAP_CMD='python2 ./bootstrap.py' -(( ${USE_GIT} )) && readonly CHECKOUT_CMD='git clone https://github.com/mozilla/gecko-dev.git' || \ +readonly PATCH_FILE=${CWD}/'${timestamp}.patch' +(( ${USE_GIT} )) && readonly BOOTSTRAP_CMD=${BOOTSTRAP_BASE_CMD}' --vcs=git' || \ + readonly BOOTSTRAP_CMD=${BOOTSTRAP_BASE_CMD}' --vcs=hg' +(( ${USE_GIT} )) && readonly CHECKOUT_CMD='git clone https://github.com/mozilla/gecko-dev.git' || \ readonly CHECKOUT_CMD='hg clone https://hg.mozilla.org/mozilla-unified' -(( ${USE_GIT} )) && readonly MARKER_CMD='$(git merge-base origin/master HEAD > '${CID_FILE}')' || \ - readonly MARKER_CMD='false' # NYI -(( ${USE_GIT} )) && readonly VALIDATE_CMD='$([[ "'${PARSE_CID_CMD}'" =~ ^[0-9a-f]{40}$ ]])' || \ - readonly VALIDATE_CMD='false' # NYI -(( ${USE_GIT} )) && readonly STAGE_CMD='git add '${CID_FILE} .gitconfig || \ +(( ${USE_GIT} )) && readonly MARKER_CMD='git merge-base origin/master HEAD' || \ + readonly MARKER_CMD='hg log --rev tip --template {node}' +(( ${USE_GIT} )) && readonly STAGE_CMD='git add . .gitconfig' || \ readonly STAGE_CMD='hg addremove' # readonly STAGE_CMD='hg add .'OR${CID_FILE} -(( ${USE_GIT} )) && readonly VCS_ENV_CMD='cp {${CWD}/,${BINARY_BUILD_SRCDIR}/.}gitconfig' || \ +(( ${USE_GIT} )) && readonly VCS_ENV_CMD='cp {${CWD}/,${BINARY_BUILD_SRCDIR}/.}gitconfig' || \ readonly VCS_ENV_CMD='cp {${CWD}/,${BINARY_BUILD_SRCDIR}/.hg/}hgrc' -(( ${USE_GIT} )) && readonly COMMIT_CMD='git commit --all --message=\"$(COMMIT_MSG)\"' || \ +(( ${USE_GIT} )) && readonly COMMIT_CMD='git commit --message=\"$(COMMIT_MSG)\"' || \ readonly COMMIT_CMD='hg commit --message=\"$(COMMIT_MSG)\"' -(( ${USE_GIT} )) && readonly PATCH_CMD='git diff --patch '${PARSE_CID_CMD}' HEAD >> '${PATCH_FILE} || \ - readonly PATCH_CMD='hg log --follow --patch > ${PATCH_FILE}' # commited range +(( ${USE_GIT} )) && readonly PATCH_CMD='git diff --patch ${PARSE_CID_CMD} HEAD' || \ + readonly PATCH_CMD='hg log --follow --patch' # commited range # readonly PATCH_CMD='hg export -o ${PATCH_FILE} -r tip' # commited tip # readonly PATCH_CMD='hg diff -r '${PARSE_CID_CMD}':0000 path > '${PATCH_FILE} # commited range # readonly PATCH_CMD='hg diff -g > ${PATCH_FILE}' # uncommited # readonly PATCH_CMD='hg log --patch > ${PATCH_FILE}' # commited - # hg log --follow --template "{node}\n" # base CID - # hg log --follow --template "{node}\n" # -# exit - -# unused config -# +[ui] -# +username = nobody <nobody@nowhere.man> -# +interface = curses -# +[diff] -# +git = true -# +showfunc = true -# +[extensions] -# +absorb = -# +histedit = -# +rebase = -# +evolve = /code/iceweasel/branding-dev-build/mozbuild/evolve/hgext3rd/evolve - - -# echo "MARKER_CMD=$MARKER_CMD" -# echo "VALIDATE_CMD=$VALIDATE_CMD" -# echo in1 -# echo "PATCH_CMD IZ $PATCH_CMD" -# echo in2 -# commit_cmd=$(eval echo ${COMMIT_CMD}) -# timestamp=$(sed -E 's|.*"([0-9:-]{19})"|\1|' <<< ${commit_cmd}) -# echo "commit_cmd=$commit_cmd" -# echo "timestamp=$timestamp" -# eval $PATCH_CMD -# ${STAGE_CMD} && eval ${VCS_ENV_CMD} && eval ${commit_cmd} && eval $PATCH_CMD && echo t || echo f && echo ff -# echo out -# exit PrepareMozillaBinaryBuild() { + [[ -d ${BINARY_BUILD_OBJDIR}/ ]] || mkdir ${BINARY_BUILD_OBJDIR} if [[ ! -d ${BINARY_BUILD_SRCDIR}/ ]] then echo - echo "NOTE: This script will prompt for a series of decisions." - echo " The buld will require approximately 30GB disk space." - echo " When prompted for build type, select: 'Firefox for Desktop Artifact Mode'." - echo " Install the required parabola and AUR packages" - echo " (currently there is one AUR dep: 'uuid' (ossp-uuid))." - echo " When prompted to create the 'mozbuild' directory, opt to create it." - echo " When prompted for 'Destination directory for Git clone', leave empty to reject." - ${BOOTSTRAP_CMD} + echo "NOTE: This initial setup will be run only once, or when the upstream sources are otherwise mising." + echo " The build will require approximately 30GB disk space." ${CHECKOUT_CMD} ${BINARY_BUILD_SRCDIR} + echo + echo "NOTE: This bootstrap script will prompt for a series of decisions." + echo " You should see: \"Using an experimental bootstrapper for Archlinux.\"." + echo " When prompted for requisites, opt to install the required Parabola and AUR packages." + echo " When prompted to configure the VCS tool, deny." + echo " When prompted to enable telemetry, deny." + echo " The bootstrap script will then download the tooling." + echo " You should see: \"Your system should be ready to build Firefox for Desktop Artifact Mode!
\"" + echo " Ignore the note about the $topsrcdir/mozconfig file; but do open a new shell to continue." + cd ${BINARY_BUILD_SRCDIR}/ ; ${BOOTSTRAP_CMD} ; cd ${CWD} ; else echo "Source directory 'sources' already exists." fi # mark upstream CID and validate - cd ${BINARY_BUILD_SRCDIR}/ ; rm ${CID_FILE} 2> /dev/null ; eval ${MARKER_CMD} ; cd ${CWD} ; - ! eval ${VALIDATE_CMD} && echo -e "\nThe ${CID_FILE} file is missing. The VCS may be insane." && \ - echo -n "The contents of that file will be injected as a comment" && \ - echo -n " into the patch files, to indicate the upstream" && \ - echo " checkout-point against which the patch was created." && \ - echo "Try running these commands before continuing:" && \ - echo " $ cd ${BINARY_BUILD_SRCDIR}" && \ - echo " $ git merge-base origin/master HEAD > ${CID_FILE}" && \ - echo " $ cd ${CWD}" && \ - echo -n "If that fails, you probably need to delete the" && \ - echo " ${BINARY_BUILD_SRCDIR} directory and start fresh." && \ - return 1 || \ - return 0 + rm ${CID_FILE} 2> /dev/null + cd ${BINARY_BUILD_SRCDIR}/ ; ${MARKER_CMD} > ${CID_FILE} ; cd ${CWD} ; + + if ! eval echo ${VALIDATE_CMD} > /dev/null + then echo + echo "NOTE: The file: ${CID_FILE} is missing. The VCS may be insane." + echo " The contents of that file will be injected as a comment into the patch files," + echo " to indicate the upstream checkout-point against which the patch was created." + echo " Try running these commands before continuing:" + echo " $ cd ${BINARY_BUILD_SRCDIR}" + echo " $ git merge-base origin/master HEAD > ../${CID_FILENAME}" + echo " $ cd ${CWD}" + echo " If that fails, you probably need to delete the" + echo " ${BINARY_BUILD_SRCDIR} directory and start fresh." + return 1 + else return 0 + fi } ConfigMozillaBinaryBuild() @@ -139,6 +119,7 @@ BINARY_BUILD_END local commit_cmd=$(eval echo ${COMMIT_CMD}) local timestamp=$(sed -E "${TIMESTAMP_REGEX}" <<< ${commit_cmd}) + local patch_comment="Created against upstream VCS checkout-point: $(eval echo ${PARSE_CID_CMD})" echo "commit_cmd=${commit_cmd}" echo "timestamp=${timestamp}" eval echo ${PATCH_FILE} @@ -146,9 +127,10 @@ eval echo ${PATCH_FILE} echo "NOTE: Your local changes are about to be committed to the upstream VCS;" echo " and a patch file against the pristine upstream source will be written." echo " The ID of this commit/patch is: ${timestamp}." - echo "Created against upstream VCS checkout-point: ${PARSE_CID_CMD}" > $(eval echo ${PATCH_FILE}) - ${STAGE_CMD} && eval ${VCS_ENV_CMD} && eval ${commit_cmd} && eval ${PATCH_CMD} && return 0 || \ - echo "Failed to commit changes and/or write patch file." && return 1 + echo ${patch_comment} > $(eval echo ${PATCH_FILE}) + ${STAGE_CMD} && eval ${VCS_ENV_CMD} && eval ${commit_cmd} && \ + eval ${PATCH_CMD} >> ${PATCH_FILE} && return 0 || \ + echo "Failed to commit changes and/or write patch file." && return 1 } ReBuildMozillaBinaryBuild() |