From f03fcae6ad2986ffc1fbae9a3ac51b3f86ddcd59 Mon Sep 17 00:00:00 2001 From: Jonas Tsai Date: Thu, 12 Sep 2024 14:21:27 +0800 Subject: [PATCH] Update documents to run Cobalt on Linux in evergreen mode android document is updated as well for generating XML test result b/361540371 b/362655498 --- cobalt/site/docs/development/setup-android.md | 19 +- cobalt/site/docs/development/setup-linux.md | 316 ++++++++++++++++-- 2 files changed, 299 insertions(+), 36 deletions(-) diff --git a/cobalt/site/docs/development/setup-android.md b/cobalt/site/docs/development/setup-android.md index 01b8fc68b6a1..518404b85b46 100644 --- a/cobalt/site/docs/development/setup-android.md +++ b/cobalt/site/docs/development/setup-android.md @@ -39,8 +39,6 @@ return and complete the following steps. ./starboard/tools/download_clang.sh ./starboard/android/shared/download_sdk.sh ``` - If you encountered `Failed to find package patcher;v4` error, please edit starboard/android/shared/download_sdk.sh - and remove `"patcher;v4" \ ` near line 53. 1. Install additional Linux packages @@ -276,6 +274,23 @@ Similar to loader_app, create the directory with arguments that meet the target adb shell "am start --esa args '--evergreen_library=app/cobalt/lib/libnplb.so,--evergreen_content=app/cobalt/content' dev.cobalt.coat" ``` +1. Generate test result with XML format + + Due to access permission constrains on AOSP, the xml file should be created + by `adb shell` first, before nplb apk writing test result in it. + + ```sh + # create a file in a folder with read/write permission + adb shell "mkdir -p /data/local/tmp/" + adb shell "touch /data/local/tmp/nplb_testResult.xml" + + # Make the file writable + adb shell "chmod a+w /data/local/tmp/nplb_testResult.xml" + + # test and output to xml file + adb shell "am start --esa args '--evergreen_library=app/cobalt/lib/libnplb.so,--evergreen_content=app/cobalt/content,--gtest_output=xml:/data/local/tmp/nplb_testResult.xml' dev.cobalt.coat" + ``` + ### Build and run nplb evergreen compat test apk 1. Build nplb_evergreen_compat_tests apk diff --git a/cobalt/site/docs/development/setup-linux.md b/cobalt/site/docs/development/setup-linux.md index 889c4d079677..0d613125ad41 100644 --- a/cobalt/site/docs/development/setup-linux.md +++ b/cobalt/site/docs/development/setup-linux.md @@ -17,35 +17,35 @@ Required libraries can differ depending on your Linux distribution and version. 1. Run the following command to install packages needed to build and run Cobalt on Linux: - ``` - $ sudo apt update && sudo apt install -qqy --no-install-recommends \ - bison clang libasound2-dev libgles2-mesa-dev libglib2.0-dev \ - libxcomposite-dev libxi-dev libxrender-dev nasm ninja-build \ - python3.8-venv + ```sh + sudo apt update && sudo apt install -qqy --no-install-recommends \ + bison clang libasound2-dev libgles2-mesa-dev libglib2.0-dev \ + libxcomposite-dev libxi-dev libxrender-dev nasm ninja-build \ + python3-venv ``` 1. Install ccache to support build acceleration. Build acceleration is \ enabled by default and must be disabled if ccache is not installed. - ``` - $ sudo apt install -qqy --no-install-recommends ccache + ```sh + sudo apt install -qqy --no-install-recommends ccache ``` We recommend adjusting the cache size as needed to increase cache hits: - ``` - $ ccache --max-size=20G + ```sh + ccache --max-size=20G ``` 1. Install Node.js via `nvm`: - ``` - $ export NVM_DIR=~/.nvm - $ export NODE_VERSION=12.17.0 + ```sh + export NVM_DIR=~/.nvm + export NODE_VERSION=12.17.0 - $ curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash + curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash - $ . $NVM_DIR/nvm.sh \ + . $NVM_DIR/nvm.sh \ && nvm install --lts \ && nvm alias default lts/* \ && nvm use default @@ -58,8 +58,8 @@ Required libraries can differ depending on your Linux distribution and version. 1. Clone the Cobalt code repository. The following `git` command creates a `cobalt` directory that contains the repository: - ``` - $ git clone https://github.com/youtube/cobalt.git + ```sh + git clone https://github.com/youtube/cobalt.git ``` 1. Set `PYTHONPATH` environment variable to include the full path to the @@ -67,7 +67,7 @@ Required libraries can differ depending on your Linux distribution and version. the end of your ~/.bash_profile (replacing `fullpathto` with the actual path where you cloned the repo): - ``` + ```sh export PYTHONPATH="/fullpathto/cobalt:${PYTHONPATH}" ``` @@ -78,8 +78,10 @@ Required libraries can differ depending on your Linux distribution and version. 1. Enter your new `cobalt` directory: - ``` - $ cd cobalt + ```sh + cd cobalt + export COBALT_SRC=${PWD} + export PYTHONPATH=${PWD}:${PYTHONPATH} ```