Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/native_full_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ on:
jobs:
build-entservices-on-pr:
name: Build xdialserver component in github rdkcentral
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
runs-on: ubuntu-22.04
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrating from a Docker container (ghcr.io/rdkcentral/docker-rdk-ci:latest) to ubuntu-22.04 runner changes the build environment significantly. The build_dependencies.sh script now requires sudo access (lines 14-19), which works on GitHub Actions runners but may not work in all environments. Consider documenting this requirement or ensuring the scripts can work both with and without sudo when needed.

Suggested change
runs-on: ubuntu-22.04
runs-on: ubuntu-22.04
container: ghcr.io/rdkcentral/docker-rdk-ci:latest

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the same as running container: ubuntu:22.04.
Please see #186


steps:
- name: Checkout code
Expand Down
162 changes: 75 additions & 87 deletions build_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,130 +1,118 @@
#!/bin/bash
set -x
set -e
set -x

##############################
# Paths
GITHUB_WORKSPACE="${PWD}"
INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr"

cd ${GITHUB_WORKSPACE}
mkdir -p "$INSTALL_PREFIX"

# # #############################
#1. Install Dependencies and packages
##############################
# System dependencies (sudo REQUIRED in GitHub Actions)
sudo apt update
sudo apt install -y \
ninja-build meson cmake curl libcurl4-openssl-dev \
libsoup2.4-dev libxml2-dev libglib2.0-dev \
gobject-introspection libgirepository1.0-dev \
libgtk-3-dev libcunit1-dev valac pandoc

apt update
apt install -y ninja-build meson curl libsoup2.4-dev libxml2-dev libglib2.0-dev gobject-introspection libgirepository1.0-dev libgtk-3-dev valac pandoc
pip install jsonref
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pip install command on line 21 does not use sudo, while the apt commands on lines 14-19 do. This inconsistency may cause the pip package to be installed in the user's local environment instead of system-wide. Consider either using 'sudo pip install' for consistency or using 'pip install --user' to make the local installation explicit.

Suggested change
pip install jsonref
pip install --user jsonref

Copilot uses AI. Check for mistakes.

############################
# Build trevor-base64
if [ ! -d "trower-base64" ]; then
##############################
# Build trower-base64
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script clones the trower-base64 repository without checking if it already exists. If the script is run multiple times, this will fail. Consider adding a check to skip cloning if the directory already exists, or remove the directory before cloning.

Suggested change
# Build trower-base64
# Build trower-base64
if [ -d "trower-base64" ]; then
rm -rf "trower-base64"
fi

Copilot uses AI. Check for mistakes.
git clone https://github.com/xmidt-org/trower-base64.git
fi
cd trower-base64
meson setup --warnlevel 3 --werror build
meson setup build --prefix="$INSTALL_PREFIX"
ninja -C build
ninja -C build install
cd ..
###########################################
# Clone the required repositories

rm -rf iarmbus ThunderTools Thunder entservices-apis entservices-testframework gssdp


##############################
# Clone required repositories
git clone https://github.com/rdkcentral/iarmbus.git
export IARMBUS_PATH=$GITHUB_WORKSPACE/iarmbus

git clone --branch R4.4.3 https://github.com/rdkcentral/ThunderTools.git
export IARMBUS_PATH="$GITHUB_WORKSPACE/iarmbus"

git clone --branch R4.4.3 https://github.com/rdkcentral/ThunderTools.git
git clone --branch R4.4.1 https://github.com/rdkcentral/Thunder.git

git clone --branch main https://github.com/rdkcentral/entservices-apis.git

git clone https://$GITHUB_TOKEN@github.com/rdkcentral/entservices-testframework.git
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GITHUB_TOKEN is exposed to the git clone command on line 40, which could log sensitive credentials in build logs. Consider using a credential helper or other secure method to handle authentication for private repositories.

Suggested change
git clone https://$GITHUB_TOKEN@github.com/rdkcentral/entservices-testframework.git
set +x
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
set -x
git clone https://github.com/rdkcentral/entservices-testframework.git

Copilot uses AI. Check for mistakes.

git clone --branch gssdp-1.2.3 https://gitlab.gnome.org/GNOME/gssdp.git
Comment on lines 34 to 41
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git clone commands for repositories on lines 34-41 will fail if these directories already exist from a previous run. With 'set -e' enabled, this will cause the entire script to fail. Consider either removing existing directories before cloning or adding checks to skip cloning if directories exist.

Copilot uses AI. Check for mistakes.

############################
# Build gssdp-1.2
echo "======================================================================================"
echo "buliding gssdp-1.2"
##############################
# Build gssdp
cd gssdp

rm -rf build
meson setup build

