Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webosose/build-webos
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.25.0
Choose a base ref
...
head repository: webosose/build-webos
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 79 additions and 38 deletions.
  1. +21 −13 mcf
  2. +48 −15 scripts/build.sh
  3. +10 −10 weboslayers.py
34 changes: 21 additions & 13 deletions mcf
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ from time import gmtime, strftime, sleep
import shutil
import glob

__version__ = "6.2.6"
__version__ = "6.2.8"

logger = logging.getLogger(__name__)

@@ -333,7 +333,13 @@ def wait_for_git_mirror(newcommitid):

def downloadrepo(layer):
cmd = 'git clone %s %s' % (layer["url"], layer["location"])
echo_check_call(cmd)
for retry in range(5):
try:
echo_check_call(cmd)
break
except subprocess.CalledProcessError:
logger.error("Can't %s retry: %d" % (cmd, retry+1))
sleep(3)

olddir = os.getcwd()
os.chdir(layer["location"])
@@ -730,18 +736,20 @@ def updaterepo(layer):
except subprocess.CalledProcessError:
raise Exception('Failed to fetch %s repo' % layer["location"])
else:
if CLEAN:
for retry in range(5):
try:
echo_check_call("git remote update")
echo_check_call('git reset --hard %s/%s' % (REMOTE, newbranch))
if CLEAN:
echo_check_call("git remote update")
echo_check_call('git reset --hard %s/%s' % (REMOTE, newbranch))
break
else:
# current branch always tracks a remote one
echo_check_call('git pull %s' % REMOTE)
break
except subprocess.CalledProcessError:
raise Exception('Failed to fetch %s repo' % layer["location"])
else:
# current branch always tracks a remote one
try:
echo_check_call('git pull %s' % REMOTE)
except subprocess.CalledProcessError:
raise Exception('Failed to fetch %s repo' % layer["location"])
logger.error("Can't remote update. retry: %d" % (retry+1))
if retry+1 == 5: raise Exception('Failed to fetch %s repo' % layer["location"])
sleep(3)
logger.info('Done updating [%s]' % layer["location"])
else:
logger.info(('[%s] is up-to-date.' % layer["location"]))
@@ -818,7 +826,7 @@ def checkmirror(name, url):

def sanitycheck(options):
try:
mirror = echo_check_call('git config -l | grep "^url\..*insteadof=github.com/"')
mirror = echo_check_call(r'git config -l | grep "^url\..*insteadof=github.com/"')
except subprocess.CalledProcessError:
# git config returns 1 when the option isn't set
mirror = ''
63 changes: 48 additions & 15 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
#set -x

# Some constants
SCRIPT_VERSION="6.11.0"
SCRIPT_VERSION="6.11.6"
SCRIPT_NAME=`basename $0`
AUTHORITATIVE_OFFICIAL_BUILD_SITE="rpt"

