Skip to content

Commit b1a0c2a

Browse files
authored
[infra] Update workflow with native_ packages (#963)
Now that flutter/flutter#143055 has landed, we should be able to start doing breaking changes.
1 parent cb9bd7e commit b1a0c2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+101
-165
lines changed

.github/workflows/native.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
os: [ubuntu, macos, windows]
3434
sdk: [stable, dev]
3535
package: [native_assets_builder, native_assets_cli, native_toolchain_c]
36-
dependencies: [published, path]
3736
# Breaking changes temporarily break the example run on the Dart SDK until native_assets_builder is rolled into the Dart SDK dev build.
3837
breaking-change: [false]
3938
exclude:
@@ -42,9 +41,6 @@ jobs:
4241
sdk: dev
4342
- os: windows
4443
sdk: dev
45-
# Only run path deps on dev
46-
- sdk: stable
47-
dependencies: published
4844

4945
runs-on: ${{ matrix.os }}-latest
5046

@@ -64,11 +60,6 @@ jobs:
6460
ndk-version: r26b
6561
if: ${{ matrix.sdk == 'stable' }}
6662

67-
- run: dart run ../../tools/check_pubspec_overrides.dart
68-
69-
- run: dart run ../../tools/delete_pubspec_overrides.dart
70-
if: ${{ matrix.dependencies == 'published' }}
71-
7263
- run: dart pub get
7364

7465
- run: dart pub get -C test_data/dart_app/
@@ -133,19 +124,19 @@ jobs:
133124

134125
- name: Install coverage
135126
run: dart pub global activate coverage
136-
if: ${{ matrix.sdk == 'stable' && matrix.dependencies == 'published' }}
127+
if: ${{ matrix.sdk == 'stable' }}
137128

138129
- name: Collect coverage
139130
run: dart pub global run coverage:test_with_coverage
140-
if: ${{ matrix.sdk == 'stable' && matrix.dependencies == 'published' }}
131+
if: ${{ matrix.sdk == 'stable' }}
141132

142133
- name: Upload coverage
143134
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949
144135
with:
145136
flag-name: ${{ matrix.package }}_${{ matrix.os }}
146137
github-token: ${{ secrets.GITHUB_TOKEN }}
147138
parallel: true
148-
if: ${{ matrix.sdk == 'stable' && matrix.dependencies == 'published' }}
139+
if: ${{ matrix.sdk == 'stable' }}
149140

150141
coverage-finished:
151142
needs: [build]

pkgs/native_assets_builder/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.3-wip
2+
3+
- Bump `package:native_assets_cli` to path dependency.
4+
15
## 0.3.2
26

37
- Reintroduce `AssetRelativePath`, it's used in `dart build`.

pkgs/native_assets_builder/CONTRIBUTING.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,44 @@ Both Dartdev and Flutter Tools are built in open source, and inside g3.
99
* Dartdev as part of the Dart SDK build on the [Dart CI].
1010
* Dartdev as part of the g3 build (see CBuild comments on CLs on [Gerrit]).
1111
* Flutter Tools as part of the workflows on GitHub.
12-
* Flutter Tools as part of the g3 build (see the "Google testing" workflow on PRs on GitHub).
1312

1413
The versions used in these different places are as follows:
1514

1615
* The Dart SDK uses pinned dependencies in [DEPS], the current hash is in `native_rev`.
1716
* The Flutter build on GitHub ussed published dependencies in [its `pubspec.yaml`].
18-
* The g3 build uses the pinned dependencies that are rolled in from the Dart SDK. **Both for Dartdev _and_ Flutter Tools**.
1917

2018
## Rolling
2119

2220
The above means the following.
2321

24-
1. The DEPS in the Dart SDK can only be rolled forward as much as is still compatible with the published deps currently used in Flutter Tools.
25-
2. Flutter Tools can only be rolled forward as much as is still compatible with with the deps pinned in the Dart SDK.
26-
27-
So, any breaking change must be done in the following way:
28-
29-
1. Introduce a new API.
30-
2. Release a new version to pub (minor version).
31-
3. Roll that version into Dart SDK, and migrate uses in the Dart SDK.
32-
4. Wait for that Dart version to roll into g3.
33-
5. Update the dependencies to Flutter Tools, and migrate uses.
34-
6. Get the Flutter PR reviewed.
35-
7. Wait for the Flutter PR to roll into g3.
36-
8. Only then, remove the old API.
37-
9. Release a new version to pub (major version, old API removed).
38-
10. Roll both in to Dart/Flutter.
22+
Breaking changes to `native_assets_cli`, `native_assets_builder`, and
23+
`native_toolchain_c` have to be rolled into the Dart SDK with a CL that
24+
runs all the `pkg` bots:
25+
```
26+
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try,pkg-linux-release-arm64-try,pkg-linux-debug-try
27+
```
28+
The CI on this repo runs with path dependencies between these packages
29+
which corresponds to the path dependencies used in the DEPS file in the Dart
30+
SDK.
31+
32+
Breaking changes to `native_assets_cli` and `native_assets_builder`
33+
have to be rolled into the packages/flutter_tools in the flutter/flutter repo.
34+
This package uses published dependencies.
35+
So this requires:
36+
37+
1. Land a commit that sets the `native_assets_cli` to a stable version.
38+
2. Publish `native_assets_cli` on pub.dev.
39+
3. Land a commit that sets `native_assets_builder` to a stable version,
40+
depends on the published version of `native_assets_cli`, and
41+
removes the `publish_to: none`.
42+
4. Publish `native_assets_builder` on pub.dev.
43+
5. (Repeat these steps for `native_toolchain_c`.)
44+
6. Finally, land a commit that sets all versions to WIP, and adds
45+
`publish_to: none` back in.
3946

4047
The roll status can be seen on internal corp links only:
4148

4249
* Dart roll to g3: https://dart-in-g3-qa-prod.corp.google.com/dg3/Home#/cbuild
43-
* Flutter roll to g3: https://frob.corp.google.com/
4450

4551
[`package:dartdev`]: https://github.com/dart-lang/sdk/tree/main/pkg/dartdev
4652
[`package:flutter_tools`]: https://github.com/flutter/flutter/tree/master/packages/flutter_tools

pkgs/native_assets_builder/pubspec.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
name: native_assets_builder
22
description: >-
33
This package is the backend that invokes top-level `build.dart` scripts.
4-
version: 0.3.2
4+
version: 0.3.3-wip
55
repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_builder
66

77
environment:
88
sdk: '>=3.0.0 <4.0.0'
99

10+
publish_to: none
11+
1012
dependencies:
1113
graphs: ^2.3.1
1214
logging: ^1.2.0
13-
native_assets_cli: ^0.4.1
15+
# native_assets_cli: ^0.4.1
16+
native_assets_cli:
17+
path: ../native_assets_cli/
1418
package_config: ^2.1.0
1519
yaml: ^3.1.2
1620
yaml_edit: ^2.1.0

pkgs/native_assets_builder/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ dependencies:
1111
cli_config: ^0.1.1
1212
cyclic_package_2:
1313
path: ../cyclic_package_2
14-
native_assets_cli: ^0.4.1
14+
# native_assets_cli: ^0.4.1
15+
native_assets_cli:
16+
path: ../../../native_assets_cli/
1517
yaml: ^3.1.1
1618
yaml_edit: ^2.1.0
1719

pkgs/native_assets_builder/test_data/cyclic_package_1/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ dependencies:
1111
cli_config: ^0.1.1
1212
cyclic_package_1:
1313
path: ../cyclic_package_1
14-
native_assets_cli: ^0.4.1
14+
# native_assets_cli: ^0.4.1
15+
native_assets_cli:
16+
path: ../../../native_assets_cli/
1517
yaml: ^3.1.1
1618
yaml_edit: ^2.1.0
1719

pkgs/native_assets_builder/test_data/cyclic_package_2/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/dart_app/pubspec_overrides.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/manifest.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@
22
# a completely clean setup.
33
- cyclic_package_1/build.dart
44
- cyclic_package_1/pubspec.yaml
5-
- cyclic_package_1/pubspec_overrides.yaml
65
- cyclic_package_2/build.dart
76
- cyclic_package_2/pubspec.yaml
8-
- cyclic_package_2/pubspec_overrides.yaml
97
- dart_app/bin/dart_app.dart
108
- dart_app/pubspec.yaml
11-
- dart_app/pubspec_overrides.yaml
129
- native_add/build.dart
1310
- native_add/ffigen.yaml
1411
- native_add/lib/native_add.dart
1512
- native_add/lib/src/native_add_bindings_generated.dart
1613
- native_add/lib/src/native_add.dart
1714
- native_add/pubspec.yaml
18-
- native_add/pubspec_overrides.yaml
1915
- native_add/src/native_add.c
2016
- native_add/src/native_add.h
2117
- native_add/test/native_add_test.dart
@@ -25,26 +21,19 @@
2521
- native_subtract/lib/src/native_subtract_bindings_generated.dart
2622
- native_subtract/lib/src/native_subtract.dart
2723
- native_subtract/pubspec.yaml
28-
- native_subtract/pubspec_overrides.yaml
2924
- native_subtract/src/native_subtract.c
3025
- native_subtract/src/native_subtract.h
3126
- package_reading_metadata/build.dart
3227
- package_reading_metadata/pubspec.yaml
33-
- package_reading_metadata/pubspec_overrides.yaml
3428
- package_with_metadata/build.dart
3529
- package_with_metadata/pubspec.yaml
36-
- package_with_metadata/pubspec_overrides.yaml
3730
- some_dev_dep/bin/some_dev_dep.dart
3831
- some_dev_dep/pubspec.yaml
3932
- wrong_build_output/build.dart
4033
- wrong_build_output/pubspec.yaml
41-
- wrong_build_output/pubspec_overrides.yaml
4234
- wrong_build_output_2/build.dart
4335
- wrong_build_output_2/pubspec.yaml
44-
- wrong_build_output_2/pubspec_overrides.yaml
4536
- wrong_build_output_3/build.dart
4637
- wrong_build_output_3/pubspec.yaml
47-
- wrong_build_output_3/pubspec_overrides.yaml
4838
- wrong_namespace_asset/build.dart
4939
- wrong_namespace_asset/pubspec.yaml
50-
- wrong_namespace_asset/pubspec_overrides.yaml

pkgs/native_assets_builder/test_data/native_add/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
- lib/src/native_add_bindings_generated.dart
55
- lib/src/native_add.dart
66
- pubspec.yaml
7-
- pubspec_overrides.yaml
87
- src/native_add.c
98
- src/native_add.h
109
- test/native_add_test.dart

pkgs/native_assets_builder/test_data/native_add/pubspec.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ environment:
1010
dependencies:
1111
cli_config: ^0.1.1
1212
logging: ^1.1.1
13-
native_assets_cli: ^0.4.1
14-
native_toolchain_c: ^0.3.4+1
13+
# native_assets_cli: ^0.4.1
14+
native_assets_cli:
15+
path: ../../../native_assets_cli/
16+
# native_toolchain_c: ^0.3.4+1
17+
native_toolchain_c:
18+
path: ../../../native_toolchain_c/
1519

1620
dev_dependencies:
1721
ffigen: ^8.0.2

pkgs/native_assets_builder/test_data/native_add/pubspec_overrides.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/native_add_add_source/pubspec.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ environment:
1010
dependencies:
1111
cli_config: ^0.1.1
1212
logging: ^1.1.1
13-
native_assets_cli: ^0.4.1
14-
native_toolchain_c: ^0.3.4+1
13+
# native_assets_cli: ^0.4.1
14+
native_assets_cli:
15+
path: ../../../native_assets_cli/
16+
# native_toolchain_c: ^0.3.4+1
17+
native_toolchain_c:
18+
path: ../../../native_toolchain_c/
1519

1620
dev_dependencies:
1721
ffigen: ^8.0.2

pkgs/native_assets_builder/test_data/native_add_add_source/pubspec_overrides.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/native_subtract/pubspec.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ environment:
1010
dependencies:
1111
cli_config: ^0.1.1
1212
logging: ^1.1.1
13-
native_assets_cli: ^0.4.1
14-
native_toolchain_c: ^0.3.4+1
13+
# native_assets_cli: ^0.4.1
14+
native_assets_cli:
15+
path: ../../../native_assets_cli/
16+
# native_toolchain_c: ^0.3.4+1
17+
native_toolchain_c:
18+
path: ../../../native_toolchain_c/
1519

1620
dev_dependencies:
1721
ffigen: ^8.0.2

pkgs/native_assets_builder/test_data/native_subtract/pubspec_overrides.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ environment:
99

1010
dependencies:
1111
cli_config: ^0.1.1
12-
native_assets_cli: ^0.4.1
12+
# native_assets_cli: ^0.4.1
13+
native_assets_cli:
14+
path: ../../../native_assets_cli/
1315
package_with_metadata:
1416
path: ../package_with_metadata/
1517
yaml: ^3.1.1

pkgs/native_assets_builder/test_data/package_reading_metadata/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/package_with_metadata/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ environment:
99

1010
dependencies:
1111
cli_config: ^0.1.1
12-
native_assets_cli: ^0.4.1
12+
# native_assets_cli: ^0.4.1
13+
native_assets_cli:
14+
path: ../../../native_assets_cli/
1315
yaml: ^3.1.1
1416
yaml_edit: ^2.1.0
1517

pkgs/native_assets_builder/test_data/package_with_metadata/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/some_dev_dep/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/wrong_build_output/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ environment:
99

1010
dependencies:
1111
cli_config: ^0.1.1
12-
native_assets_cli: ^0.4.1
12+
# native_assets_cli: ^0.4.1
13+
native_assets_cli:
14+
path: ../../../native_assets_cli/
1315
yaml: ^3.1.1
1416
yaml_edit: ^2.1.0
1517

pkgs/native_assets_builder/test_data/wrong_build_output/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ environment:
99

1010
dependencies:
1111
cli_config: ^0.1.1
12-
native_assets_cli: ^0.4.1
12+
# native_assets_cli: ^0.4.1
13+
native_assets_cli:
14+
path: ../../../native_assets_cli/
1315
yaml: ^3.1.1
1416
yaml_edit: ^2.1.0
1517

pkgs/native_assets_builder/test_data/wrong_build_output_2/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ environment:
99

1010
dependencies:
1111
cli_config: ^0.1.1
12-
native_assets_cli: ^0.4.1
12+
# native_assets_cli: ^0.4.1
13+
native_assets_cli:
14+
path: ../../../native_assets_cli/
1315
yaml: ^3.1.1
1416
yaml_edit: ^2.1.0
1517

pkgs/native_assets_builder/test_data/wrong_build_output_3/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ environment:
99

1010
dependencies:
1111
cli_config: ^0.1.1
12-
native_assets_cli: ^0.4.1
12+
# native_assets_cli: ^0.4.1
13+
native_assets_cli:
14+
path: ../../../native_assets_cli/
1315
yaml: ^3.1.1
1416
yaml_edit: ^2.1.0
1517

pkgs/native_assets_builder/test_data/wrong_namespace_asset/pubspec_overrides.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)