From 648d8a405519aa59f28b34f8248a17136894f5dc Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Tue, 17 Feb 2026 00:22:56 +0530 Subject: [PATCH 1/8] Update common_build_utils.sh --- cov_docker_script/common_build_utils.sh | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/cov_docker_script/common_build_utils.sh b/cov_docker_script/common_build_utils.sh index 0bb9f881..0f3d9daa 100755 --- a/cov_docker_script/common_build_utils.sh +++ b/cov_docker_script/common_build_utils.sh @@ -129,6 +129,35 @@ apply_patch() { return 0 fi + if [[ "$type" == "patch_file" ]]; then + # For patch_file type, 'search' parameter contains the patch file path + local patch_file="$search" + local repo_dir="$file" + + # Expand environment variables in patch file path + patch_file=$(eval echo "$patch_file") + + if [[ ! -f "$patch_file" ]]; then + err "Patch file not found: $patch_file" + return 1 + fi + + log "Applying patch file: $patch_file to $repo_dir" + + pushd "$repo_dir" >/dev/null || return 1 + + # Apply the patch using patch -p1 + if ! patch -p1 < "$patch_file"; then + err "Failed to apply patch file: $patch_file" + popd >/dev/null + return 1 + fi + + popd >/dev/null + ok "Patch file applied successfully" + return 0 + fi + if [[ ! -f "$file" ]]; then err "Patch target not found: $file" return 1 From 4e1ceea4d2374e00e83701f8c16d44ac9f6e65fb Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Tue, 17 Feb 2026 00:23:25 +0530 Subject: [PATCH 2/8] Update setup_dependencies.sh --- cov_docker_script/setup_dependencies.sh | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/cov_docker_script/setup_dependencies.sh b/cov_docker_script/setup_dependencies.sh index 7a5828f6..1a8479e4 100755 --- a/cov_docker_script/setup_dependencies.sh +++ b/cov_docker_script/setup_dependencies.sh @@ -24,6 +24,69 @@ fi check_dependencies || exit 1 +# Apply source patches for a dependency +apply_dependency_patches() { + local index=$1 + local repo_dir=$2 + local name=$3 + + local patch_count + patch_count=$(jq -r ".dependencies.repos[$index].source_patches // [] | length" "$CONFIG_FILE") + + if [[ "$patch_count" -eq 0 ]]; then + return 0 + fi + + step "Applying source patches for $name ($patch_count patches)" + + local i=0 + while [[ $i -lt $patch_count ]]; do + local file search replace type content patch_file + file=$(jq -r ".dependencies.repos[$index].source_patches[$i].file" "$CONFIG_FILE") + type=$(jq -r ".dependencies.repos[$index].source_patches[$i].type // \"replace\"" "$CONFIG_FILE") + + if [[ "$type" == "patch_file" ]]; then + # For patch_file type, get the patch file path + patch_file=$(jq -r ".dependencies.repos[$index].source_patches[$i].patch_file" "$CONFIG_FILE") + + # Expand $HOME and $BUILD_DIR in patch file path + local expanded_patch_file=$(expand_path "$patch_file") + + # For patch_file, 'file' should point to the repo directory, and patch file goes in 'search' param + if ! apply_patch "$repo_dir" "$expanded_patch_file" "" "$type" ""; then + err "Failed to apply patch $((i+1))/$patch_count for $name" + return 1 + fi + else + # For replace/create types + search=$(jq -r ".dependencies.repos[$index].source_patches[$i].search // \"\"" "$CONFIG_FILE") + replace=$(jq -r ".dependencies.repos[$index].source_patches[$i].replace // \"\"" "$CONFIG_FILE") + content=$(jq -r ".dependencies.repos[$index].source_patches[$i].content // \"\"" "$CONFIG_FILE") + + # Expand $HOME in file path, then resolve relative paths from repo_dir + local expanded_file=$(expand_path "$file") + local target_file + if [[ "$expanded_file" = /* ]]; then + # Absolute path - use as is + target_file="$expanded_file" + else + # Relative path - prepend repo_dir + target_file="$repo_dir/$expanded_file" + fi + + if ! apply_patch "$target_file" "$search" "$replace" "$type" "$content"; then + err "Failed to apply patch $((i+1))/$patch_count for $name" + return 1 + fi + fi + + i=$((i + 1)) + done + + ok "Applied $patch_count patches for $name" + return 0 +} + # Initialize environment initialize_environment() { print_banner "Dependency Setup" @@ -196,6 +259,12 @@ process_dependency() { return 1 fi + # Apply source patches + if ! apply_dependency_patches "$index" "$repo_dir" "$name"; then + err "Failed to apply patches for $name" + return 1 + fi + # Copy headers if ! process_headers "$index" "$repo_dir" "$name"; then err "Failed to copy headers for $name" From 87d683ae35a1dcd7e1a1559142a6047941261043 Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Tue, 17 Feb 2026 00:39:41 +0530 Subject: [PATCH 3/8] Update common_build_utils.sh --- cov_docker_script/common_build_utils.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cov_docker_script/common_build_utils.sh b/cov_docker_script/common_build_utils.sh index 0f3d9daa..53b4ced5 100755 --- a/cov_docker_script/common_build_utils.sh +++ b/cov_docker_script/common_build_utils.sh @@ -49,8 +49,15 @@ clone_repo() { return 0 fi + # Use GITHUB_TOKEN if available and repo is from github.com + local clone_url="$repo" + if [[ -n "$GITHUB_TOKEN" ]] && [[ "$repo" == *"github.com"* ]]; then + # Replace https://github.com with https://TOKEN@github.com + clone_url="${repo//https:\/\/github.com/https://${GITHUB_TOKEN}@github.com}" + fi + log "Cloning $name (branch: $branch)" - if ! git clone --branch "$branch" "$repo" "$dest" --depth 1; then + if ! git clone --branch "$branch" "$clone_url" "$dest" --depth 1; then err "Failed to clone $name" return 1 fi From 25255f7f3d21674775d2dd31b3c67a6582cb190c Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Tue, 17 Feb 2026 00:53:04 +0530 Subject: [PATCH 4/8] Update setup_dependencies.sh --- cov_docker_script/setup_dependencies.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cov_docker_script/setup_dependencies.sh b/cov_docker_script/setup_dependencies.sh index 1a8479e4..fb544d27 100755 --- a/cov_docker_script/setup_dependencies.sh +++ b/cov_docker_script/setup_dependencies.sh @@ -259,6 +259,14 @@ process_dependency() { return 1 fi + # Debug: List directory structure for entservices-testframework + if [[ "$name" == "entservices-testframework" ]]; then + log "Directory structure of entservices-testframework:" + find "$repo_dir" -maxdepth 3 -type d | head -20 + log "Looking for patches:" + find "$repo_dir" -name "*.patch" -o -name "patches" -type d | head -10 + fi + # Apply source patches if ! apply_dependency_patches "$index" "$repo_dir" "$name"; then err "Failed to apply patches for $name" From 2a9bf28f7cf8930ee342571c1a99c825f59bef77 Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Tue, 17 Feb 2026 00:57:54 +0530 Subject: [PATCH 5/8] Update setup_dependencies.sh --- cov_docker_script/setup_dependencies.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cov_docker_script/setup_dependencies.sh b/cov_docker_script/setup_dependencies.sh index fb544d27..1c593852 100755 --- a/cov_docker_script/setup_dependencies.sh +++ b/cov_docker_script/setup_dependencies.sh @@ -262,9 +262,9 @@ process_dependency() { # Debug: List directory structure for entservices-testframework if [[ "$name" == "entservices-testframework" ]]; then log "Directory structure of entservices-testframework:" - find "$repo_dir" -maxdepth 3 -type d | head -20 - log "Looking for patches:" - find "$repo_dir" -name "*.patch" -o -name "patches" -type d | head -10 + ls -laR "$repo_dir" | head -100 + log "Searching for all files:" + find "$repo_dir" -type f | head -50 fi # Apply source patches From 91e540cb61773f54c10d03c36c508503680e11d1 Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Tue, 17 Feb 2026 14:57:44 +0530 Subject: [PATCH 6/8] Update setup_dependencies.sh --- cov_docker_script/setup_dependencies.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cov_docker_script/setup_dependencies.sh b/cov_docker_script/setup_dependencies.sh index 1c593852..1a8479e4 100755 --- a/cov_docker_script/setup_dependencies.sh +++ b/cov_docker_script/setup_dependencies.sh @@ -259,14 +259,6 @@ process_dependency() { return 1 fi - # Debug: List directory structure for entservices-testframework - if [[ "$name" == "entservices-testframework" ]]; then - log "Directory structure of entservices-testframework:" - ls -laR "$repo_dir" | head -100 - log "Searching for all files:" - find "$repo_dir" -type f | head -50 - fi - # Apply source patches if ! apply_dependency_patches "$index" "$repo_dir" "$name"; then err "Failed to apply patches for $name" From d465da0bb2d9e0cfc006d204567deda5a83d61df Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Wed, 20 May 2026 18:43:49 +0530 Subject: [PATCH 7/8] Update common_build_utils.sh --- cov_docker_script/common_build_utils.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cov_docker_script/common_build_utils.sh b/cov_docker_script/common_build_utils.sh index 53b4ced5..0f3d9daa 100755 --- a/cov_docker_script/common_build_utils.sh +++ b/cov_docker_script/common_build_utils.sh @@ -49,15 +49,8 @@ clone_repo() { return 0 fi - # Use GITHUB_TOKEN if available and repo is from github.com - local clone_url="$repo" - if [[ -n "$GITHUB_TOKEN" ]] && [[ "$repo" == *"github.com"* ]]; then - # Replace https://github.com with https://TOKEN@github.com - clone_url="${repo//https:\/\/github.com/https://${GITHUB_TOKEN}@github.com}" - fi - log "Cloning $name (branch: $branch)" - if ! git clone --branch "$branch" "$clone_url" "$dest" --depth 1; then + if ! git clone --branch "$branch" "$repo" "$dest" --depth 1; then err "Failed to clone $name" return 1 fi From d52cdc2000e9835ab92eb0eccb1ffb10b98295ac Mon Sep 17 00:00:00 2001 From: agampa263 <133222558+agampa263@users.noreply.github.com> Date: Thu, 21 May 2026 10:07:10 +0530 Subject: [PATCH 8/8] sync with develop (#38) Signed-off-by: Netaji Panigrahi Netaji_Panigrahi@comcast.com Co-authored-by: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Co-authored-by: guruchandru <36739781+guruchandru@users.noreply.github.com> Co-authored-by: Daniel Soden Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: sowmiyachelliah <162420027+sowmiyachelliah@users.noreply.github.com> Co-authored-by: Simon Chung Co-authored-by: Netaji Panigrahi <114923459+NetajiPanigrahi@users.noreply.github.com> --- .../auto_pr_creation_rpi_manifests.yml | 117 +++++++ .../fossid_integration_stateless_diffscan.yml | 38 ++- .../auto_pr_generation_manifest.py | 19 +- cov_docker_script/build_native.sh | 100 +++++- cov_docker_script/common_build_utils.sh | 10 + cov_docker_script/setup_dependencies.sh | 18 +- ignore_projects_fossid | 312 +++++++++++++++++- 7 files changed, 585 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/auto_pr_creation_rpi_manifests.yml diff --git a/.github/workflows/auto_pr_creation_rpi_manifests.yml b/.github/workflows/auto_pr_creation_rpi_manifests.yml new file mode 100644 index 00000000..4580ef3b --- /dev/null +++ b/.github/workflows/auto_pr_creation_rpi_manifests.yml @@ -0,0 +1,117 @@ +name: Update Manifests on Meta Repo Merge + +on: + workflow_call: + secrets: + RDKCM_RDKE: + required: true + +jobs: + auto_pr_creation_manifest: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - name: Checkout build_tools_workflows code + uses: actions/checkout@v4 + with: + repository: rdkcentral/build_tools_workflows + path: 'tools' + ref: develop + token: ${{ secrets.RDKCM_RDKE }} + + - name: Checkout vendor layer Manifest Repository + uses: actions/checkout@v4 + with: + repository: 'rdkcentral/vendor-manifest-raspberrypi' + path: 'vendor_manifest_repo' + token: ${{ secrets.RDKCM_RDKE }} + + - name: Update Git Config + env: + BOT_EMAIL: ${{ vars.RDKM_BOT_EMAIL }} + run: | + cd vendor_manifest_repo + git config user.name "bot" + git config user.email "$BOT_EMAIL" + cd .. + + - name: Checkout middleware layer Manifest Repository + uses: actions/checkout@v4 + with: + repository: 'rdkcentral/middleware-manifest-rdke' + path: 'middleware_manifest_repo' + token: ${{ secrets.RDKCM_RDKE }} + + - name: Update Git Config + env: + BOT_EMAIL: ${{ vars.RDKM_BOT_EMAIL }} + run: | + cd middleware_manifest_repo + git config user.name "bot" + git config user.email "$BOT_EMAIL" + cd .. + + - name: Checkout image assembler layer Manifest Repository + uses: actions/checkout@v4 + with: + repository: 'rdkcentral/image-assembler-manifest-rdke' + path: 'image_assembler_manifest_repo' + token: ${{ secrets.RDKCM_RDKE }} + + - name: Update Git Config + env: + BOT_EMAIL: ${{ vars.RDKM_BOT_EMAIL }} + run: | + cd image_assembler_manifest_repo + git config user.name "bot" + git config user.email "$BOT_EMAIL" + cd .. + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install Python dependencies + run: | + python3 -m pip install --upgrade pip + pip install requests PyGithub GitPython + + - name: Run the update script for vendor layer + env: + GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} + GITHUB_ORG: 'rdkcentral' + MANIFEST_REPO_PATH: ${{ github.workspace }}/vendor_manifest_repo + MANIFEST_REPO_NAME: 'rdkcentral/vendor-manifest-raspberrypi' + PR_NUMBER: ${{ github.event.pull_request.number }} + BASE_BRANCH: ${{ github.event.pull_request.base.ref }} + run: | + cd vendor_manifest_repo + python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py + cd .. + + - name: Run the update script for middleware layer + env: + GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} + GITHUB_ORG: 'rdkcentral' + MANIFEST_REPO_PATH: ${{ github.workspace }}/middleware_manifest_repo + MANIFEST_REPO_NAME: 'rdkcentral/middleware-manifest-rdke' + PR_NUMBER: ${{ github.event.pull_request.number }} + BASE_BRANCH: ${{ github.event.pull_request.base.ref }} + run: | + cd middleware_manifest_repo + python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py + cd .. + + - name: Run the update script for image assembler layer + env: + GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} + GITHUB_ORG: 'rdkcentral' + MANIFEST_REPO_PATH: ${{ github.workspace }}/image_assembler_manifest_repo + MANIFEST_REPO_NAME: 'rdkcentral/image-assembler-manifest-rdke' + PR_NUMBER: ${{ github.event.pull_request.number }} + BASE_BRANCH: ${{ github.event.pull_request.base.ref }} + run: | + cd image_assembler_manifest_repo + python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py + cd .. diff --git a/.github/workflows/fossid_integration_stateless_diffscan.yml b/.github/workflows/fossid_integration_stateless_diffscan.yml index 2184d7dd..010a6415 100644 --- a/.github/workflows/fossid_integration_stateless_diffscan.yml +++ b/.github/workflows/fossid_integration_stateless_diffscan.yml @@ -13,35 +13,37 @@ on: required: true jobs: - run-fossid-cicd: + run-diffscan: name: Fossid Annotate PR runs-on: ubuntu-latest container: - image: quay.io/fossid/fossid-toolbox:latest + image: quay.io/fossid/fossid-toolbox:1.5.29 credentials: - username: ${{ secrets.FOSSID_CONTAINER_USERNAME }} + username: ${{ secrets.FOSSID_CONTAINER_USERNAME }} password: ${{ secrets.FOSSID_CONTAINER_PASSWORD }} steps: - - name: Checkout code + - name: Checkout Code uses: actions/checkout@v4 + - name: Checkout ignore projects file uses: actions/checkout@v4 with: - repository: rdkcentral/build_tools_workflows - sparse-checkout: | - ignore_projects_fossid - ref: develop - path: tools - token: ${{ secrets.RDKCM_RDKE }} - - name: Run fossid-cicd + repository: rdkcentral/build_tools_workflows + sparse-checkout: | + ignore_projects_fossid + ref: develop + path: tools + + - name: Run fossid-toolbox env: FOSSID_HOST_USERNAME: ${{ secrets.FOSSID_HOST_USERNAME }} FOSSID_HOST_TOKEN: ${{ secrets.FOSSID_HOST_TOKEN }} run: | - fossid-cicd \ - diff-scan \ - --fossid-host $FOSSID_HOST_USERNAME \ - --fossid-token $FOSSID_HOST_TOKEN \ - --github-workflow-errors \ - --fail \ - --ignore-projects tools/ignore_projects_fossid + fossid \ + diffscan \ + --fossid-host $FOSSID_HOST_USERNAME \ + --fossid-token $FOSSID_HOST_TOKEN \ + --format github \ + --fail \ + --ignore-projects tools/ignore_projects_fossid + diff --git a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py index c384ebaf..b8d34d5c 100644 --- a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py +++ b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -249,6 +249,17 @@ def create_or_checkout_branch(repo, branch_name, base_branch): print("Error checking out branch: {}".format(str(e))) sys.exit(1) +# Delete the unused branch in the remote manifest repository +def delete_branch(repo, branch_name): + print("Delete unused branch: {}".format(branch_name)) + print(':{}'.format(branch_name)) + try: + remote = repo.remote(name='origin') + remote.push(refspec=(':{}'.format(branch_name))) + except GitCommandError as e: + print("Error delete branch: {}".format(str(e))) + sys.exit(1) + def main(): github_token = os.getenv('GITHUB_TOKEN') manifest_repo_path = os.getenv('MANIFEST_REPO_PATH') @@ -290,8 +301,12 @@ def main(): changes_made = update_xml_files(manifest_repo_path, updates) if changes_made: - commit_and_push(manifest_repo_path, "Update manifest for {}".format(','.join(updates.keys()))) - create_pull_request(github_token, manifest_repo_name, feature_branch, base_branch, manifest_pr_title, manifest_pr_description) + commit_and_push(manifest_repo_path, "Update manifest for {}".format(','.join(updates.keys()))) + create_pull_request(github_token, manifest_repo_name, feature_branch, base_branch, manifest_pr_title, manifest_pr_description) + else: + # delete the unused feature branch + delete_branch(repo, feature_branch) + if __name__ == '__main__': main() diff --git a/cov_docker_script/build_native.sh b/cov_docker_script/build_native.sh index 7dd2ca14..83f57761 100755 --- a/cov_docker_script/build_native.sh +++ b/cov_docker_script/build_native.sh @@ -182,13 +182,51 @@ parse_configure_options_file() { cppflags="${cppflags//\$HOME/$HOME}" cflags="${cflags//\$HOME/$HOME}" ldflags="${ldflags//\$HOME/$HOME}" - + # Build final options array [[ -n "$cppflags" ]] && options_array+=("CPPFLAGS=${cppflags% }") [[ -n "$cflags" ]] && options_array+=("CFLAGS=${cflags% }") [[ -n "$ldflags" ]] && options_array+=("LDFLAGS=${ldflags% }") } +# Build with custom commands +build_component_commands() { + cd "$COMPONENT_DIR" + + local cmd_count + cmd_count=$(jq -r '.native_component.build.commands // [] | length' "$CONFIG_FILE") + + if [[ "$cmd_count" -eq 0 ]]; then + err "No build commands configured for 'commands' build type" + return 1 + fi + + step "Running build commands ($cmd_count commands)" + + local i=0 + while [[ $i -lt $cmd_count ]]; do + local command + command=$(jq -r ".native_component.build.commands[$i]" "$CONFIG_FILE") + + # Expand environment variables in command + command=$(expand_path "$command") + + log " [$((i+1))/$cmd_count] Executing: $command" + if eval "$command"; then + ok "Success: Command $((i+1))" + else + err "Failed: Command $((i+1)): $command" + return 1 + fi + + i=$((i + 1)) + done + + ok "All build commands completed successfully" + echo "" + return 0 +} + # Build with autotools build_component_autotools() { cd "$COMPONENT_DIR" @@ -240,6 +278,16 @@ build_component_autotools() { fi ok "autogen.sh completed" echo "" + elif [[ ! -f "./configure" ]] && [[ -f "./configure.ac" ]]; then + # No autogen.sh and no configure, but configure.ac exists + # Run autoreconf to generate configure script + step "Running autoreconf to generate configure script" + if ! autoreconf -fi; then + err "autoreconf failed" + return 1 + fi + ok "autoreconf completed" + echo "" fi # Configure @@ -335,21 +383,56 @@ run_pre_build_commands() { # Build with CMake build_component_cmake() { cd "$COMPONENT_DIR" - + local build_dir cmake_flags make_targets parallel_make build_dir=$(jq -r '.native_component.build.build_dir // "build"' "$CONFIG_FILE") cmake_flags=$(jq -r '.native_component.build.cmake_flags // empty' "$CONFIG_FILE") cmake_flags=$(expand_path "$cmake_flags") make_targets=$(jq -r '.native_component.build.make_targets[]? // "all"' "$CONFIG_FILE" | tr '\n' ' ') parallel_make=$(jq -r '.native_component.build.parallel_make // true' "$CONFIG_FILE") - - build_cmake "$COMPONENT_DIR" "$build_dir" "$cmake_flags" "$make_targets" "$parallel_make" || return 1 - + + # Parse configure options file if exists + local config_file_path cppflags cflags ldflags + config_file_path=$(jq -r '.native_component.build.configure_options_file // empty' "$CONFIG_FILE") + if [[ -n "$config_file_path" ]]; then + config_file_path=$(expand_path "$config_file_path") + if [[ ! "$config_file_path" = /* ]]; then + config_file_path="$COMPONENT_DIR/$config_file_path" + fi + + step "Reading configure options from: $config_file_path" + local parsed_array=() + if parse_configure_options_file "$config_file_path" parsed_array; then + for opt in "${parsed_array[@]}"; do + case $opt in + CPPFLAGS=*) cppflags="${opt#CPPFLAGS=}" ;; + CFLAGS=*) cflags="${opt#CFLAGS=}" ;; + LDFLAGS=*) ldflags="${opt#LDFLAGS=}" ;; + esac + done + else + err "Failed to parse configure options file (for cmake)" + return 1 + fi + fi + + # Compose cmake flags + local combined_cmake_flags="$cmake_flags" + [[ -n "$cppflags" ]] && combined_cmake_flags+=" -DCMAKE_C_FLAGS=\"$cppflags $cflags\" -DCMAKE_CXX_FLAGS=\"$cppflags $cflags\"" + [[ -n "$ldflags" ]] && combined_cmake_flags+=" -DCMAKE_EXE_LINKER_FLAGS=\"$ldflags\"" + + build_cmake "$COMPONENT_DIR" "$build_dir" "$combined_cmake_flags" "$make_targets" "$parallel_make" || return 1 return 0 } # Install libraries install_libraries() { + # Skip library installation if LIB_PATH is not set or empty + if [[ -z "$LIB_PATH" || "$LIB_PATH" == "null" ]]; then + log "No library output path configured, skipping library installation" + return 0 + fi + step "Installing libraries to $LIB_PATH" mkdir -p "$LIB_PATH" @@ -397,6 +480,13 @@ main() { exit 1 fi ;; + + commands) + if ! build_component_commands; then + err "Build commands failed" + exit 1 + fi + ;; *) err "Unsupported build type: $BUILD_TYPE" diff --git a/cov_docker_script/common_build_utils.sh b/cov_docker_script/common_build_utils.sh index 0f3d9daa..b59d6a87 100755 --- a/cov_docker_script/common_build_utils.sh +++ b/cov_docker_script/common_build_utils.sh @@ -40,6 +40,16 @@ check_dependencies() { return 0 } +# Get latest commit id +get_latest_sha() { + local repo_path="$1" + + git -C "$repo_path" rev-parse -is-inside-work-tree >/dev/null 2>&1 \ + || { echo "Invalid git repo"; return 1; } + + git -C "$repo_path" rev-parse --short HEAD +} + # Clone a git repository clone_repo() { local name="$1" repo="$2" branch="$3" dest="$4" diff --git a/cov_docker_script/setup_dependencies.sh b/cov_docker_script/setup_dependencies.sh index 1a8479e4..95a64182 100755 --- a/cov_docker_script/setup_dependencies.sh +++ b/cov_docker_script/setup_dependencies.sh @@ -102,7 +102,13 @@ initialize_environment() { [[ -d "$BUILD_DIR" ]] && rm -rf "$BUILD_DIR" [[ -d "$USR_DIR" ]] && rm -rf "$USR_DIR" fi - + + # Rebuild if requested + if [[ "${RE_BUILD:-false}" == "true" ]]; then + warn "Removing previous build completed flags" + [[ -d "$BUILD_DIR" ]] && find "$BUILD_DIR" -type f -name 'build_*.done' -print -delete + fi + # Create directories mkdir -p "$BUILD_DIR" mkdir -p "$USR_DIR/include/rdkb" @@ -163,6 +169,15 @@ build_repository() { log "No build configuration for $name (headers only)" return 0 fi + + local LATEST_SHA="$(get_latest_sha "$repo_dir")" + if [ -f "$repo_dir/build_${LATEST_SHA}.done" ]; then + # Copy libraries + copy_libraries "$repo_dir" "$USR_DIR/local/lib" + copy_libraries "$repo_dir" "$USR_DIR/lib" + log "Build already done for SHA: $LATEST_SHA, skipping rebuild." + return 0 + fi step "Building $name (type: $build_type)" @@ -237,6 +252,7 @@ build_repository() { copy_libraries "$repo_dir" "$USR_DIR/lib" ok "$name build completed" + touch "$repo_dir/build_${LATEST_SHA}.done" return 0 } diff --git a/ignore_projects_fossid b/ignore_projects_fossid index 5724c158..14d169f0 100644 --- a/ignore_projects_fossid +++ b/ignore_projects_fossid @@ -1,5 +1,311 @@ -# Ignore Projects by Repo URL (github.com/organization/repository) -github.com/openssl/openssl -# Ignore Projects by Org URL (github.com/organization) +# GitHub wildcard ignores + github.com/rdkcentral github.com/rdkcmf + +# rdk/components/generic/sys_mon_tools/udhcpc-opt43 +0312e061bbb8021780be869000000000 +# rdk/components/generic/sys_mon_tools/key_simulator +032af61a6a50ee25f4c59eed00000000 +# rdkb/devices/emulator/hal +0551aa5d79c9f0fe3aa5805100000000 +# rdkb/components/opensource/ccsp/halinterface +0555a82bf76256a3c1baa9e800000000 +# rdk/components/generic/iarmmgrs +0821ae7c2e1a9e045ca4342c00000000 +# rdk/components/generic/telemetry +08e9bcaa60ec00deb15d646600000000 +# rdk/components/generic/sys_mon_tools/analyzers/scripts/host +0ac07f8031ca4c1e870a603200000000 +# rdkb/devices/raspberrypi/sysint +0cabe96eb3d3e0393933053b00000000 +# rdkb/devices/rdkbemu/rdkbemu_xb3 +0d1f929be7f59af3aaf2294600000000 +# rdk/components/generic/sys_mon_tools/hostdataconverter +0df0e8ef62d978b9d48088b100000000 +# rdk/components/generic/libunpriv +1394b999767a4105dccce04800000000 +# rdkb/components/opensource/ccsp/CcspCMAgent +13e90f9271fab4b1284409a800000000 +# rdk/components/generic/aampabr +14cc54766d46e356b31eada200000000 +# rdkb/devices/raspberrypi/hal +17631c9e8be77d5839e8aeb800000000 +# rdk/components/opensource/oe/meta-python2 +1c232d52506c8c0111404a6b00000000 +# rdk/components/opensource/oe/meta-oic +1efdd733d486afd3554a118e00000000 +# rdk/components/generic/aampmetrics +1f2d6e54b3b673eb0baf8a5d00000000 +# rdkb/components/opensource/ccsp/CcspCommonLibrary +21790ddde6bb474a47e5831d00000000 +# rdk/components/generic/sys_mon_tools/mem_analyser_tools +21f792421a70ce360c6b247f00000000 +# rdk/components/generic/rdkbrowser2 +2209c733fb593254df10690f00000000 +# rdk/components/generic/sys_mon_tools/power-state-monitor +233ab58215eda0a1606fa37600000000 +# rdk/components/generic/syslog_helper +23f95bc5c142108a4f5f2e8b00000000 +# rdk/components/generic/gstreamer-direct-platform +23fff951e1b7273399aeeec900000000 +# rdk/components/generic/sys_mon_tools/sys_utils +24947b1d57b3bd66b1cfa88b00000000 +# rdk/components/generic/ledmgr +26b79ff9e9b7f137dfde1ca700000000 +# rdk/devices/raspberrypi/webpa-client +28a78bb9e71c2db403cdab3300000000 +# components/opensource/gdbus-client +28b95cb76e9c4b3035c92e1000000000 +# rdkb/components/opensource/ccsp/CcspLMLite +2b44713ff1ac1c670732f2a800000000 +# rdk/components/generic/netsrvmgr +2b98d86af2b8302aac86b5a100000000 +# rdkb/components/opensource/ccsp/CcspEPONAgent +2badc8bad94ca27b72658f3500000000 +# rdk/components/generic/hdmicec +2d3a12d888cf706e1dd4055f00000000 +# rdkb/components/opensource/ccsp/GwProvApp-ePON +2f2526bbea9588cd65a366ac00000000 +# rdkc/components/opensource/thumbnail +30b7b366b3cf255c5f4cddb300000000 +# rdk/components/generic/bluetooth_mgr +31249cee61fa8d2fc7eec43a00000000 +# rdk/components/generic/rmf_tools/generate_si_cache +33f194c14bf4d6c247f7a53300000000 +# rdkb/devices/intel-x86-pc/emulator/tdkb +34ad449236ecd330466b3ae600000000 +# rdk/components/generic/lxc-container-generator +34e6f3c7cc4be127297b97c600000000 +# rdk/components/generic/rdk_logger +361cae0c0c2ca825fb17cfcb00000000 +# rdkb/components/opensource/ccsp/MeshAgent +38b2e06d92588f8886352c2100000000 +# rdk/components/opensource/oe/meta-linaro +38c7c550fcdeeb42bbebb72200000000 +# rdk/components/generic/sys_mon_tools/iarm_query_powerstate +39608218f6d4418aeb1b919a00000000 +# rdk/components/opensource/oe/meta-jz-mips +398e9fecdebc6febf96067fb00000000 +# rdk/components/generic/dtcp +39a2ceada87d6eedae95aa7900000000 +# rdk/components/generic/xconf-simulator +39fe950c050612f5c01aca2600000000 +# rdkb/devices/intel-x86-pc/emulator/sysint +3b95503d9e8099795d82974c00000000 +# components/opensource/v4l2test +3bb97b8fd8862beaf1b6afd400000000 +# rdk/components/opensource/oe/meta-secure-core +3ca020f5f8a2a4c5cf4fabd700000000 +# rdk/components/opensource/oe/meta-openembedded +3df3fad0bf430978afa545f200000000 +# rdk/components/generic/sys_mon_tools/rdklogctrl +42b54399191f591ed925966000000000 +# rdk/devices/intel-x86-pc/emulator/devicesettings +45a3c381a9e33d5880b24f5500000000 +# rdk/components/generic/gst-plugins-rdk +469f619259af5237a1dbc6e400000000 +# rdk/components/generic/cpuprocanalyzer +4e0e609ae4840464d737e86d00000000 +# rdkb/components/opensource/ccsp/webui +4eed51a55512542122f78b5700000000 +# rdkb/components/opensource/ccsp/RebootManager +4f776ab8855ad0d19cc2ed6200000000 +# rdk/components/generic/audiocapturemgr +509fc97ea60e6beb1c202d1700000000 +# rdk/devices/raspberrypi/tdk +52bfe2a3b0018c6ff8657fc300000000 +# rdkc/devices/raspberrypi/mediastreamer +54e8e5c02b6fe48cf3bcce9500000000 +# rdkb/components/opensource/ccsp/CcspXDNS +56c293250ac98c4a671d5c8400000000 +# rdk/tools/tdk +5789cfb05192f1da404bb81300000000 +# rdk/components/generic/ttsengine +58178979ce4a4fbc542e746500000000 +# rdk/components/opensource/oe/meta-rtlwifi +5a1ce6e65a20ab81b7c7846000000000 +# rdkb/components/opensource/ccsp/TestAndDiagnostic +5aa5570bb6b4c520bac5a15900000000 +# rdkb/components/generic/harvester +5c4e94b9bf9048928a4b357900000000 +# rdk/components/generic/gst-plugins-rdk-aamp +5e2ab75fcf5f9b2b04690df600000000 +# rdk/devices/raspberrypi/iarmmgrs +6071165faac2654711e1904700000000 +# components/opensource/rbus +63e48edc1d3ea569e29ed97d00000000 +# rdk/components/generic/rdm +64150612cd991af9806399d100000000 +# rdk/devices/intel-x86-pc/emulator/iarmmgrs +659638e8e2cd732c9f63004a00000000 +# rdk/components/generic/dca +6a0e0b06edcacca0d43a1fdf00000000 +# rdk/components/generic/wifi +6a7e94c797b7284bc610853e00000000 +# rdkb/components/opensource/ccsp/FirmwareSanity +6c971cb75c7444f4dbea71c100000000 +# rdkc/components/opensource/httpClients +7112c0bb3cedb711a3b5333700000000 +# rdk/devices/intel-x86-pc/rdkemulator/gst-plugins-rdk/playersinkbin +717b6c5feaee2a7f6ff5bcf800000000 +# rdk/components/generic/cobalt +73042bcbe5fb5a5c2ed1da4c00000000 +# rdkb/components/opensource/ccsp/CcspPandM +73ca93e95468a50d19dbeab400000000 +# rdkc/components/opensource/plugins +76f1fb1f227750e7963e710200000000 +# rdk/components/generic/rdkmediaplayer +774eca14e8f0602aecdb856800000000 +# rdk/components/generic/aamp +7cb6e923b4c6d7351fe01a3200000000 +# rdkb/components/generic/servicemanager +7e3fe2b6f2e960d15c4a67ce00000000 +# rdk/components/generic/hwselftest +8160d7b856213b942f09767b00000000 +# rdk/components/generic/xupnp +84912ff7c47c6a0afcb285cd00000000 +# components/opensource/RDK_apps +86066d3e05d32169d321ec7100000000 +# rdkb/tools/tdkb +86c8d7224e0aee9e5ae2fab300000000 +# rdk/components/opensource/oe/meta-browser +86fa798256712121cafb76b700000000 +# rdk/components/generic/libusbctrl +88faa82d3d6ac6beed9a538800000000 +# rdk/components/generic/devicesettings +890bbc27ac4ffb9946e134db00000000 +# rdk/components/generic/rmf_tools/tenableHDCP +8f437ef3a7cd7f955a168a3e00000000 +# rdk/components/generic/breakpad_wrapper +8f55b8278f747c36b9d2ca7400000000 +# rdk/components/generic/rne +95bb39e5d5b9d811220edf6a00000000 +# rdk/components/generic/rdkat +96a5d7ec2c979a13d8b72dbd00000000 +# rdk/components/generic/netmonitor +97bdfab69951cfed719754c100000000 +# components/opensource/westeros +9a902bb420b74370487e484e00000000 +# rdkc/components/opensource/ledmgr +9e99ceeb37255df11a4218c800000000 +# rdk/components/generic/tr69hostif +9f81746b75f649527799b2ff00000000 +# rdkb/components/opensource/ccsp/CcspMoCA +9f85b22d2ec2b4d5bd81ffcd00000000 +# rdk/devices/intel-x86-pc/rdkemulator/tdk +a0b3b2a80052b106d28ce80f00000000 +# rdk/components/generic/bluetooth +a173e2b6346a1d91c833aa2b00000000 +# rdk/components/generic/lxccpid +a628c6479194b73a4a07e9aa00000000 +# components/opensource/waymetric +a62940154adbd207e207095c00000000 +# rdkb/components/opensource/ccsp/CcspMtaAgent +a823ca8d897038ec86955e5b00000000 +# rdk/components/generic/iarmbus +aa674959b198ad8cf0107fe900000000 +# rdk/components/generic/sys_mon_tools/iarm_event_sender +ab2cfd6f7f89471bdf83dce600000000 +# rdkb/components/generic/CcspLogAgent +ac13c503dc5520179e26f48700000000 +# rdkcmf/meta-westeros-raspberrypi +aea46ffc6d4435813f8a136a00000000 +# rdkc/devices/raspberrypi/tdkc +af1efc6f5da8eb4f209a2ddc00000000 +# rdk/components/opensource/oe/meta-96boards +b1782d92648d80b8e1f5e94000000000 +# rdk/components/generic/rdkbrowser +b1c57310f9fec452fc79d18100000000 +# components/opensource/wayland-egl-icegdl +b31ad1cfb0eb2f803a4be29400000000 +# rdkb/devices/raspberrypi/tdkb +b4b8da1f296305731f110c9100000000 +# rdkb/components/opensource/ccsp/CcspWifiAgent +b78a367b712de82f3aac137200000000 +# rdk/devices/raspberrypi/gst-plugins-rdk/playersinkbin +b8c91803428899447b15c1fe00000000 +# rdk/devices/intel-x86-pc/rdkemulator/gst-plugins-rdk/qamtunersrc +b8ccf187e446f7b5d5df1ca500000000 +# rdk/components/opensource/oe/meta-virtualization +b96521bfbe8b6d6a9910a19e00000000 +# rdk/components/generic/appmanager +ba0c86d5c01bdc06c35b3bca00000000 +# rdkb/components/opensource/ccsp/CcspWecbController +bb48fda394fc8567dfa05fb300000000 +# rdk/components/generic/media_utils +bc0a3725e8cb2d3ec3118ae200000000 +# rdk/components/generic/sys_mon_tools/si_cache_parser +be2aaf5bc4afe45d0dd18d5f00000000 +# rdk/components/generic/libSyscallWrapper +bf7c03cf5b3c7b98c1e2f1bc00000000 +# rdkc/tools/tdkc +c438bbe2b9dc927e5cc7564c00000000 +# rdkb/components/opensource/ccsp/Utopia +c56fc505f862dfa0dc8df6be00000000 +# rdk/components/opensource/oe/meta-wpe +c6ae41fe3ecbb3fbda3374a300000000 +# rdk/components/generic/mocahal +c7f7dd12c6c47f2d9e55e16600000000 +# rdkc/components/opensource/cvr +cdf85cdb5fa13828d87a90c000000000 +# rdk/components/opensource/rtmessage +cef528d6bc83c91b1c3caabf00000000 +# rdkc/components/opensource/rtmessage +cefe9ea55ddf4627e5bb591d00000000 +# rdk/components/opensource/oe/openembedded-core +cf30160dc190308e206f366c00000000 +# rdk/devices/raspberrypi/devicesettings +cf86595dec6e144cda33f9d500000000 +# rdk/components/generic/diagnostics +d55b46adb131c24b1b7a4b5100000000 +# rdkb/components/opensource/ccsp/sysint +d5fbb2b67f2a3e8d4f3b33a900000000 +# rdkc/components/opensource/rms +d60689cac6fcc8e19c3cf57c00000000 +# rdk/components/generic/injectedbundle +d6b70a5ee62120bd82a10abf00000000 +# rdk/components/generic/crashupload +d727ca07715b8fa358f900d200000000 +# rdk/components/generic/crashlog +d83af57f9dd6160b159e701e00000000 +# rdk/components/generic/sys_mon_tools/sys_resource +d92a5bbcda34a49236abdda600000000 +# rdkb/components/opensource/ccsp/servicemanager +d97224a6f73eaa348c988e8200000000 +# rdkc/components/opensource/configMgr +da8b4820e40bcf06eb491d1d00000000 +# rdkb/components/opensource/ccsp/utilities +db5ebe3259f1b36b92818d1900000000 +# rdk/components/generic/xconfserver +dc20f556a708560a6a6fb22900000000 +# rdk/components/generic/sys_mon_tools/iarm_set_powerstate +e0d0efbe3414a31493d868fc00000000 +# rdk/components/generic/storagemanager +e13473a724b0d15551da9dd600000000 +# rdk/components/generic/dcm +e2a1022f74327ab18e8f37e300000000 +# rdk/components/generic/trm +e77117e26a62ef760f39189e00000000 +# rdkb/components/opensource/ccsp/CcspSnmpPa +e8b1d5c4a1825c7f55e9f6c500000000 +# rdkb/devices/ci20/hal +eb10c85c56a36682e703af3a00000000 +# rdk/components/opensource/oe/meta-qt5 +f0f970a53288330a52f3780e00000000 +# components/opensource/rbuscore +f365ae1c7af6543dda362eea00000000 +# rdk/components/generic/sys_mon_tools/mfr_utils +f5f3093b9e7999c87cd0959c00000000 +# rdk/components/generic/rdkapps +f71d6986f4de1e030225ad7000000000 +# rdkb/components/opensource/ccsp/GwProvApp +f9230f364201a232d201797d00000000 +# devices/intel-x86-pc/rdkri/westeros +fb0b012d7d6c836bb0be772600000000 +# rdk/components/generic/rfc +fc15a7b0c7b974c0913a795200000000 +# rdkb/components/opensource/ccsp/hal +fc6593467d7da7131712575300000000 +# rdkb/components/opensource/ccsp/CcspEthAgent +fe4b531e392af92e932231d300000000