Skip to content
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
41 changes: 0 additions & 41 deletions .github/workflows/files-changed.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .github/workflows/shorebird_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ jobs:
- name: 🐦 Run Flutter Tools Tests
# TODO(eseidel): Find a nice way to run this on windows.
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
# TODO(eseidel): We can't run all flutter_tools tests until we make
# our changes not throw exceptions on missing shorebird.yaml.
# https://github.com/shorebirdtech/shorebird/issues/2392
run: ../../bin/flutter test test/general.shard/shorebird
run: ../../bin/flutter test test/general.shard
working-directory: packages/flutter_tools

- name: 🐦 Run Shorebird Tests
Expand Down
2 changes: 1 addition & 1 deletion bin/internal/update_dart_sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if ((Test-Path $engineStamp) -and ($engineVersion -eq (Get-Content $engineStamp)

$dartSdkBaseUrl = $Env:FLUTTER_STORAGE_BASE_URL
if (-not $dartSdkBaseUrl) {
$dartSdkBaseUrl = "https://storage.googleapis.com"
$dartSdkBaseUrl = "https://download.shorebird.dev"
}
if ($engineRealm) {
$dartSdkBaseUrl = "$dartSdkBaseUrl/$engineRealm"
Expand Down
2 changes: 1 addition & 1 deletion dev/bots/post_process_docs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Future<void> postProcess() async {
await runProcessWithValidations(<String>[
'curl',
'-L',
'https://storage.googleapis.com/flutter_infra_release/flutter/$revision/api_docs.zip',
'https://download.shorebird.dev/flutter_infra_release/flutter/$revision/api_docs.zip',
'--output',
zipDestination,
'--fail',
Expand Down
2 changes: 1 addition & 1 deletion dev/bots/unpublish_package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import 'package:process/process.dart';
const String gsBase = 'gs://flutter_infra_release';
const String releaseFolder = '/releases';
const String gsReleaseFolder = '$gsBase$releaseFolder';
const String baseUrl = 'https://storage.googleapis.com/flutter_infra_release';
const String baseUrl = 'https://download.shorebird.dev/flutter_infra_release';

/// Exception class for when a process fails to run, so we can catch
/// it and provide something more readable than a stack trace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
def flutterStorageUrl = System.getenv("FLUTTER_STORAGE_BASE_URL") ?: "https://storage.googleapis.com"
def flutterStorageUrl = System.getenv("FLUTTER_STORAGE_BASE_URL") ?: "https://download.shorebird.dev"
maven {
url = uri("$flutterStorageUrl/download.flutter.io")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
val flutterStorageUrl = System.getenv("FLUTTER_STORAGE_BASE_URL") ?: "https://storage.googleapis.com"
val flutterStorageUrl = System.getenv("FLUTTER_STORAGE_BASE_URL") ?: "https://download.shorebird.dev"
maven("$flutterStorageUrl/download.flutter.io")
}
}
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/create_api_docs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ class PlatformDocGenerator {
for (final String platform in kPlatformDocs.keys) {
final String zipFile = kPlatformDocs[platform]!.zipName;
final String url =
'https://storage.googleapis.com/${realm}flutter_infra_release/flutter/$engineRevision/$zipFile';
'https://download.shorebird.dev/${realm}flutter_infra_release/flutter/$engineRevision/$zipFile';
await _extractDocs(url, platform, kPlatformDocs[platform]!, outputDir);
}
}
Expand Down
2 changes: 1 addition & 1 deletion engine/src/flutter/build/zip_bundle.gni
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ template("zip_bundle") {
license_path =
rebase_path("//flutter/sky/packages/sky_engine/LICENSE", "//flutter")
git_url = "https://github.com/flutter/engine/tree/$engine_version"
sky_engine_url = "https://storage.googleapis.com/flutter_infra_release/flutter/$engine_version/sky_engine.zip"
sky_engine_url = "https://download.shorebird.dev/flutter_infra_release/flutter/$engine_version/sky_engine.zip"
outputs = [ license_readme ]
contents = [
"# $target_name",
Expand Down
2 changes: 1 addition & 1 deletion engine/src/flutter/impeller/toolkit/interop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A single-header C API for 2D graphics and text rendering. [Impeller](../../READM
Users may plug in a custom toolchain into the Flutter Engine build system to build the `libimpeller.so` dynamic library. However, for the common platforms, the CI bots upload a tarball containing the library and headers. This URL for the SDK tarball for a particular platform can be constructed as follows:

```sh
https://storage.googleapis.com/flutter_infra_release/flutter/$FLUTTER_SHA/$PLATFORM_ARCH/impeller_sdk.zip
https://download.shorebird.dev/flutter_infra_release/flutter/$FLUTTER_SHA/$PLATFORM_ARCH/impeller_sdk.zip
```

The `$FLUTTER_SHA` is the Git hash in the [Flutter repository](https://github.com/flutter/flutter). The `$PLATFORM_ARCH` can be determined from the table below.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CopyArtifactsStep implements PipelineStep {
),
};
final Uri url = Uri.https(
'storage.googleapis.com',
'download.shorebird.dev',
'${realmComponent}flutter_infra_release/flutter/${realm == LuciRealm.Try ? gitRevision : contentHash}/flutter-web-sdk.zip',
);
final http.Response response = await http.Client().get(url);
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/gradle/aar_init_script.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void configureProject(Project project, String outputDir) {
return
}

String storageUrl = System.getenv('FLUTTER_STORAGE_BASE_URL') ?: "https://storage.googleapis.com"
String storageUrl = System.getenv('FLUTTER_STORAGE_BASE_URL') ?: "https://download.shorebird.dev"

String engineRealm = Paths.get(getFlutterRoot(project), "bin", "cache", "engine.realm")
.toFile().text.trim()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object FlutterPluginConstants {

const val INTERMEDIATES_DIR = "intermediates"
const val FLUTTER_STORAGE_BASE_URL = "FLUTTER_STORAGE_BASE_URL"
const val DEFAULT_MAVEN_HOST = "https://storage.googleapis.com"
const val DEFAULT_MAVEN_HOST = "https://download.shorebird.dev"

/** Maps platforms to ABI architectures. */
@JvmStatic val PLATFORM_ARCH_MAP =
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class Cache {
/// The base for URLs that store Flutter engine artifacts that are fetched
/// during the installation of the Flutter SDK.
///
/// By default the base URL is https://storage.googleapis.com. However, if
/// By default the base URL is https://download.shorebird.dev. However, if
/// `FLUTTER_STORAGE_BASE_URL` environment variable ([kFlutterStorageBaseUrl])
/// is provided, the environment variable value is returned instead.
///
Expand All @@ -530,7 +530,7 @@ class Cache {
String? overrideUrl = _platform.environment[kFlutterStorageBaseUrl];
if (overrideUrl == null) {
return storageRealm.isEmpty
? 'https://storage.googleapis.com'
? 'https://download.shorebird.dev'
: 'https://storage.googleapis.com/$storageRealm';
}
// Shorebird's artifact proxy is a trusted source.
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/http_host_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'doctor_validator.dart';
import 'features.dart';

/// Common Flutter HTTP hosts.
const kCloudHost = 'https://storage.googleapis.com/';
const kCloudHost = 'https://download.shorebird.dev/';
const kCocoaPods = 'https://cocoapods.org/';
const kGitHub = 'https://github.com/';
const kMaven = 'https://maven.google.com/';
Expand Down
14 changes: 14 additions & 0 deletions packages/flutter_tools/test/general.shard/base/build_test.dart

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine, but curious why it's necessary as part of a PR to remove the need to set FLUTTER_STORAGE_BASE_URL

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was originally to try and fix /bin/dart usage, I believe the tests also depend on it. It's possible I could have separated that out after I removed detect_changes.yml

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ const kDefaultClang = <String>[
'build/foo/snapshot_assembly.o',
];

// Shorebird link info arguments added for iOS/macOS builds.
// These correspond to the dumpLinkInfoArgs in AOTSnapshotter.build().
const kLinkInfoArgs = <String>[
'--print_class_table_link_debug_info_to=build/App.class_table.json',
'--print_class_table_link_info_to=build/App.ct.link',
'--print_field_table_link_debug_info_to=build/App.field_table.json',
'--print_field_table_link_info_to=build/App.ft.link',
'--print_dispatch_table_link_debug_info_to=build/App.dispatch_table.json',
'--print_dispatch_table_link_info_to=build/App.dt.link',
];

void main() {
group('GenSnapshot', () {
late GenSnapshot genSnapshot;
Expand Down Expand Up @@ -203,6 +214,7 @@ void main() {
command: <String>[
genSnapshotPath,
'--deterministic',
...kLinkInfoArgs,
'--snapshot_kind=app-aot-assembly',
'--assembly=$assembly',
'--dwarf-stack-traces',
Expand Down Expand Up @@ -278,6 +290,7 @@ void main() {
command: <String>[
genSnapshotPath,
'--deterministic',
...kLinkInfoArgs,
'--snapshot_kind=app-aot-assembly',
'--assembly=$assembly',
'--obfuscate',
Expand Down Expand Up @@ -349,6 +362,7 @@ void main() {
command: <String>[
genSnapshotPath,
'--deterministic',
...kLinkInfoArgs,
'--snapshot_kind=app-aot-assembly',
'--assembly=${fileSystem.path.join(outputPath, 'snapshot_assembly.S')}',
'main.dill',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ const kBoundaryKey = '4d2d9609-c662-4571-afde-31410f96caa6';
const kElfAot = '--snapshot_kind=app-aot-elf';
const kAssemblyAot = '--snapshot_kind=app-aot-assembly';

/// Generate Shorebird link info arguments for iOS/macOS AOT builds.
/// The [buildPath] should be the build directory path (outputDir.parent.path).
List<String> linkInfoArgsFor(String buildPath) => <String>[
'--print_class_table_link_debug_info_to=$buildPath/App.class_table.json',
'--print_class_table_link_info_to=$buildPath/App.ct.link',
'--print_field_table_link_debug_info_to=$buildPath/App.field_table.json',
'--print_field_table_link_info_to=$buildPath/App.ft.link',
'--print_dispatch_table_link_debug_info_to=$buildPath/App.dispatch_table.json',
'--print_dispatch_table_link_info_to=$buildPath/App.dt.link',
];

final Platform macPlatform = FakePlatform(
operatingSystem: 'macos',
environment: <String, String>{},
Expand Down Expand Up @@ -803,6 +814,7 @@ void main() {
// This path is not known by the cache due to the iOS gen_snapshot split.
'Artifact.genSnapshotArm64.TargetPlatform.ios.profile',
'--deterministic',
...linkInfoArgsFor(build),
'--write-v8-snapshot-profile-to=code_size_1/snapshot.arm64.json',
'--trace-precompiler-to=code_size_1/trace.arm64.json',
kAssemblyAot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ import '../../../src/fake_process_manager.dart';
import '../../../src/fakes.dart';
import '../../../src/package_config.dart';

/// Generate Shorebird link info arguments for iOS/macOS AOT builds.
/// The [buildPath] should be the build directory path (outputDir.parent.path).
List<String> linkInfoArgsFor(String buildPath) => <String>[
'--print_class_table_link_debug_info_to=$buildPath/App.class_table.json',
'--print_class_table_link_info_to=$buildPath/App.ct.link',
'--print_field_table_link_debug_info_to=$buildPath/App.field_table.json',
'--print_field_table_link_info_to=$buildPath/App.ft.link',
'--print_dispatch_table_link_debug_info_to=$buildPath/App.dispatch_table.json',
'--print_dispatch_table_link_info_to=$buildPath/App.dt.link',
];

void main() {
late Environment environment;
late MemoryFileSystem fileSystem;
Expand Down Expand Up @@ -811,28 +822,36 @@ void main() {
environment.defines[kXcodeAction] = 'install';
environment.defines[kFlavor] = 'internal';

// Set up engine artifacts
fileSystem
.file('bin/cache/artifacts/engine/darwin-x64/vm_isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem
.file('bin/cache/artifacts/engine/darwin-x64/isolate_snapshot.bin')
.createSync(recursive: true);

// Set up App.framework binary
fileSystem
.file(fileSystem.path
.join(environment.buildDir.path, 'App.framework', 'App'))
.createSync(recursive: true);
final String shorebirdYamlPath = fileSystem.path.join(
environment.buildDir.path,
'App.framework',
'Versions',
'A',
'Resources',
'flutter_assets',
'shorebird.yaml',
);
fileSystem.file(fileSystem.path
.join(environment.buildDir.path, 'App.framework', 'App'))
..createSync(recursive: true)

// Set up native_assets.json (required by MacOSBundleFlutterAssets)
environment.buildDir.childFile('native_assets.json').createSync();

// Set up pubspec.yaml with shorebird.yaml as an asset
fileSystem.file('pubspec.yaml')
..createSync()
..writeAsStringSync('''
name: example
flutter:
assets:
- shorebird.yaml
''');

// Create the shorebird.yaml asset file
fileSystem.file('shorebird.yaml')
..createSync()
..writeAsStringSync('''
# Some other text that should be removed
app_id: base-app-id
Expand All @@ -841,8 +860,21 @@ flavors:
stable: stable-app-id
''');

// Set up package config
writePackageConfigFiles(directory: fileSystem.currentDirectory, mainLibName: 'example');

await const ReleaseMacOSBundleFlutterAssets().build(environment);

// The output is in environment.outputDir, not buildDir
final String shorebirdYamlPath = fileSystem.path.join(
environment.outputDir.path,
'App.framework',
'Versions',
'A',
'Resources',
'flutter_assets',
'shorebird.yaml',
);
expect(fileSystem.file(shorebirdYamlPath).readAsStringSync(),
'app_id: internal-app-id');
},
Expand Down Expand Up @@ -912,11 +944,13 @@ flavors:
.childFile('x86_64/App.framework.dSYM/Contents/Resources/DWARF/App')
.createSync(recursive: true);

final build = environment.buildDir.path;
processManager.addCommands(<FakeCommand>[
FakeCommand(
command: <String>[
'Artifact.genSnapshotArm64.TargetPlatform.darwin.release',
'--deterministic',
...linkInfoArgsFor(build),
'--snapshot_kind=app-aot-assembly',
'--assembly=${environment.buildDir.childFile('arm64/snapshot_assembly.S').path}',
environment.buildDir.childFile('app.dill').path,
Expand All @@ -926,6 +960,7 @@ flavors:
command: <String>[
'Artifact.genSnapshotX64.TargetPlatform.darwin.release',
'--deterministic',
...linkInfoArgsFor(build),
'--snapshot_kind=app-aot-assembly',
'--assembly=${environment.buildDir.childFile('x86_64/snapshot_assembly.S').path}',
environment.buildDir.childFile('app.dill').path,
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/test/general.shard/cache_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ void main() {
expect(messages, <String>['Downloading Web SDK...']);

expect(downloads, <String>[
'https://storage.googleapis.com/flutter_infra_release/flutter/hijklmnop/flutter-web-sdk.zip',
'https://download.shorebird.dev/flutter_infra_release/flutter/hijklmnop/flutter-web-sdk.zip',
]);

expect(locations, <String>['/bin/cache/flutter_web_sdk']);
Expand Down Expand Up @@ -1067,7 +1067,7 @@ void main() {
expect(messages, <String>['Downloading engine information...']);

expect(downloads, <String>[
'https://storage.googleapis.com/flutter_infra_release/flutter/hijklmnop/engine_stamp.json',
'https://download.shorebird.dev/flutter_infra_release/flutter/hijklmnop/engine_stamp.json',
]);
expect(locations, <String>['/bin/cache']);
// file copy is done by the real uploader; not the fake.
Expand Down
14 changes: 14 additions & 0 deletions packages/flutter_tools/test/general.shard/version_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ void main() {
required int commitsBetweenRefs,
}) {
return [
// Shorebird release branch check (returns empty to fall through to
// regular version lookup).
FakeCommand(
command: [
'git',
'for-each-ref',
'--contains',
headRef,
'--format',
'%(refname:short)',
'refs/remotes/origin/flutter_release/*',
],
stdout: '',
),
FakeCommand(
command: const [
'git',
Expand Down