Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 52 additions & 8 deletions lib/web_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,54 @@ When running tests on LUCI using Chromium, LUCI uses the version of Chromium
fetched from CIPD.

Since the engine code and infra recipes do not live in the same repository
there are few steps to follow in order to upgrade a browser's version. For
now these instructins are most relevant to Chrome.
there are few steps to follow in order to upgrade a browser's version.

#### Chromium

Chromium is an independent project that gets rolled into Flutter manually, and as needed.
Flutter consumes a pre-built Chromium version from chromium.org. When a new version of
Chromium (check [here](https://www.chromium.org/getting-involved/download-chromium/#downloading-old-builds-of-chrome-chromium))
is needed, follow these steps to roll the new version:

- Make sure you have `depot_tools` installed (if you are regularly hacking on
the engine code, you probably do).
- If not already authenticated with CIPD, run `cipd auth-login` and follow
instructions (this step requires sufficient privileges; contact
#hackers-infra-🌡 on [Flutter's Discord server](https://github.com/flutter/flutter/wiki/Chat)).
- Edit `dev/browser_lock.yaml` and update the following values under `chrome`:
- Set `Windows`, `Mac` and `Linux` to the `branch_base_position`s given [in this table](https://omahaproxy.appspot.com).
(Pick from `linux`, `mac` and `win` as `os`, and the `stable` channel.)
- Set `version` to a string composed of the Major Version of the browser, and
the number of times that major version has been uploaded to CIPD. For example,
start with `'99'` for version 99.0.4844.51 of Chromium, and update to `'99.1'`,
`'99.2'` and so on if you need to upload newer bundles of the same major version.
(This is required because tags can't be repeated in CIPD).
- Run `dart dev/browser_roller.dart` and make sure it completes successfully.
The script uploads the specified versions of Chromium (and Chromedriver) to the
right locations in CIPD: [Chrome](https://chrome-infra-packages.appspot.com/p/flutter_internal/browsers/chrome),
[Chromedriver](https://chrome-infra-packages.appspot.com/p/flutter_internal/browser-drivers/chrome).
- Send a pull request containing the above file changes. Newer versions of Chromium
might break some tests or Goldens. Get those fixed too!

If you have questions, contact the Flutter Web team on Flutter Discord on the
\#hackers-web-🌍 channel.

##### **browser_roller.dart**

The script has the following command-line options:

- `--dry-run` - The script will stop before uploading artifacts to CIPD. The location of the data will be reported at the end of the script, if the script finishes successfullyThe output of the script will be visible in /tmp/browser-roll-RANDOM_STRING
- `--verbose` - Greatly increase the amount of information printed to `stdout` by the script.

> Try the following!
>
> ```bash
> dart ./dev/browser_roller.dart --dry-run --verbose
> ```

#### **Other browsers / manual upload**

In general, the manual process goes like this:

1. Dowload the binaries for the new browser/driver for each operaing system
(macOS, linux, windows).
Expand All @@ -147,11 +193,10 @@ now these instructins are most relevant to Chrome.

Resources:

1. For Chrome downloads [link][3].
2. Browser and driver CIPD [packages][4] (required speciall access; ping
1. Browser and driver CIPD [packages][4] (requires special access; ping
hackers-infra on Discord for more information)
3. LUCI web [recipe][5]
4. More general reading on CIPD packages [link][6]
2. LUCI web [recipe][5]
3. More general reading on CIPD packages [link][6]

### Rolling CanvasKit

Expand Down Expand Up @@ -222,7 +267,6 @@ FELT_USE_SNAPSHOT=false felt <command>

[1]: https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment
[2]: https://github.com/flutter/engine/blob/main/lib/web_ui/dev/browser_lock.yaml
[3]: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html
[4]: https://chrome-infra-packages.appspot.com/p/flutter_internal
[5]: https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/web_engine.py
[5]: https://cs.opensource.google/flutter/recipes/+/master:recipes/engine/web_engine.py
[6]: https://chromium.googlesource.com/chromium/src.git/+/main/docs/cipd_and_3pp.md#What-is-CIPD
7 changes: 5 additions & 2 deletions lib/web_ui/dev/browser_lock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ class ChromeLock {
ChromeLock._fromYaml(YamlMap yaml) :
linux = (yaml['Linux'] as int).toString(),
mac = (yaml['Mac'] as int).toString(),
windows = (yaml['Win'] as int).toString();
windows = (yaml['Win'] as int).toString(),
version = yaml['version'] as String;

final String linux;
final String mac;
final String windows;
/// The major version of Chromium represented by this lock. E.g: '96' (for Chromium 96.0.554.51)
final String version;

/// Return the version of Chromium to use for the current operating system.
/// Return the Chromium Build ID to use for the current operating system.
String get versionForCurrentPlatform {
return PlatformBinding.instance.getChromeBuild(this);
}
Expand Down
104 changes: 55 additions & 49 deletions lib/web_ui/dev/browser_lock.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
# Please refer to the "Upgrade Browser Version" section in the README.md for
# more details on how to update browser version numbers.
chrome:
# It seems Chrome can't always release from the same build for all operating
# systems, so we specify per-OS build number.
#
# The OS names here must match what recipe Python expression
# `self.m.platform.name.capitalize()` evaluates to. See:
#
# recipe_modules/web_util/api.py
Linux: 927388 # Major version 96
Mac: 927385 # Major version 96
Win: 927369 # Major version 96

## Firefox does not use CIPD. To update the version, simply update it in this
## file.
firefox:
version: '83.0'

edge:
launcher_version: '1.2.0.0'

safari_ios:
# Make sure this version is the same version supported by LUCI macOS bots.
# XCode on these bots will be updated once a year, do not forget to update
# `heightOfHeader` during this time.
major_version: 13
minor_version: 0
device: 'iPhone 11'
# `xcrun simctl` command is used to take screenshots. It takes the screenshot
# of the entire simulator. Therefore we need to crop all the parts other than
# the browsers' content. This file must be in sync with the local and LUCI
# versions of macOS, iOS Simulator, and Xcode.
# `heightOfHeader` is the number of pixels taken by the phone's header menu
# and the browsers address bar.
# TODO: https://github.com/flutter/flutter/issues/65672
height_of_header: 189
# `heightOfFooter` is the number of pixels taken by the phone's navigation
# menu.
height_of_footer: 250
# Most of the time tests use a portion of the screen to compare goldens
# instead of the entire screen. This area is reprented by a rectangle
# when taking screenshots. However the rectangle dimensions are in logical
# coordinates. In order to convert these coordinates to coordinates on the
# phone screeen we enlarge or shrink the area by applying a linear
# transformation by a scale_factor (a.k.a. we perform isotropic scaling).
# This value will be differ depending on the phone.
# For iOS 13.0 iPhone 11 Pro, this number is 1.15.
scale_factor: 1.00
# Please refer to the "Upgrade Browser Version" section in the README.md for
# more details on how to update browser version numbers.
chrome:
# It seems Chrome can't always release from the same build for all operating
# systems, so we specify per-OS build number.
#
# Follow these instructions to find the correct build number for a specific
# Chromium version + OS combo:
#
# https://www.chromium.org/getting-involved/download-chromium/#downloading-old-builds-of-chrome-chromium
#
# The OS names here must match what recipe Python expression
# `self.m.platform.name.capitalize()` evaluates to. See:
#
# recipe_modules/web_util/api.py
Linux: 929514
Mac: 929514
Win: 929514
version: '96.2' # CIPD tag for the above Build IDs. Normally "ChromeMajorVersion.UploadAttempt". ;)

## Firefox does not use CIPD. To update the version, simply update it in this
## file.
firefox:
version: '83.0'

edge:
launcher_version: '1.2.0.0'

safari_ios:
# Make sure this version is the same version supported by LUCI macOS bots.
# XCode on these bots will be updated once a year, do not forget to update
# `heightOfHeader` during this time.
major_version: 13
minor_version: 0
device: 'iPhone 11'
# `xcrun simctl` command is used to take screenshots. It takes the screenshot
# of the entire simulator. Therefore we need to crop all the parts other than
# the browsers' content. This file must be in sync with the local and LUCI
# versions of macOS, iOS Simulator, and Xcode.
# `heightOfHeader` is the number of pixels taken by the phone's header menu
# and the browsers address bar.
# TODO: https://github.com/flutter/flutter/issues/65672
height_of_header: 189
# `heightOfFooter` is the number of pixels taken by the phone's navigation
# menu.
height_of_footer: 250
# Most of the time tests use a portion of the screen to compare goldens
# instead of the entire screen. This area is reprented by a rectangle
# when taking screenshots. However the rectangle dimensions are in logical
# coordinates. In order to convert these coordinates to coordinates on the
# phone screeen we enlarge or shrink the area by applying a linear
# transformation by a scale_factor (a.k.a. we perform isotropic scaling).
# This value will be differ depending on the phone.
# For iOS 13.0 iPhone 11 Pro, this number is 1.15.
scale_factor: 1.00
Loading