Skip to content

[code_assets] Support custom target OS and Architecture#3413

Open
dcharkes wants to merge 1 commit into
code-assets-close-link-modefrom
code-assets-custom-os
Open

[code_assets] Support custom target OS and Architecture#3413
dcharkes wants to merge 1 commit into
code-assets-close-link-modefrom
code-assets-custom-os

Conversation

@dcharkes

@dcharkes dcharkes commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Closes: #3411

Closes: #1258

Enables

extension OhosOS on OS {
  static final ohos = OS.fromString('ohos');
}

to work properly.

The other open enums in the JSON schema that were not open in the Dart API:

  • architecture
  • sanitizer

Link mode and link mode preference should be closed:

If we were to add code assets already presigned and prepackaged in xcodeframeworks for example, it would be a new asset type, rather than new option for the existing asset type.

Because we don't have a pub workspace for FFIgen and JNIgen with the other packages, we now need many more pubspec overrides. Basically before it was kinda working without a complete set of overrides because the inconsistent set of deps (half from the repo, half from pub) managed to resolve. This is no longer true with pushing code_assets to v2.0.0.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

PR Health

Breaking changes ⚠️
Package Change Current Version New Version Needed Version Looking good?
hooks Non-Breaking 2.0.2 2.1.0-wip 2.1.0-wip ✔️
code_assets Non-Breaking 1.2.1 2.0.0-wip 2.0.0-wip ✔️
hooks_runner Non-Breaking 1.5.0 1.6.0-wip 1.6.0-wip ✔️
native_toolchain_c Non-Breaking 0.19.2 0.19.3-wip 0.19.3-wip ✔️
objective_c Non-Breaking 9.4.1 9.4.2 9.5.0
Got "9.4.2" expected >= "9.5.0" (non-breaking changes)
⚠️

This check can be disabled by tagging the PR with skip-breaking-check.

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 symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Package publishing

If you have publishing permissions, you can use the links below to publish the changes after merging this PR.

Package Version Status Publish tag (post-merge)
package:code_assets 2.0.0 ready to publish code_assets-v2.0.0
package:data_assets 0.20.0 already published at pub.dev
package:ffi 2.2.0 already published at pub.dev
package:hooks 2.0.2 already published at pub.dev
package:hooks_runner 1.6.0-wip WIP (no publish necessary)
package:jni_flutter 1.0.1 already published at pub.dev
package:jni_util 1.0.0-wip WIP (no publish necessary)
package:native_toolchain_c 0.19.3-wip WIP (no publish necessary)
package:record_use 0.6.1-wip WIP (no publish necessary)
package:swift2objc 0.2.0 already published at pub.dev
package:swiftgen 0.1.3-wip WIP (no publish necessary)

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@dcharkes
dcharkes force-pushed the code-assets-custom-os branch 2 times, most recently from 0dfe2f3 to 27eeaef Compare June 9, 2026 07:39
@dcharkes
dcharkes force-pushed the code-assets-custom-os branch from 27eeaef to 4d6c36c Compare June 9, 2026 16:22
Comment thread pkgs/code_assets/CHANGELOG.md
Comment thread pkgs/ffigen/example/c_json/pubspec.yaml Outdated
Comment thread tool/ci.dart
@dcharkes

Copy link
Copy Markdown
Collaborator Author

@goderbauer I'm not entirely sure what to do with link mode preference and link mode:

  • Extensibility of link mode is somewhat problematic, because it's likely more than a string. And it's not namespaced with a package. So different third_parties (or us) might not agree on what fields the link mode should have.
  • Introducing new link modes is also problematic, because we don't communicate in the protocol which link modes are supported yes or no. So a packages' link hook doesn't know if they emit something in a specific link mode.
  • And introducing link mode preferences will not work either.

If we decide to lock it down, then the way to add something later from our side would be to make a new asset type package:code_assets/code_asset_v2. And have new link modes there.

And I can't think of a link mode we would add in the first place.

WDYT about locking it down instead of making it extensible?

@dcharkes
dcharkes requested a review from goderbauer June 22, 2026 06:54
@goderbauer

Copy link
Copy Markdown
Contributor

WDYT about locking it down instead of making it extensible?

Yeah, given that it is highly questionable that we'll ever add another mode (famous last words): Let's lock it down.

@dcharkes

dcharkes commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@dcharkes
dcharkes force-pushed the code-assets-custom-os branch from 23dc6db to 761c686 Compare July 9, 2026 10:43
@dcharkes

dcharkes commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

WDYT about locking it down instead of making it extensible?

Yeah, given that it is highly questionable that we'll ever add another mode (famous last words): Let's lock it down.

Made a separate PR for this:

@dcharkes
dcharkes force-pushed the code-assets-custom-os branch from 761c686 to 6ce683f Compare July 10, 2026 07:32
@dcharkes
dcharkes changed the base branch from main to code-assets-close-link-mode July 10, 2026 07:32
@dcharkes
dcharkes force-pushed the code-assets-close-link-mode branch from fa60898 to 0a837af Compare July 10, 2026 07:33
@dcharkes
dcharkes force-pushed the code-assets-custom-os branch from 6ce683f to 009567e Compare July 10, 2026 07:39
@dcharkes
dcharkes force-pushed the code-assets-custom-os branch from 009567e to 4f941ad Compare July 10, 2026 07:53

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code_assets] Make Architecture and OS extensible [native_assets_cli] Non-predefined targetOS

2 participants