Skip to content

Remove v1.0 / v1.1 serialization format code. Require 3.6.0+ (which has newest serialization format) via increased Dart SDK constraint #1592

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

Merged
merged 8 commits into from
Sep 25, 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
3 changes: 0 additions & 3 deletions .github/workflows/native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ jobs:
- run: dart pub get -C test_data/native_add_duplicate/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_add_v1_0_0/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_add_add_source/
if: ${{ matrix.package == 'native_assets_builder' }}

Expand Down
1 change: 1 addition & 0 deletions pkgs/native_assets_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
hooks to prevent concurrency issues with shared output caching.
- Fix test packages with RecordUse annotations
[#1586](https://github.com/dart-lang/native/issues/1586).
- Update SDK constraint to 3.5.0+

## 0.8.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,6 @@ ${result.stdout}

try {
final output = HookOutputImpl.readFromFile(file: config.outputFile) ??
(config.outputFileV1_1_0 == null
? null
: HookOutputImpl.readFromFile(file: config.outputFileV1_1_0!)) ??
HookOutputImpl();

final validateResult = await validate(
Expand Down
2 changes: 1 addition & 1 deletion pkgs/native_assets_builder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_bui
publish_to: none

environment:
sdk: '>=3.3.0 <4.0.0'
sdk: '>=3.5.0 <4.0.0'

dependencies:
collection: ^1.18.0
Expand Down
34 changes: 0 additions & 34 deletions pkgs/native_assets_builder/test/build_runner/v1_0_0_test.dart

This file was deleted.

8 changes: 0 additions & 8 deletions pkgs/native_assets_builder/test_data/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@
- fail_on_os_sdk_version_linker/pubspec.yaml
- fail_on_os_sdk_version/hook/build.dart
- fail_on_os_sdk_version/pubspec.yaml
- native_add_v1_0_0/build.dart
- native_add_v1_0_0/ffigen.yaml
- native_add_v1_0_0/lib/native_add.dart
- native_add_v1_0_0/lib/src/native_add_bindings_generated.dart
- native_add_v1_0_0/lib/src/native_add.dart
- native_add_v1_0_0/pubspec.yaml
- native_add_v1_0_0/src/native_add.c
- native_add_v1_0_0/src/native_add.h
- native_add/ffigen.yaml
- native_add/hook/build.dart
- native_add/lib/native_add.dart
Expand Down
32 changes: 0 additions & 32 deletions pkgs/native_assets_builder/test_data/native_add_v1_0_0/build.dart

This file was deleted.

20 changes: 0 additions & 20 deletions pkgs/native_assets_builder/test_data/native_add_v1_0_0/ffigen.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 4 additions & 1 deletion pkgs/native_assets_cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
## 0.8.1-wip
## 0.9.0-wip

- Add `BuildConfig` and `LinkConfig` `outputDirectoryShared`.
- Remove `package:native_assets_cli/locking.dart` with `runUnderDirectoryLock`.
Hook writers should not use this, the `native_assets_builder` does this.
- Fix example packages with RecordUse annotations
[#1586](https://github.com/dart-lang/native/issues/1586).
- Remove v1.0 / v1.1 related serialization
- Update SDK constraint to 3.5.0+
- Remove (deprecated) support for accepting yaml as config

## 0.8.0

Expand Down
1 change: 0 additions & 1 deletion pkgs/native_assets_cli/lib/src/api/asset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import 'package:pub_semver/pub_semver.dart';

import '../model/target.dart';
import '../utils/json.dart';
import '../utils/map.dart';
import 'architecture.dart';
Expand Down
1 change: 0 additions & 1 deletion pkgs/native_assets_cli/lib/src/api/build_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'dart:io';

import 'package:collection/collection.dart';
import 'package:pub_semver/pub_semver.dart';
import 'package:yaml/yaml.dart' show loadYaml;

import '../model/dependencies.dart';
import '../model/metadata.dart';
Expand Down
1 change: 0 additions & 1 deletion pkgs/native_assets_cli/lib/src/model/asset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ abstract final class AssetImpl implements Asset {
final type = jsonMap[NativeCodeAssetImpl.typeKey];
switch (type) {
case NativeCodeAsset.type:
case null: // Backwards compatibility with v1.0.0.
assets.add(NativeCodeAssetImpl.fromJson(jsonMap));
case DataAsset.type:
assets.add(DataAssetImpl.fromJson(jsonMap));
Expand Down
9 changes: 1 addition & 8 deletions pkgs/native_assets_cli/lib/src/model/build_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig {
}

@override
String get outputName =>
version > Version(1, 1, 0) ? 'build_output.json' : outputNameV1_1_0;

@override
String get outputNameV1_1_0 => 'build_output.yaml';
String get outputName => 'build_output.json';

@override
Object? metadatum(String packageName, String key) {
Expand All @@ -36,9 +32,6 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig {

@override
bool get linkingEnabled {
if (version <= Version(1, 2, 0)) {
return false;
}
if (version == Version(1, 3, 0)) {
return true;
}
Expand Down
14 changes: 3 additions & 11 deletions pkgs/native_assets_cli/lib/src/model/hook_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ abstract class HookConfigImpl implements HookConfig {
/// Makes newer build hooks work with older Dart SDKs.
String get outputName;

/// Legacy output file name.
///
/// Older build hooks output a yaml file, ignoring the newer protocol version
/// in the config.
String? get outputNameV1_1_0;

HookConfigImpl({
required this.hook,
required this.outputDirectory,
Expand Down Expand Up @@ -157,10 +151,6 @@ abstract class HookConfigImpl implements HookConfig {

Uri get outputFile => outputDirectory.resolve(outputName);

Uri? get outputFileV1_1_0 => outputNameV1_1_0 == null
? null
: outputDirectory.resolve(outputNameV1_1_0!);

// This is currently overriden by [BuildConfig], do account for older versions
// still using a top-level build.dart.
Uri get script => packageRoot.resolve('hook/').resolve(hook.scriptName);
Expand Down Expand Up @@ -484,7 +474,9 @@ can _only_ depend on OS.''');
if (other.targetOS != targetOS) return false;
if (other.linkModePreference != linkModePreference) return false;
if (!const DeepCollectionEquality()
.equals(other.supportedAssetTypes, supportedAssetTypes)) return false;
.equals(other.supportedAssetTypes, supportedAssetTypes)) {
return false;
}
if (!dryRun) {
if (other.buildMode != buildMode) return false;
if (other.targetArchitecture != targetArchitecture) return false;
Expand Down
Loading