Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/oniro-core/oniro
  • landgraf/oniro
  • zyga/oniro
  • mrybczyn/oniro
  • agherzan/oniro
  • pcoval/oniro
  • tony3oo3/oniro
  • stefanschmidt/oniro
  • waykovalenko/oniro
  • bero/oniro
  • esben/oniro
  • robertd/oniro
  • pidge/oniro
  • shettygururaj/oniro
  • thierrye/oniro
  • sradakovi/oniro
  • dricci783/oniro
  • ektor5/oniro
  • fldn/oniro
  • lucafavaretto/oniro
  • lucazizolfi/oniro
  • artemkondratiuk/oniro
  • lucaseri/oniro
  • gwozdzcfs/oniro
  • kristis/oniro
  • brgl/oniro
  • heurtemattes/oniro
  • idlethread/oniro
  • lquach/oniro
  • ghassaneben/oniro
  • heurtemattes/oniro-bitbake
  • kzarka/oniro
  • heurtemattes/oniro-migration
  • pastanki/oniro
  • malowe/oniro
  • chaseqi/oniro
  • mrfrank/oniro
37 results
Show changes
Commits on Source (918)
Showing
with 1184 additions and 342 deletions
......@@ -5,3 +5,5 @@
docs/build
*.pyc
*.pyo
*.swp
*~
......@@ -17,20 +17,28 @@
stages:
- compliance
- build
- build-gcc
- build-clang
- update
- test
- report
- deploy
include:
- local: '/.oniro-ci/build-generic.yaml'
- local: '/.oniro-ci/test-generic.yaml'
- local: '/.oniro-ci/machines-and-flavours.yaml'
- local: '/.oniro-ci/dco.yaml'
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
- local: '/.oniro-ci/build-generic.yaml'
- local: '/.oniro-ci/test-generic.yaml'
- local: '/.oniro-ci/machines-and-flavours.yaml'
- local: '/.oniro-ci/dco.yaml'
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
- project: 'eclipsefdn/it/releng/gitlab-runner-service/gitlab-ci-templates'
file: '/jobs/eca.gitlab-ci.yml'
dco:
extends: .dco
eca:
extends: .eca
build-docs:
extends: .build-docs
......@@ -45,15 +53,22 @@ aggregate-docs:
variables:
CI_ONIRO_GIT_REPO_PATH: oniro
# Customize the .bitbake-workspace job to set the rules governing when a build
# is attempted to: modifications (changes) to the pipeline, meta-layers,
# flavours and assets OR to placement of a tag on a commit OR when a job is
# scheduled. In addition, draft merge requests will no longer start the heavy
# build jobs automatically, giving an option to the developer, to start the
# desired jobs manually.
.bitbake-workspace:
# Anchor job rules, which govern if a job is instantiated in a given pipeline.
# This job is then used as another base to several different jobs, including
# .bitbake-workspace, .build-rauc-bundle and the
# .publish-rauc-bundle-to-hawkbit jobs.
#
# The rules are: modifications (changes) to the pipeline, meta-layers, flavours
# and assets OR to placement of a tag on a commit OR when a job is scheduled.
# In addition, draft merge requests will no longer start the heavy build jobs
# automatically, giving an option to the developer, to start the desired jobs
# manually.
.workspace-rules:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
variables:
CI_ONIRO_MANIFEST_URL: "$CI_PROJECT_URL"
CI_ONIRO_MANIFEST_BRANCH: "$CI_COMMIT_REF_NAME"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(wip|draft):.*/i'
when: manual
variables:
......@@ -61,13 +76,6 @@ aggregate-docs:
CI_ONIRO_MANIFEST_URL: "$CI_MERGE_REQUEST_SOURCE_PROJECT_URL"
CI_ONIRO_MANIFEST_BRANCH: "$CI_COMMIT_REF_NAME"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- assets/**/*
- flavours/**/*
- manifests/*.xml
- meta-*/**/*
- .oniro-ci/*
- .gitlab-ci.yml
# When building a merge request substitute the CI_ONIRO_MANIFEST_URL to point
# to the incoming repository, and CI_ONIRO_MANIFEST_BRANCH, to the right
# branch name. This allows testing the changes coming into project. This
......@@ -78,77 +86,82 @@ aggregate-docs:
- if: '$CI_COMMIT_TAG'
# XXX: This needs CI_ONIRO_MANIFEST_BRANCH as well, most likely.
# Mimic the updated rules for lava-test from the bitbake-workspace.
.lava-test:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(wip|draft):.*/i'
when: manual
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- assets/**/*
- flavours/**/*
- manifests/*.xml
- meta-*/**/*
- .oniro-ci/*
- if: '$CI_COMMIT_TAG'
# Mimic the updated rules for lava-report from the bitbake-workspace.
.lava-report:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(wip|draft):.*/i'
when: manual
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- assets/**/*
- flavours/**/*
- manifests/*.xml
- meta-*/**/*
- .oniro-ci/*
- if: '$CI_COMMIT_TAG'
# The three jobs defined below override the definitions from build-generic.yaml
# to inject .workspace-rules and the rules defined therein. It is important to
# understand that this is based on several separate systems: parsing and
# loading yaml, processing the include rules, and processing extends rules.
#
# This specific trick (ab)uses the fact that yaml-top-level is one big map of
# entities, and we can define an entity multiple times to effectively extend or
# replace specific elements.
#
# The following three jobs are equivalent to copy-pasting the modified extends
# line into the jobs in .oniro-ci/build-generic.yaml, because map/dictionary
# entries compute the union of the defined keys, unlike list entries or scalars
# that replace the previous value.
.bitbake-workspace:
extends: [.workspace, .workspace-rules]
.build-rauc-bundle:
extends: [.build-image, .workspace-rules]
##
## Submit jobs to LAVA
##
lava-linux-avenger96:
needs: [linux-stm32mp1-av96]
stage: test
extends: .lava-test
.publish-rauc-bundle-to-hawkbit:
extends: [.workspace-rules]
# Build a RAUC update bundle for qemu x86
bundle-qemu-x86:
extends: .build-rauc-bundle
stage: update
# Depend on the build job to prevent repeating build failures.
needs: [linux-qemu-x86-gcc]
variables:
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/avenger96-acts.yaml"
CI_BUILD_JOB_NAME: linux-stm32mp1-av96
CI_REPORT_JOB_NAME: lava-report
rules:
- when: never
MACHINE: qemux86
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-bundle-base
lava-qemu-x86_64:
needs: [linux-qemu-x86_64]
stage: test
extends: .lava-test
# Build a RAUC update bundle for qemu x86 64
bundle-qemu-x86_64:
extends: .build-rauc-bundle
stage: update
# Depend on the build job to prevent repeating build failures.
needs: [linux-qemu-x86_64-gcc]
variables:
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86_64-acts.yaml"
CI_BUILD_JOB_NAME: linux-qemu-x86_64
CI_REPORT_JOB_NAME: lava-report
rules:
- when: never
MACHINE: qemux86-64
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-bundle-base
lava-qemu-x86:
needs: [linux-qemu-x86]
stage: test
extends: .lava-test
# Build a RAUC update bundle for Raspberry Pi 4
bundle-raspberrypi4-64:
extends: .build-rauc-bundle
stage: update
# Depend on the build job to prevent repeating build failures.
needs: [linux-raspberrypi4-64-gcc]
variables:
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86-acts.yaml"
CI_BUILD_JOB_NAME: linux-qemu-x86
CI_REPORT_JOB_NAME: lava-report
rules:
- when: never
MACHINE: raspberrypi4-64
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-bundle-base
# Build a RAUC update bundle for SECO B68
bundle-seco-intel-b68:
extends: .build-rauc-bundle
stage: update
# Depend on the build job to prevent repeating build failures.
needs: [linux-seco-intel-b68-gcc]
variables:
MACHINE: seco-intel-b68
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-bundle-base
lava-report:
needs: [lava-linux-avenger96, lava-qemu-x86_64, lava-qemu-x86]
extends: .lava-report
.build-wic-image-daily:
extends: .build-wic-image
variables:
# Add packages needed by daily testing.
CI_ONIRO_BB_LOCAL_CONF_IMAGE_INSTALL_colon_append: " ltp"
rules:
- when: never
# Run the build for scheduled pipelines.
- if: '$CI_PIPELINE_SOURCE == "schedule"'
.build-with-kaniko:
stage: build
......@@ -156,10 +169,22 @@ lava-report:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- test -n "$CI_ONIRO_REGISTRY" || (
echo "CI_ONIRO_REGISTRY not provided. Docker registry deployment can not continue."
&& exit 1 )
- test -n "$CI_ONIRO_REGISTRY_IMAGE" || (
echo "CI_ONIRO_REGISTRY_IMAGE not provided. Docker registry deployment can not continue."
&& exit 1 )
- test -n "$CI_ONIRO_REGISTRY_USER" || (
echo "CI_ONIRO_REGISTRY_USER not provided. Docker registry deployment can not continue."
&& exit 1 )
- test -n "$CI_ONIRO_REGISTRY_TOKEN" || (
echo "CI_ONIRO_REGISTRY_TOKEN not provided. Docker registry deployment can not continue."
&& exit 1 )
- |
set -xe
mkdir -p /kaniko/.docker
printf '{"auths":{"%s":{"auth":"%s"}}}\n' "$CI_REGISTRY" "$(printf '%s:%s' "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64)" > /kaniko/.docker/config.json
printf '{"auths":{"%s":{"auth":"%s"}}}\n' "$CI_ONIRO_REGISTRY" "$(printf '%s:%s' "$CI_ONIRO_REGISTRY_USER" "$CI_ONIRO_REGISTRY_TOKEN" | base64)" > /kaniko/.docker/config.json
BUILD_DATE="$(date '+%FT%T%z' | sed -E -n 's/(\+[0-9]{2})([0-9]{2})$/\1:\2/p')" #rfc 3339 date
BUILD_TITLE=$(echo "$CI_PROJECT_TITLE" | tr " " "_")
IMAGE_LABELS="$(cat <<EOM
......@@ -176,7 +201,7 @@ lava-report:
--label org.opencontainers.image.description=$BUILD_TITLE
--label org.opencontainers.image.documentation=$CI_PROJECT_URL
--label org.opencontainers.image.licenses=$CI_PROJECT_URL
--label org.opencontainers.image.ref.name=$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
--label org.opencontainers.image.ref.name=$CI_ONIRO_REGISTRY:$CI_COMMIT_REF_NAME
--label org.opencontainers.image.revision=$CI_COMMIT_SHA
--label org.opencontainers.image.source=$CI_PROJECT_URL
--label org.opencontainers.image.title=$BUILD_TITLE
......@@ -199,9 +224,11 @@ lava-report:
fi
FORMATTED_TAG_LIST="$(echo "$FORMATTED_TAG_LIST" | sed -e 's/--tag/--destination/g')"
echo "Building and shipping image to $CI_REGISTRY_IMAGE"
exec /kaniko/executor --context "$CI_PROJECT_DIR/.oniro-ci/containers/$CONTAINER_PATH" --dockerfile "$CI_PROJECT_DIR/.oniro-ci/containers/$CONTAINER_PATH/Dockerfile" --destination $CI_REGISTRY_IMAGE/$CONTAINER_PATH $IMAGE_LABELS
echo "Building and shipping image to $CI_ONIRO_REGISTRY"
exec /kaniko/executor --context "$CI_PROJECT_DIR/.oniro-ci/containers/$CONTAINER_PATH" --dockerfile "$CI_PROJECT_DIR/.oniro-ci/containers/$CONTAINER_PATH/Dockerfile" --destination $CI_ONIRO_REGISTRY_IMAGE/$CONTAINER_PATH $IMAGE_LABELS
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- .oniro-ci/containers/$CONTAINER_PATH/*
......@@ -233,3 +260,93 @@ build-npm-cspell:
extends: .build-with-kaniko
variables:
CONTAINER_PATH: npm-cspell
.oe-selftest-rules:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_TYPE == "weekly" && $OE_SELFTEST == "gcc"
oe-selftest-gcc-qemu-linux-user:
extends: [.oe-selftest, .oe-selftest-rules]
variables:
# Set the variable to 'gcc' will run all tests defined in the gcc.py file.
# https://github.com/openembedded/openembedded-core/blob/master/meta/lib/oeqa/selftest/cases/gcc.py#L79
CI_ONIRO_OE_SELFTESTS:
gcc.GccCrossSelfTest
gcc.GccLibAtomicSelfTest
gcc.GccLibGompSelfTest
gcc.GccLibItmSelfTest
gcc.GccLibSspSelfTest
gcc.GccLibStdCxxSelfTest
gcc.GxxCrossSelfTest
.oe-selftest-gcc-system-emulated:
timeout: 8h
extends: [.oe-selftest, .oe-selftest-rules]
variables:
MACHINE: qemux86-64
CI_ONIRO_OE_SELFTESTS:
gcc.GccCrossSelfTestSystemEmulated
gcc.GccLibAtomicSelfTestSystemEmulated
gcc.GccLibGompSelfTestSystemEmulated
gcc.GccLibItmSelfTestSystemEmulated
gcc.GccLibStdCxxSelfTestSystemEmulated
gcc.GccLibSspSelfTestSystemEmulated
gcc.GxxCrossSelfTestSystemEmulated
oe-selftest-gcc-system-emulated-qemux86-64:
extends: .oe-selftest-gcc-system-emulated
variables:
MACHINE: qemux86-64
oe-selftest-gcc-system-emulated-qemuarm64:
extends: .oe-selftest-gcc-system-emulated
variables:
MACHINE: qemuarm64
oe-selftest-report:
timeout: 6h
extends: .oe-selftest-rules
image:
name: registry.ostc-eu.org/ostc/oniro/bitbake-builder:latest
stage: report
dependencies:
- oe-selftest-gcc-qemu-linux-user
- oe-selftest-gcc-system-emulated-qemux86-64
- oe-selftest-gcc-system-emulated-qemuarm64
needs:
- oe-selftest-gcc-qemu-linux-user
- oe-selftest-gcc-system-emulated-qemux86-64
- oe-selftest-gcc-system-emulated-qemuarm64
script:
- |
set -x
curl https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-test-definitions/-/raw/oniro/automated/utils/gcc-result-parser.py \
> gcc-result-parser.py
for job_path in $(find artifacts/ -type d -name oe-selftest-gcc*); do
(
job=$(basename $job_path)
test_env="$(echo $job | cut -d'-' -f4-)"
cd $job_path
xz -d *.xz
# Parse sum file.
for sum_file in $(ls *.sum); do
python3 $CI_PROJECT_DIR/gcc-result-parser.py $sum_file
done
# Upload result to squad.
gcc_version="$(cat gcc_version)"
for result_file in $(ls result_*.json); do
component="$(basename $result_file .json | cut -d'_' -f2-)"
job_id="$job-$component"
time curl \
--header "Auth-Token: $CI_SQUAD_TOKEN" \
https://squadp.svc.ostc-eu.dev/api/submit/scheduled-weekly/gcc/$CI_PIPELINE_ID/$test_env \
--form tests=@$result_file \
--form "metadata={\"job_id\": \"$job_id\", \"gcc_version\": \"$gcc_version\"}"
done
)
done
set +x
artifacts:
paths:
- artifacts/oe-selftest-gcc*/*.json
- artifacts/oe-selftest-gcc*/*.txt
<!--
SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: MIT
-->
## The module affected
## What is the action to reproduce the bug?
(Steps to reproduce)
## What is the result you see?
(Actual result)
## What is the result you expect?
(Expected behaviour)
## Frequency?
(always, sometimes, one-time issue)
## Tested version
(image name and version, platform)
## Do you know any workaround of this issue?
(link to workaround/mitigation steps etc)
## Do you have a fix for this issue?
(link to upstream patch, merge/pull request)
/label ~"Issue::Bug" ~needs-investigation ~"team::maintenance"
......@@ -5,16 +5,19 @@
.workspace:
interruptible: true
image:
name: registry.booting.oniroproject.org/distro/oniro/bitbake-builder:latest
name: registry.ostc-eu.org/ostc/oniro/bitbake-builder:latest
tags: [large-disk, $CI_ONIRO_RUNNER_TAG, $CI_ONIRO_INSTANCE_SIZE]
variables:
CI_ONIRO_RUNNER_TAG : ""
CI_ONIRO_MANIFEST_URL: https://booting.oniroproject.org/distro/oniro
CI_ONIRO_MANIFEST_BRANCH: dunfell
CI_ONIRO_MANIFEST_URL: https://gitlab.eclipse.org/eclipse/oniro-core/oniro
CI_ONIRO_MANIFEST_BRANCH: kirkstone
CI_ONIRO_MANIFEST_NAME: default.xml
CI_ONIRO_MANIFEST_MIRROR: oniro-develop
CI_ONIRO_GIT_REPO_PATH: ""
CI_ONIRO_INSTANCE_SIZE: s3.large.8
# For testing with bleeding edge Yocto.
CI_ONIRO_OECORE_REPO: ""
CI_ONIRO_OECORE_BRANCH: ""
before_script:
- test ! -e "$CI_PROJECT_DIR"/.scratch-dir-name || (
echo "precondition failed - concurrent modification of $CI_PROJECT_DIR"
......@@ -30,29 +33,45 @@
- cd "$SCRATCH_DIR"
- |
set -x
echo "Building repo workspace with the following properties:"
echo "CI_ONIRO_MANIFEST_URL: $CI_ONIRO_MANIFEST_URL"
echo "CI_ONIRO_MANIFEST_NAME: $CI_ONIRO_MANIFEST_NAME"
echo "CI_ONIRO_MANIFEST_BRANCH: $CI_ONIRO_MANIFEST_BRANCH"
repo init --reference \
/var/shared/pub/git-repo-mirrors/"$CI_ONIRO_MANIFEST_MIRROR" \
repo init \
$(test -n "${CI_ONIRO_RUNNER_PERSISTENT_STORAGE:-}" && echo --reference "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE"/pub/git-repo-mirrors/"$CI_ONIRO_MANIFEST_MIRROR") \
--manifest-url "$CI_ONIRO_MANIFEST_URL" \
--manifest-name "$CI_ONIRO_MANIFEST_NAME" \
--manifest-branch "$CI_ONIRO_MANIFEST_BRANCH"
set +x
- time repo sync --no-clone-bundle
# See the documentation of CI_ONIRO_GIT_REPO_PATH
- |
set -x
if [ -n "$CI_ONIRO_GIT_REPO_PATH" ]; then
if [ -n "$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" ]; then
echo "CI: Bootstrapping '$CI_PROJECT_DIR' as 'incoming-merged' remote in '$CI_ONIRO_GIT_REPO_PATH'";
( cd "$CI_ONIRO_GIT_REPO_PATH" \
&& git remote add incoming-merged "$CI_PROJECT_DIR" \
&& git fetch incoming-merged HEAD );
fi;
echo "CI: Switching $CI_ONIRO_GIT_REPO_PATH to $CI_COMMIT_SHA";
( cd "$CI_ONIRO_GIT_REPO_PATH" && git checkout "$CI_COMMIT_SHA" );
if [ ! -d "$CI_ONIRO_GIT_REPO_PATH/.git" ]; then
echo "Configuration error? $CI_ONIRO_GIT_REPO_PATH is not a git repository"
fi
echo "CI: Replacing $CI_ONIRO_GIT_REPO_PATH with $CI_PROJECT_DIR"
rm -rf "$CI_ONIRO_GIT_REPO_PATH"
ln -sf "$CI_PROJECT_DIR" "$CI_ONIRO_GIT_REPO_PATH"
fi
set +x
- |
set -x
if [ -n "$CI_ONIRO_OECORE_BRANCH" ]; then
if [ -n "$CI_ONIRO_OECORE_REPO" ]; then
echo "CI: Using oe-core from '$CI_ONIRO_OECORE_REPO': '$CI_ONIRO_OECORE_BRANCH'"
( cd oe-core && git remote add oecore-nut "$CI_ONIRO_OECORE_REPO" \
&& git fetch oecore-nut && git checkout oecore-nut/"$CI_ONIRO_OECORE_BRANCH" )
else
echo "CI: Using oe-core branch: '$CI_ONIRO_OECORE_BRANCH'"
( cd oe-core && git fetch && git checkout "$CI_ONIRO_OECORE_BRANCH" )
fi
fi
set +x
script:
# Reload the value of SCRATCH_DIR set in the before_script phase. Those run
......@@ -79,8 +98,8 @@
CI_ONIRO_BUILD_FLAVOUR: ""
CI_ONIRO_BUILD_CACHE: "private"
CI_ONIRO_BB_LOCAL_CONF_CONNECTIVITY_CHECK_URIS: "https://example.net/"
CI_ONIRO_BB_LOCAL_CONF_DL_DIR: /var/shared/$CI_ONIRO_BUILD_CACHE/bitbake/downloads
CI_ONIRO_BB_LOCAL_CONF_SSTATE_DIR: /var/shared/$CI_ONIRO_BUILD_CACHE/bitbake/sstate-cache
CI_ONIRO_BB_LOCAL_CONF_DL_DIR: $CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake/downloads
CI_ONIRO_BB_LOCAL_CONF_SSTATE_DIR: $CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake/sstate-cache
CI_ONIRO_BB_LOCAL_CONF_IMAGE_VERSION_SUFFIX: ""
CI_ONIRO_BB_LOCAL_CONF_CVE_CHECK_DB_DIR: "$${TMPDIR}/CVE_CHECK/"
CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT: cve-check
......@@ -98,19 +117,25 @@
- test -n "$CI_ONIRO_BUILD_FLAVOUR" || (
echo "precondition failed - set CI_ONIRO_BUILD_FLAVOUR to \"flavour\" of the build to use (e.g. linux)"
&& exit 1 )
- test -n "$MACHINE" || (
echo "precondition failed - set MACHINE to supported machines (e.g. qemux86-64)"
&& exit 1 )
# Check devtool operation is enabled and configured properly.
- |
if { [ -n "$CI_ONIRO_DEVTOOL_RECIPE_NAME" ] && [ -z "$CI_ONIRO_DEVTOOL_LAYER_PATH" ]; } || { [ -z "$CI_ONIRO_DEVTOOL_RECIPE_NAME" ] && [ -n "$CI_ONIRO_DEVTOOL_LAYER_PATH" ]; } then
echo "precondition failed - cannot define just one of CI_ONIRO_DEVTOOL_RECIPE_NAME and CI_ONIRO_DEVTOOL_LAYER_PATH"
exit 1
fi
# Bitbake is configured to use /var/shared/$CI_ONIRO_BUILD_CACHE/bitbake
# Bitbake is configured to use $CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake
# directory for both the download directory and the sstate-cache.
- test -w /var/shared/$CI_ONIRO_BUILD_CACHE/bitbake || (
echo "precondition failed - expected /var/shared/$CI_ONIRO_BUILD_CACHE/bitbake to be writable"
- test -n "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE" || (
echo "precondition failed - CI_ONIRO_RUNNER_PERSISTENT_STORAGE is not set"
&& exit 1 )
- test -w "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake" || (
echo "precondition failed - expected $CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake to be writable"
&& exit 1 )
# Log available disk space on the persistent shared disk.
- df -h /var/shared/$CI_ONIRO_BUILD_CACHE/bitbake
- df -h "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE/$CI_ONIRO_BUILD_CACHE/bitbake"
- !reference [.workspace, before_script]
script:
......@@ -132,20 +157,37 @@
# dropped. Some extra sed processing is used to quote the variables.
# Everything runs in a sub-shell with bash pipefail disabled, as otherwise
# lack of variables matching the grep pattern causes the execution to stop.
# Variables in the form of 'CI_ONIRO_BB_LOCAL_CONF_attr' are converted to
# 'attr = "value"'. It can include '_colon_' substrings which are converted
# to ':'.
- |
( set +o pipefail;
env \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_[A-Z_0-9]+=' \
| sed -e 's/^CI_ONIRO_BB_LOCAL_CONF_//g' -e 's/"/\\"/g' -e 's/=/ = "/g' -e 's/$/"/g' \
| grep -v "_plus_equals_" \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_[a-zA-Z_0-9]+=' \
| sed -e 's/^CI_ONIRO_BB_LOCAL_CONF_//g' -e 's/_colon_/:/g' -e 's/"/\\"/g' -e 's/=/ = "/g' -e 's/$/"/g' \
| sort \
| tee -a conf/local.conf )
# Variables in the form of 'CI_ONIRO_BB_LOCAL_CONF_plus_equals_attr' are
# converted to 'attr += "value"'
- |
( set +o pipefail;
env \
| grep -E '^CI_ONIRO_BB_LOCAL_CONF_plus_equals_[A-Z_0-9]+=' \
| sed -e 's/^CI_ONIRO_BB_LOCAL_CONF_plus_equals_//g' -e 's/"/\\"/g' -e 's/=/ += "/g' -e 's/$/"/g' \
| sort \
| tee -a conf/local.conf )
# Variables in the form of '^CI_ONIRO_BB_BBLAYERS_CONF_plus_equals_attr' are
# converted to 'attr += "value"' and appended to bblayers.conf
# this is useful if layer has to be added but bitbake add-layer command cannot be used
# (for example this layer's class is inherited via local.conf already)
- |
( set +o pipefail;
env \
| grep -E '^CI_ONIRO_BB_BBLAYERS_CONF_plus_equals_[A-Z_0-9]+=' \
| sed -e 's/^CI_ONIRO_BB_BBLAYERS_CONF_plus_equals_//g' -e 's/"/\\"/g' -e 's/=/ += "/g' -e 's/$/"/g' \
| sort \
| tee -a conf/bblayers.conf )
# Sanity check: disallow using public build cache with a specific setting
# in local.conf. The list of settings may grow over time.
......@@ -178,13 +220,6 @@
# them).
time devtool finish --remove-work --force "$CI_ONIRO_DEVTOOL_RECIPE_NAME" "$(basename "$CI_ONIRO_DEVTOOL_LAYER_PATH")";
fi
rules:
# Run the job when a merge request is created.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
# Run the job when a tag is placed.
- if: '$CI_COMMIT_TAG'
# Run the build for scheduled pipelines.
- if: '$CI_PIPELINE_SOURCE == "schedule"'
# This job is documented in docs/ci/hidden-jobs/build-linux.rst
.build-linux:
......@@ -195,6 +230,7 @@
# Linux builds can be extremely large. Use rm_work to remove the temporary
# build data as soon as possible to reclaim space.
CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT: "rm_work"
CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT: create-spdx
script:
- test -n "$CI_ONIRO_BITBAKE_TARGETS" || (
echo "nothing to build - CI_ONIRO_BITBAKE_TARGETS is empty"
......@@ -213,29 +249,13 @@
matrix:
- CI_ONIRO_BITBAKE_TARGETS: ["oniro-image-base-tests", "oniro-image-extra-tests"]
# This job is documented in docs/ci/hidden-jobs/build-zephyr.rst
.build-zephyr:
extends: .bitbake-workspace
variables:
CI_ONIRO_BUILD_FLAVOUR: zephyr
CI_ONIRO_BITBAKE_TARGETS: "zephyr-philosophers"
CI_ONIRO_INSTANCE_SIZE: s3.large.2
script:
- test -n "$CI_ONIRO_BITBAKE_TARGETS" || (
echo "nothing to build - CI_ONIRO_BITBAKE_TARGETS is empty"
&& exit 1 )
- !reference [.bitbake-workspace, script]
- |
for target in $CI_ONIRO_BITBAKE_TARGETS; do
time bitbake "$target"
done
# This job is documented in docs/ci/hidden-jobs/build-freertos.rst
.build-freertos:
extends: .bitbake-workspace
variables:
CI_ONIRO_BUILD_FLAVOUR: freertos
CI_ONIRO_INSTANCE_SIZE: s3.large.2
CI_ONIRO_BB_LOCAL_CONF_plus_equals_CVE_CHECK_CREATE_MANIFEST: "0"
script:
- !reference [.bitbake-workspace, script]
- time bitbake freertos-demo
......@@ -252,47 +272,96 @@
# This job is documented in docs/ci/hidden-jobs/build-image.rst
.build-image:
extends: .build-recipe
variables:
CI_ONIRO_JOB_ARTIFACTS: ""
script:
- !reference [.build-recipe, script]
# Move artifacts for recovery, which only considers $CI_PROJECT_DIR and
# subdirectories.
- mkdir -p "$CI_PROJECT_DIR"/artifacts
# The name of the build-specific tmp directory may vary. Ask bitbake
# instead of hard-coding it. This is currently only relevant for Zephyr,
# which uses tmp-newlib.
- eval "$(bitbake -e | grep ^TMPDIR= | sed -e 's/^TMPDIR/BITBAKE_TMPDIR/g')"
- rm -rf "$CI_PROJECT_DIR"/artifacts/*
# The name of the build-specific deploy dir may vary. Ask bitbake instead
# of hard-coding it.
- eval "$(bitbake -e | grep ^DEPLOY_DIR= | sed -e 's/^DEPLOY_DIR/BITBAKE_DEPLOY_DIR/g')"
# Top level of bitbake working directory.
# The name is build specific ask bitbake instead of hard-coding.
- eval "$(bitbake -e | grep ^TOPDIR= | sed -e 's/^TOPDIR/BITBAKE_TOPDIR/g')"
# Uncompressed wic image is not needed in CI. We cannot remove it from
# meta-oniro-core/classes/oniro-image.bbclass as runqemu needs it for local
# build and boot.
- find "$BITBAKE_TMPDIR"/deploy/images/ -name *.wic -exec rm -rf {} \;
- mv "$BITBAKE_TMPDIR"/deploy/images/ "$CI_PROJECT_DIR"/artifacts || true
- mv "$BITBAKE_TMPDIR"/deploy/licenses/ "$CI_PROJECT_DIR"/artifacts || true
- find "$BITBAKE_DEPLOY_DIR"/images/ -name *.wic -exec rm -rf {} \;
- cp -a "$BITBAKE_DEPLOY_DIR"/licenses/ "$CI_PROJECT_DIR"/artifacts || true
# Only copy the files defined in the CI_ONIRO_JOB_ARTIFACTS variable. Most
# of the remaining files are redundant and quite large.
- |
set -x
if test -n "$CI_ONIRO_JOB_ARTIFACTS" && test -d "$BITBAKE_DEPLOY_DIR"; then
(
cd "$BITBAKE_DEPLOY_DIR"
for artifact in $CI_ONIRO_JOB_ARTIFACTS; do
find ./ \( -type f -o -type l \) -name "$artifact" -exec cp --verbose --archive --parents {} "$CI_PROJECT_DIR"/artifacts \;
done
)
fi
# Compress and copy artifacts of do_abicheck task (if any)
if test -n "$CI_ONIRO_ABICHECK_TOPDIR" && test -d "$BITBAKE_TOPDIR"/"$CI_ONIRO_ABICHECK_TOPDIR"; then
tar -cJf "$CI_PROJECT_DIR"/artifacts/abicheck-"$CI_COMMIT_SHA"-"$CI_JOB_NAME".tar.xz "$BITBAKE_TOPDIR"/"$CI_ONIRO_ABICHECK_TOPDIR"/*/*/binaryaudit
fi
set +x
artifacts:
paths:
- artifacts/
.build-wic-image:
extends: .build-image
variables:
CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT: create-spdx
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap"
script:
- !reference [.build-image, script]
# Remove everything _except_ for the .wic.* and *.bmap files. Most of the
# remaining files are redundant and quite large. Our Linux builds really
# only care about the wic files.
- echo "Removing non-wic/bmap image files"
- find "$CI_PROJECT_DIR"/artifacts/images/ \( -type f -o -type l \) -a ! -name "*.wic.*" -print -delete
- echo "Pruning empty directories"
- find "$CI_PROJECT_DIR"/artifacts/ -type d -exec rmdir --verbose --ignore-fail-on-non-empty {} \; 2>/dev/null || true
.build-rauc-bundle:
extends: .build-image
variables:
# Put timestamp into bundle name.
CI_ONIRO_BB_LOCAL_CONF_IMAGE_VERSION_SUFFIX: "-$${DATETIME}"
# Collect rauc bundles as artifacts.
CI_ONIRO_JOB_ARTIFACTS: "*.raucb"
# Avoid pulling in any artifacts from the previous stage.
dependencies: []
.build-zephyr-image:
extends: .build-image
variables:
CI_ONIRO_BUILD_FLAVOUR: zephyr
CI_ONIRO_RECIPE_NAME: zephyr-philosophers
CI_ONIRO_INSTANCE_SIZE: s3.large.2
CI_ONIRO_JOB_ARTIFACTS: "*.elf *.bin"
script:
- !reference [.build-image, script]
- echo 'INHERIT += "create-spdx"' >> conf/local.conf
- echo 'do_create_spdx[nostamp] = "1"' >> conf/local.conf
- echo 'do_create_runtime_spdx[nostamp] = "1"' >> conf/local.conf
- bitbake --runall=do_create_runtime_spdx $CI_ONIRO_RECIPE_NAME
# This job is currently used to customize the behavior in oniro and xts-acts.
# It will be removed when that is safe to do so. It is not documented.
.build:
extends: .build-recipe
.check-abi:
variables:
CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT: abicheck
CI_ONIRO_BB_LOCAL_CONF_BINARY_AUDIT_WARN_ONLY: "1"
CI_ONIRO_MANIFEST_NAME: manifests/ci.xml
CI_ONIRO_BB_BBLAYERS_CONF_plus_equals_BBLAYERS: "../meta-binaryaudit"
CI_ONIRO_ABICHECK_TOPDIR: "./buildhistory/packages"
# This job is documented in docs/ci/hidden-jobs/build-docs.rst
.build-docs:
interruptible: true
image:
name: registry.booting.oniroproject.org/distro/oniro/docs-builder:latest
name: registry.ostc-eu.org/ostc/oniro/docs-builder:latest
stage: build
script:
- make -C docs
......@@ -300,6 +369,8 @@
paths:
- docs/build
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
# Build the docs when a merge request is created.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
......@@ -320,8 +391,10 @@
# This job is documented in docs/ci/hidden-jobs/aggregate-docs.rst
.aggregate-docs:
stage: deploy
trigger: distro/docs
trigger: eclipse/oniro-core/docs
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
# Update the documentation when things land in the default branch.
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
changes:
......@@ -330,3 +403,64 @@
# Run this job in case the pipeline changes.
- .oniro-ci/*.yml
- .gitlab-ci.yml
# This job is documented in docs/ci/hidden-jobs/oe-selftest.rst
.oe-selftest:
image:
name: registry.ostc-eu.org/ostc/oniro/bitbake-builder:latest
tags: [qemu-friendly, large-disk, $CI_ONIRO_RUNNER_TAG, $CI_ONIRO_INSTANCE_SIZE]
stage: test
dependencies: []
extends: .bitbake-workspace
variables:
MACHINE: qemux86-64
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_BB_LOCAL_CONF_SANITY_TESTED_DISTROS: ""
CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT: "oniro-debug-linux"
CI_ONIRO_OE_SELFTESTS: ""
CI_ONIRO_OE_SEFLTEST_SKIPS: ""
CI_SQUAD_INSTANCE: "https://squadp.svc.ostc-eu.dev"
# The USER variable is required by oe-selftest but missing in env.
USER: "builder"
ARTIFACTS_DIR: "$CI_PROJECT_DIR/artifacts/$CI_JOB_NAME"
script:
- test -n "$CI_ONIRO_OE_SELFTESTS" || (
echo "nothing to test - CI_ONIRO_OE_SELFTESTS is empty"
&& exit 1 )
- !reference [.bitbake-workspace, script]
# Only run tests when gcc version changed.
- gcc_version="$(bitbake -s | grep '^gcc-runtime' | awk -F':' '{print $NF}' | head -1 | awk '{$1=$1;print}')"
- echo "Current GCC version $gcc_version"
- last_build_id="$(curl --silent $CI_SQUAD_INSTANCE/api/projects/12/builds/ | jq -r '.results | .[] | .id' | head -1)"
- |
if [ -n "${last_build_id}" ]; then
last_tested_gcc_version="$(curl --silent $CI_SQUAD_INSTANCE/api/builds/$last_build_id/metadata/ | jq -r '.gcc_version')"
echo "The last tested GCC version $last_tested_gcc_version"
if [ "$gcc_version" != "$last_tested_gcc_version" ]; then
echo "GCC verion changed, about to test the new version ..."
else
echo "GCC verion not changed, skipping gcc tests ..."
exit 0
fi
else
echo "The last tested GCC version not found, about to run gcc tests ..."
fi
- |
# oe-selftest inherits the current 'build/conf/local.conf' to create
# '../build-st/conf/local.conf' for qemu image building. Adding the
# MACHINE variable to the current local conf allows test job to customize
# the qemu image arch for testing.
- echo "MACHINE = \"$MACHINE\"" >> conf/local.conf
- echo "Running specific tests $CI_ONIRO_OE_SELFTESTS ..."
- time oe-selftest -vvv -r $CI_ONIRO_OE_SELFTESTS -K
- rm -rf "$ARTIFACTS_DIR" & mkdir -p "$ARTIFACTS_DIR"
- find ../build-st \( -name "*.sum" -o -name "*.log" \) \( -path "*/gcc-runtime/*testsuite*" \)
-exec cp --verbose {} "$ARTIFACTS_DIR" \;
- for file in $(find "$ARTIFACTS_DIR" -type f); do xz $file; done
- echo "$gcc_version" > $ARTIFACTS_DIR/gcc_version
- rm -rf ../build-st
artifacts:
paths:
- $ARTIFACTS_DIR
......@@ -2,5 +2,5 @@
# SPDX-License-Identifier: Apache-2.0
[user]
name = OSTC Builder
email = ostc-builder@example.org
name = Oniro Core Project Bot
email = oniro-core-bot@eclipse.org
......@@ -25,16 +25,23 @@ RUN apt-get update -qq \
&& eatmydata apt-get install -qq -y \
bash git-repo git-lfs apt-utils build-essential chrpath cpio diffstat \
gawk git sudo wget language-pack-en-base time locales python-is-python3 \
python3-distutils libssl-dev iproute2 iputils-ping curl jq \
&& eatmydata apt-get install -qq -y 'ca-certificates=20210119~20.04.2' \
python3-distutils python3-pip libssl-dev iproute2 iputils-ping curl jq \
lz4 zstd iptables\
&& eatmydata apt-get install -qq -y 'ca-certificates=20211016ubuntu0.20.04.1' \
&& eatmydata apt-get clean && rm -rf /var/lib/apt/lists/*
RUN locale-gen
RUN pip3 install anybadge
# Let's just have /bin/sh as bash
RUN echo "dash dash/sh boolean false" | debconf-set-selections \
&& DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder
# runqemu command needs sudo permission to create tun device for the
# communication between host and vm for gcc testing.
RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder \
&& usermod -aG sudo builder\
&& echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
COPY --chown=builder:builder .gitconfig /home/builder/.gitconfig
USER builder
WORKDIR /home/builder
......@@ -23,5 +23,5 @@ ARG DEBIAN_FRONTEND="noninteractive"
RUN apt-get update -qq \
&& apt-get install -y eatmydata \
&& eatmydata apt-get install -qq -y 'dco-check=0.1.1-1+ostc2' \
&& eatmydata apt-get install -qq -y 'ca-certificates=20210119~20.04.2' \
&& eatmydata apt-get install -qq -y 'ca-certificates=20211016ubuntu0.20.04.1' \
&& eatmydata apt-get clean && rm -rf /var/lib/apt/lists/*
# SPDX-FileCopyrightText: 2021 Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
[user]
name = OSTC Builder
email = ostc-builder@example.org
name = Oniro Core Project Bot
email = oniro-core-bot@eclipse.org
# SPDX-FileCopyrightText: Huawei Inc.
# SPDX-License-Identifier: Apache-2.0
FROM ubuntu:20.10
FROM ubuntu:20.04
COPY --chown=root:root ppa/zyga-ubuntu-oh-tools-groovy.list /etc/apt/sources.list.d/
COPY --chown=root:root ppa/zyga-ubuntu-oh-tools-focal.list /etc/apt/sources.list.d/
COPY --chown=root:root ppa/zyga-ubuntu-oh-tools.gpg /etc/apt/trusted.gpg.d/
ARG DEBIAN_FRONTEND="noninteractive"
......@@ -11,7 +11,12 @@ RUN apt-get update -qq \
&& apt-get install -y eatmydata \
&& eatmydata apt-get install -qq -y \
git-repo git git-lfs \
python3-sphinx python3-sphinx-rtd-theme python3-recommonmark python3-sphinx-tabs \
python3-pip python3-sphinx python3-sphinx-rtd-theme python3-recommonmark \
python3-sphinxcontrib.plantuml \
&& eatmydata apt-get install -qq -y 'ca-certificates=20210119~20.10.1' \
&& eatmydata apt-get install -qq -y 'ca-certificates=20211016ubuntu0.20.04.1' \
&& eatmydata apt-get clean && rm -rf /var/lib/apt/lists/*
# We need to fix the version here to avoid pulling docutils 0.18 which is
# incompatible with the sphinx version from Ubuntu focal. See more here:
# https://github.com/sphinx-doc/sphinx/issues/9841
RUN pip3 install sphinx-tabs==3.4.0
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2020 Huawei Inc.
deb http://ppa.launchpad.net/zyga/oh-tools/ubuntu/ groovy main
# deb-src http://ppa.launchpad.net/zyga/oh-tools/ubuntu/ groovy main
deb http://ppa.launchpad.net/zyga/oh-tools/ubuntu/ focal main
# deb-src http://ppa.launchpad.net/zyga/oh-tools/ubuntu/ focal main
......@@ -23,5 +23,5 @@ ARG DEBIAN_FRONTEND="noninteractive"
RUN apt-get update -qq \
&& apt-get install -y eatmydata \
&& eatmydata apt-get install -qq -y reuse=0.13.0-1 'spread=0~20201124-1+ohos3' \
&& eatmydata apt-get install -qq -y 'ca-certificates=20210119~20.04.2' \
&& eatmydata apt-get install -qq -y 'ca-certificates=20211016ubuntu0.20.04.1' \
&& eatmydata apt-get clean && rm -rf /var/lib/apt/lists/*
# SPDX-FileCopyrightText: 2021 Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-components-met-Use-API-v2.patch"
RRECOMMENDS_${PN} += "smart-home-homeassistant-plugin"
[user]
name = Oniro Project CI
email = oniro-dev@eclipse.org
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: MIT
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND="noninteractive"
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update -qq \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:hardware-certification/public \
&& apt-get install -y checkbox-ng plainbox-provider-resource-generic plainbox-provider-certification-client plainbox-provider-checkbox canonical-certification-client jq
......@@ -30,7 +30,7 @@
# # add any stages that your pipeline requires here
#
# include:
# - project: 'distro/oniro'
# - project: 'eclipse/oniro-core/oniro'
# file: '.oniro-ci/dco.yaml'
#
# dco:
......@@ -47,12 +47,11 @@
.dco:
stage: compliance
interruptible: true
tags: [compliance]
# This pipeline relies on a container with the dco-check package pre-installed.
# Precise, machine readable description of this container can be found in
# https://booting.oniroproject.org/distro/oniro/-/blob/master/.oniro-ci/containers/dco-check/Dockerfile
# https://gitlab.eclipse.org/eclipse/oniro-core/oniro/-/blob/kirkstone/.oniro-ci/containers/dco-check/Dockerfile
image:
name: registry.booting.oniroproject.org/distro/oniro/dco-check:latest
name: registry.ostc-eu.org/ostc/oniro/dco-check:latest
script:
# Work around a bug in dco-check affecting pipelines for merge requests.
# https://github.com/christophebedard/dco-check/issues/104
......
......@@ -6,8 +6,71 @@
# The following jobs are documented in docs/ci/machines-and-flavours.rst
linux-qemu-x86:
extends: .build-wic-image
.toolchain-gcc:
stage: build-gcc
dependencies: []
needs: []
variables:
CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
.toolchain-clang:
stage: build-clang
dependencies: []
needs: []
variables:
CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang"
CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
.broken:
rules:
# Some builds fail, so allow them to fail until the situation improves
# dramatically so that the policy can be re-visited. Clang builds are also
# expensive, so only present the user with an option to start the build,
# but do not commence the build automatically.
- when: manual
allow_failure: true
.linux-qemuarm-efi:
extends: [.build-wic-image]
variables:
MACHINE: qemuarm-efi
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
# Set CI_ONIRO_BUILD_CACHE to "pub", overriding the value defined in the
# .build job. This enables sharing of download and sstate-cache created
# during this job.
#
# This is done assuming that there are no non-redistributable or otherwise
# tainted build intermediate files, downloads or published artifacts.
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.qemuboot.conf uefi.bin"
linux-qemuarm-efi-gcc:
extends: [.linux-qemuarm-efi, .toolchain-gcc]
linux-qemuarm-efi-clang:
extends: [.linux-qemuarm-efi, .toolchain-clang]
.linux-qemuarm64-efi:
extends: [.build-wic-image]
variables:
MACHINE: qemuarm64-efi
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
# Set CI_ONIRO_BUILD_CACHE to "pub", overriding the value defined in the
# .build job. This enables sharing of download and sstate-cache created
# during this job.
#
# This is done assuming that there are no non-redistributable or otherwise
# tainted build intermediate files, downloads or published artifacts.
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.qemuboot.conf uefi.bin"
linux-qemuarm64-efi-gcc:
extends: [.linux-qemuarm64-efi, .toolchain-gcc]
linux-qemuarm64-efi-clang:
extends: [.linux-qemuarm64-efi, .toolchain-clang]
.linux-qemu-x86:
extends: [.build-wic-image]
variables:
MACHINE: qemux86
CI_ONIRO_BUILD_FLAVOUR: linux
......@@ -19,9 +82,14 @@ linux-qemu-x86:
# This is done assuming that there are no non-redistributable or otherwise
# tainted build intermediate files, downloads or published artifacts.
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap ovmf.qcow2"
linux-qemu-x86-gcc:
extends: [.linux-qemu-x86, .toolchain-gcc]
linux-qemu-x86-clang:
extends: [.linux-qemu-x86, .toolchain-clang]
linux-qemu-x86_64:
extends: .build-wic-image
.linux-qemu-x86_64:
extends: [.build-wic-image]
variables:
MACHINE: qemux86-64
CI_ONIRO_BUILD_FLAVOUR: linux
......@@ -29,137 +97,178 @@ linux-qemu-x86_64:
# See the note on linux-qemu-x86.
CI_ONIRO_BUILD_CACHE: "pub"
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap ovmf.qcow2"
linux-qemu-x86_64-gcc:
extends: [.linux-qemu-x86_64, .toolchain-gcc]
linux-qemu-x86_64-clang:
extends: [.linux-qemu-x86_64, .toolchain-clang]
linux-seco-intel-b68:
extends: .build-linux-matrix
.linux-seco-intel-b68:
extends: .build-wic-image
variables:
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
MACHINE: seco-intel-b68
linux-seco-intel-b68-gcc:
extends: [.linux-seco-intel-b68, .toolchain-gcc]
linux-seco-intel-b68-clang:
extends: [.linux-seco-intel-b68, .toolchain-clang]
linux-seco-imx8mm-c61:
extends: .build-linux-matrix
.linux-seco-intel-b68-extra:
extends: .build-linux
variables:
MACHINE: seco-imx8mm-c61
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_BITBAKE_TARGETS: oniro-image-extra-tests
MACHINE: seco-intel-b68
linux-seco-intel-b68-extra-gcc:
extends: [.linux-seco-intel-b68-extra, .toolchain-gcc]
linux-seco-intel-b68-extra-clang:
extends: [.linux-seco-intel-b68-extra, .toolchain-clang]
.linux-seco-imx8mm-c61-2gb:
extends: .build-wic-image
variables:
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
MACHINE: seco-imx8mm-c61-2gb
# This platform requires proprietary resources to boot.
# See build-generic.yaml for explanation of CI_ONIRO_BB_LOCAL_CONF_ variables.
CI_ONIRO_BB_LOCAL_CONF_ACCEPT_FSL_EULA: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap flash.bin-seco-imx8mm-c61-2gb*"
linux-seco-imx8mm-c61-2gb-gcc:
extends: [.linux-seco-imx8mm-c61-2gb, .toolchain-gcc]
linux-seco-imx8mm-c61-2gb-clang:
extends: [.linux-seco-imx8mm-c61-2gb, .toolchain-clang, .broken]
linux-stm32mp1-av96:
extends: .build-recipe
.linux-seco-imx8mm-c61-4gb:
extends: .build-wic-image
variables:
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
MACHINE: stm32mp1-av96
MACHINE: seco-imx8mm-c61-4gb
# This platform requires proprietary resources to boot.
# See build-generic.yaml for explanation of CI_ONIRO_BB_LOCAL_CONF_ variables.
CI_ONIRO_BB_LOCAL_CONF_ACCEPT_FSL_EULA: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap flash.bin-seco-imx8mm-c61-4gb*"
linux-seco-imx8mm-c61-4gb-gcc:
extends: [.linux-seco-imx8mm-c61-4gb, .toolchain-gcc]
linux-seco-imx8mm-c61-4gb-clang:
extends: [.linux-seco-imx8mm-c61-4gb, .toolchain-clang, .broken]
.linux-seco-imx8mm-c61-4gb-extra:
extends: .build-linux
variables:
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_BITBAKE_TARGETS: oniro-image-extra-tests
MACHINE: seco-imx8mm-c61-4gb
# This platform requires proprietary resources to boot.
# See build-generic.yaml for explanation of CI_ONIRO_BB_LOCAL_CONF_ variables.
CI_ONIRO_BB_LOCAL_CONF_ACCEPT_FSL_EULA: 1
linux-seco-imx8mm-c61-4gb-extra-gcc:
extends: [.linux-seco-imx8mm-c61-4gb-extra, .toolchain-gcc]
linux-seco-imx8mm-c61-4gb-extra-clang:
extends: [.linux-seco-imx8mm-c61-4gb-extra, .toolchain-clang, .broken]
linux-raspberrypi4-64:
.linux-seco-px30-d23:
extends: .build-wic-image
variables:
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base
MACHINE: seco-px30-d23
linux-seco-px30-d23-gcc:
extends: [.linux-seco-px30-d23, .toolchain-gcc]
linux-seco-px30-d23-clang:
extends: [.linux-seco-px30-d23, .toolchain-clang]
.linux-raspberrypi4-64:
extends: [.build-wic-image]
variables:
MACHINE: raspberrypi4-64
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
linux-raspberrypi4-64-gcc:
extends: [.linux-raspberrypi4-64, .toolchain-gcc]
linux-raspberrypi4-64-clang:
extends: [.linux-raspberrypi4-64, .toolchain-clang]
zephyr-qemu-x86:
extends: .build-image
.zephyr-qemu-x86:
extends: .build-zephyr-image
variables:
MACHINE: qemu-x86
# See the note on linux-qemu-x86.
CI_ONIRO_BUILD_CACHE: "pub"
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_RECIPE_NAME: zephyr-philosophers
CI_ONIRO_BUILD_FLAVOUR: zephyr
CI_ONIRO_INSTANCE_SIZE: s3.large.2
zephyr-qemu-x86-gcc:
extends: [.zephyr-qemu-x86, .toolchain-gcc]
zephyr-qemu-x86-clang:
extends: [.zephyr-qemu-x86, .toolchain-clang, .broken]
zephyr-qemu-cortex-m3:
extends: .build-image
.zephyr-qemu-cortex-m3:
extends: .build-zephyr-image
variables:
MACHINE: qemu-cortex-m3
# See the note on linux-qemu-x86.
CI_ONIRO_BUILD_CACHE: "pub"
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_RECIPE_NAME: zephyr-philosophers
CI_ONIRO_BUILD_FLAVOUR: zephyr
CI_ONIRO_INSTANCE_SIZE: s3.large.2
zephyr-qemu-cortex-m3-gcc:
extends: [.zephyr-qemu-cortex-m3, .toolchain-gcc]
zephyr-qemu-cortex-m3-clang:
extends: [.zephyr-qemu-cortex-m3, .toolchain-clang, .broken]
zephyr-96b-nitrogen:
extends: .build-image
.zephyr-qemu-x86-twister:
extends: .build-zephyr-image
variables:
MACHINE: 96b-nitrogen
CI_ONIRO_RECIPE_NAME: zephyr-philosophers
CI_ONIRO_BUILD_FLAVOUR: zephyr
CI_ONIRO_INSTANCE_SIZE: s3.large.2
zephyr-96b-nitrogen-tests:
extends: .build-image
variables:
MACHINE: 96b-nitrogen
CI_ONIRO_RECIPE_NAME: zephyr-kernel-test-all
CI_ONIRO_BUILD_FLAVOUR: zephyr
CI_ONIRO_INSTANCE_SIZE: s3.large.2
MACHINE: qemu-x86
CI_ONIRO_RECIPE_NAME: zephyr-kernel-test-twister
CI_ONIRO_JOB_ARTIFACTS: "twister*.tar.bz2"
rules:
# Twister tests are somewhat heavy. Run them only on scheduled pipelines.
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_TYPE == "daily"
zephyr-qemu-x86-twister-gcc:
extends: [.zephyr-qemu-x86-twister, .toolchain-gcc]
zephyr-qemu-x86-twister-clang:
extends: [.zephyr-qemu-x86-twister, .toolchain-clang, .broken]
zephyr-96b-avenger:
extends: .build-zephyr
.zephyr-qemu-cortex-m3-twister:
extends: .build-zephyr-image
variables:
MACHINE: 96b-avenger96
MACHINE: qemu-cortex-m3
CI_ONIRO_RECIPE_NAME: zephyr-kernel-test-twister
CI_ONIRO_JOB_ARTIFACTS: "twister*.tar.bz2"
rules:
# Twister tests are somewhat heavy. Run them only on scheduled pipelines.
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_TYPE == "daily"
zephyr-qemu-cortex-m3-twister-gcc:
extends: [.zephyr-qemu-cortex-m3-twister, .toolchain-gcc]
zephyr-qemu-cortex-m3-twister-clang:
extends: [.zephyr-qemu-cortex-m3-twister, .toolchain-clang, .broken]
zephyr-nrf52840dk-nrf52840:
extends: .build-zephyr
.zephyr-nrf52840dk-nrf52840:
extends: .build-zephyr-image
variables:
MACHINE: nrf52840dk-nrf52840
zephyr-nrf52840dk-nrf52840-gcc:
extends: [.zephyr-nrf52840dk-nrf52840, .toolchain-gcc]
zephyr-nrf52840dk-nrf52840-clang:
extends: [.zephyr-nrf52840dk-nrf52840, .toolchain-clang, .broken]
zephyr-arduino-nano-33-ble:
extends: .build-zephyr
.zephyr-arduino-nano-33-ble:
extends: .build-zephyr-image
variables:
MACHINE: arduino-nano-33-ble
zephyr-arduino-nano-33-ble-gcc:
extends: [.zephyr-arduino-nano-33-ble, .toolchain-gcc]
zephyr-arduino-nano-33-ble-clang:
extends: [.zephyr-arduino-nano-33-ble, .toolchain-clang, .broken]
freertos-armv5:
.freertos-armv5:
extends: .build-freertos
variables:
MACHINE: qemuarmv5
# See the note on linux-qemu-x86.
CI_ONIRO_BUILD_CACHE: "pub"
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
blueprint-smartpanel-zephyr:
extends: .build-zephyr
variables:
MACHINE: 96b-nitrogen
DISTRO: oniro-zephyr-blueprint-dashboard
CI_ONIRO_BITBAKE_TARGETS: "zephyr-blueprint-smarthome-sensors zephyr-blueprint-smarthome-switch"
blueprint-smartpanel-linux:
extends: .build-linux
variables:
MACHINE: stm32mp1-av96
DISTRO: oniro-linux-blueprint-dashboard
CI_ONIRO_BITBAKE_TARGETS: "blueprint-dashboard-gateway-image"
CI_ONIRO_INSTANCE_SIZE: s3.xlarge.4
blueprint-gateway-linux:
extends: .build-linux
variables:
MACHINE: raspberrypi4-64
DISTRO: oniro-linux-blueprint-gateway
CI_ONIRO_BITBAKE_TARGETS: "blueprint-gateway-image"
CI_ONIRO_INSTANCE_SIZE: s3.xlarge.4
blueprint-gateway-zephyr:
extends: .build-zephyr
variables:
MACHINE: arduino-nano-33-ble
DISTRO: oniro-zephyr-blueprint-gateway
CI_ONIRO_BITBAKE_TARGETS: "zephyr-blueprint-gateway-node"
blueprint-vending-machine-seco-intel-b68:
extends: .build-linux
variables:
MACHINE: seco-intel-b68
DISTRO: oniro-linux-blueprint-vending-machine
CI_ONIRO_BITBAKE_TARGETS: "blueprint-vending-machine-image"
CI_ONIRO_INSTANCE_SIZE: s3.xlarge.4
blueprint-vending-machine-raspberrypi4-64:
extends: .build-linux
variables:
MACHINE: raspberrypi4-64
DISTRO: oniro-linux-blueprint-vending-machine
CI_ONIRO_BITBAKE_TARGETS: "blueprint-vending-machine-image"
CI_ONIRO_INSTANCE_SIZE: s3.xlarge.4
freertos-armv5-gcc:
extends: [.freertos-armv5, .toolchain-gcc]
freertos-armv5-clang:
extends: [.freertos-armv5, .toolchain-clang, .broken]
......@@ -33,7 +33,7 @@
# # add any stages that your pipeline requires here
#
# include:
# - project: 'distro/oniro'
# - project: 'eclipse/oniro-core/oniro'
# file: '.oniro-ci/reuse.yaml'
#
# reuse:
......@@ -42,13 +42,12 @@
# # allow_failure: true
# -- 8< ------------[ cut here ]---
.reuse:
stage: compliance
interruptible: true
tags: [compliance]
# This pipeline relies on a container with the reuse package pre-installed.
# Precise, machine readable description of this container can be found in
# https://booting.oniroproject.org/distro/oniro/-/blob/master/.oniro-ci/containers/reuse/Dockerfile
# https://gitlab.eclipse.org/eclipse/oniro-core/oniro/-/blob/kirkstone/.oniro-ci/containers/reuse/Dockerfile
image:
name: registry.booting.oniroproject.org/distro/oniro/reuse:latest
name: registry.ostc-eu.org/ostc/oniro/reuse:latest
script:
- reuse lint
......@@ -7,63 +7,112 @@
.lava-test:
interruptible: true
image:
name: registry.ostc-eu.org/ostc/containers/ostc-builder:latest
name: registry.ostc-eu.org/ostc/oniro/bitbake-builder:latest
variables:
GIT_STRATEGY: none
CI_LAVA_INSTANCE: "https://lava.ostc-eu.org/"
CI_SQUAD_INSTANCE: "https://squadp.svc.ostc-eu.dev"
CI_SQUAD_GROUP_NAME: ""
CI_SQUAD_PROJECT_NAME: ""
CI_LAVA_JOB_PRIORITY: "medium"
# Run the same ltp test suites that using by LKFT project.
# Reference: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.98-75-g9f5cb871ceb9/testjobs/
LTP_TST_CMDFILES: "cap_bounds cpuhotplug crypto nptl pty securebits fs controllers hugetlb mm tracing containers io dio syscalls math commands ipc fcntl-locktests filecaps fs_bind fs_perms_simple fsx sched cve"
before_script:
- test -n "$CI_LAVA_TOKEN" || (
echo "precondition failed - please disable the child job if CI_LAVA_TOKEN not set in gitlab CI/CD variables"
&& exit 1 )
# Check if the job is configured properly.
- test -n "$CI_LAVA_JOB_DEFINITION" || (
echo "precondition failed - set CI_LAVA_JOB_DEFINITION to the URL of the LAVA test job definition"
- test -n "$MACHINE" || (
echo "precondition failed - set MACHINE to the name of the target device for which the image is built"
&& exit 1 )
- test -n "$CI_BUILD_JOB_NAME" || (
echo "precondition failed - set CI_BUILD_JOB_NAME to the appropriate job name from which LAVA will pick up build artifact"
&& exit 1 )
- test -n "$CI_LAVA_JOB_DEFINITION" || (
echo "precondition failed - set CI_LAVA_JOB_DEFINITION to the URL of the LAVA test job definition"
&& exit 1 )
- test -n "$CI_REPORT_JOB_NAME" || (
echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from LAVA"
echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from Squad"
&& exit 1 )
- test -n "$CI_SQUAD_GROUP_NAME" || (
echo "precondition failed - set CI_SQUAD_GROUP_NAME to the squad group name."
&& exit 1 )
- test -n "$CI_SQUAD_PROJECT_NAME" || (
echo "precondition failed - set CI_SQUAD_PROJECT_NAME to the squad project name."
&& exit 1 )
# If the test job name contains 'sysota', usage of update job name is
# required.
- |
if [[ -z "$CI_UPDATE_JOB_NAME" ]] && [[ "$CI_JOB_NAME" == *"sysota"* ]]; then
echo "precondition failed - jobs with 'sysota' in their name must have CI_UPDATE_JOB_NAME variable with the name of the 'update' CI job that contains rauc bundles"
exit 1
fi
script:
# Build callback URL for the "report" job
- curl --silent "https://git.ostc-eu.org/api/v4/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs?per_page=100" > jobs-manual.json
- |
curl --silent \
--header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" \
"$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs?per_page=100" > jobs-manual.json
- job_id="$(jq -r ".[] | select(.name == \"$CI_REPORT_JOB_NAME\") | .id" jobs-manual.json)"
- build_job_id="$(jq -r ".[] | select(.name == \"$CI_BUILD_JOB_NAME\") | .id" jobs-manual.json)"
- CALLBACK_URL="https://git.ostc-eu.org/api/v4/projects/$CI_PROJECT_ID/jobs/${job_id}/play"
- update_job_id="$(jq -r ".[] | select(.name == \"$CI_UPDATE_JOB_NAME\") | .id" jobs-manual.json)"
- CALLBACK_URL="$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/${job_id}/play"
# Get the job definition from remote source.
- curl --silent "$CI_LAVA_JOB_DEFINITION" > job_def.yaml
# Update the job definition with CI data.
- sed -i -e 's/$ci_job_id/'"$CI_JOB_ID"'/'
-e 's/$ci_project_id/'"$CI_PROJECT_ID"'/'
-e 's/$ci_pipeline_id/'"$CI_PIPELINE_ID"'/'
-e 's,$ci_pipeline_url,'"$CI_PIPELINE_URL"','
-e 's/$build_job_id/'"$build_job_id"'/'
-e 's,$callback_url,'"$CALLBACK_URL"',' job_def.yaml
# Generate job definitions for zephyr build
- sed -i -e 's/@ci_job_id@/'"$CI_JOB_ID"'/'
-e 's/@ci_project_id@/'"$CI_PROJECT_ID"'/'
-e 's/@ci_pipeline_id@/'"$CI_PIPELINE_ID"'/'
-e 's/@ci_lava_job_priority@/'"$CI_LAVA_JOB_PRIORITY"'/'
-e 's,@ci_pipeline_url@,'"$CI_PIPELINE_URL"','
-e 's,@update_job_id@,'"$update_job_id"','
-e 's/@build_job_id@/'"$build_job_id"'/' job_def.yaml
# Update the job with device configuration
- sed -i -e 's/@BOARD_RAM_SIZE@/'"$BOARD_RAM_SIZE"'/g' job_def.yaml
# Generate test jobs.
- |
mkdir lava_jobs
if echo "${CI_BUILD_JOB_NAME}" | grep -i "zephyr"; then
for image in $(find artifacts/ -name "*.elf" -exec basename {} \;); do
job_name=$(basename "${image}" ".elf")
echo "--- Generating lava job definition ${job_name}.yaml ---"
sed "s/\$elf_file/$image/" job_def.yaml | tee lava_jobs/"${job_name}".yaml
set -x
rm -rf lava_jobs && mkdir lava_jobs
# Generate job definitions for zephyr build
if echo "${CI_BUILD_JOB_NAME}" | grep -i "zephyr" | grep -vi "twister"; then
for image in $(find artifacts/images/${MACHINE} -type f -name "*.elf" -exec basename {} \;); do
image_basename=$(basename "${image}" ".elf")
echo "--- Generating lava job definition ${image_basename}.yaml ---"
sed "s/@image_basename@/$image_basename/" job_def.yaml | tee lava_jobs/"${image_basename}".yaml
done
# Generate job definitions for linux LTP test.
elif grep -q "@TST_CMDFILES@" job_def.yaml; then
for test_cmdfile in ${LTP_TST_CMDFILES}; do
ltp_job_name="ltp-${test_cmdfile}.yaml"
echo "--- Generating lava job definition ${ltp_job_name} ---"
sed "s/@TST_CMDFILES@/${test_cmdfile}/" job_def.yaml | tee lava_jobs/"${ltp_job_name}"
done
else
mv job_def.yaml lava_jobs/
fi
# Submit the job to LAVA.
set +x
# Submit the jobs to SQUAD.
- |
for job_def in $(find lava_jobs/ -name "*.yaml"); do
lava_job_id=$(curl -X POST -H "Authorization: Token $CI_LAVA_TOKEN" -F "definition=$(<${job_def})" "$CI_LAVA_INSTANCE/api/v0.2/jobs/" | jq ".job_ids" | tr -d "[\n ]")
if [ -n "${lava_job_id}" ]; then
echo "$CI_LAVA_INSTANCE/scheduler/job/$lava_job_id"
echo "$lava_job_id" >> job_ids_"${CI_JOB_NAME}_${lava_job_id}".txt
else
echo "Failed to submit LAVA job"
exit 1
fi
echo $CI_SQUAD_INSTANCE/api/submitjob/$CI_SQUAD_GROUP_NAME/$CI_SQUAD_PROJECT_NAME/$CI_PIPELINE_ID/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}"
curl $CI_SQUAD_INSTANCE/api/submitjob/$CI_SQUAD_GROUP_NAME/$CI_SQUAD_PROJECT_NAME/$CI_PIPELINE_ID/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}"
done
# Attach a callback to this build to trigger the lava-report job
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
curl --silent \
-X POST "$CI_SQUAD_INSTANCE/api/builds/$squad_build_id/callbacks/" \
-H "Authorization: Token $CI_SQUAD_TOKEN" \
-F "callback_url=$CALLBACK_URL" \
-F "callback_record_response=true"
artifacts:
paths:
- job_ids_*.txt
- lava_jobs/*.yaml
rules:
- if: '$CI_SQUAD_TOKEN == null'
when: never
# Run the build when it is scheduled.
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_TYPE == "daily"
# Do not run pipelines for draft merge requests unless manually triggered.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(wip|draft):.*/i'
when: manual
......@@ -74,35 +123,34 @@
.lava-report:
interruptible: true
# Let the pipeline continue running 'lava-badge' job.
allow_failure: true
image:
name: registry.ostc-eu.org/ostc/containers/ostc-builder:latest
name: registry.ostc-eu.org/ostc/oniro/bitbake-builder:latest
stage: report
variables:
GIT_STRATEGY: none
CI_LAVA_INSTANCE: "https://lava.ostc-eu.org/"
CI_SQUAD_INSTANCE: "https://squadp.svc.ostc-eu.dev"
script:
- |
for file in $(find ./ -name "job_ids_*.txt"); do
echo "Job file: $file"
while read -r p; do
echo "Job ID: $p"
mkdir "$p"
# Echo LAVA job health and link.
link="$CI_LAVA_INSTANCE/scheduler/job/$p"
health="$(curl --silent "$CI_LAVA_INSTANCE/api/v0.2/jobs/$p/" | jq '.health' | tr -d '"')"
echo "[$health] $link"
# Get the JUnit export from LAVA.
curl --silent -o job_$p.xml "$CI_LAVA_INSTANCE/api/v0.2/jobs/$p/junit/"
echo "Report file: $(ls job_$p.xml)"
done < "$file"
done
artifacts:
when: always
paths:
- job_*.xml
reports:
junit:
- job_*.xml
# Get the test_runs_incomplete value from build status. That will tell
# us if any of the LAVA jobs failed and we can determine whether the
# report job is successful or not.
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
curl --silent "$CI_SQUAD_INSTANCE/api/builds/$squad_build_id/testjobs/" > test_jobs.json
jq -r '.results | .[] | .name, .environment, .external_url, .job_status | @sh' test_jobs.json \
| xargs printf '------------\nname: %s\ndevice: %s\nurl: %s\nstatus: %s\n' \
| tee job_status.txt
if grep -qi "incomplete" job_status.txt; then
echo "ERROR: Incomplete test job reported: exit code 1"
exit 1
fi
rules:
- if: '$CI_SQUAD_TOKEN == null'
when: never
# Run the build when it is scheduled.
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_TYPE == "daily"
when: manual
# Do not run pipelines for draft merge requests unless manually triggered.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(wip|draft):.*/i'
......@@ -113,3 +161,36 @@
# Run the build when a tag is placed.
- if: '$CI_COMMIT_TAG'
when: manual
.lava-badge:
interruptible: true
image:
name: registry.ostc-eu.org/ostc/oniro/bitbake-builder:latest
stage: report
variables:
GIT_STRATEGY: none
CI_SQUAD_INSTANCE: "https://squadp.svc.ostc-eu.dev"
script:
- |
set -x
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
status_uri="$CI_SQUAD_INSTANCE/api/builds/$squad_build_id/status/"
pass_percentage="$(curl --silent $status_uri | jq -r '.pass_percentage')"
if [ "pass_percentage" != "null" ]; then
success_rate=`printf "%.2f" $pass_percentage`
else
echo "ERROR: Failed to query pass percentage via $status_uri"
exit 1
fi
anybadge --label=lava-test --value=${success_rate} --suffix='%' --file=lava-test.svg 50=red 60=orange 80=yellow 100=green
set +x
artifacts:
when: always
paths:
- lava-test.svg
rules:
# Run the build when it is scheduled.
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_TYPE == "daily"
# Do not run pipelines for draft merge requests unless manually triggered.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(wip|draft):.*/i'
when: manual
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: meta-oniro-staging/recipes-devtools/gcc/gcc_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/gcc-12.2.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-common.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-configure-common.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-cross_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/gcc-cross-canadian_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/gcc-cross-canadian.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-cross.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-crosssdk_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/gcc-crosssdk.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-multilib-config.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-runtime_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/gcc-runtime.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-sanitizers_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/gcc-sanitizers.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-shared-source.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-source_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/gcc-source.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-target.inc
meta-oniro-staging/recipes-devtools/gcc/gcc-testsuite.inc
meta-oniro-staging/recipes-devtools/gcc/libgcc_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/libgcc-common.inc
meta-oniro-staging/recipes-devtools/gcc/libgcc-initial_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/libgcc-initial.inc
meta-oniro-staging/recipes-devtools/gcc/libgcc.inc
meta-oniro-staging/recipes-devtools/gcc/libgfortran_12.2.bb
meta-oniro-staging/recipes-devtools/gcc/libgfortran.inc
Copyright: OpenEmbedded Contributors
License: MIT
Comment: Recipe files copied from Poky at https://git.yoctoproject.org/poky,
meta/recipes-devtools/gcc. LICENSE file of Poky project states:
"All metadata is MIT licensed unless otherwise stated."
Files: meta-oniro-staging/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0004-Pass-CXXFLAGS_FOR_BUILD-in-a-couple-of-places-to-avo.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0005-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0006-cpp-honor-sysroot.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0007-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0008-libtool.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0009-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0010-Use-the-multilib-config-files-from-B-instead-of-usin.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0011-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0012-export-CPP.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0013-Ensure-target-gcc-headers-can-be-included.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0014-Don-t-search-host-directory-during-relink-if-inst_pr.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0015-libcc1-fix-libcc1-s-install-path-and-rpath.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0017-Search-target-sysroot-gcc-version-specific-dirs-with.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0019-Re-introduce-spe-commandline-options.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0022-mingw32-Enable-operation_not_supported.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0023-libatomic-Do-not-enforce-march-on-aarch64.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0024-Fix-install-path-of-linux64.h.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0025-Move-sched.h-include-ahead-of-user-headers.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/0026-rust-recursion-limit.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/hardcoded-paths.patch
meta-oniro-staging/recipes-devtools/gcc/gcc/prefix-map-realpath.patch
Copyright: OpenEmbedded Contributors
License: GPL-3.0-only WITH GCC-exception-3.1 AND GPL-3.0-only
Comment: Patch files for gcc copied from Poky at
https://git.yoctoproject.org/poky, meta/recipes-devtools/gcc/gcc.
LICENSE file of Poky project states:
"Source code included in tree for individual recipes (e.g. patches) are
under the LICENSE stated in the associated recipe (.bb file) unless
otherwise stated."
The LICENSE stated in gcc recipes is GPL-3.0-with-GCC-exception & GPLv3
Files: meta-oniro-staging/recipes-devtools/binutils/binutils_2.39.bb
meta-oniro-staging/recipes-devtools/binutils/binutils-2.39.inc
meta-oniro-staging/recipes-devtools/binutils/binutils-cross_2.39.bb
meta-oniro-staging/recipes-devtools/binutils/binutils-cross-canadian_2.39.bb
meta-oniro-staging/recipes-devtools/binutils/binutils-cross-canadian.inc
meta-oniro-staging/recipes-devtools/binutils/binutils-cross-testsuite_2.39.bb
meta-oniro-staging/recipes-devtools/binutils/binutils-cross.inc
meta-oniro-staging/recipes-devtools/binutils/binutils-crosssdk_2.39.bb
meta-oniro-staging/recipes-devtools/binutils/binutils.inc
Copyright: OpenEmbedded Contributors
License: MIT
Comment: Recipe files copied from Poky at https://git.yoctoproject.org/poky,
meta/recipes-devtools/binutils. LICENSE file of Poky project states:
"All metadata is MIT licensed unless otherwise stated."
Files: meta-oniro-staging/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0005-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0007-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0008-Use-libtool-2.4.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0009-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0010-sync-with-OE-libtool-changes.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0011-Check-for-clang-before-checking-gcc-version.patch
meta-oniro-staging/recipes-devtools/binutils/binutils/0012-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
Copyright: OpenEmbedded Contributors
License: GPL-3.0-only
Comment: Patch files for binutils copied from Poky at
https://git.yoctoproject.org/poky, meta/recipes-devtools/binutils/binutils.
LICENSE file of Poky project states:
"Source code included in tree for individual recipes (e.g. patches) are
under the LICENSE stated in the associated recipe (.bb file) unless
otherwise stated."
The LICENSE stated in binutils recipes is GPL-3.0-only
Files: meta-oniro-staging/recipes-devtools/libcoap/libcoap_4.3.0.bb
meta-oniro-staging/recipes-devtools/libcoap/libcoap/0001-coap_session.c-Balance-SESSIONS_ADD-and-SESSIONS_DEL.patch
meta-oniro-staging/recipes-devtools/libcoap/libcoap/0001-libcoap-Fix-gnu-configize-error.patch
meta-oniro-staging/recipes-devtools/libcoap/libcoap/run-ptest
Copyright: OpenEmbedded Contributors
License: MIT
Comment: Recipe and patch files for libcoab copied from OpenEmbedded at
https://git.openembedded.org/meta-openembedded,
meta-networking/recipes-devtools/libcoap. OpenEmbedded is licensed
under MIT license.
Files: meta-oniro-staging/recipes-containers/buildah/buildah_git.bb
Copyright: OpenEmbedded Contributors
License: MIT
Comment: Recipe file for buildah copied from meta-virtualization project at
https://git.yoctoproject.org/meta-virtualization,
recipes-containers/buildah.
README file of meta-virtualization project states:
"All metadata is MIT licensed unless otherwise stated."
Files: meta-oniro-staging/recipes-devtools/ninja/ninja/0001-feat-support-cpu-limit-by-cgroups-on-linux.patch
Copyright: Google Inc.
License: Apache-2.0
Comment: Patch for ninja backported from Ninja project at
https://github.com/ninja-build/ninja, commit 540be33
Copyright text left as found in the header of the patched file.
Files: meta-oniro-core/recipes-support/rauc-hawkbit-updater/rauc-hawkbit-updater/0001-hawkbit-client-do-not-pass-NULL-format-to-g_strdup_v.patch
Copyright: 2021-2022 Bastian Krause <bst@pengutronix.de>, Pengutronix
2018-2020 Lasse K. Mikkelsen <lkmi@prevas.dk>, Prevas A/S (www.prevas.com)
License: LGPL-2.1-only
Comment: Patch for rauc-hawkbit-updater backported from
https://github.com/rauc/rauc-hawkbit-updater, commit 439feee
Copyright text left as found in the header of the patched file.
Files: meta-oniro-staging/recipes-multimedia/libtiff/files/0001-fix-upstream-issue-352-heap-buffer-overflow-by-correcting-uint32t-underflow.patch
Copyright: 1988-1997 Sam Leffler
1991-1997 Silicon Graphics, Inc.
Richard Nolde 2006-2010
License: libtiff
Comment: Patch for libtiff backported from Libtiff project at
https://gitlab.com/libtiff/libtiff, commit bcf28bb7
Copyright text left as found in the header of the patched file.
......@@ -4,42 +4,155 @@ SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: CC-BY-4.0
-->
- [Gitlab contributions](#gitlab-contributions)
- [Overview](#overview)
- [REUSE compliance](#reuse-compliance)
- [SPDX information and REUSE standard](#spdx-information-and-reuse-standard)
- [SPDX header example](#spdx-header-example)
- [Substantial contributions](#substantial-contributions)
- [DCO sign-off](#dco-sign-off)
- [Overview](#overview-1)
- [Developer Certificate of Origin](#developer-certificate-of-origin)
- [`oniro`-specific contributions process and guidelines](#oniro-specific-contributions-process-and-guidelines)
# Gitlab contributions
- <a href="#eclipse-contributor-agreement" id="toc-eclipse-contributor-agreement">Eclipse Contributor Agreement</a>
- <a href="#gitlab-contributions" id="toc-gitlab-contributions">Gitlab Contributions</a>
- <a href="#overview" id="toc-overview">Overview</a>
- <a href="#git-setup" id="toc-git-setup">Git setup</a>
- <a href="#commit-guidelines" id="toc-commit-guidelines">Commit Guidelines</a>
- <a href="#contributions-to-documentation" id="toc-contributions-to-documentation">Contributions to Documentation</a>
- <a href="#creating-merge-requests" id="toc-creating-merge-requests">Creating merge requests</a>
- <a href="#reuse-compliance" id="toc-reuse-compliance">REUSE Compliance</a>
- <a href="#spdx-information-and-reuse-standard" id="toc-spdx-information-and-reuse-standard">SPDX Information and REUSE Standard</a>
- <a href="#spdx-header-example" id="toc-spdx-header-example">SPDX Header Example</a>
- <a href="#dep5-files-paragraph-examples" id="toc-dep5-files-paragraph-examples">DEP5 "Files" Paragraph Examples</a>
- <a href="#substantial-contributions" id="toc-substantial-contributions">Substantial Contributions</a>
- <a href="#dco-sign-off" id="toc-dco-sign-off">DCO sign-off</a>
- <a href="#overview-1" id="toc-overview-1">Overview</a>
- <a href="#docs_dco" id="toc-docs_dco">Developer Certificate of Origin</a>
- <a href="#oniro-specific-contributions-process-and-guidelines" id="toc-projectname-specific-contributions-process-and-guidelines"><code>oniro</code>-specific contributions process and guidelines</a>
# Eclipse Contributor Agreement
Before your contribution can be accepted by the project team, contributors must electronically sign the [Eclipse Contributor Agreement (ECA)](http://www.eclipse.org/legal/ECA.php).
Commits must have a Signed-off-by field in the footer indicating that the author is aware of the terms by which the contribution has been provided to the project. Also, an associated Eclipse Foundation account needs to be in place with a signed Eclipse Contributor Agreement on file. These requirements are enforced by the Eclipse Foundation infrastructure tooling.
For more information, please see the [Eclipse Committer Handbook](https://www.eclipse.org/projects/handbook/#resources-commit).
# Gitlab Contributions
## Overview
Oniro Project handles contributions as [merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/) to relevant repositories part of the Oniro Project [GitLab instance](https://git.ostc-eu.org/distro). The flow for handling that is classic: fork-based merge requests. This means that once you have an account, you can fork any repository, create a branch with proposed changes and raise a merge request against the forked repository. More generic information you can find on the Gitlab's documentation as part of ["Merge requests workflow"](https://docs.gitlab.com/ee/development/contributing/merge_request_workflow.html).
Oniro Project handles contributions as [merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/) to relevant repositories part of the Oniro Project [GitLab instance](https://gitlab.eclipse.org/eclipse/oniro-core). The flow for handling that is classic: fork-based merge requests. This means that once you have an account, you can fork any repository, create a branch with proposed changes and raise a merge request against the forked repository. More generic information you can find on the Gitlab's documentation as part of ["Merge requests workflow"](https://docs.gitlab.com/ee/development/contributing/merge_request_workflow.html).
# REUSE compliance
## Git setup
## SPDX information and REUSE standard
Clone your fork locally, enter its directory and set:
All projects and files for an hosted project **MUST** be [REUSE](https://reuse.software/) compliant. REUSE requires SPDX information for each file, rules for which are as follows:
``` bash
$ git config --local user.email <your_eclipse_account_email>
$ git config --local user.name <your_eclipse_full_name>
```
To push and pull over HTTPS with Git using your account, you must set a password or [a Personal Access Token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) .
If you want to push or pull repositories using SSH, you have to [add a SSH key](https://docs.gitlab.com/ee/user/ssh.html) to your profile.
## Commit Guidelines
<div class="note">
- Any new file must have a SPDX header (copyright and license).
- For files that don't support headers (for example binaries, patches etc.) an associated `.license` file must be included with the relevant SPDX information.
- Do not add Copyright Year as part of the SPDX header information.
- The general rule of thumb for the license of a patch file is to use the license of the component for which the patch applies.
- When modifying a file through this contribution process, you may (but don't have to) claim copyright by adding a copyright line.
- Never alter copyright statements made by others, but only add your own.
<div class="title">
Some files will make an exception to the above rules as described below:
Note
- Files for which copyright is not claimed and for which this information was not trivial to fetch (for example backporting patches, importing build recipes etc. when upstream doesn't provide the SPDX information in the first place)
- license files (for example `common-licenses` in bitbake layers)
</div>
### SPDX header example
If you are new to `git`, start by reading the official [Getting Started Document](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup).
</div>
At its core, contributing to the Oniro Project project means *wrapping* your work as `git` commits. How we handle this has an impact on rebasing, cherry-picking, back-porting, and ultimately exposing consistent documentation through its logs.
To achieve this, we maintain the following commit guidelines:
- Each commit should be able to stand by itself providing a building block as part of the MR.
- A good balance of granularity with scoped commits helps to handle backports (e.g. cherry-picks) and also improves the ability to review smaller chunks of code taking commit by commit.
- Changes that were added on top of changes introduced in the MR, should be squashed into the initial commit.
- For example, a MR that introduced a new build system recipe and, as a separate commit, fixed a build error in the initial recipe. The latter commit should be squashed into the initial commit.
- For example, a MR introducing a new docs chapter and also adding, as a separate commit, some typo fixes. The latter commits should be squashed into the initial commit.
- There is a small set of exceptions to this rule. All these exceptions gravitate around the case where an MR, even if it provides multiple commits in the same scope (for example, to the same build recipe), each of the commits has a very specific purpose.
- For example, a line formating change followed by a chapter addition change in the same documentation file.
- Also, it can be the case of two functional changes that are building blocks in the same scope.
- Another example where commits are not to be squashed is when having a commit moving the code and a commit modifying the code in the new location.
- Make sure you clean your code of trailing white spaces/tabs and that each file ends with a new line.
- Avoid *merge* commits as part of your MR. Your commits should be rebased on top of the *HEAD* of the destination branch.
As mentioned above, *git log* becomes informally part of the documentation of the product. Maintaining consistency in its format and content improves debugging, auditing, and general code browsing. To achieve this, we also require the following commit message guidelines:
- The *subject* line (the first line) needs to have the following format: `scope: Title limited to 80 characters`.
- Use the imperative mood in the *subject* line for the *title*.
- The *scope* prefix (including the colon and the following whitespace) is optional but most of the time highly recommended. For example, fixing an issue for a specific build recipe, would use the recipe name as the *scope*.
- The *title* (the part after the *scope*) starts with a capital letter.
- The entire *subject* line shouldn't exceed 80 characters (same text wrapping rule for the commit body).
- The commit *body* separated by an empty line from the *subject* line.
- The commit *body* is optional but highly recommended. Provide a clear, descriptive text block that accounts for all the changes introduced by a specific commit.
- The commit *body* must not contain more than 80 characters per line.
- The commit message will have the commit message *trailers* separated by a new line from the *body*.
- Each commit requires at least a *Signed-off-by* trailer line. See more as part of the `/contributing/dco` document.
- All *trailer* lines are to be provided as part of the same text block - no empty lines in between the *trailers*.
Additional commit message notes:
- Avoid using special characters anywhere in the commit message.
- Be succinct but descriptive.
- Have at least one *trailer* as part of each commit: *Signed-off-by*.
- You can automatically let `git` add the *Signed-off-by* by taking advantage of its `-s` argument.
- Whenever in doubt, check the existing log on the file (`<FILE>`) you are about to commit changes, using something similar to: `git log <FILE>`.
Example of a full git message:
``` text
busybox: Add missing dependency on virtual/crypt
Since version 1.29.2, the busybox package requires virtual/crypt. Add this
to DEPENDS to make sure the build dependency is satisfied.
Signed-off-by: Joe Developer <joe.developer@example.com>
```
## Contributions to Documentation
In Oniro Project, the documentation usually stays with the respective code repositories. This means that contributing to documentation is not in any way different than contributing to code. The processes, contribution guidelines are to remain the same. The only difference is that documentation files are to be released under `Creative Commons License version 4.0`.
Documentation that doesn't link directly to one specific repository, is available in the [docs repository](https://gitlab.eclipse.org/eclipse/oniro-core/docs).
In terms of file format, the project unifies its documentation as `ReStructuredText` files. A RestructuredText primer is available as part of the Sphinx [documentation](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html).
As a rule of thumb, anything that ends up compiled in the project documentation is to maintain the RestructuredText file format. Text files that are not meant to be compiled as part of the project's documentation can be written in [Markdown](https://daringfireball.net/projects/markdown/). For example, a repository `README` file can be written in Markdown as it doesn't end up compiled in the project-wide documentation.
### Creating merge requests
Once your changes have been pushed to your fork, you are ready to prepare a merge request.
1. Go to your repository in an internet browser.
2. Create a merge request by clicking `Merge Requests` on left toolbar and press `New merge request`. Add an explainable description and create a merge request. Alternatively, you can enter the website of your fork. You should see a message that you pushed your branch to the repository. In the same section you can press `Create merge request`.
3. Before merging, it has to be reviewed and approved by Oniro Project repository maintainers. Read their review and add any required changes to your merge request.
4. After you polish your merge request, the maintainers will run the pipelines which check if your changes do not break the project and approve them. If everything is correct, your work is merged to the main project. Remember that each commit of the merge request should be a minimum, self-contained building block.
# REUSE Compliance
## SPDX Information and REUSE Standard
All projects and files for an hosted project **MUST** be [REUSE](https://reuse.software/) compliant. REUSE requires SPDX information for each file, rules for which are as follows:
- for files copyrighted by projects contributors (**"First Party Files"**):
- any new file MUST have a SPDX header (copyright and license);
- for files that don't support headers (for example binaries, patches etc.) an associated `.license` file MUST be included with the relevant SPDX information;
- do not add Copyright Year as part of the SPDX header information;
- the general rule for patch files is to use the MIT license and *not* the license of the component for which the patch applies - the latter solution would be error-prone and hard to manage and maintain in the long run, and there may be difficult-to-handle cases (what if the patches modifies multiple files in the same component - eg. gcc - which are subject to different licenses?);
- when modifying a file through this contribution process, you may (but don't have to) claim copyright by adding a copyright line;
- you MUST NOT alter copyright statements made by others, but only add your own;
- for files copyrighted by third parties and just added to the project by contributors, eg. files copied from other projects or back-ported patches (**"Third Party Files"**):
- if upstream files already have SPDX headers, they MUST be left unchanged;
- if upstream files do *not* have SPDX headers:
- the exact upstream provenance (repo, revision, path) MUST be identified;
- you MUST NOT add SPDX headers to Third Party Files;
- copyright and license information, as well as upstream provenance information (in the "Comment" section), MUST be stored in <span class="title-ref">.reuse/dep5</span> following [Debian dep5 specification](https://dep-team.pages.debian.net/deps/dep5/) (see examples below);
- you MUST NOT use wildcards (\*) in dep5 "Files" paragraphs even if Debian specs allow it: it may lead to unnoticed errors or inconsistencies in case of future file additions that may be covered by wildcard expressions even if they have a different license;
- in case of doubts or problems in finding the correct license and copyright information for Third Party Files, contributors may ask the project's Legal Team in the project mailing list <oniro-dev@eclipse.org>;
### SPDX Header Example
Make sure all of your submitted new files have a licensing statement in the headers. Please make sure that the license for your file is consistent with the licensing choice at project level and that you select the correct SPDX identifier, as in the following example for Apache 2.0 license:
......@@ -51,15 +164,35 @@ Make sure all of your submitted new files have a licensing statement in the head
*/
```
### Substantial contributions
### DEP5 "Files" Paragraph Examples
``` text
Files: meta-oniro-staging/recipes-containers/buildah/buildah_git.bb
Copyright: OpenEmbedded Contributors
License: MIT
Comment: Recipe file for buildah copied from meta-virtualization project at
https://git.yoctoproject.org/meta-virtualization,
recipes-containers/buildah.
README file of meta-virtualization project states:
"All metadata is MIT licensed unless otherwise stated."
Files: meta-oniro-staging/recipes-devtools/ninja/ninja/0001-feat-support-cpu-limit-by-cgroups-on-linux.patch
Copyright: Google Inc.
License: Apache-2.0
Comment: Patch for ninja backported from Ninja project at
https://github.com/ninja-build/ninja, commit 540be33
Copyright text left as found in the header of the patched file.
```
### Substantial Contributions
Therefore, if your contribution is only a patch directly applied to an existing file, then you are not required to do anything. If your contribution is an entire new project, or a substantial, copyrighted contribution, you **MUST** make sure that you do that following the [IP Policy](https://git.ostc-eu.org/distro/governance/ip-policy/-/blob/main/policy/source/sections/section05.rst) and that you comply with REUSE standard to include the licensing information where they are required.
Therefore, if your contribution is only a patch directly applied to an existing file, then you are not required to do anything. If your contribution is an entire new project, or a substantial, copyrighted contribution, you **MUST** make sure that you do that following the [IP Policy](https://git.ostc-eu.org/oss-compliance/ip-policy/) and that you comply with REUSE standard to include the licensing information where they are required.
# DCO sign-off
## Overview
Commits **MUST** be submitted only with a sign-off by the submitter. A commit without a sign-off will be automatically rejected. You need not be the author or the copyright holder of the contribution, but you must make sure that you have the power to submit on behalf of those who are.
Commits **MUST** be submitted only with a sign-off by the submitter. A commit without a sign-off will be automatically rejected. You don't need be the author or the copyright holder of the contribution, but you must make sure that you have the power to submit on behalf of those who are.
To sign your work, just add a line like this at the end of your commit message:
......@@ -120,7 +253,7 @@ By making a contribution to this project, I certify that:
# `oniro`-specific contributions process and guidelines
The project handles contributions as merge request in the project's
[GitLab instance](https://git.ostc-eu.org/distro/oniro). See above for
[GitLab instance](https://gitlab.eclipse.org/eclipse/oniro-core/oniro). See above for
more details.
Each contributions must adhere to the [OpenEmbedded Commit Patch Message Guidelines](http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines).
......
GCC RUNTIME LIBRARY EXCEPTION
Version 3.1, 31 March 2009
General information: http://www.gnu.org/licenses/gcc-exception.html
Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
This GCC Runtime Library Exception ("Exception") is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file (the "Runtime Library") that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception.
When you use GCC to compile a program, GCC may combine portions of certain GCC header files and runtime libraries with the compiled program. The purpose of this Exception is to allow compilation of non-GPL (including proprietary) programs to use, in this way, the header files and runtime libraries covered by this Exception.
0. Definitions.
A file is an "Independent Module" if it either requires the Runtime Library for execution after a Compilation Process, or makes use of an interface provided by the Runtime Library, but is not otherwise based on the Runtime Library.
"GCC" means a version of the GNU Compiler Collection, with or without modifications, governed by version 3 (or a specified later version) of the GNU General Public License (GPL) with the option of using any subsequent versions published by the FSF.
"GPL-compatible Software" is software whose conditions of propagation, modification and use would permit combination with GCC in accord with the license of GCC.
"Target Code" refers to output from any compiler for a real or virtual target processor architecture, in executable form or suitable for input to an assembler, loader, linker and/or execution phase. Notwithstanding that, Target Code does not include data in any format that is used as a compiler intermediate representation, or used for producing a compiler intermediate representation.
The "Compilation Process" transforms code entirely represented in non-intermediate languages designed for human-written code, and/or in Java Virtual Machine byte code, into Target Code. Thus, for example, use of source code generators and preprocessors need not be considered part of the Compilation Process, since the Compilation Process can be understood as starting with the output of the generators or preprocessors.
A Compilation Process is "Eligible" if it is done using GCC, alone or with other GPL-compatible software, or if it is done without using any work based on GCC. For example, using non-GPL-compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process.
1. Grant of Additional Permission.
You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules, even if such propagation would otherwise violate the terms of GPLv3, provided that all Target Code was generated by Eligible Compilation Processes. You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules.
2. No Weakening of GCC Copyleft.
The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of GCC.