meson setup build --prefix="$INSTALL_PREFIX"
ninja -C build
ninja -C build install
cd -
cd ..

############################
# Build Thunder-Tools
echo "======================================================================================"
echo "buliding thunderTools"
##############################
# Build ThunderTools
cd ThunderTools
patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch
cd -

patch -p1 < "$GITHUB_WORKSPACE/entservices-testframework/patches/00010-R4.4-Add-support-for-project-dir.patch"
cd ..

cmake -G Ninja -S ThunderTools -B build/ThunderTools \
-DEXCEPTIONS_ENABLE=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \
-DGENERIC_CMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake"

cmake --build build/ThunderTools --target install


############################
##############################
# Build Thunder
echo "======================================================================================"
echo "buliding thunder"

cd Thunder
patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch
patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/error_code_R4_4.patch
patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/1004-Add-support-for-project-dir.patch
patch -p1 < $GITHUB_WORKSPACE/entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch
cd -
patch -p1 < "$GITHUB_WORKSPACE/entservices-testframework/patches/Use_Legact_Alt_Based_On_ThunderTools_R4.4.3.patch"
patch -p1 < "$GITHUB_WORKSPACE/entservices-testframework/patches/error_code_R4_4.patch"
patch -p1 < "$GITHUB_WORKSPACE/entservices-testframework/patches/1004-Add-support-for-project-dir.patch"
patch -p1 < "$GITHUB_WORKSPACE/entservices-testframework/patches/RDKEMW-733-Add-ENTOS-IDS.patch"
cd ..

cmake -G Ninja -S Thunder -B build/Thunder \
-DMESSAGING=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \
-DGENERIC_CMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \
-DBUILD_TYPE=Debug \
-DBINDING=127.0.0.1 \
-DPORT=55555 \
-DEXCEPTIONS_ENABLE=ON \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \
-DMESSAGING=ON \
-DBUILD_TYPE=Debug \
-DEXCEPTIONS_ENABLE=ON

cmake --build build/Thunder --target install

############################
##############################
# Build entservices-apis
echo "======================================================================================"
echo "buliding entservices-apis"
cd entservices-apis
rm -rf jsonrpc/DTV.json
cd ..

cmake -G Ninja -S entservices-apis -B build/entservices-apis \
-DEXCEPTIONS_ENABLE=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \
cmake -G Ninja -S entservices-apis -B build/entservices-apis \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake"

cmake --build build/entservices-apis --target install

############################

