From c56eb0360ff5455dc1821fdd1a2d10986934050f Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Mon, 21 Aug 2023 11:07:35 -0700 Subject: [PATCH 1/8] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000000..dd84ea7824f11 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000000..bbcbbe7d61558 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 260c63ae832a450d302b63ed533a2399f29ae34f Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Sun, 6 Aug 2023 16:02:19 -0700 Subject: [PATCH 2/8] Add XB1 builders and runner b/266878119 --- .github/config/win32.json | 1 + .github/config/xb1.json | 17 +++++++++++ .github/workflows/main_win.yaml | 10 +++++-- .github/workflows/xb1.yaml | 32 ++++++++++++++++++++ docker-compose-windows.yml | 34 ++++++++++++++++++++++ docker/windows/runner/Dockerfile | 7 +++-- docker/windows/runner/runner.ps1 | 4 +-- docker/windows/xb1/Dockerfile | 50 ++++++++++++++++++++++++++++++++ 8 files changed, 148 insertions(+), 7 deletions(-) create mode 100644 .github/config/xb1.json create mode 100644 .github/workflows/xb1.yaml create mode 100644 docker/windows/xb1/Dockerfile diff --git a/.github/config/win32.json b/.github/config/win32.json index 9de9f00102345..4ffbc7cbb3e3a 100644 --- a/.github/config/win32.json +++ b/.github/config/win32.json @@ -1,6 +1,7 @@ { "docker_service": "build-win-win32", "docker_runner_service": "runner-win-win32", + "runner_tag": "win32", "platforms": [ "win32" ], diff --git a/.github/config/xb1.json b/.github/config/xb1.json new file mode 100644 index 0000000000000..39918cb8d5d58 --- /dev/null +++ b/.github/config/xb1.json @@ -0,0 +1,17 @@ +{ + "docker_service": "build-xb1", + "__comment" : "TODO: Deploy a runner and change this", + "docker_runner_service": "runner-xb1", + "runner_tag": "xb1", + "platforms": [ + "xb1" + ], + "includes": [ + { + "name":"xb1", + "platform":"xb1", + "target_platform":"xb1", + "extra_gn_arguments":"is_clang=false" + } + ] +} diff --git a/.github/workflows/main_win.yaml b/.github/workflows/main_win.yaml index 0b9f14be35b6d..6b455b48fde83 100644 --- a/.github/workflows/main_win.yaml +++ b/.github/workflows/main_win.yaml @@ -112,6 +112,11 @@ jobs: run: | docker_runner_service=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.docker_runner_service') echo "docker_runner_service=${docker_runner_service}" >> $GITHUB_ENV + - id: set-runner-tag + shell: bash + run: | + runner_tag=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.runner_tag') + echo "runner_tag=${runner_tag}" >> $GITHUB_ENV outputs: platforms: ${{ env.platforms }} includes: ${{ env.includes }} @@ -120,6 +125,7 @@ jobs: on_host_test_shards: ${{ env.on_host_test_shards }} docker_service: ${{ env.docker_service }} docker_runner_service: ${{ env.docker_runner_service }} + runner_tag: ${{ env.runner_tag }} # Build windows docker images. build-docker-image: needs: [initialize] @@ -152,7 +158,7 @@ jobs: build: needs: [initialize] permissions: {} - runs-on: [self-hosted, win32] + runs-on: [self-hosted, "${{ needs.initialize.outputs.runner_tag }}"] name: ${{matrix.name}}_${{matrix.config}} strategy: fail-fast: false @@ -186,7 +192,7 @@ jobs: needs: [initialize, build] permissions: {} if: needs.initialize.outputs.on_host_test == 'true' - runs-on: [self-hosted, win32] + runs-on: [self-hosted, "${{ needs.initialize.outputs.runner_tag }}"] name: ${{matrix.name}}_${{matrix.shard}}_test strategy: fail-fast: false diff --git a/.github/workflows/xb1.yaml b/.github/workflows/xb1.yaml new file mode 100644 index 0000000000000..96e37f5514eb0 --- /dev/null +++ b/.github/workflows/xb1.yaml @@ -0,0 +1,32 @@ +name: xb1 + +on: + pull_request: + types: [opened, reopened, synchronize, labeled] + branches: + - main + - feature/* + push: + branches: + - main + - feature/* + schedule: + # GTM timezone. + - cron: '0 4 * * *' + workflow_dispatch: + inputs: + nightly: + description: 'Nightly workflow.' + required: true + type: boolean + default: false + +jobs: + xb1: + uses: ./.github/workflows/main_win.yaml + permissions: + packages: write + pull-requests: write + with: + platform: xb1 + nightly: ${{ github.event.inputs.nightly }} diff --git a/docker-compose-windows.yml b/docker-compose-windows.yml index 9c6aa27a21c6c..935cc6674deca 100644 --- a/docker-compose-windows.yml +++ b/docker-compose-windows.yml @@ -97,6 +97,17 @@ services: - cobalt-build-win32-base image: cobalt-build-win-win32 + build-xb1: + <<: *common-definitions + build: + context: ./docker/windows/xb1 + dockerfile: ./Dockerfile + args: + - FROM_IMAGE=cobalt-build-win32-base + depends_on: + - cobalt-build-win32-base + image: cobalt-build-xb1 + # ----------------------------------------- # Win32 Platform Images for Building Cobalt # ----------------------------------------- @@ -115,6 +126,16 @@ services: PLATFORM: win-win32 image: cobalt-build-win32 + xb1: + <<: *common-definitions + environment: + <<: *shared-build-env + PLATFORM: xb1 + COBALT_CONCURRENT_LINKS: ${COBALT_CONCURRENT_LINKS:-2} + image: cobalt-build-xb1 + depends_on: + - build-xb1 + runner-win-win32: <<: *common-definitions build: @@ -122,6 +143,19 @@ services: dockerfile: ./Dockerfile args: - RUNNER_VERSION=2.294.0 + - FROM_IMAGE=cobalt-build-win-win32 depends_on: - cobalt-build-win32-base image: cobalt-runner-win-win32 + + runner-xb1: + <<: *common-definitions + build: + context: ./docker/windows/runner + dockerfile: ./Dockerfile + args: + - RUNNER_VERSION=2.294.0 + - FROM_IMAGE=cobalt-build-xb1 + depends_on: + - xb1 + image: cobalt-runner-xb1 diff --git a/docker/windows/runner/Dockerfile b/docker/windows/runner/Dockerfile index a49481150bbde..b8aa4ad105076 100644 --- a/docker/windows/runner/Dockerfile +++ b/docker/windows/runner/Dockerfile @@ -11,7 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM cobalt-build-win32-base +ARG FROM_IMAGE +FROM ${FROM_IMAGE} SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"] @@ -20,7 +21,7 @@ ARG RUNNER_VERSION RUN Invoke-WebRequest -Uri 'https://aka.ms/install-powershell.ps1' -OutFile install-powershell.ps1; \ powershell -ExecutionPolicy Unrestricted -File ./install-powershell.ps1 -AddToPath -RUN Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v$env:RUNNER_VERSION/actions-runner-win-x64-$env:RUNNER_VERSION.zip -OutFile runner.zip; \ +RUN Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v$env:RUNNER_VERSION/actions-runner-win-x64-$env:RUNNER_VERSION.zip -OutFile C:/runner.zip; \ Expand-Archive -Path C:/runner.zip -DestinationPath C:/actions-runner; \ Remove-Item -Path C:\runner.zip; \ setx /M PATH $(${Env:PATH} + \";${Env:ProgramFiles}\Git\bin\") @@ -31,4 +32,4 @@ RUN choco install -f -y 7zip --version=19.0 ENV TMP "C:\Users\ContainerAdministrator\AppData\Local\Temp2" ADD runner.ps1 C:/runner.ps1 -CMD ["pwsh", "-ExecutionPolicy", "Unrestricted", "-File", ".\\runner.ps1"] +CMD ["pwsh", "-ExecutionPolicy", "Unrestricted", "-File", "C:\\runner.ps1"] diff --git a/docker/windows/runner/runner.ps1 b/docker/windows/runner/runner.ps1 index 9e96a5e581740..fa4fb5c7922c2 100644 --- a/docker/windows/runner/runner.ps1 +++ b/docker/windows/runner/runner.ps1 @@ -1,2 +1,2 @@ -.\actions-runner\config.cmd --unattended --replace --url https://github.com/${env:RUNNER_REPO} --token $env:RUNNER_TOKEN --name $env:RUNNER_NAME --work $env:RUNNER_WORKDIR --labels $env:RUNNER_LABELS; -.\actions-runner\run.cmd; +C:\actions-runner\config.cmd --unattended --replace --url https://github.com/${env:RUNNER_REPO} --token $env:RUNNER_TOKEN --name $env:RUNNER_NAME --work $env:RUNNER_WORKDIR --labels $env:RUNNER_LABELS; +C:\actions-runner\run.cmd; diff --git a/docker/windows/xb1/Dockerfile b/docker/windows/xb1/Dockerfile new file mode 100644 index 0000000000000..e4a7fd55c9ad3 --- /dev/null +++ b/docker/windows/xb1/Dockerfile @@ -0,0 +1,50 @@ +# escape=` + +# Copyright 2021 The Cobalt Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ARG FROM_IMAGE +FROM ${FROM_IMAGE} + +SHELL ["powershell", "-ExecutionPolicy", "Unrestricted", "-Command", ` + "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# Note: Visual Studio is installed as part of cobalt-build-win-base + +# Windows SDK +RUN Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/p/?linkid=2173743 ` + -OutFile C:\win_sdk_installer.exe ; ` + Write-Host 'Installing win_sdk_installer.exe ...' ; ` + C:\win_sdk_installer.exe /ceip off /quiet /features + | Out-Null ; ` + Write-Host 'Install of win_sdk_installer.exe completed. Cleaning up ...' ; ` + Remove-Item -Force -Recurse $env:TEMP\* ; ` + Remove-Item C:\win_sdk_installer.exe + +# MSVC sdk +ARG vs_buildtools_version="15" +ARG windows_11_sdk_version="22000" +RUN Write-Host 'Downloading vs_buildtools.exe' ; ` + Invoke-WebRequest -Uri https://aka.ms/vs/${env:vs_buildtools_version}/release/vs_buildtools.exe ` + -OutFile C:\vs_buildtools.exe ; ` + Write-Host 'Installing vs_buildtools.exe ...' ;` + Start-Process -Wait -FilePath C:\vs_buildtools.exe -ArgumentList "--quiet","--wait","--norestart","--nocache","--installPath","C:\BuildTools","--add","Microsoft.VisualStudio.Component.Windows11SDK.${env:windows_11_sdk_version}","--add","Microsoft.VisualStudio.Component.VC.Redist.14.Latest" ; ` + Write-Host 'Install of vs_buildtools.exe completed. Cleaning up ...' ; ` + Remove-Item C:\vs_buildtools.exe + + +WORKDIR "C:\code" + +CMD python3 cobalt/build/gn.py -p $env:PLATFORM -c $env:CONFIG out/${env:PLATFORM}_${env:CONFIG};` + if ($?) {` + ninja $env:NINJA_FLAGS -C out/${env:PLATFORM}_$env:CONFIG $env:TARGET;` + } From c42690e7a6b52ad0fec921c7d9131902f63534cd Mon Sep 17 00:00:00 2001 From: Igor Sarkisov Date: Tue, 19 Sep 2023 13:06:18 -0700 Subject: [PATCH 3/8] Update BUILD.gn From feb51c219722ff3a4ee5e521e482d6aba157dd88 Mon Sep 17 00:00:00 2001 From: Tyler Holcombe Date: Tue, 23 Jan 2024 16:17:46 -0800 Subject: [PATCH 4/8] Apply changes from main repo to concurrent_links.gni Change to win64 based build b/266878119 --- build/toolchain/concurrent_links.gni | 23 ++++++++--------------- docker-compose-windows.yml | 2 +- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/build/toolchain/concurrent_links.gni b/build/toolchain/concurrent_links.gni index a10a5cd526fcf..e074dfdfa6f48 100644 --- a/build/toolchain/concurrent_links.gni +++ b/build/toolchain/concurrent_links.gni @@ -1,4 +1,4 @@ -# Copyright 2016 The Chromium Authors +# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -36,7 +36,7 @@ if (concurrent_links == "") { # a little padding to account for future growth. _args += [ "--mem_per_link_gb=45" ] } else { - _args += [ "--mem_per_link_gb=20" ] + _args += [ "--mem_per_link_gb=10" ] } } else if ((use_clang_coverage && # When coverage_instrumentation_input_file is not empty it means @@ -61,7 +61,8 @@ if (concurrent_links == "") { } else if (is_android && !is_component_build && symbol_level == 2) { # Full debug symbols require large memory for link. _args = [ "--mem_per_link_gb=25" ] - } else if (is_android && !is_debug && !using_sanitizer && symbol_level < 2) { + } else if (is_android && !is_debug && !using_sanitizer && is_java_debug && + disable_android_lint && symbol_level < 2) { if (symbol_level == 1) { _args = [ "--mem_per_link_gb=6" ] } else { @@ -70,18 +71,6 @@ if (concurrent_links == "") { } else if ((is_linux || is_chromeos_lacros) && symbol_level == 0) { # Memory consumption on link without debug symbols is low on linux. _args = [ "--mem_per_link_gb=3" ] - } else if (current_os == "zos") { - _args = [ "--mem_per_link_gb=1" ] - } else if (is_fuchsia) { - # TODO(crbug.com/1347159): This was defaulting to 8GB. The number of - # linker instances to run in parallel is calculated by diviging - # the available memory by this value. On a 32GB machine with - # roughly 29GB of available memory, this would cause three instances - # to run. This started running out of memory and thrashing. This change - # addresses that issue to get the SDk rollers running again but - # could be optimized (maybe to 12GB or for different configs like - # component build). - _args = [ "--mem_per_link_gb=16" ] } else { _args = [] } @@ -112,6 +101,10 @@ if (concurrent_links == "") { } } else { assert(!use_thin_lto, "can't explicitly set concurrent_links with thinlto") + + # Convert the value to a number if it's a string. + concurrent_links = + exec_script("//starboard/build/echo.py", [ concurrent_links ], "value") concurrent_links_logs = [ "concurrent_links set by GN arg (value=$concurrent_links)" ] } diff --git a/docker-compose-windows.yml b/docker-compose-windows.yml index 935cc6674deca..3f4875dce389d 100644 --- a/docker-compose-windows.yml +++ b/docker-compose-windows.yml @@ -103,7 +103,7 @@ services: context: ./docker/windows/xb1 dockerfile: ./Dockerfile args: - - FROM_IMAGE=cobalt-build-win32-base + - FROM_IMAGE=cobalt-build-win-base depends_on: - cobalt-build-win32-base image: cobalt-build-xb1 From f02f6533ddbdb7e54f5d27d376c84d3999cf00a6 Mon Sep 17 00:00:00 2001 From: Igor Sarkisov Date: Tue, 23 Jan 2024 19:23:25 -0800 Subject: [PATCH 5/8] Update docker-compose-windows.yml --- docker-compose-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose-windows.yml b/docker-compose-windows.yml index 3f4875dce389d..17e964eedbfed 100644 --- a/docker-compose-windows.yml +++ b/docker-compose-windows.yml @@ -105,7 +105,7 @@ services: args: - FROM_IMAGE=cobalt-build-win-base depends_on: - - cobalt-build-win32-base + - cobalt-build-win-base image: cobalt-build-xb1 # ----------------------------------------- From 6cad3341917770e4284213c90561ba853ad3090a Mon Sep 17 00:00:00 2001 From: Tyler Holcombe Date: Wed, 24 Jan 2024 15:53:47 -0800 Subject: [PATCH 6/8] Add target_cpu and target_os to xb1 config --- .github/config/xb1.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/config/xb1.json b/.github/config/xb1.json index 39918cb8d5d58..39d6247f5aca0 100644 --- a/.github/config/xb1.json +++ b/.github/config/xb1.json @@ -11,7 +11,9 @@ "name":"xb1", "platform":"xb1", "target_platform":"xb1", - "extra_gn_arguments":"is_clang=false" + "extra_gn_arguments": "is_clang=false", + "target_cpu": "target_cpu=\\\"x64\\\"", + "target_os": "target_os=\\\"winuwp\\\"" } ] } From 9483d004a4c996bf69d8cc010ef02a1e695cd938 Mon Sep 17 00:00:00 2001 From: Tyler Holcombe Date: Mon, 29 Jan 2024 13:25:12 -0800 Subject: [PATCH 7/8] Test github builds without converting concurrent_links Testing if github builds fail when we don't convert concurrent_links to an int from a string. Locally this fails, but our CI may be configured differently. --- build/toolchain/concurrent_links.gni | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/toolchain/concurrent_links.gni b/build/toolchain/concurrent_links.gni index e074dfdfa6f48..05d90158edb4e 100644 --- a/build/toolchain/concurrent_links.gni +++ b/build/toolchain/concurrent_links.gni @@ -101,10 +101,6 @@ if (concurrent_links == "") { } } else { assert(!use_thin_lto, "can't explicitly set concurrent_links with thinlto") - - # Convert the value to a number if it's a string. - concurrent_links = - exec_script("//starboard/build/echo.py", [ concurrent_links ], "value") concurrent_links_logs = [ "concurrent_links set by GN arg (value=$concurrent_links)" ] } From e73887e7aef63e70567ec9c2047e8d0e4a63ffb2 Mon Sep 17 00:00:00 2001 From: Tyler Holcombe Date: Mon, 29 Jan 2024 13:31:19 -0800 Subject: [PATCH 8/8] Restore concurrent_links.gni to match trunk --- build/toolchain/concurrent_links.gni | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/build/toolchain/concurrent_links.gni b/build/toolchain/concurrent_links.gni index 05d90158edb4e..a10a5cd526fcf 100644 --- a/build/toolchain/concurrent_links.gni +++ b/build/toolchain/concurrent_links.gni @@ -1,4 +1,4 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. +# Copyright 2016 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -36,7 +36,7 @@ if (concurrent_links == "") { # a little padding to account for future growth. _args += [ "--mem_per_link_gb=45" ] } else { - _args += [ "--mem_per_link_gb=10" ] + _args += [ "--mem_per_link_gb=20" ] } } else if ((use_clang_coverage && # When coverage_instrumentation_input_file is not empty it means @@ -61,8 +61,7 @@ if (concurrent_links == "") { } else if (is_android && !is_component_build && symbol_level == 2) { # Full debug symbols require large memory for link. _args = [ "--mem_per_link_gb=25" ] - } else if (is_android && !is_debug && !using_sanitizer && is_java_debug && - disable_android_lint && symbol_level < 2) { + } else if (is_android && !is_debug && !using_sanitizer && symbol_level < 2) { if (symbol_level == 1) { _args = [ "--mem_per_link_gb=6" ] } else { @@ -71,6 +70,18 @@ if (concurrent_links == "") { } else if ((is_linux || is_chromeos_lacros) && symbol_level == 0) { # Memory consumption on link without debug symbols is low on linux. _args = [ "--mem_per_link_gb=3" ] + } else if (current_os == "zos") { + _args = [ "--mem_per_link_gb=1" ] + } else if (is_fuchsia) { + # TODO(crbug.com/1347159): This was defaulting to 8GB. The number of + # linker instances to run in parallel is calculated by diviging + # the available memory by this value. On a 32GB machine with + # roughly 29GB of available memory, this would cause three instances + # to run. This started running out of memory and thrashing. This change + # addresses that issue to get the SDk rollers running again but + # could be optimized (maybe to 12GB or for different configs like + # component build). + _args = [ "--mem_per_link_gb=16" ] } else { _args = [] }