Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release 3.19.x #5

Merged
merged 6 commits into from
Mar 13, 2024
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
89 changes: 89 additions & 0 deletions .github/workflows/build_with_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build With Tag

on:
workflow_dispatch:
inputs:
version:
description: 'input dart version here(should be >= 3.3.0)'
required: true
default: '3.3.0'
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
Release:
strategy:
matrix:
os: [macos-latest, windows-latest, macos-14]
include:
- os: macos-latest
output: darwin_x64
- os: windows-latest
output: windows_x64
- os: macos-14
output: darwin_arm64
runs-on: ${{ matrix.os }}

steps:
- name: Check Inputs (macos)
if: matrix.os != 'windows-latest'
run: |
if [[ ${{ inputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "${{ inputs.version }} is a version number"
else
echo "${{ inputs.version }} is not a version number"
exit 1
fi

- name: Check Inputs (windows)
if: matrix.os == 'windows-latest'
run: |
$tag = "${{ inputs.version }}"
if ($tag -match '^\d+\.\d+\.\d+$') {
Write-Output "$tag is a version number"
} else {
Write-Output "$tag is not a version number"
exit 1
}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GIOSDK_PAT }}

- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ inputs.version }}

- name: Checkout Dart SDK
run: |
git clone --depth 1 --branch ${{ inputs.version }} https://github.com/dart-lang/sdk.git
cd sdk
git apply --ignore-space-change --ignore-whitespace "../dart_flutter.patch"

- name: Install Dependencies
run: |
dart pub get
mkdir build
mkdir build/${{ matrix.output }}

- name: Generate Snapshot
if: matrix.os == 'macos-latest'
working-directory: ./lib/flutter_frontend_server
run: |
dart --deterministic --snapshot=frontend_server.dart.snapshot frontend_server_starter.dart
cp frontend_server.dart.snapshot ../../build/frontend_server.dart.snapshot

- name: Generate AOT Snapshot
working-directory: ./lib/flutter_frontend_server
run: |
dart compile aot-snapshot frontend_server_starter.dart
cp frontend_server_starter.aot ../../build/${{ matrix.output }}/frontend_server_aot.dart.snapshot

- uses: actions/upload-artifact@v4
with:
name: snapshots-${{ matrix.output }}
path: build
4 changes: 2 additions & 2 deletions dart_flutter.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/pkg/vm/lib/target/flutter.dart b/pkg/vm/lib/target/flutter.dart
index 8bdde3d4201..8473a3fa020 100644
index 0ed541a8817..3d3994f324b 100644
--- a/pkg/vm/lib/target/flutter.dart
+++ b/pkg/vm/lib/target/flutter.dart
@@ -9,11 +9,18 @@ import 'package:kernel/target/targets.dart';
Expand All @@ -21,7 +21,7 @@ index 8bdde3d4201..8473a3fa020 100644
@override
String get name => 'flutter';

@@ -61,6 +68,14 @@ class FlutterTarget extends VmTarget {
@@ -58,6 +65,14 @@ class FlutterTarget extends VmTarget {
DiagnosticReporter diagnosticReporter,
{void Function(String msg)? logger,
ChangedStructureNotifier? changedStructureNotifier}) {
Expand Down
14 changes: 11 additions & 3 deletions lib/flutter_frontend_server/flutter_frontend_compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,20 @@ class FlutterFrontendCompiler implements frontend.CompilerInterface {
{frontend.BinaryPrinterFactory? printerFactory,
frontend.ProgramTransformer? transformer,
bool? unsafePackageSerialization,
bool? incrementalSerialization,
bool incrementalSerialization = true,
bool useDebuggerModuleNames = false,
bool emitDebugMetadata = false,
bool emitDebugSymbols = false})
bool emitDebugSymbols = false,
bool canaryFeatures = false,})
: _compiler = frontend.FrontendCompiler(outputStream,
printerFactory: printerFactory,
transformer: transformer,
unsafePackageSerialization: unsafePackageSerialization,
incrementalSerialization: incrementalSerialization,
useDebuggerModuleNames: useDebuggerModuleNames,
emitDebugMetadata: emitDebugMetadata,
unsafePackageSerialization: unsafePackageSerialization);
emitDebugSymbols: emitDebugSymbols,
canaryFeatures: canaryFeatures);