@@ -103,6 +103,7 @@ OPTIONS:
-T, --targets Targets to build (unlike images they aren't copied from buildhistory)
-M, --machines Machines to build
-b, --bom Generate BOM files
-o, --only-bom Generate webOS BOM only without image
-s, --signatures Dump sstate signatures, useful to compare why something is rebuilding
-u, --scp-url scp will use this path to download and update
\${URL}/latest_project_baselines.txt and also
@@ -219,8 +220,10 @@ function unset_buildhistory_commit {
}

function set_buildhistory_commit {
[ -f webos-local.conf ] && sed -i '/BUILDHISTORY_COMMIT/d' webos-local.conf
echo "BUILDHISTORY_COMMIT = \"1\"" >> webos-local.conf
if [ -n "${BUILD_BUILDHISTORY_PUSH_REF}" ]; then
[ -f webos-local.conf ] && sed -i '/BUILDHISTORY_COMMIT/d' webos-local.conf
echo "BUILDHISTORY_COMMIT = \"1\"" >> webos-local.conf
fi
}

function generate_webos_bom {
@@ -355,13 +358,18 @@ function add_buildhistory_artifacts {
ln -vn buildhistory/images/${BHMACHINE}/glibc/${I}/installed-package-sizes.txt ${ARTIFACTS}/${MACHINE}/${I}/installed-package-sizes.txt
if [ -d buildhistory/images/${BHMACHINE}/glibc/${I}/ls2_api ] ; then
cd buildhistory
git diff HEAD~1 HEAD images/${BHMACHINE}/glibc/${I}/ls2_api > ${ARTIFACTS}/${MACHINE}/${I}/ls2-api-diff.txt
git diff HEAD~1 HEAD images/${BHMACHINE}/glibc/${I}/ls2_api > ${ARTIFACTS}/${MACHINE}/${I}/ls2_api_diff.txt
cd -
fi

if [ -e buildhistory/images/${BHMACHINE}/glibc/${I}/installed-package-file-sizes.txt ] ; then
ln -vn buildhistory/images/${BHMACHINE}/glibc/${I}/installed-package-file-sizes.txt ${ARTIFACTS}/${MACHINE}/${I}/installed-package-file-sizes.txt
fi
if [ -f buildhistory/images/${BHMACHINE}/glibc/${I}/ls2_api_list.json ]; then
ln -vn buildhistory/images/${BHMACHINE}/glibc/${I}/ls2_api_list.json ${ARTIFACTS}/${MACHINE}/${I}/ls2_api_list.json
else
echo "Warning: There is no ls2_api_list.json at 'buildhistory/images/${BHMACHINE}/glibc/${I}'"
fi
fi
}

@@ -394,16 +402,20 @@ function move_artifacts {
mkdir -p "${ARTIFACTS}/${MACHINE}/${I}" || true
# we store only tar.gz, vmdk.zip and .epk images
# and we don't publish kernel images anymore
if ls BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk >/dev/null 2>/dev/null; then
if type zip >/dev/null 2>/dev/null; then
# zip vmdk images if they exists
find BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk -exec zip -j {}.zip {} \;
ln -vn BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk.zip ${ARTIFACTS}/${MACHINE}/${I}/
else
# report failure and publish vmdk
echo "ERROR: ${SCRIPT_NAME}-${SCRIPT_VERSION} zip utility isn't installed on the build server" >&2
RESULT+=1
ln -vn BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk ${ARTIFACTS}/${MACHINE}/${I}/
if ls BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk* >/dev/null 2>/dev/null; then
if ls BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk >/dev/null 2>/dev/null; then
if type zip >/dev/null 2>/dev/null; then
# zip vmdk images if they exists
find BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk -exec zip -j {}.zip {} \;
ln -vn BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk.zip ${ARTIFACTS}/${MACHINE}/${I}/
else
# report failure and publish vmdk
echo "ERROR: ${SCRIPT_NAME}-${SCRIPT_VERSION} zip utility isn't installed on the build server" >&2
RESULT+=1
ln -vn BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk ${ARTIFACTS}/${MACHINE}/${I}/
fi
elif ls BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk.gz >/dev/null 2>/dev/null; then
ln -vn BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.vmdk.gz ${ARTIFACTS}/${MACHINE}/${I}/
fi
# copy webosvbox if we've built vmdk image
if [ -e meta-webosose/meta-webos/scripts/webosvbox -a ! -e ${ARTIFACTS}/${MACHINE}/webosvbox ] ; then
@@ -516,6 +528,22 @@ function move_artifacts {
echo "WARN: No cve.json to copy as build artifacts"
fi

if ls BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.spdx.* >/dev/null 2>/dev/null; then
for SPDX in BUILD/deploy/images/${MACHINE}/${I}-${MACHINE}-*.spdx.*; do
if echo $SPDX | grep -q "${WEBOS_DISTRO_BUILD_ID}"; then
ln -vn $(readlink -f ${SPDX}) ${ARTIFACTS}/${MACHINE}/${I}/
fi
done
else
echo "WARN: No spdx files to copy as build artifacts"
fi

if ls BUILD/deploy/images/${MACHINE}/${I}-checksec.json >/dev/null 2>/dev/null; then
ln -vn BUILD/deploy/images/${MACHINE}/${I}-checksec.json ${ARTIFACTS}/${MACHINE}/${I}/checksec.json
else
echo "WARN: No checksec.json to copy as build artifacts"
fi

# delete possibly empty directories
rmdir --ignore-fail-on-non-empty ${ARTIFACTS}/${MACHINE}/${I} ${ARTIFACTS}/${MACHINE}
done
@@ -541,7 +569,7 @@ function move_artifacts {
add_md5sums_and_buildhistory_artifacts
}

TEMP=`getopt -o I:T:M:S:j:J:B:u:bshV --long images:,targets:,machines:,scp-url:,site:,jenkins:,job:,buildhistory-ref:,bom,signatures,help,version \
TEMP=`getopt -o I:T:M:S:j:J:B:u:bshV --long images:,targets:,machines:,scp-url:,site:,jenkins:,job:,buildhistory-ref:,bom,only-bom,signatures,help,version \
-n $(basename $0) -- "$@"`

if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 2 ; fi
@@ -560,6 +588,7 @@ while true ; do
-B|--buildhistory-ref) BUILD_BUILDHISTORY_PUSH_REF="$2" ; shift 2 ;;
-u|--scp-url) URL="$2" ; shift 2 ;;
-b|--bom) CREATE_BOM="Y" ; shift ;;
-o|--only-bom) CREATE_BOM="O" ; shift ;;
-s|--signatures) SIGNATURES="Y" ; shift ;;
-h|--help) showusage ; shift ;;
-V|--version) echo ${SCRIPT_NAME} ${SCRIPT_VERSION}; exit ;;
@@ -725,6 +754,10 @@ print_timestamp "before main '${JOB_NAME}' build"
FIRST_IMAGE=
if [ -z "${BMACHINES}" ]; then
echo "ERROR: calling build.sh without -M parameter"
elif [ "${CREATE_BOM}" = "O" -a -n "${BMACHINES}" ]; then
echo "[INFO] Generate webOS BOM only"
cd "${CALLDIR}"
exit 0;
else
# remove old ccache_stats.json
rm -fv ccache_stats.json
20 changes: 10 additions & 10 deletions weboslayers.py
Original file line number Diff line number Diff line change
@@ -58,32 +58,32 @@
# github.com/openembedded repositories are read-only mirrors of the authoritative
# repositories on git.openembedded.org
webos_layers = [
('bitbake', -1, 'https://github.com/openembedded/bitbake.git', 'branch=2.0,commit=42a1c9fe6', ''),
('bitbake', -1, 'https://github.com/openembedded/bitbake.git', 'branch=2.0,commit=eb5c1ce6b', ''),

('meta', 5, 'https://github.com/openembedded/openembedded-core.git', 'branch=kirkstone,commit=eea685e1ca', 'oe-core'),
('meta', 5, 'https://github.com/openembedded/openembedded-core.git', 'branch=kirkstone,commit=f09fca692f', 'oe-core'),

('meta-oe', 10, 'https://github.com/openembedded/meta-openembedded.git', 'branch=kirkstone,commit=402affcc07', 'meta-oe'),
('meta-oe', 10, 'https://github.com/openembedded/meta-openembedded.git', 'branch=kirkstone,commit=dd3d2293ff', 'meta-oe'),
('meta-multimedia', 11, 'https://github.com/openembedded/meta-openembedded.git', '', 'meta-oe'),
('meta-networking', 12, 'https://github.com/openembedded/meta-openembedded.git', '', 'meta-oe'),
('meta-python', 13, 'https://github.com/openembedded/meta-openembedded.git', '', 'meta-oe'),
('meta-filesystems', 14, 'https://github.com/openembedded/meta-openembedded.git', '', 'meta-oe'),

('meta-clang', 15, 'https://github.com/kraj/meta-clang.git', 'branch=kirkstone,commit=1602c0a', ''),
('meta-virtualization', 17, 'https://git.yoctoproject.org/git/meta-virtualization', 'branch=kirkstone,commit=88327090', ''),
('meta-clang', 15, 'https://github.com/kraj/meta-clang.git', 'branch=kirkstone,commit=8bc893d', ''),
('meta-virtualization', 17, 'https://git.yoctoproject.org/git/meta-virtualization', 'branch=kirkstone,commit=02a6c00d', ''),

('meta-qt6', 20, 'https://code.qt.io/yocto/meta-qt6.git', 'branch=6.6.0,commit=v6.6.0', ''),
('meta-qt6', 20, 'https://code.qt.io/yocto/meta-qt6.git', 'branch=6.7.2,commit=v6.7.2', ''),

('meta-webos-backports-4.1', 30, 'https://github.com/webosose/meta-webosose.git', '', ''),
('meta-webos-backports-4.2', 31, 'https://github.com/webosose/meta-webosose.git', '', ''),
('meta-webos-backports-4.3', 32, 'https://github.com/webosose/meta-webosose.git', '', ''),
('meta-webos-backports-5.0', 33, 'https://github.com/webosose/meta-webosose.git', '', ''),
('meta-webos-backports-5.1', 34, 'https://github.com/webosose/meta-webosose.git', '', ''),

('meta-webos', 40, 'https://github.com/webosose/meta-webosose.git', 'branch=master,commit=1a6a5fce', ''),
('meta-webos', 40, 'https://github.com/webosose/meta-webosose.git', 'branch=master,commit=9af32dd4', ''),

('meta-raspberrypi', 50, 'https://github.com/agherzan/meta-raspberrypi.git', 'branch=kirkstone,commit=59a6a1b', ''),
('meta-raspberrypi', 50, 'https://github.com/agherzan/meta-raspberrypi.git', 'branch=kirkstone,commit=d7544f3', ''),
('meta-webos-raspberrypi', 51, 'https://github.com/webosose/meta-webosose.git', '', ''),
('meta-webos-virtualization', 53, 'https://github.com/webosose/meta-webosose.git', '', ''),

('meta-webos-smack', 75, 'https://github.com/webosose/meta-webosose.git', '', ''),
('meta-security', 77, 'https://git.yoctoproject.org/git/meta-security', 'branch=kirkstone,commit=1a3e42c', ''),
('meta-security', 76, 'https://git.yoctoproject.org/git/meta-security', 'branch=kirkstone,commit=353078b', ''),
]