############################
# Build and deploy stubs for IARMBus and WPEFramework securityagent
mkdir -p /usr/include/WPEFramework/securityagent
cp $GITHUB_WORKSPACE/stubs/securityagent/* /usr/include/WPEFramework/securityagent/ -v

echo "======================================================================================"
echo "Building IARMBus and WPEFramework securityagent stubs"
cd $GITHUB_WORKSPACE
cd ./stubs
g++ -fPIC -shared -o libIARMBus.so iarm_stubs.cpp -I$GITHUB_WORKSPACE/stubs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$IARMBUS_PATH/core -I$IARMBUS_PATH/core/include -fpermissive
g++ -fPIC -shared -o libWPEFrameworkSecurityUtil.so securityagent/SecurityTokenUtil.cpp -I$GITHUB_WORKSPACE/stubs -fpermissive

cp libIARMBus.so /usr/local/lib/
cp libWPEFrameworkSecurityUtil.so /usr/local/lib/
##############################
# Build and install IARMBus & SecurityAgent stubs
STUB_INCLUDE="$INSTALL_PREFIX/include"
STUB_LIB="$INSTALL_PREFIX/lib"

mkdir -p "$STUB_INCLUDE/WPEFramework/securityagent"
mkdir -p "$STUB_LIB"

cd "$GITHUB_WORKSPACE/stubs"

g++ -fPIC -shared -o libIARMBus.so iarm_stubs.cpp \
-I"$GITHUB_WORKSPACE/stubs" \
-I"$IARMBUS_PATH/core" \
-I"$IARMBUS_PATH/core/include" \
-I"$STUB_INCLUDE" \
-fpermissive

g++ -fPIC -shared -o libWPEFrameworkSecurityUtil.so \
securityagent/SecurityTokenUtil.cpp \
-I"$GITHUB_WORKSPACE/stubs" \
-I"$STUB_INCLUDE" \
-fpermissive
Comment on lines +104 to +110
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -fpermissive flag suppresses compilation errors and treats them as warnings. This can hide real issues in the code and should be avoided in production builds. Consider fixing the underlying compilation errors instead of masking them with -fpermissive.

Suggested change
-fpermissive
g++ -fPIC -shared -o libWPEFrameworkSecurityUtil.so \
securityagent/SecurityTokenUtil.cpp \
-I"$GITHUB_WORKSPACE/stubs" \
-I"$STUB_INCLUDE" \
-fpermissive
-Wall
g++ -fPIC -shared -o libWPEFrameworkSecurityUtil.so \
securityagent/SecurityTokenUtil.cpp \
-I"$GITHUB_WORKSPACE/stubs" \
-I"$STUB_INCLUDE" \
-Wall

Copilot uses AI. Check for mistakes.
Comment on lines +103 to +110
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -fpermissive flag suppresses compilation errors and treats them as warnings. This can hide real issues in the code and should be avoided in production builds. Consider fixing the underlying compilation errors instead of masking them with -fpermissive.

Suggested change
-I"$STUB_INCLUDE" \
-fpermissive
g++ -fPIC -shared -o libWPEFrameworkSecurityUtil.so \
securityagent/SecurityTokenUtil.cpp \
-I"$GITHUB_WORKSPACE/stubs" \
-I"$STUB_INCLUDE" \
-fpermissive
-I"$STUB_INCLUDE"
g++ -fPIC -shared -o libWPEFrameworkSecurityUtil.so \
securityagent/SecurityTokenUtil.cpp \
-I"$GITHUB_WORKSPACE/stubs" \
-I"$STUB_INCLUDE"

Copilot uses AI. Check for mistakes.

cp libIARMBus.so "$STUB_LIB/"
cp libWPEFrameworkSecurityUtil.so "$STUB_LIB/"
cp securityagent/* "$STUB_INCLUDE/WPEFramework/securityagent/"

echo "========================================================"
echo "Dependencies built and installed into $INSTALL_PREFIX"
echo "========================================================"
35 changes: 26 additions & 9 deletions cov_build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
#!/bin/bash
set -x
set -e
set -x

##############################
# Paths
GITHUB_WORKSPACE="${PWD}"
ls -la ${GITHUB_WORKSPACE}
############################
# Build xdialserver
echo "buliding xdialserver"
INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr"

cd ${GITHUB_WORKSPACE}
##############################
# Environment
export CMAKE_PREFIX_PATH="$INSTALL_PREFIX"
export PKG_CONFIG_PATH="$INSTALL_PREFIX/lib/pkgconfig:$INSTALL_PREFIX/lib/x86_64-linux-gnu/pkgconfig"
export LD_LIBRARY_PATH="$INSTALL_PREFIX/lib:$INSTALL_PREFIX/lib/x86_64-linux-gnu"

make
##############################
# Build xdialserver (out-of-source)
cmake -G Ninja \
-S "$GITHUB_WORKSPACE/server" \
-B build/xdialserver \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake" \
-DCMAKE_CXX_FLAGS="\
-I$INSTALL_PREFIX/include/WPEFramework \
-I$INSTALL_PREFIX/include/WPEFramework/core \
-I$INSTALL_PREFIX/include/WPEFramework/plugins \
-I$INSTALL_PREFIX/include/WPEFramework/interfaces" \
Comment on lines +23 to +27
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using CMAKE_CXX_FLAGS to pass include directories is not the recommended approach. CMake provides CMAKE_CXX_INCLUDES or the target-level include_directories command for this purpose. CMAKE_CXX_FLAGS should be reserved for actual compiler flags (optimization levels, warnings, etc.). Additionally, the multiline format with the backslash continuation after the opening quote will introduce leading whitespace in the flags, which may cause issues with some compilers.

Suggested change
-DCMAKE_CXX_FLAGS="\
-I$INSTALL_PREFIX/include/WPEFramework \
-I$INSTALL_PREFIX/include/WPEFramework/core \
-I$INSTALL_PREFIX/include/WPEFramework/plugins \
-I$INSTALL_PREFIX/include/WPEFramework/interfaces" \
-DCMAKE_CXX_INCLUDES="$INSTALL_PREFIX/include/WPEFramework;$INSTALL_PREFIX/include/WPEFramework/core;$INSTALL_PREFIX/include/WPEFramework/plugins;$INSTALL_PREFIX/include/WPEFramework/interfaces" \

Copilot uses AI. Check for mistakes.
-DCMAKE_SHARED_LINKER_FLAGS="-L$INSTALL_PREFIX/lib" \
-DCMAKE_EXE_LINKER_FLAGS="-L$INSTALL_PREFIX/lib" \
-DCMAKE_BUILD_RPATH="$INSTALL_PREFIX/lib" \
-DCMAKE_INSTALL_RPATH="$INSTALL_PREFIX/lib"

echo "======================================================================================"
exit 0
cmake --build build/xdialserver