Commit Graph

8 Commits

Author SHA1 Message Date
Moritz 182a20f835 Fix failing tests in pkg:native
Rev the import and fix the tests in pkg:dartdev to reflect recent refactorings.


Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try

Change-Id: If3df36284b1a324cbdc94b709008891b1f3d756f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341221
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2023-12-13 11:00:41 +00:00
Daco Harkes 363f07e89a [native_assets] Pass the runPackage
Pass which package is being run from `dart run` to native assets
builds. This means `dart run ffigen --config=ffigen.yaml` does not
need to build native assets of the root package.

Note the special treatment for `dart run test` to behave as
`dart test`: it does need the native assets for the root package.

Rolls native packages to get the new parameter.

Bug: https://github.com/dart-lang/native/issues/822
Change-Id: I7ed89b2b7251341278ee7d9cecd29924063cb0bb
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339124
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-12-01 21:09:02 +00:00
Daco Harkes 72f847f458 [dartdev] Error on dart compile if native assets build fails
`dart run` and `dart build` already checked.

`dart compile` only checked if there are no native assets. However,
it should also error if native assets builds failed, as there could
have been native assets resulting from those builds.

Change-Id: Id90eb9b58675856421b793b271bf627506effe3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334223
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-11-08 11:13:10 +00:00
Tess Strickland a4cb6abdb4 [pkg/dartdev] Autodetect target OS when compiling to an executable.
Report an error if compiling to an executable and the user attempts
a cross-OS compilation, that is, the user provides a '--target-os'
argument that does not match the host OS.

For AOT snapshots, no target OS is autodetected, so the default
output is OS agnostic, and cross-OS compilation is allowed.

Add '--target-os' as a command line option to 'dart build', with
the same restrictions as 'dart compile'.

Also removes test restrictions that were added for
https://github.com/dart-lang/sdk/issues/51707, which has since
been closed.

TEST=pkg/dartdev/test/commands/compile_test
     pkg/dartdev/test/native_assets/build_test

Fixes https://github.com/dart-lang/sdk/issues/53247

Change-Id: Ieb82d0d25736b0036c5579d25ca29c8834b789b7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322341
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-08-25 10:40:52 +00:00
Daco Harkes 72dd200f8a [pkg][dartdev] Error on native assets but not enabled
And only print logs if `-v` is passed.

TEST=pkg/dartdev/test/native_assets/

Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: Iccf879c80ea01cb39f9dd0d13c2f515a885d11d2
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314721
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Hossein Yousefi <yousefi@google.com>
2023-07-24 11:25:06 +00:00
Daco Harkes bd1bad7afc [deps/ffi] Unbundle package:native_assets_builder
The Dart SDK CL for https://github.com/dart-lang/native/pull/69.

Bug: https://github.com/dart-lang/native/issues/67
Change-Id: I45d7ac691a6aaa41bce5be0e36403021a948bb4f
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311740
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2023-06-28 09:09:09 +00:00
Daco Harkes b5ee6fa888 [vm/ffi] Support native assets in dart build with relative path
`ResolveUri` in the VM works on Uris, not on paths.
Add `file://` to complete the uri with a schema, and remove `file://`
again before calling dlopen.

TEST=pkg/dartdev/test/native_assets/build_test.dart
Added a relative path run.

Closes: https://github.com/dart-lang/sdk/issues/52614
Change-Id: Ib253f530b9edecb69ba1ec2269874fdfc2693b37
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307460
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Hossein Yousefi <yousefi@google.com>
2023-06-06 09:41:02 +00:00
Daco Harkes e1ae1b48ae [vm/ffi] dartdev CLI native-assets
This CL introduces native assets suport for `dart run` and introduces
`dart build` which is similar to `dart compile` but outputs a folder
instead to that native assets can be bundled with an executable.

Change-Id: Ib6cfb95539f0adee46c99e531e440928c3f72f2b
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267340
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-05-30 09:10:28 +00:00