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

[native_assets_cli] Fix system libraries and add documentation #1880

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

dcharkes
Copy link
Collaborator

Closes: #940
Closes: #1879

@github-actions github-actions bot added type-infra A repository infrastructure change or enhancement package:native_assets_cli package:native_assets_builder labels Jan 10, 2025
@dcharkes dcharkes changed the title [native_assets_cli] [doc] System libraries [native_assets_cli] Fix system libraries and add documentation Jan 10, 2025
Copy link

PR Health

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/jni/lib/src/third_party/generated_bindings.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

@coveralls
Copy link

Coverage Status

coverage: 87.72% (-0.008%) from 87.728%
when pulling bf27d78 on system-libraries-fix
into b7b8e00 on main.

@@ -198,7 +198,7 @@ void _validateCodeAssets(
}

final file = codeAsset.file;
if (file == null && !dryRun) {
if (file == null && !dryRun && _mustHaveFile(codeAsset.linkMode)) {
Copy link
Member

Choose a reason for hiding this comment

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

The fix is maybe 10 lines of code. All the other things in here are 350 lines of code. I think this is a huge burden to maintain. Why can't we have one simple package, that emits various kids of code assets and executes them at runtime? Then the test in this PR would be maybe 30 lines of code (10 for a hook, 10 for native declarations and 10 for invoking and checking) instead of 10x this. The tests would also run much faster. Any good argument that speaks against this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

350 lines:

  • Example to illustrate how this works, to cover a user journey for Mariam.
  • Integration test combines all the link modes that are not the bundling mode.

and executes them at runtime

Yeah, that's not going to work until the fix rolls in to Dart and Flutter, so that's why test_data/ is exercised in dartdev. I'll make sure we exercise it in Dartdev on the roll.

I think this is a huge burden to maintain.

Objection noted. Agree to disagree with refactoring tools at our disposal.

@auto-submit auto-submit bot merged commit a7fb6ee into main Jan 10, 2025
40 checks passed
@auto-submit auto-submit bot deleted the system-libraries-fix branch January 10, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants