├── .github └── workflows │ ├── build-images.yaml │ ├── build_bromite_dev.yaml │ ├── check_git_apply.yaml │ ├── execute-tests.yaml │ └── release.yaml ├── .gitignore ├── LICENSE ├── README.md ├── apply-all-patch.sh ├── apply-bromite-patches.sh ├── apply-failed-patch.sh ├── apply-single-patch.sh ├── build-from-repos.sh ├── buildbox-casd ├── buildbox-run-hosttools ├── buildbox-worker ├── casupload ├── clone-src.sh ├── create-from-patch.sh ├── depot_tools.diff ├── export-all-patch.sh ├── export-patch-list.sh ├── export-single-patch.sh ├── goma_auth.py ├── images ├── bromite-build │ ├── Dockerfile │ ├── action.yaml │ ├── build_args.gni │ ├── casupload │ ├── generic_android31.textpb │ ├── goma_auth.py │ ├── pre-start.sh │ └── start-build.sh ├── bromite-source │ ├── Dockerfile │ ├── action.yaml │ └── apply-bromite-patches.sh ├── build-deps │ ├── Dockerfile │ └── action.yaml ├── buildboxcasd │ ├── Dockerfile │ ├── buildbox-casd │ └── set-perms.sh ├── buildboxrunner │ ├── Dockerfile │ ├── buildbox-run-hosttools │ └── buildbox-worker ├── buildstack.env.example ├── buildstack.yml ├── chr-source │ ├── Dockerfile │ ├── action.yaml │ ├── depot_tools.diff │ ├── prepare-build.sh │ └── remove_ninja_uploader.diff ├── docker-host │ └── Dockerfile ├── github-runner │ ├── .env.example │ ├── Dockerfile │ ├── docker.default │ ├── patched │ │ ├── RunnerService.js │ │ └── runsvc.sh │ ├── proxy.conf │ ├── start-runner.sh │ └── startup.sh ├── goma-server │ ├── Dockerfile │ ├── config-file │ ├── install-goma-server.sh │ └── start-goma-server.sh ├── image-downloader │ └── check_and_download.sh ├── registry │ └── docker-compose.yml ├── remote-index │ ├── Dockerfile │ ├── entry_point.sh │ └── generate.sh ├── squid │ ├── Dockerfile │ ├── squid.conf │ ├── start-proxy.sh │ └── whitelist ├── terraform-buildgrid │ ├── buildgrid.tf │ ├── buildgrid.yml │ └── variables.tf └── test32bit │ ├── Dockerfile │ ├── bytecode_builtins_list_generator │ ├── gen-regexp-special-case │ └── torque ├── ninja-one-target-for-compdb.patch ├── prepare-build.sh ├── setup-goma-client.sh ├── start-build.sh ├── start-goma-server.sh └── start_proxy.sh /.github/workflows/build-images.yaml: -------------------------------------------------------------------------------- 1 | permissions: 2 | actions: none 3 | checks: none 4 | contents: none 5 | deployments: none 6 | issues: write 7 | packages: none 8 | pull-requests: none 9 | repository-projects: none 10 | security-events: none 11 | statuses: none 12 | 13 | on: 14 | workflow_dispatch: 15 | inputs: 16 | version: 17 | description: 'chromium version' 18 | required: false 19 | default: '' 20 | # schedule: 21 | # - cron: '0 1 * * *' 22 | 23 | env: 24 | VERSION: ${{ github.event.inputs.version }} 25 | NEW_VERSION: ${{ null }} 26 | 27 | name: Builds and pushes tagged image to DockerHub 28 | jobs: 29 | generate_build_deps: 30 | name: Generate Build Deps 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Reclaiming disk space on / by removing dotnet/android/ghc 34 | run: | 35 | sudo rm -rf /usr/share/dotnet 36 | sudo rm -rf /usr/local/lib/android 37 | sudo rm -rf /opt/ghc 38 | sudo apt-get remove google-cloud-sdk azure-cli google-chrome-stable \ 39 | firefox mysql-server-core-8.0 mono-devel podman \ 40 | powershell 41 | sudo apt-get autoremove 42 | 43 | - name: Checkout repo 44 | uses: actions/checkout@v2 45 | with: 46 | path: bromite-buildtools 47 | fetch-depth: 1 48 | 49 | - name: Login to Docker Hub 50 | uses: docker/login-action@v2 51 | with: 52 | username: ${{ secrets.DOCKERHUB_USERNAME }} 53 | password: ${{ secrets.DOCKERHUB_TOKEN }} 54 | 55 | - name: Check versions 56 | shell: bash 57 | run: | 58 | if [ -z $VERSION ]; then 59 | VERSION=$(curl -s https://omahaproxy.appspot.com/all.json | jq '.[] | select(.os | contains("win64")) | .versions[] | select(.channel | contains("stable")) | .current_version' | xargs) 60 | echo "VERSION=$VERSION" >> $GITHUB_ENV 61 | fi 62 | 63 | - name: Building build-deps container ${{ env.VERSION }} 64 | shell: bash 65 | run: | 66 | IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?) 67 | if [ $IS_PRESENT -ne "0" ]; then 68 | IS_PRESENT=$(docker manifest inspect uazo/build-deps:$VERSION > /dev/null ; echo $?) 69 | if [ $IS_PRESENT -ne "0" ]; then 70 | DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION \ 71 | --progress plain \ 72 | --build-arg VERSION=$VERSION \ 73 | --build-arg HTTP_PROXY="$PROXY_ADDR" \ 74 | --no-cache \ 75 | bromite-buildtools/images/build-deps/. 76 | 77 | docker push uazo/build-deps:$VERSION 78 | echo "NEW_VERSION=$VERSION" >> $GITHUB_ENV 79 | fi 80 | fi 81 | 82 | - name: Building chromium container ${{ env.VERSION }} 83 | shell: bash 84 | run: | 85 | IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?) 86 | if [ $IS_PRESENT -ne "0" ]; then 87 | IS_PRESENT=$(docker manifest inspect uazo/chromium:$VERSION > /dev/null ; echo $?) 88 | if [ $IS_PRESENT -ne "0" ]; then 89 | DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION \ 90 | --progress plain \ 91 | --build-arg VERSION=$VERSION \ 92 | --build-arg HTTP_PROXY="$PROXY_ADDR" \ 93 | bromite-buildtools/images/chr-source/. 94 | 95 | docker push uazo/chromium:$VERSION 96 | echo "NEW_VERSION=$VERSION" >> $GITHUB_ENV 97 | fi 98 | fi 99 | 100 | - name: Create issue ${{ env.VERSION }} 101 | if: "${{ env.NEW_VERSION != '' }}" 102 | shell: bash 103 | run: | 104 | GH=../gh_2.18.1_linux_amd64/bin/gh 105 | wget https://github.com/cli/cli/releases/download/v2.18.1/gh_2.18.1_linux_amd64.tar.gz 106 | tar xfz gh_2.18.1_linux_amd64.tar.gz 107 | 108 | cd bromite-buildtools 109 | echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token 110 | $GH issue create -t "$VERSION: new stable chromium version" -b "" 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /.github/workflows/build_bromite_dev.yaml: -------------------------------------------------------------------------------- 1 | name: Build Bromite 2 | permissions: 3 | actions: none 4 | checks: none 5 | contents: none 6 | deployments: none 7 | issues: none 8 | packages: none 9 | pull-requests: none 10 | repository-projects: none 11 | security-events: none 12 | statuses: none 13 | 14 | on: 15 | workflow_dispatch: 16 | inputs: 17 | sha: 18 | description: 'uazo/bromite SHA' 19 | required: true 20 | default: '' 21 | target_os: 22 | description: 'targetos [android/win/all]' 23 | required: true 24 | default: 'all' 25 | build: 26 | description: 'android arch [arm64/x64/all]' 27 | required: true 28 | default: 'all' 29 | type: 30 | description: 'runner? [dev/ci]' 31 | required: true 32 | default: 'ci' 33 | debug: 34 | description: 'debug? [true/false]' 35 | required: true 36 | default: 'false' 37 | clangd: 38 | description: 'clangd? [true/false]' 39 | required: true 40 | default: 'false' 41 | 42 | env: 43 | BROMITE_SHA: ${{ github.event.inputs.sha }} 44 | REMOVEDOCKERSUPPORT: true 45 | USELOCALIMAGE: true 46 | 47 | jobs: 48 | check_images: 49 | runs-on: ${{ github.event.inputs.type }} 50 | steps: 51 | - name: Checkout repo 52 | uses: actions/checkout@v2 53 | with: 54 | path: bromite-buildtools 55 | fetch-depth: 1 56 | 57 | - name: Enable proxy on container 58 | shell: bash 59 | run: | 60 | if ! [[ -z "${HTTP_PROXY}" ]]; then 61 | PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118 62 | echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV 63 | sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT 64 | sudo iptables -D INPUT -p tcp --dport 8118 -j DROP 65 | fi 66 | 67 | - name: Get current chromium version 68 | shell: bash 69 | run: | 70 | mkdir bromite 71 | cd bromite 72 | git init 73 | git remote add origin https://github.com/uazo/bromite 74 | git fetch origin $BROMITE_SHA 75 | git reset --hard FETCH_HEAD 76 | cd .. 77 | 78 | export VERSION=$( cat ./bromite/build/RELEASE ) 79 | rm -rf bromite 80 | 81 | echo Current version is $VERSION 82 | echo "VERSION=$VERSION" >> $GITHUB_ENV 83 | 84 | cd bromite-buildtools 85 | 86 | - name: Building build-deps container ${{ env.VERSION }} 87 | shell: bash 88 | run: | 89 | IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?) 90 | if [ $IS_PRESENT -ne "0" ]; then 91 | IS_PRESENT=$(docker manifest inspect uazo/build-deps:$VERSION > /dev/null ; echo $?) 92 | if [ $IS_PRESENT -ne "0" ]; then 93 | DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION \ 94 | --progress plain \ 95 | --build-arg VERSION=$VERSION \ 96 | --build-arg HTTP_PROXY="$PROXY_ADDR" \ 97 | --no-cache \ 98 | bromite-buildtools/images/build-deps/. 99 | fi 100 | fi 101 | 102 | - name: Building chromium container ${{ env.VERSION }} 103 | shell: bash 104 | run: | 105 | IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?) 106 | if [ $IS_PRESENT -ne "0" ]; then 107 | IS_PRESENT=$(docker manifest inspect uazo/chromium:$VERSION > /dev/null ; echo $?) 108 | if [ $IS_PRESENT -ne "0" ]; then 109 | DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION \ 110 | --progress plain \ 111 | --build-arg VERSION=$VERSION \ 112 | --build-arg HTTP_PROXY="$PROXY_ADDR" \ 113 | bromite-buildtools/images/chr-source/. 114 | fi 115 | fi 116 | 117 | - name: Building bromite container ${{ env.VERSION }}-${{ env.BROMITE_SHA }} 118 | shell: bash 119 | run: | 120 | IS_PRESENT=$(docker inspect --type=image uazo/bromite:$VERSION-$BROMITE_SHA > /dev/null ; echo $?) 121 | if [ $IS_PRESENT -ne "0" ]; then 122 | IS_PRESENT=$(docker manifest inspect uazo/bromite:$VERSION-$BROMITE_SHA > /dev/null ; echo $?) 123 | if [ $IS_PRESENT -ne "0" ]; then 124 | DOCKER_BUILDKIT=1 docker build -t uazo/bromite:$VERSION-$BROMITE_SHA --progress plain \ 125 | --build-arg BROMITE_SHA=$BROMITE_SHA \ 126 | --build-arg VERSION=$VERSION \ 127 | --build-arg HTTP_PROXY="$PROXY_ADDR" \ 128 | bromite-buildtools/images/bromite-source/. 129 | fi 130 | fi 131 | 132 | - name: Building bromite-build container ${{ env.VERSION }}-${{ env.BROMITE_SHA }} 133 | shell: bash 134 | run: | 135 | IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:$VERSION-$BROMITE_SHA > /dev/null ; echo $?) 136 | if [ $IS_PRESENT -ne "0" ]; then 137 | IS_PRESENT=$(docker manifest inspect uazo/bromite-build:$VERSION-$BROMITE_SHA > /dev/null ; echo $?) 138 | if [ $IS_PRESENT -ne "0" ]; then 139 | DOCKER_BUILDKIT=1 docker build -t uazo/bromite-build:$VERSION-$BROMITE_SHA --progress plain \ 140 | --build-arg BROMITE_SHA=$BROMITE_SHA \ 141 | --build-arg VERSION=$VERSION \ 142 | --build-arg HTTP_PROXY="$PROXY_ADDR" \ 143 | --no-cache \ 144 | bromite-buildtools/images/bromite-build/. 145 | fi 146 | fi 147 | 148 | - name: Mark image to build 149 | shell: bash 150 | run: | 151 | IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:build > /dev/null ; echo $?) 152 | if [ $IS_PRESENT -eq "0" ]; then 153 | docker rmi uazo/bromite-build:build 154 | fi 155 | docker tag uazo/bromite-build:$VERSION-$BROMITE_SHA uazo/bromite-build:build 156 | 157 | build: 158 | runs-on: ${{ github.event.inputs.type }} 159 | needs: check_images 160 | if: success() 161 | timeout-minutes: 1200 162 | 163 | container: 164 | image: uazo/bromite-build:build 165 | env: 166 | REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket 167 | USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images 168 | USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal 169 | WORKSPACE: /home/lg/working_dir 170 | # kythe 171 | KYTHE_CORPUS: chromium.googlesource.com/chromium/src 172 | KYTHE_ROOT_DIRECTORY: /home/lg/working_dir/chromium/src 173 | KYTHE_OUTPUT_DIRECTORY: /home/lg/working_dir/chromium/src/out/bromite/kythe 174 | # cross build 175 | DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: /win_sdk/10.0.22621.0/ 176 | WINDOWSSDKDIR: "/win_sdk/10.0.22621.0/Windows Kits/10/" 177 | GYP_MSVS_OVERRIDE_PATH: /win_sdk/10.0.22621.0/ 178 | # compile in debug mode 179 | TARGET_ISDEBUG: ${{ github.event.inputs.debug }} 180 | TARGET_OS: ${{ github.event.inputs.target_os }} 181 | volumes: 182 | - /storage/images/android/${{ github.event.inputs.sha }}/${{ github.event.inputs.debug }}/arm64:/home/lg/working_dir/chromium/src/out/bromite 183 | - /storage/images/android/${{ github.event.inputs.sha }}/${{ github.event.inputs.debug }}/x64:/home/lg/working_dir/chromium/src/out/bromite_x64 184 | - /storage/images/win/x64/${{ github.event.inputs.sha }}:/home/lg/working_dir/chromium/src/out/bromite_win 185 | - /tmp/proxy:/tmp/proxy 186 | - /win_sdk:/win_sdk 187 | 188 | steps: 189 | - name: Prepare Build Container 190 | shell: bash 191 | run: | 192 | # set workspace paths 193 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 194 | cd $WORKSPACE 195 | 196 | # reset proxy env 197 | HTTP_PROXY= 198 | HTTPS_PROXY= 199 | http_proxy= 200 | https_proxy= 201 | 202 | # set out folder permissions 203 | test -d chromium/src/out/bromite || sudo mkdir -p chromium/src/out/bromite && \ 204 | sudo chown lg chromium/src/out && 205 | sudo chown lg chromium/src/out/bromite 206 | 207 | test -d chromium/src/out/bromite_win || sudo mkdir -p chromium/src/out/bromite_win && \ 208 | sudo chown lg chromium/src/out && 209 | sudo chown lg chromium/src/out/bromite_win 210 | 211 | test -d chromium/src/out/bromite_x64 || sudo mkdir -p chromium/src/out/bromite_x64 && \ 212 | sudo chown lg chromium/src/out && 213 | sudo chown lg chromium/src/out/bromite_x64 214 | 215 | # make kythe output directory 216 | test -d $KYTHE_OUTPUT_DIRECTORY || mkdir -p $KYTHE_OUTPUT_DIRECTORY 217 | 218 | sudo mkdir -p /run/user/1000/ 219 | sudo chown lg /run/user/1000/ 220 | sudo chmod g-rxw /run/user/1000/ 221 | sudo chmod o-rxw /run/user/1000/ 222 | 223 | - name: Build Bromite Android arm64 224 | if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }} 225 | shell: bash 226 | run: | 227 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 228 | cd $WORKSPACE/chromium/src 229 | 230 | echo "::group::-------- gn gen" 231 | gn gen --args="import(\"/home/lg/working_dir/bromite/build/bromite.gn_args\") $(cat ../../build_args.gni) target_cpu = \"arm64\" " out/bromite 232 | echo "::endgroup::" 233 | 234 | echo "::group::-------- gn args" 235 | gn args out/bromite/ --list --short 236 | gn args out/bromite/ --list >out/bromite/gn_list 237 | echo "::endgroup::" 238 | 239 | autoninja -C out/bromite chrome_public_apk 240 | 241 | cp ../../bromite/build/RELEASE out/bromite 242 | 243 | - name: Get ninja logs Android arm64 244 | if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }} 245 | shell: bash 246 | run: | 247 | cd $WORKSPACE 248 | $WORKSPACE/ninjatracing/ninjatracing $WORKSPACE/chromium/src/out/bromite/.ninja_log >$WORKSPACE/chromium/src/out/bromite/ninja_log_trace.json 249 | python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/bromite/ninja_log_trace.json 250 | 251 | - name: Build Bromite Windows 252 | if: ${{ github.event.inputs.target_os == 'win' || github.event.inputs.target_os == 'all' }} 253 | shell: bash 254 | run: | 255 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 256 | cd $WORKSPACE/chromium/src 257 | 258 | echo "::group::-------- gn gen" 259 | gn gen --args="import(\"/home/lg/working_dir/bromite/build/bromite.gn_args\") target_os = \"win\" $(cat ../../build_args.gni) target_cpu = \"x64\" " out/bromite_win 260 | echo "::endgroup::" 261 | 262 | echo "::group::-------- gn args" 263 | gn args out/bromite_win/ --list --short 264 | gn args out/bromite_win/ --list >out/bromite_win/gn_list 265 | echo "::endgroup::" 266 | 267 | autoninja -C out/bromite_win chrome 268 | 269 | cp ../../bromite/build/RELEASE out/bromite_win 270 | 271 | - name: Get ninja logs Windows 272 | if: ${{ github.event.inputs.target_os == 'win' || github.event.inputs.target_os == 'all' }} 273 | shell: bash 274 | run: | 275 | cd $WORKSPACE 276 | $WORKSPACE/ninjatracing/ninjatracing $WORKSPACE/chromium/src/out/bromite_win/.ninja_log >$WORKSPACE/chromium/src/out/bromite_win/ninja_log_trace.json 277 | python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/bromite_win/ninja_log_trace.json 278 | 279 | - name: Build Bromite Android x64 280 | if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'x64' || github.event.inputs.build == 'all') }} 281 | shell: bash 282 | run: | 283 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 284 | cd $WORKSPACE/chromium/src 285 | 286 | echo "::group::-------- gn gen" 287 | gn gen --args="import(\"/home/lg/working_dir/bromite/build/bromite.gn_args\") $(cat ../../build_args.gni) target_cpu = \"x64\" " out/bromite_x64 288 | echo "::endgroup::" 289 | 290 | echo "::group::-------- gn args" 291 | gn args out/bromite_x64/ --list --short 292 | gn args out/bromite_x64/ --list >out/bromite_x64/gn_list 293 | echo "::endgroup::" 294 | 295 | autoninja -C out/bromite_x64 chrome_public_apk 296 | 297 | cp ../../bromite/build/RELEASE out/bromite_x64 298 | 299 | - name: Get ninja logs Android x64 300 | if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'x64' || github.event.inputs.build == 'all') }} 301 | shell: bash 302 | run: | 303 | cd $WORKSPACE 304 | $WORKSPACE/ninjatracing/ninjatracing $WORKSPACE/chromium/src/out/bromite_x64/.ninja_log >$WORKSPACE/chromium/src/out/bromite_x64/ninja_log_trace.json 305 | python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/bromite_x64/ninja_log_trace.json 306 | 307 | 308 | - name: Generate breakpad symbols arm64 309 | if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }} 310 | shell: bash 311 | run: | 312 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 313 | cd $WORKSPACE/chromium/src 314 | 315 | echo "::group::-------- generating breakpad symbols" 316 | autoninja -C out/bromite minidump_stackwalk dump_syms 317 | components/crash/content/tools/generate_breakpad_symbols.py --build-dir=out/bromite \ 318 | --symbols-dir=out/bromite/symbols/ --binary=out/bromite/lib.unstripped/libchrome.so \ 319 | --platform=android --clear --verbose 320 | cp out/bromite/lib.unstripped/libchrome.so out/bromite/symbols/libchrome.lib.so 321 | cp out/bromite/minidump_stackwalk out/bromite/symbols 322 | cp out/bromite/dump_syms out/bromite/symbols 323 | echo "::endgroup::" 324 | 325 | - name: Generate Supersize data 326 | if: ${{ github.event.inputs.debug == 'false' && (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }} 327 | shell: bash 328 | run: | 329 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 330 | cd $WORKSPACE/chromium/src 331 | 332 | tools/binary_size/supersize archive out/bromite/chrome.size --apk-file out/bromite/apks/ChromePublic.apk -v 333 | 334 | - name: Generate clangd index 335 | if: ${{ github.event.inputs.clangd == 'true' }} 336 | shell: bash 337 | run: | 338 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 339 | cd $WORKSPACE/chromium/src 340 | 341 | test -f out/bromite/bromite.idx || \ 342 | cp -r out/bromite out/clangd && \ 343 | gn gen --args="import(\"/home/lg/working_dir/bromite/build/bromite.gn_args\") $(cat ../../build_args.gni) skip_clangd_unsupported_options = true" out/clangd && \ 344 | $WORKSPACE/ninja/ninja -C $WORKSPACE/chromium/src/out/clangd -a chrome_public_apk \ 345 | -t compdb cc cxx objc objcxx >$WORKSPACE/chromium/src/out/clangd/compile_commands.json && \ 346 | /home/lg/working_dir/clangd_snapshot_20211205/bin/clangd-indexer --executor=all-TUs out/clangd/compile_commands.json >out/bromite/bromite.idx && \ 347 | rm -rf out/clangd 348 | -------------------------------------------------------------------------------- /.github/workflows/check_git_apply.yaml: -------------------------------------------------------------------------------- 1 | name: Check git apply 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | rtag: 7 | description: 'uazo/bromite TAG or COMMIT' 8 | required: true 9 | default: '' 10 | branch: 11 | description: 'uazo/bromite BRANCH' 12 | required: true 13 | default: '' 14 | 15 | env: 16 | GITHUB_SHA: ${{ github.event.inputs.rtag }} 17 | BROMITE_SHA: ${{ github.event.inputs.rtag }} 18 | USEINTERNALNETWORK: false # CUSTOM RUNNER: create the docker network as internal 19 | REMOVEDOCKERSUPPORT: false # CUSTOM RUNNER: remove sharing of docker socket 20 | https_proxy: http://172.18.0.1:8118 21 | http_proxy: http://172.18.0.1:8118 22 | jobs: 23 | get-git-apply: 24 | runs-on: ci 25 | container: 26 | image: uazo/build-deps:latest 27 | env: 28 | GITHUB_SHA: ${{ github.event.inputs.rtag }} 29 | USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images 30 | REMOVEDOCKERSUPPORT: false # CUSTOM RUNNER: remove sharing of docker socket 31 | volumes: 32 | - /tmp/proxy:/tmp/proxy 33 | 34 | steps: 35 | 36 | - name: Prepare container 37 | run: | 38 | sudo chown lg /etc/apt/apt.conf.d/proxy.conf 39 | sudo chown lg . 40 | sudo echo Acquire::http::Proxy \"http://172.18.0.1:8118\"\; >/etc/apt/apt.conf.d/proxy.conf 41 | #export HTTPS_PROXY=http://172.18.0.1:8118 42 | #export HTTP_PROXY=http://172.18.0.1:8118 43 | #export http_proxy=http://172.18.0.1:8118 44 | #export https_proxy=http://172.18.0.1:8118 45 | 46 | sudo chmod 777 /__w/_temp 47 | 48 | wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb 49 | sudo dpkg -i packages-microsoft-prod.deb 50 | rm packages-microsoft-prod.deb 51 | 52 | sudo apt update 53 | sudo apt install -y wget unzip tar sed dos2unix patchutils wiggle curl nano aspnetcore-runtime-6.0 54 | 55 | wget https://github.com/uazo/superpatch/releases/latest/download/SuperPatchUtils.tar.gz 56 | tar xfz SuperPatchUtils.tar.gz 57 | rm SuperPatchUtils.tar.gz 58 | 59 | git clone https://github.com/uazo/bromite-buildtools 60 | 61 | #wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip 62 | #unzip pup_v0.4.0_linux_amd64.zip 63 | #rm pup_v0.4.0_linux_amd64.zip 64 | #BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$GITHUB_SHA | ./pup -p li.branch:last-child a text{}) 65 | 66 | test -d /github/home/.vscode-server || sudo mkdir /github/home/.vscode-server 67 | sudo chown lg /github/home/.vscode-server 68 | 69 | - name: Checkout 'uazo/bromite' 70 | uses: actions/checkout@v2 71 | with: 72 | repository: 'uazo/bromite' 73 | ref: ${{ github.event.inputs.rtag }} 74 | path: 'bromite' 75 | fetch-depth: 1 76 | 77 | - name: Create chromium sources 78 | run: | 79 | #sleep 2h 80 | VERSION=$(cat bromite/build/RELEASE) 81 | ./bin/SuperPatchUtils bromite $BROMITE_SHA chromium/src 82 | 83 | cd chromium/src 84 | git init 85 | git config user.email "you@example.com" 86 | git config user.name "Your Name" 87 | git add . 88 | git commit -m $VERSION 89 | git tag -a $VERSION -m $VERSION 90 | 91 | - name: Apply patches ${{ github.event.inputs.rtag }} 92 | run: | 93 | export HOME=$(pwd) 94 | cd ~/chromium/src 95 | 96 | export SILENT=true 97 | export CGA_REMOTE=true 98 | export SKIPAUTOGENERATED=true 99 | bash ~/bromite-buildtools/apply-all-patch.sh || sleep 23h || true 100 | 101 | rm -rf ~/bromite/build/patches-new/ 102 | rm ~/bromite/build/bromite_patches_list_new.txt 103 | 104 | - name: Export patches 105 | run: | 106 | export HOME=$(pwd) 107 | 108 | cd ~/chromium/src 109 | bash ~/bromite-buildtools/export-all-patch.sh 110 | 111 | cd ~/bromite 112 | rm -rf build/patches/* 113 | mv build/patches-new/* build/patches 114 | rm -rf build/patches-new/ 115 | 116 | - name: Check differences CHANGES=${{ env.CHANGES }} 117 | run: | 118 | cd bromite 119 | CHANGES=0 && git diff --quiet || CHANGES=1 120 | 121 | if [[ CHANGES -eq 1 ]]; then 122 | git add build/patches/*.patch 123 | git diff --name-only --staged 124 | fi 125 | 126 | - name: Create Pull Request 127 | uses: peter-evans/create-pull-request@dcd5fd746d53dd8de555c0f10bca6c35628be47a #v3.12.0 128 | with: 129 | token: ${{ secrets.BROMITE_PULLS_PAT }} 130 | path: bromite 131 | base: ${{ github.event.inputs.branch }} 132 | add-paths: | 133 | build/patches/*.patch 134 | commit-message: 'AUTOMATED - git apply results' 135 | title: Git apply result for ${{ github.event.inputs.branch }} branch 136 | body: ${{ env.MESSAGE }} 137 | delete-branch: true 138 | branch-suffix: short-commit-hash 139 | -------------------------------------------------------------------------------- /.github/workflows/execute-tests.yaml: -------------------------------------------------------------------------------- 1 | name: Execute Tests 2 | permissions: 3 | actions: none 4 | checks: none 5 | contents: none 6 | deployments: none 7 | issues: none 8 | packages: none 9 | pull-requests: none 10 | repository-projects: none 11 | security-events: none 12 | statuses: none 13 | 14 | on: 15 | workflow_dispatch: 16 | inputs: 17 | sha: 18 | description: 'uazo/bromite SHA' 19 | required: true 20 | default: 'ce2f07034a3d3b257e9bada65d8293a6786bb95f' 21 | 22 | env: 23 | BROMITE_SHA: ${{ github.event.inputs.sha }} 24 | REMOVEDOCKERSUPPORT: true 25 | USELOCALIMAGE: true 26 | 27 | jobs: 28 | get_image: 29 | runs-on: self-hosted 30 | steps: 31 | - name: Mark image to test 32 | shell: bash 33 | run: | 34 | docker tag uazo/bromite-build:$BROMITE_SHA uazo/bromite-build:test 35 | 36 | exec-test: 37 | runs-on: self-hosted 38 | needs: get_image 39 | if: success() 40 | 41 | container: 42 | image: uazo/bromite-build:test 43 | env: 44 | REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket 45 | USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images 46 | USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal 47 | WORKSPACE: /home/lg/working_dir 48 | ARTIFACS_DIR: /home/lg/working_dir/artifacs 49 | volumes: 50 | - /storage/images/${{ github.event.inputs.sha }}/out:/home/lg/working_dir/chromium/src/out/bromite:r 51 | - /storage/images/${{ github.event.inputs.sha }}/out/tests:/home/lg/working_dir/chromium/src/out/tests 52 | options: --device=/dev/kvm 53 | 54 | steps: 55 | - name: Prepare Test Container 56 | shell: bash 57 | run: | 58 | # set workspace paths 59 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 60 | cd $WORKSPACE 61 | 62 | # copy artifacts 63 | #cd chromium/src 64 | #mkdir -p out/bromite 65 | #cp -arp $ARTIFACS_DIR/out/* out/bromite 66 | 67 | rm -rf out/tests/* 68 | #mkdir -p out/tests 69 | 70 | # reset proxy env 71 | #HTTP_PROXY= 72 | #HTTPS_PROXY= 73 | #http_proxy= 74 | #https_proxy= 75 | 76 | # - name: Wait forever 77 | # shell: bash 78 | # run: | 79 | # sleep infinity 80 | 81 | - name: Execute chrome junit test 82 | shell: bash 83 | run: | 84 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 85 | cd $WORKSPACE/chromium/src 86 | out/bromite/bin/run_chrome_junit_tests --gtest_filter=*Bromite* || KO=1 87 | 88 | - name: Start Android Emulator 89 | shell: bash 90 | run: | 91 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 92 | cd $WORKSPACE/chromium/src 93 | 94 | sudo mkdir -p /github/home/.android 95 | sudo chmod 666 /github/home/.android/ 96 | tools/android/avd/avd.py install --avd-config ../../generic_android31.textpb -v 97 | tools/android/avd/avd.py start --avd-config ../../generic_android31.textpb -v 98 | 99 | - name: Execute unit tests 100 | shell: bash 101 | run: | 102 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 103 | cd $WORKSPACE/chromium/src 104 | out/bromite/unit_tests -v --fast-local-dev --gtest_filter=*Bromite* || KO=1 105 | 106 | - name: Restart Android Emulator 107 | shell: bash 108 | run: | 109 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 110 | cd $WORKSPACE/chromium/src 111 | pkill -f qemu-system-x86 112 | tools/android/avd/avd.py start --avd-config ../../generic_android31.textpb -v 113 | 114 | - name: Execute instrumentation tests 115 | shell: bash 116 | run: | 117 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 118 | cd $WORKSPACE/chromium/src 119 | out/bromite/bin/run_chrome_public_test_apk -v --num-retries=1 --gtest_filter=*Bromite* || KO=1 120 | 121 | #- name: Wait forever 122 | # shell: bash 123 | # run: | 124 | # sleep infinity 125 | 126 | - name: Copy results 127 | shell: bash 128 | run: | 129 | sudo cp -r $WORKSPACE/chromium/src/out/bromite/TEST_RESULTS* $WORKSPACE/chromium/src/out/tests/ 130 | 131 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release Bromite CI 2 | permissions: 3 | contents: write 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | sha: 9 | description: 'uazo/bromite SHA' 10 | required: true 11 | default: '0a8ff322d6e9d738f7b2fa52618b178081bd100d' 12 | type: 13 | description: 'runner? [dev/ci]' 14 | required: true 15 | default: 'ci' 16 | 17 | env: 18 | BROMITE_SHA: ${{ github.event.inputs.sha }} 19 | REMOVEDOCKERSUPPORT: true 20 | USELOCALIMAGE: true 21 | 22 | jobs: 23 | release: 24 | runs-on: ${{ github.event.inputs.type }} 25 | env: 26 | OUTPUTFILE_ARM64: /storage/images/android/${{ github.event.inputs.sha }}/false/arm64/ 27 | OUTPUTFILE_X64: /storage/images/android/${{ github.event.inputs.sha }}/false/x64/ 28 | 29 | steps: 30 | - name: Prepare container 31 | run: | 32 | wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip 33 | unzip pup_v0.4.0_linux_amd64.zip && rm pup_v0.4.0_linux_amd64.zip 34 | BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$BROMITE_SHA | ./pup -p li.branch:last-child a text{} | xargs) 35 | echo "BRANCH=$BRANCH" >> $GITHUB_ENV 36 | 37 | wget https://github.com/cli/cli/releases/download/v2.18.1/gh_2.18.1_linux_amd64.tar.gz 38 | tar xfz gh_2.18.1_linux_amd64.tar.gz 39 | 40 | - name: Checkout 'uazo/buildtools' 41 | uses: actions/checkout@v2 42 | with: 43 | repository: 'uazo/bromite-buildtools' 44 | path: 'bromite' 45 | fetch-depth: 1 46 | 47 | - name: Create release 48 | shell: bash 49 | run: | 50 | GH=gh_2.18.1_linux_amd64/bin/gh 51 | WINOUT=/storage/images/win/x64/$BROMITE_SHA/ 52 | VERSION=v$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE) 53 | 54 | cd bromite 55 | 56 | GH=gh_2.21.1_linux_amd64/bin/gh 57 | wget https://github.com/cli/cli/releases/download/v2.21.1/gh_2.21.1_linux_amd64.tar.gz 58 | tar xfz gh_2.21.1_linux_amd64.tar.gz 59 | 60 | echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token 61 | 62 | echo "\`\`\`" >note 63 | echo "this is not the official release of bromite but a test version." >>note 64 | echo "you can try it at your own risk." >>note 65 | echo "\`\`\`" >>note 66 | 67 | $GH release create $VERSION-$BROMITE_SHA --notes-file note -d 68 | 69 | # android arm64 70 | sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/ChromePublic.apk arm64_ChromePublic.apk 71 | sudo chown runner arm64_ChromePublic.apk 72 | echo Uploading arm64_ChromePublic 73 | $GH release upload $VERSION-$BROMITE_SHA arm64_ChromePublic.apk 74 | 75 | # android x64 76 | sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/ChromePublic.apk x64_ChromePublic.apk 77 | sudo chown runner x64_ChromePublic.apk 78 | echo Uploading x64_ChromePublic 79 | $GH release upload $VERSION-$BROMITE_SHA x64_ChromePublic.apk 80 | 81 | echo Uploading chrome.size 82 | test $VERSION-$BROMITE_SHA $OUTPUTFILE_ARM64/chrome.size && \ 83 | $GH release upload $VERSION-$BROMITE_SHA $OUTPUTFILE_ARM64/chrome.size 84 | 85 | echo Uploading arm64_ninja_log_trace.html 86 | test $OUTPUTFILE_ARM64/ninja_log_trace.html && \ 87 | cp $OUTPUTFILE_ARM64/ninja_log_trace.html arm64_ninja_log_trace.html && \ 88 | $GH release upload $VERSION-$BROMITE_SHA arm64_ninja_log_trace.html 89 | 90 | # windows 91 | mkdir chrome-win/ 92 | cp $WINOUT/*.manifest chrome-win/ 93 | cp $WINOUT/chrome.dll chrome-win/ 94 | cp $WINOUT/chrome.exe chrome-win/ 95 | cp $WINOUT/chrome_100_percent.pak chrome-win/ 96 | cp $WINOUT/chrome_200_percent.pak chrome-win/ 97 | cp $WINOUT/chrome_elf.dll chrome-win/ 98 | cp $WINOUT/chrome_proxy.exe chrome-win/ 99 | cp $WINOUT/chrome_pwa_launcher.exe chrome-win/ 100 | cp $WINOUT/chrome_wer.dll chrome-win/ 101 | cp "/win_sdk/10.0.22621.0/Windows Kits/10/Redist/D3D/x64/d3dcompiler_47.dll" chrome-win/ 102 | cp $WINOUT/elevation_service.exe chrome-win/ 103 | cp "$WINOUT/First Run" chrome-win/ 104 | cp $WINOUT/headless_lib_data.pak chrome-win/ 105 | cp $WINOUT/icudtl.dat chrome-win/ 106 | cp $WINOUT/libEGL.dll chrome-win/ 107 | cp $WINOUT/libGLESv2.dll chrome-win/ 108 | cp $WINOUT/Logo.png chrome-win/ 109 | cp $WINOUT/mojo_core.dll chrome-win/ 110 | cp $WINOUT/notification_helper.exe chrome-win/ 111 | cp $WINOUT/resources.pak chrome-win/ 112 | cp $WINOUT/SmallLogo.png chrome-win/ 113 | cp $WINOUT/snapshot_blob.bin chrome-win/ 114 | cp $WINOUT/VkICD_mock_icd.dll chrome-win/ 115 | cp $WINOUT/VkLayer_khronos_validation.dll chrome-win/ 116 | cp $WINOUT/vk_swiftshader.dll chrome-win/ 117 | cp $WINOUT/vulkan-1.dll chrome-win/ 118 | cp -r $WINOUT/locales chrome-win/locales 119 | 120 | #test chrome-win.zip && rm chrome-win.zip 121 | zip -r chrome-win.zip chrome-win/ 122 | 123 | echo Uploading chrome-win.zip 124 | $GH release upload $VERSION-$BROMITE_SHA chrome-win.zip 125 | 126 | # workaround for https://github.com/cli/cli/issues/6599 127 | sleep 30s 128 | 129 | TIMESTAMP=$(date +%s -r chrome-win.zip) 130 | echo >updateurl.txt "browser=chromium;os=windows;architecture=64-bit;timestamp=$TIMESTAMP;editor=uazo;channel=stable;repository=https://github.com/uazo/bromite-buildtools/releases;download=https://github.com/uazo/bromite-buildtools/releases/latest/download/chrome-win.zip;version=$(cat $WINOUT/RELEASE);revision=1;commit=$BROMITE_SHA" 131 | $GH release upload $VERSION-$BROMITE_SHA updateurl.txt 132 | 133 | $GH release edit $VERSION-$BROMITE_SHA -t $VERSION-$BROMITE_SHA 134 | $GH release edit $VERSION-$BROMITE_SHA --draft=false 135 | 136 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /.vs 6 | images/github-runner/.env 7 | images/privoxy/privoxy.conf.save 8 | images/remote-index/bromite.idx 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bromite-buildtools 2 | 3 | this repo contains my build machine and some scripts I use for Bromite development. the ci uses a modified version of the gihub runner (avaiable [here](https://github.com/uazo/runner)) and use [sysbox](https://github.com/nestybox/sysbox) to improve security. it also contains everything you need to use a self-hosted modified version of [goma](https://github.com/uazo/goma-server) for a multi-machine build 4 | 5 | ### Setting-up 6 | 7 | 1. Prepare folders 8 | 9 | ``` 10 | cd ~ && mkdir gh-runner 11 | cd gh-runner && mkdir docker-inner 12 | SYSBOX_UID=$(cat /etc/subuid | grep sysbox | cut -d : -f 2) 13 | sudo chown $SYSBOX_UID:$SYSBOX_UID docker-inner/ 14 | 15 | mkdir /storage 16 | sudo chown $SYSBOX_UID:$SYSBOX_UID /storage 17 | ``` 18 | 19 | 2. Clone this repo 20 | 3. Prepare `.env` 21 | 22 | ``` 23 | cd bromite-buildtools/images/github-runner/ 24 | cp .env.example .env 25 | ``` 26 | 27 | 4. Edit `.env` file 28 | 29 | ``` 30 | RUNNER_NAME=pd-gh-runner 31 | GITHUB_PERSONAL_TOKEN= 32 | GITHUB_OWNER=uazo 33 | GITHUB_REPOSITORY=bromite-buildtools 34 | RUNNER_LABELS=dev 35 | ALLOWEDAUTHORSLIST=uazo 36 | ``` 37 | 38 | 5. Prepare for windows cross build 39 | Follow the [instructions](https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/win_cross.md#if-you_re-not-at-google) to create the zip with the toolchain 40 | 41 | example: 42 | ``` 43 | cd path\to\depot_tools\win_toolchain 44 | D:\Downloads\depot_tools\win_toolchain> package_from_installed.py --allow_multiple_vs_installs -w 10.0.20348.0 2019 45 | ``` 46 | 47 | create the `/casefold` in the unix host with [casefold attribute](https://unix.stackexchange.com/questions/558977/how-to-enable-new-in-kernel-5-2-case-insensitivity-for-ext4-on-a-given-directory) and unzip the contents into. 48 | ``` 49 | ~$ ls /casefold/10.0.20348.0/ -la 50 | total 36 51 | drwxr-xr-x 8 root root 4096 Oct 5 13:20 . 52 | drwxr-xr-x 5 root root 4096 Oct 5 13:17 .. 53 | drwxr-xr-x 6 root root 4096 Oct 5 13:19 'DIA SDK' 54 | drwxr-xr-x 2 root root 4096 Oct 5 13:20 sys32 55 | drwxr-xr-x 2 root root 4096 Oct 5 13:20 sys64 56 | drwxr-xr-x 2 root root 4096 Oct 5 13:20 sysarm64 57 | drwxr-xr-x 5 root root 4096 Oct 5 13:20 VC 58 | -rw-rw-rw- 1 root root 5 Sep 26 17:05 VS_VERSION 59 | drwxr-xr-x 3 root root 4096 Oct 5 13:20 'Windows Kits' 60 | ``` 61 | 62 | 6. Start the runner 63 | ``` 64 | cd bromite-buildtools/images/github-runner/ 65 | ./start-runner.sh 66 | ``` 67 | 68 | ### Test Android Version 69 | 70 | Simply download latest build on https://github.com/uazo/bromite-buildtools/releases/latest 71 | 72 | ### Test Windows Version 73 | 74 | 1. Download https://github.com/henrypp/chrlauncher/releases 75 | 2. Create a `chrlauncher.ini` 76 | 77 | ``` 78 | [chrlauncher] 79 | 80 | # Custom Chromium update URL (string): 81 | ChromiumUpdateUrl=https://github.com/uazo/bromite-buildtools/releases/latest/download/updateurl.txt 82 | 83 | # Command line for Chromium (string): 84 | # See here: http://peter.sh/experiments/chromium-command-line-switches/ 85 | ChromiumCommandLine=--user-data-dir=".\User Data" --no-default-browser-check 86 | 87 | # Chromium executable file name (string): 88 | ChromiumBinary=chrome.exe 89 | 90 | # Chromium binaries directory (string): 91 | # Relative (to chrlauncher directory) or full path (env. variables supported). 92 | ChromiumDirectory=.\bin 93 | ``` 94 | -------------------------------------------------------------------------------- /apply-all-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git am --abort 4 | 5 | PATCH_OLD_PATH=~/bromite/build/patches 6 | PATCH_NEW_PATH=~/bromite/build/patches-new 7 | 8 | DESTINATION=~/bromite/build/bromite_patches_list_ok.txt 9 | DESTINATION_FAILED=~/bromite/build/bromite_patches_list_failed.txt 10 | 11 | rm $DESTINATION 12 | rm $DESTINATION_FAILED 13 | mkdir $PATCH_NEW_PATH 14 | 15 | IFS=$'\n' 16 | 17 | PATCH_LIST=~/bromite/build/bromite_patches_list_new.txt 18 | if [ ! -f $PATCH_LIST ]; then 19 | cp ~/bromite/build/bromite_patches_list.txt $PATCH_LIST 20 | fi 21 | 22 | echo "Phase 1: check clean" 23 | for current_file in $(cat $PATCH_LIST); do 24 | 25 | if [[ $current_file =~ ^#.* ]]; then 26 | 27 | echo "Executing $current_file" 28 | eval "${current_file:1}" 29 | echo $current_file >>$DESTINATION 30 | 31 | elif [[ $current_file =~ ^-.* ]]; then 32 | 33 | echo "Skipping $current_file" 34 | 35 | elif [[ $current_file =~ ^=.* ]]; then 36 | 37 | echo "Adding $current_file" 38 | echo "Executing bash ~/create-from-patch.sh $PATCH_OLD_PATH/${current_file:1} $PATCH_NEW_PATH" 39 | 40 | bash ~/bromite-buildtools/create-from-patch.sh $PATCH_OLD_PATH/${current_file:1} $PATCH_NEW_PATH 41 | 42 | #echo "Press return" 43 | #read -n 1 44 | 45 | 46 | elif [[ $current_file =~ ^1.* ]]; then 47 | 48 | echo "Using new path $current_file" 49 | 50 | bash ~/bromite-buildtools/apply-single-patch.sh $PATCH_NEW_PATH/${current_file:1} $PATCH_NEW_PATH 51 | 52 | echo "" 53 | LAST_COMMIT=$(git rev-parse HEAD) 54 | echo "Last Commit " $LAST_COMMIT 55 | bash ~/bromite-buildtools/export-single-patch.sh $LAST_COMMIT 56 | 57 | else 58 | 59 | if [ -n "$SKIPAUTOGENERATED" ]; then 60 | if [[ "$current_file" == *"Automated-domain-substitution"* ]]; then 61 | echo "" 62 | echo -e ${RED} " -> Excluding $current_file" ${NC} 63 | continue 64 | fi 65 | fi 66 | 67 | bash ~/bromite-buildtools/apply-single-patch.sh $PATCH_OLD_PATH/$current_file $PATCH_NEW_PATH || exit 1 68 | 69 | if [ -z "$SILENT" ]; then 70 | echo $current_file >>$DESTINATION 71 | echo $PATCH_FILE 72 | 73 | echo "" 74 | LAST_COMMIT=$(git rev-parse HEAD) 75 | echo "Last Commit " $LAST_COMMIT 76 | bash ~/bromite-buildtools/export-single-patch.sh $LAST_COMMIT || exit 1 77 | 78 | #cp -r ~/bromite/build/patches-new/* ~/br2/bromite/build/patches/ 79 | #git -C ~/br2/bromite/ add . 80 | #git -C ~/br2/bromite/ commit -m "$current_file" 81 | fi 82 | 83 | fi 84 | 85 | done 86 | -------------------------------------------------------------------------------- /apply-bromite-patches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | NC='\033[0m' # No Color 5 | 6 | sudo apt install sed 7 | 8 | cd chromium/src 9 | 10 | echo -e ${RED} ------- apply patchs ${NC} 11 | for file in $(cat ../../bromite/build/bromite_patches_list.txt) ; do 12 | echo -e ${RED} " -> Apply $file" ${NC} 13 | 14 | REPL="0,/^---/s//FILE:"$file"\n---/" 15 | cat ../../bromite/build/patches/$file | sed $REPL | git am 16 | 17 | if [ $? -ne 0 ] 18 | then 19 | echo -e "Error on ../../bromite/build/patches/${file}" 20 | exit 1 21 | fi 22 | 23 | echo " " 24 | done -------------------------------------------------------------------------------- /apply-failed-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git am --abort 4 | 5 | PATCH_OLD_PATH=../../bromite/build/patches 6 | PATCH_NEW_PATH=../../bromite/build/patches-new 7 | DESTINATION_FAILED=~/bromite/build/bromite_patches_list_failed.txt 8 | 9 | mkdir $PATCH_NEW_PATH 10 | 11 | IFS=$'\n' 12 | 13 | for file in $(cat $DESTINATION_FAILED | sed -e 's/\r//g'); do 14 | 15 | if [[ $file =~ ^#.* ]]; then 16 | 17 | echo "Executing $file" 18 | eval "${file:1}" 19 | 20 | else 21 | 22 | PATCH=$PATCH_OLD_PATH/$file 23 | 24 | echo "Applying patch $PATCH" 25 | git apply --reject "$PATCH" 26 | 27 | for file in $(find . -name *.rej); do 28 | echo " -> Check $file"; 29 | wiggle --replace ${file::-4} $file && rm $file && rm ${file::-4}.porig && echo " OK"; 30 | done 31 | 32 | for file in $(find . -name *.rej); do 33 | echo "---Found: $file"; 34 | done 35 | 36 | read -p "--- ERROR: Press enter to continue" 37 | 38 | find . -type f -name '*.rej' -delete 39 | find . -type f -name '*.porig' -delete 40 | git add . 41 | 42 | HEAD=$(sed -n '1,/---/ p' $PATCH | sed '/^---/d') 43 | CONTENT=$(git -C ~/chromium/src/ diff --cached) 44 | 45 | PATCH_FILE=$PATCH_NEW_PATH/$(basename $PATCH) 46 | rm $PATCH_FILE 47 | echo "$HEAD" >$PATCH_FILE 48 | echo "" >>$PATCH_FILE 49 | echo "FILE:$(basename $PATCH)" >>$PATCH_FILE 50 | echo "---" >>$PATCH_FILE 51 | echo "$CONTENT" >>$PATCH_FILE 52 | 53 | sed -i '/^index/d' $PATCH_FILE 54 | sed -i '/^ mode change/d' $PATCH_FILE 55 | sed -i '/^old mode /d' $PATCH_FILE 56 | sed -i '/^new mode /d' $PATCH_FILE 57 | sed -i '/^create mode /d' $PATCH_FILE 58 | git reset --hard 59 | 60 | git am $PATCH_FILE 61 | fi 62 | 63 | #read -p "Press enter to continue" 64 | 65 | done 66 | 67 | 68 | -------------------------------------------------------------------------------- /apply-single-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PATCH=$1 4 | LOG_FILE=~/build.log 5 | 6 | dos2unix $PATCH 7 | 8 | OK=0 9 | DOBUILD=1 10 | DOEXPORT=1 11 | 12 | TEST=0 13 | git log | grep FILE:$(basename -- $PATCH) && TEST=1 14 | if [[ TEST -eq 1 ]]; then 15 | 16 | echo "Patch $PATCH already exists. skipped." | tee -a ${LOG_FILE} 17 | exit 0 18 | 19 | fi 20 | 21 | echo "" | tee -a ${LOG_FILE} 22 | echo "Applying patch $PATCH" | tee -a ${LOG_FILE} 23 | git apply --reject --whitespace=fix $PATCH && OK=1 24 | 25 | if [[ OK -eq 0 ]]; then 26 | OK=1 27 | for file in $(grep '+++ b/' $PATCH | sed -e 's#+++ [ab]/##'); do 28 | test -f $file || OK=0 29 | done 30 | 31 | for file in $(find . -name *.rej); do 32 | echo " -> Check $file" | tee -a ${LOG_FILE}; 33 | wiggle --no-ignore --replace ${file::-4} $file && rm $file && rm ${file::-4}.porig && echo " OK" || OK=0 34 | done 35 | 36 | for file in $(find . -name *.rej); do 37 | echo " Found: $file" | tee -a ${LOG_FILE}; 38 | git add ${file::-4} 39 | OK=0 40 | done 41 | 42 | if [[ OK -eq 0 ]]; then 43 | DOBUILD=1 44 | echo "Current patch $PATCH" | tee -a ${LOG_FILE} 45 | echo " Patch not apply cleanly. Please fix..." | tee -a ${LOG_FILE} 46 | if [ -n "$SILENT" ]; then 47 | exit 1 48 | fi 49 | echo " Press return" 50 | read -n 1 51 | else 52 | echo " Patch not apply cleanly. Wiggle done!" | tee -a ${LOG_FILE} 53 | fi 54 | 55 | echo " Deleting rej" 56 | find . -type f -name '*.rej' -delete 57 | find . -type f -name '*.porig' -delete 58 | 59 | else 60 | echo "Patch apply cleanly." | tee -a ${LOG_FILE} 61 | DOBUILD=0 62 | fi 63 | 64 | if [[ DOBUILD -eq 1 ]]; then 65 | OK=0 66 | #echo "Building ${PATCH}: chrome_public_apk" | tee -a ${LOG_FILE} 67 | #date "+%Y%m%d %H.%M.%S" | tee -a ${LOG_FILE} 68 | #autoninja -C out/arm64 chrome_public_apk && OK=1 69 | #date "+%Y%m%d %H.%M.%S" | tee -a ${LOG_FILE} 70 | 71 | DOEXPORT=1 72 | 73 | if [[ OK -eq 1 ]]; then 74 | if [ -z "$SILENT" ]; then 75 | echo "Read to add $PATCH. Press return" 76 | read -n 1 77 | fi 78 | fi 79 | fi 80 | 81 | if [[ DOEXPORT -eq 1 ]]; then 82 | until false 83 | do 84 | bash ~/bromite-buildtools/create-from-patch.sh $PATCH $2 || exit 1 85 | 86 | rm /tmp/1 /tmp/2 || true 87 | lsdiff $PATCH >/tmp/1 88 | lsdiff ../../bromite/build/patches-new/$(basename -- $PATCH) >/tmp/2 89 | STATUS="$(cmp --silent /tmp/1 /tmp/2; echo $?)" 90 | if [[ $STATUS -ne 0 ]]; then 91 | git reset HEAD^ 92 | diff /tmp/1 /tmp/2 93 | echo "Some files are missing. Check again." | tee -a ${LOG_FILE} 94 | if [ -n "$SILENT" ]; then 95 | exit 1 96 | fi 97 | 98 | read -r -p "y to continue [y/N] " response 99 | if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then 100 | bash ~/bromite-buildtools/create-from-patch.sh $PATCH $2 || exit 1 101 | break 102 | fi 103 | else 104 | break 105 | fi 106 | done 107 | fi 108 | -------------------------------------------------------------------------------- /build-from-repos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this script assumes that in 4 | # ~/bromite ---> there is the bromite repo 5 | # ~/chromium ---> there is the chromium repo 6 | 7 | RED='\033[0;31m' 8 | NC='\033[0m' # No Color 9 | 10 | cd ~ 11 | 12 | echo -e ${RED} -------- download bromite repo ${NC} 13 | mkdir ~/bromite 14 | cd ~/bromite 15 | git fetch 16 | git pull 17 | 18 | VERSION=$( cat ~/bromite/build/RELEASE ) 19 | echo -e ${RED} -------- lastest version is: $VERSION ${NC} 20 | 21 | 22 | echo -e ${RED} -------- download chromium repo ${NC} 23 | mkdir ~/chromium 24 | cd ~/chromium 25 | #fetch --nohooks --no-history android 26 | 27 | gclient config https://chromium.googlesource.com/chromium/src.git 28 | echo "target_os=['android']" >>.gclient 29 | 30 | cd src 31 | 32 | # cleanup repo! 33 | #git reset 34 | #git reset --hard HEAD 35 | #git clean -fdx 36 | git fetch --depth 2 https://chromium.googlesource.com/chromium/src.git +refs/tags/$VERSION:chromium_$VERSION 37 | #git tag 38 | #git checkout . 39 | #git clean -fdx 40 | #git am --abort && git reset 95a0064cd30fa82247881080e7f70d9904c79864^ && git reset --hard && git clean -f -d 41 | git checkout $VERSION 42 | 43 | echo -e ${RED} -------- git current status ${NC} 44 | git status 45 | git log 46 | 47 | echo -e ${RED} -------- sync other chromium repos ${NC} 48 | gclient sync -D --no-history 49 | 50 | # remove origin for chromium 51 | git remote remove origin 52 | 53 | echo -e ${RED} ------- apply patchs ${NC} 54 | for file in $(cat ~/bromite/build/bromite_patches_list.txt) ; do 55 | echo -e ${RED} " -> Apply $file" ${NC} 56 | 57 | REPL="0,/^---/s//FILE:"$file"\n---/" 58 | cat ~/bromite/build/patches/$file | sed $REPL | git am 59 | 60 | if [ $? -ne 0 ] 61 | then 62 | echo -e "Error on ~/bromite/build/patches/${file} press return" 63 | 64 | read -n 1 65 | fi 66 | 67 | echo " " 68 | done 69 | 70 | file="Add-a-flag-to-always-view-desktop-site-for-all-websites.patch" 71 | REPL="0,/^---/s//FILE:"$file"\n---/" 72 | cat ~/bromite/build/patches/$file | sed $REPL | git am 73 | 74 | 75 | 76 | # install builds deps 77 | sudo build/install-build-deps-android.sh 78 | gclient runhooks 79 | 80 | # generate ninja files and autogenerated files 81 | gn gen --args="$(cat ~/bromite/build/GN_ARGS) target_cpu=\"arm64\" " out/arm64 82 | 83 | # build time! 84 | set NINJA_SUMMARIZE_BUILD=1 85 | date && autoninja -C out/arm64 chrome_public_apk && date && adb install out/arm64/apks/ChromePublic.apk 86 | 87 | 88 | 89 | 90 | PATH=/root/chromium/src/third_party/llvm-build/Release+Asserts/bin:/root/depot_tools/:$PATH 91 | 92 | ccache --max-size=10G 93 | export CCACHE_CPP2=yes 94 | export CCACHE_SLOPPINESS=time_macros 95 | gn gen --args="$(cat ~/bromite/build/GN_ARGS) target_cpu=\"arm64\" cc_wrapper=\"ccache\" " out/arm64 96 | -------------------------------------------------------------------------------- /buildbox-casd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/buildbox-casd -------------------------------------------------------------------------------- /buildbox-run-hosttools: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/buildbox-run-hosttools -------------------------------------------------------------------------------- /buildbox-worker: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/buildbox-worker -------------------------------------------------------------------------------- /casupload: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/casupload -------------------------------------------------------------------------------- /clone-src.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION=$(cat ~/bromite/build/RELEASE) 4 | CURRENT_RELEASE=$(git -C ~/chromium/src/ rev-parse --verify refs/tags/$VERSION) 5 | 6 | 7 | for file in $(git -C ~/chromium/src/ show --pretty="" --name-only $CURRENT_RELEASE...HEAD); do 8 | DIRNAME=$(dirname $file) 9 | mkdir -p ~/mytests/$DIRNAME 10 | git -C ~/chromium/src/ show $CURRENT_RELEASE:$file > ~/mytests/$file 11 | done 12 | git -C ~/mytests/ add . 13 | git -C ~/mytests/ commit -m "$VERSION" 14 | 15 | 16 | ALLPATCHS_E=$(git -C ~/chromium/src/ rev-list --reverse $CURRENT_RELEASE...HEAD) 17 | for patch in $ALLPATCHS_E; do 18 | 19 | for file in $(git -C ~/chromium/src/ show --pretty="" --name-only $patch); do 20 | DIRNAME=$(dirname $file) 21 | mkdir -p ~/mytests/$DIRNAME 22 | #cp ~/chromium/src/$file ~/mytests/$file 23 | #echo $file 24 | OK=0 25 | git -C ~/chromium/src/ show $patch:$file > ~/mytests/$file && OK=1 26 | if [[ OK -eq 0 ]]; then 27 | echo " Removing ~/mytests/$file" 28 | rm ~/mytests/$file 29 | fi 30 | done 31 | 32 | #echo $ALLFILES_E 33 | #read -n 1 34 | 35 | MESSAGE=$(git -C ~/chromium/src/ log --pretty=format:%s -n 1 $patch) 36 | git -C ~/mytests/ add . 37 | git -C ~/mytests/ commit -m "$MESSAGE" 38 | 39 | #read -n 1 40 | done 41 | 42 | -------------------------------------------------------------------------------- /create-from-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PATCH=$1 4 | 5 | PLEASEWAIT=0 6 | if [[ $PATCH =~ ^+.* ]]; then 7 | PLEASEWAIT=1 8 | PATCH=${PATCH:1} 9 | fi 10 | 11 | if [ -z "$2" ] 12 | then 13 | PATCH_NEW_PATH=~/bromite/build/patches-new 14 | else 15 | PATCH_NEW_PATH=$2 16 | fi 17 | 18 | echo " Creating new patch" 19 | git add . 20 | 21 | HEAD=$(sed -n '1,/---/ p' $PATCH | sed '/^---/d') 22 | CONTENT=$(git -C ~/chromium/src/ diff --cached --binary) 23 | 24 | PATCH_FILE=$PATCH_NEW_PATH/$(basename $PATCH) 25 | test -f $PATCH_FILE && rm $PATCH_FILE 26 | echo "$HEAD" >$PATCH_FILE 27 | 28 | NEWLINE=$(tail -n 1 "$PATCH_FILE") 29 | #echo $NEWLINE 30 | if [[ "$NEWLINE" == Subject:* ]]; then 31 | echo "" >>$PATCH_FILE 32 | else 33 | NEWLINE=$(tail -n 2 "$PATCH_FILE" | head -n 1) 34 | if [[ "$NEWLINE" == Subject:* ]]; then 35 | echo "" >>$PATCH_FILE 36 | fi 37 | fi 38 | 39 | echo "FILE:$(basename $PATCH)" >>$PATCH_FILE 40 | echo "---" >>$PATCH_FILE 41 | echo "$CONTENT" >>$PATCH_FILE 42 | 43 | #echo press return 44 | #read -n 1 45 | 46 | git reset --hard 47 | git clean -f -d 48 | 49 | echo " Applying new patch" 50 | OK=1 51 | git am $PATCH_FILE || OK=0 52 | 53 | if [[ OK -eq 0 ]]; then 54 | if [ -n "$SILENT" ]; then 55 | exit 1 56 | fi 57 | echo "---> Failed to apply. Press return" 58 | read -n 1 59 | fi 60 | -------------------------------------------------------------------------------- /depot_tools.diff: -------------------------------------------------------------------------------- 1 | diff --git a/gclient_scm.py b/gclient_scm.py 2 | --- a/gclient_scm.py 3 | +++ b/gclient_scm.py 4 | @@ -1012,28 +1012,35 @@ class GitWrapper(SCMWrapper): 5 | gclient_utils.safe_makedirs(parent_dir) 6 | 7 | template_dir = None 8 | + use_fetch = False 9 | + 10 | + tmp_dir = tempfile.mkdtemp( 11 | + prefix='_gclient_%s_' % os.path.basename(self.checkout_path), 12 | + dir=parent_dir) 13 | + 14 | if hasattr(options, 'no_history') and options.no_history: 15 | if gclient_utils.IsGitSha(revision): 16 | # In the case of a subproject, the pinned sha is not necessarily the 17 | # head of the remote branch (so we can't just use --depth=N). Instead, 18 | # we tell git to fetch all the remote objects from SHA..HEAD by means of 19 | # a template git dir which has a 'shallow' file pointing to the sha. 20 | - template_dir = tempfile.mkdtemp( 21 | - prefix='_gclient_gittmp_%s' % os.path.basename(self.checkout_path), 22 | - dir=parent_dir) 23 | - self._Run(['init', '--bare', template_dir], options, cwd=self._root_dir) 24 | - with open(os.path.join(template_dir, 'shallow'), 'w') as template_file: 25 | - template_file.write(revision) 26 | - clone_cmd.append('--template=' + template_dir) 27 | + self._Run(['init', tmp_dir], options, cwd=self._root_dir) 28 | + 29 | + self._Run(['-C', tmp_dir, 'remote', 'add', 'origin', url], options, cwd=self._root_dir) 30 | + 31 | + clone_cmd = cfg + ['-C', tmp_dir, 'fetch', '--progress'] 32 | + clone_cmd.append('--depth=1') 33 | + clone_cmd.append(url) 34 | + clone_cmd.append(revision) 35 | + use_fetch = True 36 | else: 37 | # Otherwise, we're just interested in the HEAD. Just use --depth. 38 | clone_cmd.append('--depth=1') 39 | 40 | - tmp_dir = tempfile.mkdtemp( 41 | - prefix='_gclient_%s_' % os.path.basename(self.checkout_path), 42 | - dir=parent_dir) 43 | try: 44 | - clone_cmd.append(tmp_dir) 45 | + if use_fetch == False: 46 | + clone_cmd.append(tmp_dir) 47 | + 48 | if self.print_outbuf: 49 | print_stdout = True 50 | filter_fn = None 51 | @@ -1328,6 +1335,9 @@ class GitWrapper(SCMWrapper): 52 | if refspec: 53 | fetch_cmd.append(refspec) 54 | 55 | + if hasattr(options, 'no_history') and options.no_history: 56 | + fetch_cmd.append('--depth=1') 57 | + 58 | if prune: 59 | fetch_cmd.append('--prune') 60 | if options.verbose: 61 | -------------------------------------------------------------------------------- /export-all-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION=$(cat ~/bromite/build/RELEASE) 4 | CURRENT_RELEASE=$(git -C ~/chromium/src/ rev-parse --verify refs/tags/$VERSION) 5 | 6 | ALLPATCHS_E=$(git -C ~/chromium/src/ rev-list HEAD...$CURRENT_RELEASE) 7 | 8 | mkdir ~/bromite/build/patches-new 9 | 10 | NO_NAME=1 11 | 12 | for patch in $ALLPATCHS_E; do 13 | 14 | PATCH_FILE=$(git -C ~/chromium/src/ show -s $patch | grep FILE: | sed 's/FILE://g' | sed 's/^[ \t]*//;s/[ \t]*$//') 15 | if [[ "$PATCH_FILE" == *"Automated-domain-substitution"* ]]; then 16 | continue 17 | fi 18 | 19 | if [ -z "$PATCH_FILE" ] 20 | then 21 | PATCH_FILE=$(git -C ~/chromium/src/ show -s $patch | tail -n 1) 22 | if [[ "$PATCH_FILE" != *".patch" ]]; then 23 | PATCH_FILE=00$(git -C ~/chromium/src/ show -s $patch | head -n 5 | tail -n 1 | xargs | tr " " - | tr [:punct:] -).patch 24 | echo New Patch: ${PATCH_FILE} 25 | fi 26 | fi 27 | 28 | bash ~/bromite-buildtools/export-single-patch.sh $patch $PATCH_FILE 29 | 30 | done 31 | 32 | PATCH_LIST=~/bromite/build/bromite_patches_list.txt 33 | mkdir ~/bromite/build/patches-new/changed 34 | mkdir ~/bromite/build/patches-new/contrib 35 | for current_file in $(cat $PATCH_LIST); do 36 | if [[ "$current_file" == *".patch" ]]; then 37 | if [[ $current_file =~ ^changed/.* ]]; then 38 | mv ~/bromite/build/patches-new/$(basename $current_file) ~/bromite/build/patches-new/changed 39 | elif [[ $current_file =~ ^contrib/.* ]]; then 40 | mv ~/bromite/build/patches-new/$(basename $current_file) ~/bromite/build/patches-new/contrib || true 41 | fi 42 | fi 43 | done 44 | -------------------------------------------------------------------------------- /export-patch-list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION=$(cat ~/bromite/build/RELEASE) 4 | CURRENT_RELEASE=$(git -C ~/chromium/src/ rev-parse --verify refs/tags/$VERSION) 5 | 6 | ALLPATCHS_E=$(git -C ~/chromium/src/ rev-list HEAD...$CURRENT_RELEASE) 7 | 8 | mkdir ~/bromite/build/patches-new 9 | rm ~/bromite/build/patches-new/patch-list 10 | 11 | NO_NAME=1 12 | 13 | for patch in $ALLPATCHS_E; do 14 | 15 | PATCH_FILE=$(git -C ~/chromium/src/ show -s $patch | grep FILE: | sed 's/FILE://g' | sed 's/^[ \t]*//;s/[ \t]*$//') 16 | if [[ "$PATCH_FILE" == *"Automated-domain-substitution"* ]]; then 17 | continue 18 | fi 19 | PATCH_MESSAGE=$(git -C ~/chromium/src/ show -s $patch) 20 | if [[ $PATCH_MESSAGE == *NOEXPORT:* ]] ; 21 | then 22 | continue 23 | fi 24 | if [[ -z "$PATCH_FILE" ]]; then 25 | PATCH_FILE=00$(git -C ~/chromium/src/ show -s $patch | head -n 5 | tail -n 1 | xargs | tr " " - | tr [:punct:] -).patch 26 | fi 27 | 28 | echo $PATCH_FILE >>~/bromite/build/patches-new/patch-list 29 | 30 | done 31 | 32 | tac ~/bromite/build/patches-new/patch-list >~/bromite/build/patches-new/zz-patch-list.txt 33 | rm ~/bromite/build/patches-new/patch-list 34 | -------------------------------------------------------------------------------- /export-single-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | patch=$1 4 | output=$2 5 | 6 | PATCH_FILE=$(git -C ~/chromium/src/ show -s $patch | grep FILE: | sed 's/FILE://g' | sed 's/^[ \t]*//;s/[ \t]*$//') 7 | if [ -z "$output" ] 8 | then 9 | PATCH_FILE=$(git -C ~/chromium/src/ show -s $patch | tail -n 1 | xargs) 10 | echo Exporting $patch ~/bromite/build/patches-new/$PATCH_FILE 11 | else 12 | PATCH_FILE=$output 13 | echo Exporting new $patch ~/bromite/build/patches-new/$PATCH_FILE 14 | fi 15 | 16 | PATCH_MESSAGE=$(git -C ~/chromium/src/ show -s $patch) 17 | if [[ $PATCH_MESSAGE == *NOEXPORT:* ]] ; 18 | then 19 | echo Request NO export 20 | exit 0 21 | fi 22 | 23 | git -C ~/chromium/src/ format-patch -1 --keep-subject --stdout --full-index --zero-commit --no-signature $patch >~/bromite/build/patches-new/$PATCH_FILE 24 | echo " exported" 25 | 26 | CHANGE_REF="" 27 | while read line; do 28 | for i in {1..5} 29 | do 30 | if [[ "$line" == index* ]]; then 31 | read next_line 32 | if [[ "$next_line" != "GIT binary patch" ]]; then 33 | CHANGE_REF=${CHANGE_REF}"/^${line}/d;" 34 | break 35 | else 36 | line=$next_line 37 | continue 38 | fi 39 | else 40 | break 41 | fi 42 | done 43 | done <~/bromite/build/patches-new/$PATCH_FILE 44 | 45 | if [ "$CHANGE_REF" ] 46 | then 47 | sed -i "$CHANGE_REF" ~/bromite/build/patches-new/$PATCH_FILE 48 | fi 49 | sed -i '/^From 0000000000000000000000000000000000000000/d' ~/bromite/build/patches-new/$PATCH_FILE 50 | sed -i '/^FILE:/d' ~/bromite/build/patches-new/$PATCH_FILE 51 | sed -i '/^ mode change/d' ~/bromite/build/patches-new/$PATCH_FILE 52 | sed -i '/^old mode /d' ~/bromite/build/patches-new/$PATCH_FILE 53 | sed -i '/^new mode /d' ~/bromite/build/patches-new/$PATCH_FILE 54 | 55 | echo "--" >> ~/bromite/build/patches-new/$PATCH_FILE 56 | echo "2.25.1" >> ~/bromite/build/patches-new/$PATCH_FILE 57 | #echo "" >> ~/bromite/build/patches-new/$PATCH_FILE 58 | 59 | echo " done." 60 | echo "" 61 | -------------------------------------------------------------------------------- /goma_auth.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | def main(): 3 | return 0 4 | -------------------------------------------------------------------------------- /images/bromite-build/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BROMITE_SHA 2 | ARG VERSION 3 | 4 | FROM uazo/bromite:$VERSION-$BROMITE_SHA 5 | 6 | ARG HTTP_PROXY 7 | ENV HTTP_PROXY=$HTTP_PROXY 8 | ENV HTTPS_PROXY=$HTTP_PROXY 9 | ENV https_proxy=$HTTP_PROXY 10 | 11 | USER lg 12 | WORKDIR /home/lg/working_dir 13 | 14 | COPY pre-start.sh . 15 | COPY start-build.sh . 16 | COPY goma_auth.py . 17 | COPY casupload . 18 | COPY build_args.gni . 19 | 20 | COPY generic_android31.textpb . 21 | 22 | ENV CIPD_CACHE_DIR=/home/lg/working_dir/.cipd_cache 23 | ENV VPYTHON_VIRTUALENV_ROOT=/home/lg/vpython_root 24 | 25 | RUN sudo chmod +x ./start-build.sh \ 26 | && \ 27 | sudo chmod +x ./pre-start.sh \ 28 | && \ 29 | sudo chmod 775 ./goma_auth.py \ 30 | && \ 31 | ./pre-start.sh 32 | 33 | -------------------------------------------------------------------------------- /images/bromite-build/action.yaml: -------------------------------------------------------------------------------- 1 | name: 'Prepare Bromite Builder Image' 2 | description: 'Check and build Bromite builder image by sha' 3 | 4 | inputs: 5 | sha: 6 | description: 'Bromite sha ref' 7 | required: true 8 | 9 | runs: 10 | using: "composite" 11 | steps: 12 | - name: Checking image for "${{ inputs.sha }}" 13 | shell: bash 14 | run: | 15 | BROMITE_SHA="${{ inputs.sha }}" 16 | 17 | IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?) 18 | if [ $IS_PRESENT -ne "0" ]; then 19 | IS_PRESENT=$(docker manifest inspect uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?) 20 | if [ $IS_PRESENT -ne "0" ]; then 21 | echo "Image not found" 22 | 23 | mkdir bromite-source 24 | pushd bromite-source/ 25 | git clone https://github.com/uazo/bromite-buildtools 26 | 27 | cd bromite-buildtools/images/bromite-build/ 28 | DOCKER_BUILDKIT=1 docker build -t uazo/bromite-build:$BROMITE_SHA --progress plain \ 29 | --build-arg BROMITE_SHA=$BROMITE_SHA \ 30 | . 31 | 32 | popd 33 | fi 34 | fi 35 | -------------------------------------------------------------------------------- /images/bromite-build/build_args.gni: -------------------------------------------------------------------------------- 1 | 2 | declare_args() { 3 | _is_debug_build = "" 4 | } 5 | 6 | not_needed(["_target_build", "_is_debug_build"]) 7 | 8 | if(getenv("TARGET_CPU") != "") { 9 | target_cpu = getenv("TARGET_CPU") 10 | } 11 | 12 | if (target_os == "android") { 13 | target_os = "android" # fix traffic annotation auditor 14 | #enable_kythe_annotations = true 15 | chrome_public_manifest_package = "org.bromite.bromite.dev" 16 | 17 | _is_debug_build = getenv("TARGET_ISDEBUG") 18 | if(_is_debug_build == "true") { 19 | # print("Debug build on") 20 | is_debug = true 21 | is_official_build = false 22 | dcheck_always_on = true 23 | symbol_level = 1 24 | strip_debug_info = false 25 | generate_linker_map = false 26 | 27 | # since is_cfi require use_thin_lto 28 | # but not work in debug mode 29 | is_cfi = false # disable it 30 | use_cfi_cast = false # disable it 31 | } else { 32 | generate_linker_map = true 33 | use_relative_vtables_abi = false 34 | } 35 | } 36 | 37 | if (target_os == "win") { 38 | target_os = "win" # fix traffic annotation auditor 39 | target_cpu = "x64" 40 | symbol_level = 0 41 | use_large_pdbs = true 42 | 43 | enable_pdf = true 44 | pdf_is_complete_lib = true 45 | enable_plugins = true 46 | enable_ppapi = false 47 | 48 | is_cfi = false # disable it 49 | use_cfi_cast = false # disable it 50 | } 51 | -------------------------------------------------------------------------------- /images/bromite-build/casupload: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/images/bromite-build/casupload -------------------------------------------------------------------------------- /images/bromite-build/generic_android31.textpb: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # Configuration for a generic x86_64 android-12 AVD (userdebug build). 6 | 7 | emulator_package { 8 | package_name: "chromium/third_party/android_sdk/public/emulator" 9 | version: "gMHhUuoQRKfxr-MBn3fNNXZtkAVXtOwMwT7kfx8jkIgC" # 30.7.5 10 | dest_path: ".emulator_sdk" 11 | } 12 | 13 | system_image_package { 14 | package_name: "chromium/third_party/android_sdk/public/system-images/android-31/google_apis/x86_64" 15 | version: "R6Jh5_P21Euu-kdb11zcNjdJKN4vV1mdQTb8t4gph4IC" # 6 16 | dest_path: ".emulator_sdk" 17 | } 18 | system_image_name: "system-images;android-31;google_apis;x86_64" 19 | 20 | avd_package { 21 | package_name: "chromium/third_party/android_sdk/public/avds/android-31/google_apis/x86_64" 22 | version: "Ur_zl6_BRKRkf_9X3SMZ3eH2auoOyJ2kLslpTZZwi3gC" # created in bb_id 8841388797862621664 23 | dest_path: ".android" 24 | } 25 | avd_name: "android_31_google_apis_x86_64" 26 | -------------------------------------------------------------------------------- /images/bromite-build/goma_auth.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | def main(): 3 | return 0 4 | -------------------------------------------------------------------------------- /images/bromite-build/pre-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | NC='\033[0m' # No Color 5 | 6 | WORKSPACE=/home/lg/working_dir 7 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$PATH 8 | 9 | sudo apt-get install -y lsof libgoogle-glog-dev libprotobuf17 libgrpc++1 parallel golang-go 10 | 11 | echo -e ${RED} -------- download mtool ${NC} 12 | git clone https://github.com/bromite/mtool 13 | cd mtool 14 | make 15 | cd .. 16 | 17 | echo -e ${RED} -------- download ninjatracing ${NC} 18 | git clone https://github.com/nico/ninjatracing 19 | 20 | mkdir $CIPD_CACHE_DIR 21 | mkdir $VPYTHON_VIRTUALENV_ROOT 22 | 23 | echo -e ${RED} -------- download goma client ${NC} 24 | cd $WORKSPACE 25 | cipd install infra/goma/client/linux-amd64 -root $WORKSPACE/goma 26 | 27 | echo "nomatter" >$WORKSPACE/.debug_auth_file 28 | sudo cp $WORKSPACE/goma_auth.py $WORKSPACE/goma/ 29 | 30 | echo -e ${RED} -------- prepare vpython virtual environment ${NC} 31 | rm -rf /tmp/vpython* 32 | cd $WORKSPACE/chromium/src 33 | vpython -vpython-spec .vpython -vpython-root $VPYTHON_VIRTUALENV_ROOT -vpython-log-level debug -vpython-tool install 34 | vpython3 -vpython-spec .vpython3 -vpython-root $VPYTHON_VIRTUALENV_ROOT -vpython-log-level debug -vpython-tool install 35 | 36 | echo -e ${RED} -------- download x86_64 android image ${NC} 37 | #echo -e "\$ParanoidMode CheckIntegrity\n\nchromium/third_party/android_sdk/public/avds/android-31/google_apis/x86_64 Ur_zl6_BRKRkf_9X3SMZ3eH2auoOyJ2kLslpTZZwi3gC" | .cipd_client ensure -ensure-file - -root $WORKSPACE/chromium/src/.android 38 | #echo -e "\$ParanoidMode CheckIntegrity\n\nchromium/third_party/android_sdk/public/emulator gMHhUuoQRKfxr-MBn3fNNXZtkAVXtOwMwT7kfx8jkIgC\nchromium/third_party/android_sdk/public/system-images/android-31/google_apis/x86_64 R6Jh5_P21Euu-kdb11zcNjdJKN4vV1mdQTb8t4gph4IC" | .cipd_client ensure -ensure-file - -root $WORKSPACE/chromium/src/.emulator_sdk 39 | 40 | echo -e ${RED} -------- download kythe resources ${NC} 41 | wget https://chromium.googlesource.com/chromium/tools/build/+/main/recipes/recipe_modules/codesearch/resources/add_kythe_metadata.py?format=TEXT -O ~/add_kythe_metadata.py.base64 42 | base64 -d ~/add_kythe_metadata.py.base64 >~/add_kythe_metadata.py 43 | echo -e "infra/tools/package_index/linux-amd64 latest" | .cipd_client ensure -ensure-file - -root ~/package_index/latest 44 | 45 | cd $WORKSPACE/ 46 | wget https://github.com/kythe/kythe/releases/download/v0.0.55/kythe-v0.0.55.tar.gz 47 | tar xfz kythe-v0.0.55.tar.gz 48 | 49 | # removed since fail download with 50 | # https://commondatastorage.9oo91eapis.qjz9zk/chromium-browser-clang/Linux_x64/translation_unit-llvmorg-14-init-5759-g02895eed-1.tgz 51 | python tools/clang/scripts/update.py --package=translation_unit 52 | 53 | echo -e ${RED} -------- download bromite-buildtools ${NC} 54 | cd $WORKSPACE/ 55 | git clone https://github.com/uazo/bromite-buildtools 56 | 57 | echo -e ${RED} -------- compile modified ninja ${NC} 58 | cd $WORKSPACE/ 59 | git clone https://github.com/ninja-build/ninja.git -b v1.8.2 60 | cd ninja 61 | git apply $WORKSPACE/bromite-buildtools/ninja-one-target-for-compdb.patch 62 | CXX=clang++ ./configure.py --bootstrap 63 | 64 | echo -e ${RED} -------- download clang indexer ${NC} 65 | cd $WORKSPACE/ 66 | wget https://github.com/clangd/clangd/releases/download/snapshot_20211205/clangd_indexing_tools-linux-snapshot_20211205.zip 67 | unzip clangd_indexing_tools-linux-snapshot_20211205.zip 68 | rm clangd_indexing_tools-linux-snapshot_20211205.zip 69 | -------------------------------------------------------------------------------- /images/bromite-build/start-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | NC='\033[0m' # No Color 5 | 6 | WORKSPACE=/home/lg/working_dir 7 | 8 | PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH 9 | 10 | export GOMA_SERVER_HOST=$SERVER_HOST_GOMA 11 | export GOMA_SERVER_PORT=5050 12 | export GOMA_USE_SSL=false 13 | export GOMA_HTTP_AUTHORIZATION_FILE=$WORKSPACE/.debug_auth_file 14 | export GOMA_HERMETIC=error 15 | export GOMA_USE_LOCAL=false 16 | export GOMA_FALLBACK=true 17 | export GOMA_ARBITRARY_TOOLCHAIN_SUPPORT=true 18 | 19 | $WORKSPACE/goma/goma_ctl.py ensure_stop 20 | $WORKSPACE/goma/goma_ctl.py ensure_start 21 | 22 | cd chromium/src 23 | 24 | OUT_PRESENT=0 25 | test -d out/bromite && OUT_PRESENT=1 26 | if [[ OUT_PRESENT -eq 0 ]]; then 27 | 28 | echo -e ${RED} -------- sync out folder ${NC} 29 | test -d ../../artifacs/out/bromite && \ 30 | mkdir -p out/bromite && \ 31 | cp -arp ../../artifacs/out/bromite/* out/bromite/ 32 | 33 | echo -e ${RED} -------- gn gen ${NC} 34 | gn gen --args="import(\"/home/lg/working_dir/bromite/build/GN_ARGS\") use_goma=true goma_dir=\"$WORKSPACE/goma\" $(cat ../../build_args.gni) " out/bromite 35 | 36 | echo -e ${RED} -------- gn args ${NC} 37 | gn args out/bromite/ --list --short 38 | gn args out/bromite/ --list >$WORKSPACE/artifacs/gn_list 39 | 40 | echo -e ${RED} -------- apply .mtool ${NC} 41 | test -f out/bromite/.mtool && \ 42 | cp out/bromite/.mtool .mtool && \ 43 | $WORKSPACE/mtool/chromium/mtime.sh --restore 44 | 45 | fi 46 | 47 | if [[ -z "${GOMAJOBS}" ]]; then 48 | GOMAJOBS=40 49 | fi 50 | 51 | echo -e ${RED} -------- pre-cache toolchain ${NC} 52 | sudo ../../casupload --cas-server=unix:/tmp/proxy/bots.sock --instance=default_instance \ 53 | third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include \ 54 | third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/include \ 55 | third_party/llvm-build/Release+Asserts/lib \ 56 | third_party/llvm-build/Release+Asserts/bin \ 57 | buildtools/third_party/libc++ \ 58 | chrome/android/profiles/afdo.prof 59 | 60 | 61 | echo -e ${RED} -------- start build ${NC} 62 | autoninja -j $GOMAJOBS -C out/bromite chrome_public_apk 63 | echo -e ${RED} -------- end build ${NC} 64 | 65 | wget http://127.0.0.1:8088/logz?INFO -O ../../artifacs/goma-client.log 66 | cp out/bromite/apks/* $WORKSPACE/artifacs/ 67 | 68 | echo -e ${RED} -------- generating breakpad symbols ${NC} 69 | autoninja -j $GOMAJOBS -C out/bromite minidump_stackwalk dump_syms 70 | components/crash/content/tools/generate_breakpad_symbols.py --build-dir=out/bromite \ 71 | --symbols-dir=$WORKSPACE/artifacs/symbols/ --binary=out/bromite/lib.unstripped/libchrome.so --clear --verbose 72 | cp out/bromite/lib.unstripped/libchrome.so $WORKSPACE/artifacs/symbols/libchrome.lib.so 73 | cp out/bromite/minidump_stackwalk $WORKSPACE/artifacs/symbols 74 | cp out/bromite/dump_syms $WORKSPACE/artifacs/symbols 75 | 76 | echo -e ${RED} -------- sync out folder ${NC} 77 | $WORKSPACE/mtool/chromium/mtime.sh --backup 78 | mv .mtool out/bromite/ 79 | cp -arp out/bromite $WORKSPACE/artifacs/out 80 | 81 | echo -e ${RED} -------- stop goma ${NC} 82 | $WORKSPACE/goma/goma_ctl.py ensure_stop 83 | -------------------------------------------------------------------------------- /images/bromite-source/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | 3 | FROM uazo/chromium:$VERSION 4 | 5 | ARG BROMITE_SHA 6 | ENV BROMITE_SHA=$BROMITE_SHA 7 | 8 | ARG HTTP_PROXY 9 | ENV HTTP_PROXY=$HTTP_PROXY 10 | ENV HTTPS_PROXY=$HTTP_PROXY 11 | ENV https_proxy=$HTTP_PROXY 12 | 13 | #USER lg 14 | WORKDIR /home/lg/working_dir 15 | 16 | RUN sudo chown lg /etc/apt/apt.conf.d/proxy.conf 17 | RUN sudo echo "Acquire::http::Proxy \"$HTTP_PROXY\";" >/etc/apt/apt.conf.d/proxy.conf 18 | RUN sudo apt-get update 19 | 20 | COPY apply-bromite-patches.sh . 21 | 22 | RUN sudo chmod +x ./apply-bromite-patches.sh && \ 23 | mkdir bromite && \ 24 | cd bromite && \ 25 | git init && \ 26 | git remote add origin https://github.com/uazo/bromite && \ 27 | git fetch origin $BROMITE_SHA && \ 28 | git reset --hard FETCH_HEAD && \ 29 | cd .. 30 | 31 | RUN ./apply-bromite-patches.sh 32 | 33 | -------------------------------------------------------------------------------- /images/bromite-source/action.yaml: -------------------------------------------------------------------------------- 1 | name: 'Prepare Bromite Source Image' 2 | description: 'Check and build Bromite sources image by version' 3 | 4 | inputs: 5 | version: 6 | description: 'Chromium Version (example 91.0.4472.146)' 7 | required: true 8 | 9 | sha: 10 | description: 'Bromite sha ref' 11 | required: true 12 | 13 | runs: 14 | using: "composite" 15 | steps: 16 | - name: Checking image for "${{ inputs.sha }}" 17 | shell: bash 18 | run: | 19 | BROMITE_SHA="${{ inputs.sha }}" 20 | VERSION="${{ inputs.version }}" 21 | 22 | IS_PRESENT=$(docker inspect --type=image uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?) 23 | if [ $IS_PRESENT -ne "0" ]; then 24 | IS_PRESENT=$(docker manifest inspect uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?) 25 | if [ $IS_PRESENT -ne "0" ]; then 26 | echo "Image not found" 27 | 28 | mkdir bromite-source 29 | pushd bromite-source/ 30 | 31 | git clone https://github.com/uazo/bromite-buildtools 32 | 33 | cd bromite-buildtools/images/bromite-source/ 34 | DOCKER_BUILDKIT=1 docker build -t uazo/bromite:$BROMITE_SHA --progress plain \ 35 | --build-arg BROMITE_SHA=$BROMITE_SHA \ 36 | --build-arg VERSION=$VERSION \ 37 | . 38 | 39 | popd 40 | fi 41 | fi 42 | -------------------------------------------------------------------------------- /images/bromite-source/apply-bromite-patches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | NC='\033[0m' # No Color 5 | 6 | sudo apt install sed 7 | 8 | cd chromium/src 9 | 10 | echo -e ${RED} ------- apply patchs ${NC} 11 | for file in $(cat ../../bromite/build/bromite_patches_list.txt) ; do 12 | 13 | if [[ "$file" == *".patch" ]]; then 14 | #if [[ "$file" == *"Automated-domain-substitution"* ]]; then 15 | # echo -e ${RED} " -> Excluding $file" ${NC} 16 | # continue 17 | #fi 18 | 19 | echo -e ${RED} " -> Apply $file" ${NC} 20 | 21 | REPL="0,/^---/s//FILE:"$(basename $file)"\n---/" 22 | cat ../../bromite/build/patches/$file | sed $REPL | git am 23 | 24 | if [ $? -ne 0 ] 25 | then 26 | echo -e "Error on ../../bromite/build/patches/${file}" 27 | exit 1 28 | fi 29 | 30 | echo " " 31 | fi 32 | 33 | done 34 | -------------------------------------------------------------------------------- /images/build-deps/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | ARG VERSION 3 | 4 | ARG HTTP_PROXY 5 | 6 | ENV HTTP_PROXY=$HTTP_PROXY 7 | ENV http_proxy=$HTTP_PROXY 8 | 9 | ENV HTTPS_PROXY=$HTTP_PROXY 10 | ENV https_proxy=$HTTP_PROXY 11 | 12 | RUN touch /etc/apt/apt.conf.d/proxy.conf && \ 13 | echo "Acquire::http::Proxy \"$HTTP_PROXY\";" >/etc/apt/apt.conf.d/proxy.conf 14 | 15 | RUN dpkg --add-architecture i386 16 | 17 | RUN apt-get update &&\ 18 | DEBIAN_FRONTEND=noninteractive \ 19 | apt-get -f -y install sudo lsb-release cl-base64 bash wget apt-utils python sed tzdata build-essential lib32gcc-9-dev g++-multilib dos2unix wiggle 20 | 21 | ENV user lg 22 | 23 | RUN useradd -m -d /home/${user} ${user} && \ 24 | chown -R ${user} /home/${user} && \ 25 | adduser ${user} sudo && \ 26 | chmod 4755 /usr/bin/sudo && \ 27 | echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 28 | USER ${user} 29 | 30 | #RUN mkdir -p /home/${user} && \ 31 | # echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 32 | 33 | WORKDIR /home/${user} 34 | 35 | RUN wget https://raw.githubusercontent.com/chromium/chromium/$VERSION/build/install-build-deps.sh && \ 36 | wget https://raw.githubusercontent.com/chromium/chromium/$VERSION/build/install-build-deps.py && \ 37 | sed -i 's/snapcraft/wget/' install-build-deps.sh && \ 38 | chmod +x ./install-build-deps.sh && \ 39 | chmod +x ./install-build-deps.py && \ 40 | sudo ./install-build-deps.sh --no-prompt --lib32 --no-chromeos-fonts && \ 41 | sudo ./install-build-deps.sh --android --no-prompt --no-chromeos-fonts && \ 42 | sudo mkdir -p /github/home/.vscode-server && \ 43 | sudo chown lg /github/home/.vscode-server 44 | 45 | -------------------------------------------------------------------------------- /images/build-deps/action.yaml: -------------------------------------------------------------------------------- 1 | name: 'Prepare Build Deps Image' 2 | description: 'Check and build build deps image by version' 3 | 4 | inputs: 5 | version: 6 | description: 'Chromium Version (example 91.0.4472.146)' 7 | required: true 8 | 9 | runs: 10 | using: "composite" 11 | steps: 12 | - name: Checking image for "${{ inputs.version }}" 13 | shell: bash 14 | run: | 15 | VERSION="${{ inputs.version }}" 16 | IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?) 17 | if [ $IS_PRESENT -ne "0" ]; then 18 | IS_PRESENT=$(docker manifest inspect uazo/build-deps:$VERSION > /dev/null ; echo $?) 19 | if [ $IS_PRESENT -ne "0" ]; then 20 | echo "Image not found" 21 | 22 | mkdir build-repo 23 | pushd build-repo/ 24 | 25 | git clone https://github.com/uazo/bromite-buildtools 26 | cd bromite-buildtools/images/build-deps/ 27 | DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION --progress plain . 28 | 29 | popd 30 | rm -rf build-repo 31 | fi 32 | fi 33 | -------------------------------------------------------------------------------- /images/buildboxcasd/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | FROM ubuntu:latest 3 | 4 | ENV DEBIAN_FRONTEND=noninteractive 5 | 6 | COPY buildbox-casd . 7 | COPY set-perms.sh . 8 | 9 | RUN apt-get update &&\ 10 | apt-get -f -y install sudo libgoogle-glog-dev libprotobuf17 libgrpc++1 socat &&\ 11 | sudo chmod +x buildbox-casd &&\ 12 | sudo chmod +x set-perms.sh 13 | 14 | CMD sudo rm -rf /wrk-cache/* &&\ 15 | bash -c "socat -t10 UNIX-LISTEN:/wrk-cache/bots.sock,reuseaddr,fork TCP4:$REMOTEEXEC_ADDR &" &&\ 16 | bash -c "$PWD/set-perms.sh &" &&\ 17 | ./buildbox-casd \ 18 | --instance=default_instance \ 19 | --cas-instance=default_instance \ 20 | --cas-remote=http://$REMOTEEXEC_ADDR \ 21 | --ra-remote=http://$REMOTEEXEC_ADDR \ 22 | --verbose \ 23 | /wrk-cache 24 | -------------------------------------------------------------------------------- /images/buildboxcasd/buildbox-casd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/images/buildboxcasd/buildbox-casd -------------------------------------------------------------------------------- /images/buildboxcasd/set-perms.sh: -------------------------------------------------------------------------------- 1 | 2 | wait_file() { 3 | local file="$1"; shift 4 | local wait_seconds="${1:-10}"; shift # 10 seconds as default timeout 5 | 6 | until test $((wait_seconds--)) -eq 0 -o -e "$file" ; do sleep 1; done 7 | 8 | ((++wait_seconds)) 9 | } 10 | 11 | echo "--Checking permissions bots.sock" 12 | wait_file "/wrk-cache/bots.sock" && { 13 | echo "--Set bots.sock permissions" 14 | sudo chmod 777 /wrk-cache/bots.sock 15 | } 16 | 17 | echo "--Checking permissions casd.sock" 18 | wait_file "/wrk-cache/casd.sock" && { 19 | echo "--Set casd.sock permissions" 20 | sudo chmod 777 /wrk-cache/casd.sock 21 | } 22 | 23 | echo "--Done" 24 | -------------------------------------------------------------------------------- /images/buildboxrunner/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | FROM uazo/build-deps:$VERSION 3 | 4 | ENV DEBIAN_FRONTEND=noninteractive 5 | 6 | USER lg 7 | COPY buildbox-worker . 8 | COPY buildbox-run-hosttools . 9 | 10 | RUN HTTP_PROXY= &&\ 11 | HTTPS_PROXY= &&\ 12 | http_proxy= &&\ 13 | https_proxy= &&\ 14 | sudo rm /etc/apt/apt.conf.d/proxy.conf 15 | 16 | RUN sudo apt-get -f -y install libgoogle-glog-dev libprotobuf17 libgrpc++1 &&\ 17 | sudo chmod +x buildbox-worker &&\ 18 | sudo chmod +x buildbox-run-hosttools 19 | 20 | USER root 21 | 22 | CMD PATH=.:$PATH &&\ 23 | ./buildbox-worker \ 24 | --instance=default_instance \ 25 | --bots-remote=unix:/wrk-cache/bots.sock \ 26 | --stop-after=50 \ 27 | --bots-retry-limit=5 \ 28 | --buildbox-run=buildbox-run-hosttools \ 29 | --cas-remote=unix:/wrk-cache/casd.sock \ 30 | --logstream-remote=unix:/wrk-cache/casd.sock \ 31 | --cas-instance=default_instance \ 32 | --cas-retry-limit=10 \ 33 | --request-timeout=10 \ 34 | --verbose 35 | -------------------------------------------------------------------------------- /images/buildboxrunner/buildbox-run-hosttools: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/images/buildboxrunner/buildbox-run-hosttools -------------------------------------------------------------------------------- /images/buildboxrunner/buildbox-worker: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uazo/bromite-buildtools/314d85413b70ba9f453a4f89b6a211291493c860/images/buildboxrunner/buildbox-worker -------------------------------------------------------------------------------- /images/buildstack.env.example: -------------------------------------------------------------------------------- 1 | REMOTEEXEC_ADDR=:50051 2 | -------------------------------------------------------------------------------- /images/buildstack.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | 3 | services: 4 | buildboxcasd: 5 | image: uazo/buildboxcasd 6 | networks: 7 | - bridge-ext 8 | env_file: 9 | - buildstack.env 10 | volumes: 11 | - /cache:/wrk-cache:rw 12 | deploy: 13 | mode: global 14 | placement: 15 | max_replicas_per_node: 1 16 | 17 | buildboxrunner-32: 18 | image: uazo/buildboxrunner 19 | networks: 20 | - bridge-int 21 | depends_on: 22 | - buildboxcasd 23 | volumes: 24 | - /cache:/wrk-cache:rw 25 | deploy: 26 | replicas: 40 27 | placement: 28 | max_replicas_per_node: 30 29 | constraints: [node.labels.gomarunners == 32] 30 | 31 | buildboxrunner-12: 32 | image: uazo/buildboxrunner 33 | networks: 34 | - bridge-int 35 | depends_on: 36 | - buildboxcasd 37 | volumes: 38 | - /cache:/wrk-cache:rw 39 | deploy: 40 | replicas: 60 41 | placement: 42 | max_replicas_per_node: 12 43 | constraints: [node.labels.gomarunners == 12] 44 | 45 | buildboxrunner-8: 46 | image: uazo/buildboxrunner 47 | networks: 48 | - bridge-int 49 | depends_on: 50 | - buildboxcasd 51 | volumes: 52 | - /cache:/wrk-cache:rw 53 | deploy: 54 | replicas: 60 55 | placement: 56 | max_replicas_per_node: 8 57 | constraints: [node.labels.gomarunners == 8] 58 | 59 | buildboxrunner-6: 60 | image: uazo/buildboxrunner 61 | networks: 62 | - bridge-int 63 | depends_on: 64 | - buildboxcasd 65 | volumes: 66 | - /cache:/wrk-cache:rw 67 | deploy: 68 | replicas: 60 69 | placement: 70 | max_replicas_per_node: 6 71 | constraints: [node.labels.gomarunners == 6] 72 | 73 | buildboxrunner-4: 74 | image: uazo/buildboxrunner 75 | networks: 76 | - bridge-int 77 | depends_on: 78 | - buildboxcasd 79 | volumes: 80 | - /cache:/wrk-cache:rw 81 | deploy: 82 | replicas: 60 83 | placement: 84 | max_replicas_per_node: 4 85 | constraints: [node.labels.gomarunners == 4] 86 | 87 | buildboxrunner-2: 88 | image: uazo/buildboxrunner 89 | networks: 90 | - bridge-int 91 | depends_on: 92 | - buildboxcasd 93 | volumes: 94 | - /cache:/wrk-cache:rw 95 | deploy: 96 | replicas: 60 97 | placement: 98 | max_replicas_per_node: 2 99 | constraints: [node.labels.gomarunners == 2] 100 | 101 | networks: 102 | bridge-int: 103 | driver: overlay 104 | driver_opts: 105 | com.docker.network.bridge.name: build-bridge-int 106 | com.docker.network.bridge.enable_icc: "false" 107 | com.docker.network.bridge.enable_ip_masquerade: "false" 108 | com.docker.network.bridge.default_bridge: "false" 109 | name: build-bridge-int 110 | internal: true 111 | 112 | bridge-ext: 113 | driver: overlay 114 | driver_opts: 115 | com.docker.network.bridge.name: build-bridge-ext 116 | com.docker.network.bridge.enable_icc: "false" 117 | name: build-bridge-ext 118 | -------------------------------------------------------------------------------- /images/chr-source/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | 3 | FROM uazo/build-deps:$VERSION 4 | ARG VERSION 5 | ENV VERSION=$VERSION 6 | 7 | #USER lg 8 | WORKDIR /home/lg/working_dir 9 | 10 | COPY prepare-build.sh . 11 | COPY depot_tools.diff . 12 | COPY remove_ninja_uploader.diff . 13 | 14 | RUN sudo chmod +x ./prepare-build.sh \ 15 | && \ 16 | ./prepare-build.sh 17 | 18 | -------------------------------------------------------------------------------- /images/chr-source/action.yaml: -------------------------------------------------------------------------------- 1 | name: 'Prepare Chromium Sources Image' 2 | description: 'Check and build chromium source image by version' 3 | 4 | inputs: 5 | version: 6 | description: 'Chromium Version (example 91.0.4472.146)' 7 | required: true 8 | 9 | runs: 10 | using: "composite" 11 | steps: 12 | - name: Checking image for "${{ inputs.version }}" 13 | shell: bash 14 | run: | 15 | VERSION="${{ inputs.version }}" 16 | IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?) 17 | if [ $IS_PRESENT -ne "0" ]; then 18 | IS_PRESENT=$(docker manifest inspect uazo/chromium:$VERSION > /dev/null ; echo $?) 19 | if [ $IS_PRESENT -ne "0" ]; then 20 | echo "Image not found" 21 | 22 | mkdir chr-source 23 | pushd chr-sourced/ 24 | 25 | git clone https://github.com/uazo/bromite-buildtools 26 | cd bromite-buildtools/images/chr-source/ 27 | DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION --progress plain --build-arg VERSION=$VERSION . 28 | 29 | popd 30 | rm -rf chr-source 31 | fi 32 | fi 33 | -------------------------------------------------------------------------------- /images/chr-source/depot_tools.diff: -------------------------------------------------------------------------------- 1 | diff --git a/gclient_scm.py b/gclient_scm.py 2 | index f58c07a8..c8409726 100644 3 | --- a/gclient_scm.py 4 | +++ b/gclient_scm.py 5 | @@ -1137,31 +1137,29 @@ class GitWrapper(SCMWrapper): 6 | clone_cmd.append(url) 7 | 8 | template_dir = None 9 | + use_fetch = False 10 | + 11 | + tmp_dir = tempfile.mkdtemp( 12 | + prefix='_gclient_%s_' % os.path.basename(self.checkout_path), 13 | + dir=parent_dir) 14 | + 15 | if hasattr(options, 'no_history') and options.no_history: 16 | if gclient_utils.IsGitSha(revision): 17 | - # In the case of a subproject, the pinned sha is not necessarily the 18 | - # head of the remote branch (so we can't just use --depth=N). Instead, 19 | - # we tell git to fetch all the remote objects from SHA..HEAD by means 20 | - # of a template git dir which has a 'shallow' file pointing to the 21 | - # sha. 22 | - template_dir = tempfile.mkdtemp(prefix='_gclient_gittmp_%s' % 23 | - os.path.basename(self.checkout_path), 24 | - dir=parent_dir) 25 | - self._Run(['init', '--bare', template_dir], 26 | - options, 27 | - cwd=self._root_dir) 28 | - with open(os.path.join(template_dir, 'shallow'), 29 | - 'w') as template_file: 30 | - template_file.write(revision) 31 | - clone_cmd.append('--template=' + template_dir) 32 | + self._Run(['init', tmp_dir], options, cwd=self._root_dir) 33 | + 34 | + self._Run(['-C', tmp_dir, 'remote', 'add', 'origin', url], options, cwd=self._root_dir) 35 | + 36 | + clone_cmd = cfg + ['-C', tmp_dir, 'fetch', '--progress'] 37 | + clone_cmd.append('--depth=1') 38 | + clone_cmd.append(url) 39 | + clone_cmd.append(revision) 40 | + use_fetch = True 41 | else: 42 | # Otherwise, we're just interested in the HEAD. Just use --depth. 43 | clone_cmd.append('--depth=1') 44 | 45 | - tmp_dir = tempfile.mkdtemp(prefix='_gclient_%s_' % 46 | - os.path.basename(self.checkout_path), 47 | - dir=parent_dir) 48 | - clone_cmd.append(tmp_dir) 49 | + if use_fetch == False: 50 | + clone_cmd.append(tmp_dir) 51 | 52 | try: 53 | self._Run(clone_cmd, 54 | @@ -1452,6 +1450,9 @@ class GitWrapper(SCMWrapper): 55 | if refspec: 56 | fetch_cmd.append(refspec) 57 | 58 | + if hasattr(options, 'no_history') and options.no_history: 59 | + fetch_cmd.append('--depth=1') 60 | + 61 | if prune: 62 | fetch_cmd.append('--prune') 63 | if options.verbose: 64 | -------------------------------------------------------------------------------- /images/chr-source/prepare-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | NC='\033[0m' # No Color 5 | 6 | echo -e ${RED} -------- chromium version is: $VERSION ${NC} 7 | 8 | echo -e ${RED} -------- cloning depot_tools ${NC} 9 | git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git 10 | 11 | echo -e ${RED} -------- apply depot_tools patch ${NC} 12 | cd depot_tools/ 13 | git apply ../depot_tools.diff 14 | git apply ../remove_ninja_uploader.diff 15 | cd .. 16 | 17 | echo -e ${RED} -------- set envs ${NC} 18 | PATH=/home/lg/working_dir/depot_tools:$PATH 19 | echo $PATH 20 | 21 | echo -e ${RED} -------- download chromium repo ${NC} 22 | mkdir ./chromium 23 | cd ./chromium 24 | 25 | export DEPOT_TOOLS_UPDATE=0 26 | 27 | gclient root 28 | 29 | mkdir ./src 30 | cd ./src 31 | 32 | #CHR_SOURCE=https://chromium.googlesource.com/chromium/src.git 33 | CHR_SOURCE=https://github.com/chromium/chromium.git 34 | 35 | git init 36 | git remote add origin $CHR_SOURCE 37 | 38 | git fetch --depth 2 $CHR_SOURCE +refs/tags/$VERSION:chromium_$VERSION 39 | git checkout $VERSION 40 | VERSION_SHA=$( git show-ref -s $VERSION | head -n1 ) 41 | 42 | echo >../.gclient "solutions = [" 43 | echo >>../.gclient " { \"name\" : 'src'," 44 | echo >>../.gclient " \"url\" : '$CHR_SOURCE@$VERSION_SHA'," 45 | echo >>../.gclient " \"deps_file\" : 'DEPS'," 46 | echo >>../.gclient " \"managed\" : True," 47 | echo >>../.gclient " \"custom_deps\" : {" 48 | echo >>../.gclient " }," 49 | echo >>../.gclient " \"custom_vars\": {" 50 | echo >>../.gclient " \"checkout_android_prebuilts_build_tools\": True," 51 | echo >>../.gclient " \"checkout_telemetry_dependencies\": False," 52 | echo >>../.gclient " \"codesearch\": 'Debug'," 53 | echo >>../.gclient " }," 54 | echo >>../.gclient " }," 55 | echo >>../.gclient "]" 56 | echo >>../.gclient "target_os=['android']" 57 | 58 | git submodule foreach git config -f ./.git/config submodule.$name.ignore all 59 | git config --add remote.origin.fetch '+refs/tags/*:refs/tags/*' 60 | #git config diff.ignoreSubmodules all 61 | 62 | echo -e ${RED} -------- sync third_party repos ${NC} 63 | gclient sync -D --no-history --nohooks 64 | 65 | git config user.email "you@example.com" 66 | git config user.name "Your Name" 67 | 68 | # remove origin for chromium 69 | # git remote remove origin 70 | 71 | echo -e ${RED} -------- running hooks ${NC} 72 | gclient runhooks 73 | 74 | echo -e ${RED} -------- download objdump ${NC} 75 | tools/clang/scripts/update.py --package=objdump 76 | 77 | echo -e ${RED} -------- build rc ${NC} 78 | cd build/toolchain/win/rc 79 | git clone -q https://github.com/nico/hack 80 | cd hack/res 81 | 82 | ../../../../../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ \ 83 | -std=c++14 rc.cc -Wall \ 84 | -Wno-c++11-narrowing -O2 -fno-rtti -fno-exceptions -DNDEBUG \ 85 | -o rc-linux64 -fuse-ld=lld -target x86_64-unknown-linux-gnu 86 | cd ../../../../../../ 87 | cp build/toolchain/win/rc/hack/res/rc-linux64 build/toolchain/win/rc/linux64/rc 88 | 89 | -------------------------------------------------------------------------------- /images/chr-source/remove_ninja_uploader.diff: -------------------------------------------------------------------------------- 1 | diff --git a/ninjalog_uploader_wrapper.py b/ninjalog_uploader_wrapper.py 2 | index fbfca3f2..3cd9e9b1 100755 3 | --- a/ninjalog_uploader_wrapper.py 4 | +++ b/ninjalog_uploader_wrapper.py 5 | @@ -75,6 +75,7 @@ You can find a more detailed explanation in 6 | 7 | 8 | def main(): 9 | + return 0 10 | config = LoadConfig() 11 | 12 | if len(sys.argv) == 2 and sys.argv[1] == 'opt-in': 13 | -------------------------------------------------------------------------------- /images/docker-host/Dockerfile: -------------------------------------------------------------------------------- 1 | #FROM nestybox/ubuntu-focal-systemd-docker 2 | FROM ubuntu:20.04 3 | 4 | RUN set -xe && \ 5 | echo '#!/bin/sh' > /usr/sbin/policy-rc.d && \ 6 | echo 'exit 101' >> /usr/sbin/policy-rc.d && \ 7 | chmod +x /usr/sbin/policy-rc.d && \ 8 | dpkg-divert --local --rename --add /sbin/initctl && \ 9 | cp -a /usr/sbin/policy-rc.d /sbin/initctl && \ 10 | sed -i 's/^exit.*/exit 0/' /sbin/initctl && \ 11 | echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \ 12 | echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean && \ 13 | echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean && \ 14 | echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean && \ 15 | echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages && \ 16 | echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes && \ 17 | echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests 18 | 19 | RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container 20 | 21 | RUN apt-get update && \ 22 | apt-get install -y --no-install-recommends \ 23 | systemd systemd-sysv libsystemd0 ca-certificates dbus \ 24 | iptables iproute2 kmod locales sudo udev && \ 25 | echo "ReadKMsg=no" >> /etc/systemd/journald.conf && \ 26 | apt-get clean -y && \ 27 | rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/* \ 28 | /usr/share/doc/* /usr/share/man/* /usr/share/local/* && \ 29 | useradd --create-home --shell /bin/bash admin && \ 30 | echo "admin:admin" | chpasswd && \ 31 | adduser admin sudo 32 | 33 | STOPSIGNAL SIGRTMIN+3 34 | 35 | RUN apt-get update && \ 36 | apt-get install --no-install-recommends -y apt-transport-https ca-certificates \ 37 | curl gnupg-agent software-properties-common && \ 38 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ 39 | apt-key fingerprint 0EBFCD88 && \ 40 | add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \ 41 | apt-get update && apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io=1.4.4-1 && \ 42 | apt-get clean -y && \ 43 | rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/* \ 44 | /usr/share/doc/* /usr/share/man/* /usr/share/local/* && \ 45 | usermod -a -G docker admin 46 | 47 | RUN apt-get update && \ 48 | apt-get install --no-install-recommends -y \ 49 | openssh-server && \ 50 | mkdir /home/admin/.ssh && \ 51 | chown admin:admin /home/admin/.ssh 52 | 53 | # Extra deps 54 | ENV DEBIAN_FRONTEND=noninteractive 55 | RUN apt-get update \ 56 | && apt-get install -y \ 57 | sudo \ 58 | pigz \ 59 | && rm -rf /var/lib/apt/list/* 60 | 61 | ENTRYPOINT ["/sbin/init", "--log-level=err"] 62 | CMD ["/bin/bash"] 63 | -------------------------------------------------------------------------------- /images/github-runner/.env.example: -------------------------------------------------------------------------------- 1 | RUNNER_NAME=pd-gh-runner 2 | GITHUB_PERSONAL_TOKEN= 3 | GITHUB_OWNER= 4 | GITHUB_REPOSITORY= 5 | RUNNER_LABELS=