@override
Future<bool> compile(String filename, ArgResults options,
Expand Down Expand Up @@ -96,6 +100,8 @@ class FlutterFrontendCompiler implements frontend.CompilerInterface {
String libraryUri,
String? klass,
String? method,
int offset,
String? scriptUri,
bool isStatic) {
return _compiler.compileExpression(
expression,
Expand All @@ -107,6 +113,8 @@ class FlutterFrontendCompiler implements frontend.CompilerInterface {
libraryUri,
klass,
method,
offset,
scriptUri,
isStatic);
}

Expand Down
Binary file not shown.
22 changes: 15 additions & 7 deletions lib/flutter_frontend_server/starter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
// BSD-style license that can be found in the LICENSE.md file.

import 'dart:async';
import 'dart:io' show Directory, File, InternetAddress, stdin;
import 'dart:io' show Directory, File, InternetAddress, Socket, stdin;

import 'package:args/args.dart';
import 'package:path/path.dart' as path;
import 'package:vm/incremental_compiler.dart' show IncrementalCompiler;

import 'package:frontend_server/frontend_server.dart';
import 'package:frontend_server/src/binary_protocol.dart';
import 'package:frontend_server/src/resident_frontend_server.dart';

import 'flutter_frontend_compiler.dart';

Expand All @@ -36,14 +37,21 @@ Future<int> starter(
return 1;
}

if (options['resident-info-file-name'] != null) {
StreamSubscription<Socket>? serverSubscription =
await residentListenAndCompile(InternetAddress.loopbackIPv4, 0,
File(options['resident-info-file-name']));
return serverSubscription == null ? 1 : 0;
}

if (options['train']) {
if (options.rest.isEmpty) {
throw Exception('Must specify input.dart');
}

final String input = options.rest[0];
final String sdkRoot = options['sdk-root'];
//final String? platform = options['platform'];
final String? platform = options['platform'];
final Directory temp =
Directory.systemTemp.createTempSync('train_frontend_server');
try {
Expand All @@ -55,11 +63,10 @@ Future<int> starter(
'--output-dill=$outputTrainingDill',
'--target=flutter',
'--track-widget-creation',
'--enable-asserts',
];
// if (platform != null) {
// args.add('--platform=${Uri.file(platform)}');
// }
if (platform != null) {
args.add('--platform=${Uri.file(platform)}');
}
options = argParser.parse(args);
// compiler ??= FrontendCompiler(output, printerFactory: binaryPrinterFactory);
compiler ??= FlutterFrontendCompiler(output,printerFactory: binaryPrinterFactory);
Expand Down Expand Up @@ -91,7 +98,8 @@ Future<int> starter(
incrementalSerialization: options["incremental-serialization"],
useDebuggerModuleNames: options['debugger-module-names'],
emitDebugMetadata: options['experimental-emit-debug-metadata'],
emitDebugSymbols: options['emit-debug-symbols']);
emitDebugSymbols: options['emit-debug-symbols'],
canaryFeatures: options['dartdevc-canary'],);

if (options.rest.isNotEmpty) {
return await compiler.compile(options.rest[0], options,
Expand Down
46 changes: 23 additions & 23 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,61 @@ environment:
sdk: '>=2.18.5 <3.0.0'

dependencies:
analyzer: ^5.3.1
analyzer: ^6.4.1
args: ^2.3.1
bazel_worker: ^1.0.2
coverage: ^1.6.1
bazel_worker: ^1.1.1
coverage: ^1.7.2
fixnum: ^1.0.1
http_parser: ^4.0.2
matcher: ^0.12.13
mime: ^1.0.3
node_preamble: ^2.0.1
protobuf: ^2.1.0
protobuf: ^3.1.0
quiver: ^3.1.0
shelf: ^1.4.0
shelf_packages_handler: ^3.0.1
shelf_static: ^1.1.1
shelf_web_socket: ^1.0.3
vm_service: ^9.4.0
vm_service: ^14.1.0
yaml: ^3.1.1

dev_dependencies:
lints: ^2.0.0
lints: ^3.0.0
test: ^1.22.1

dependency_overrides:
kernel:
path: /Users/growingio/Desktop/sdk/pkg/kernel
path: ./sdk/pkg/kernel
meta:
path: /Users/growingio/Desktop/sdk/pkg/meta
path: ./sdk/pkg/meta
frontend_server:
path: /Users/growingio/Desktop/sdk/pkg/frontend_server
path: ./sdk/pkg/frontend_server
front_end:
path: /Users/growingio/Desktop/sdk/pkg/front_end
path: ./sdk/pkg/front_end
dart2js_info:
path: /Users/growingio/Desktop/sdk/pkg/dart2js_info
path: ./sdk/pkg/dart2js_info
dev_compiler:
path: /Users/growingio/Desktop/sdk/pkg/dev_compiler
path: ./sdk/pkg/dev_compiler
_fe_analyzer_shared:
path: /Users/growingio/Desktop/sdk/pkg/_fe_analyzer_shared
path: ./sdk/pkg/_fe_analyzer_shared
js_shared:
path: /Users/growingio/Desktop/sdk/pkg/js_shared
path: ./sdk/pkg/js_shared
build_integration:
path: /Users/growingio/Desktop/sdk/pkg/build_integration
path: ./sdk/pkg/build_integration
_js_interop_checks:
path: /Users/growingio/Desktop/sdk/pkg/_js_interop_checks
path: ./sdk/pkg/_js_interop_checks
package_config: any
compiler:
path: /Users/growingio/Desktop/sdk/pkg/compiler
path: ./sdk/pkg/compiler
js_runtime:
path: /Users/growingio/Desktop/sdk/pkg/js_runtime
path: ./sdk/pkg/js_runtime
js_ast:
path: /Users/growingio/Desktop/sdk/pkg/js_ast
path: ./sdk/pkg/js_ast
vm:
path: /Users/growingio/Desktop/sdk/pkg/vm
path: ./sdk/pkg/vm
dart2wasm:
path: /Users/growingio/Desktop/sdk/pkg/dart2wasm
path: ./sdk/pkg/dart2wasm
wasm_builder:
path: /Users/growingio/Desktop/sdk/pkg/wasm_builder
path: ./sdk/pkg/wasm_builder
mmap:
path: /Users/growingio/Desktop/sdk/pkg/mmap
path: ./sdk/pkg/mmap