Skip to content

Commit 7063ea1

Browse files
authored
Reland licenses cpp switch (flutter#172671)
changes since last land: 1) Now the license checker can trim matched licenses to remove regions that aren't apropos 1) There is a `.autoroller-preupload.sh` script that should update the LICENSE file when the autoroller executes relies on: - flutter#172655 - https://skia-review.googlesource.com/c/buildbot/+/1025936 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 4d060ae commit 7063ea1

File tree

6 files changed

+34166
-19742
lines changed

6 files changed

+34166
-19742
lines changed

.autoroller-preupload.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2014 The Flutter Authors. All rights reserved.
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
6+
# This is executed by the skia autoroller after the roll has happened but before
7+
# the PR is uploaded. Previously this logic was hardcoded into the autoroller
8+
# and was reserved for updating the LICENSE file. Now the autoroller delegates
9+
# to this script.
10+
# See also:
11+
# - https://skia-review.googlesource.com/c/buildbot/+/1025936
12+
# - https://issues.skia.org/issues/433551375
13+
14+
REPO_PATH=$(dirname "$(readlink -f "$0")")
15+
ET="$REPO_PATH/engine/src/flutter/bin/et"
16+
LICENSE_CPP="$REPO_PATH/engine/src/out/host_profile/licenses_cpp"
17+
WORKING_DIR="$REPO_PATH/engine/src/flutter"
18+
LICENSES_PATH="$REPO_PATH/engine/src/flutter/sky/packages/sky_engine/LICENSE"
19+
DATA_PATH="$REPO_PATH/engine/src/flutter/tools/licenses_cpp/data"
20+
21+
$ET build --no-rbe -c host_profile //flutter/tools/licenses_cpp
22+
$LICENSE_CPP \
23+
--working_dir=$WORKING_DIR \
24+
--licenses_path=$LICENSES_PATH \
25+
--data_dir=$DATA_PATH \
26+
--v=1

dev/bots/analyze.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,7 @@ Future<CommandResult> _runFlutterAnalyze(
26532653

26542654
// These files legitimately require executable permissions
26552655
const Set<String> kExecutableAllowlist = <String>{
2656+
'.autoroller-preupload.sh',
26562657
'bin/dart',
26572658
'bin/flutter',
26582659
'bin/flutter-dev',

engine/src/flutter/ci/builders/standalone/linux_license.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,32 @@
66
"cas_archive": false,
77
"name": "licenses",
88
"description": "Runs the license check script.",
9+
"gn": [
10+
"--target-dir",
11+
"ci/host_release_licenses",
12+
"--runtime-mode",
13+
"release",
14+
"--no-rbe",
15+
"--no-goma"
16+
],
17+
"ninja": {
18+
"config": "ci/host_release_licenses",
19+
"targets": [
20+
"flutter/tools/licenses_cpp",
21+
"flutter/tools/licenses_cpp:licenses_cpp_testrunner"
22+
]
23+
},
924
"tests": [
1025
{
11-
"name": "licenses check",
12-
"max_attempts": 1,
13-
"script": "flutter/ci/licenses.sh"
26+
"name": "Run license_cpp unittests",
27+
"script": "out/ci/host_release_licenses/licenses_cpp_testrunner"
28+
},
29+
{
30+
"name": "Run license_cpp",
31+
"script": "flutter/ci/licenses_cpp.sh",
32+
"parameters": [
33+
"ci/host_release_licenses"
34+
]
1435
}
1536
]
1637
}

engine/src/flutter/ci/licenses_cpp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ DATA_DIR="$SCRIPT_DIR/../tools/licenses_cpp/data"
6464
# in the directory where you *run* the script from (your current working directory).
6565
LICENSES_OUTPUT_PATH="$SCRIPT_DIR/../sky/packages/sky_engine/LICENSE_CPP.new"
6666

67-
LICENSES_PATH="$SCRIPT_DIR/../sky/packages/sky_engine/LICENSE_CPP"
67+
LICENSES_PATH="$SCRIPT_DIR/../sky/packages/sky_engine/LICENSE"
6868

6969
# --- Validation ---
7070

0 commit comments

Comments
 (0)