dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
153 stars 43 forks source link

[native_assets_cli] Provide an easier way to re(run) builds #544

Open dcharkes opened 11 months ago

dcharkes commented 11 months ago

Currently the only way to rerun a native assets build build is to invoke: dart path/to/build.dart --config=.dart_tool/native_assets_builder/<some-hash>/config.yaml. This command is printed when a native build fails if -v was passed. Maybe we could provide a better way to run builds.

Possibly: dart run native_assets_cli:build --package=my_package --os=.. --arch=... by adding a bin script to package:native_assets_cli.

@mosuem Did you have any other ideas?

mosuem commented 11 months ago

dart run native_assets_cli:build should not have any required args, os, arch etc. could have sensible defaults such as the users system.

dcharkes commented 11 months ago

And I guess --package should just default to the current root package as well.

And --link-mode to dynamic library.

And this should live in package:native_assets_cli instead of native_assets_builder, because users wont depend on the latter.

dcharkes commented 11 months ago

When we implement this feature, we should either wire it up to https://github.com/dart-lang/sdk/issues/52992, or close that issue as wontfix.