-
Notifications
You must be signed in to change notification settings - Fork 54
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
[infra] Use Pub Workspaces #1884
base: main
Are you sure you want to change the base?
Conversation
@dcharkes The ## Pin ffigen version because we are depending on internal APIs.
ffigen: 8.0.2 But the current ffigen version is Edit: I bumped the dependency in |
Possibly silly question, but does this require a pubspec bump and changelog addition? |
I tried running $ dart tool\generate_ffi_bindings.dart
INFO: Generating C wrappers
Unknown type ffi.UnsignedInt for return type I tracked that down to these lines in String jValueGetterOf(String returnType) {
const getters = {
'jboolean': 'z',
'jbyte': 'b',
'jshort': 's',
'jchar': 'c',
'jint': 'i',
'jsize': 'i', // jsize is an alias to jint
'jfloat': 'f',
'jlong': 'j',
'jdouble': 'd',
'jobject': 'l',
'jweak': 'l',
'jarray': 'l',
'jstring': 'l',
'jthrowable': 'l',
};
if (!getters.containsKey(returnType)) {
stderr.writeln('Unknown type $returnType for return type');
exit(1);
}
return getters[returnType]!;
} Seems it's expecting some Java-y value and is getting a C-ish value instead. Any idea why this is happening? And should I be fixing it in this PR? I'm concerned it happened due to changing the version of |
Looking at the blame for that file, this test has been broken for over a year. I'll need to fix it later. Filed a bug: #1889 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ffigen and objective_c changes LGTM, but there are some CI failures (all infra stuff)
Does the GitHub action support using the master channel? It's all about quick feedback. The |
Done, switched to Flutter's
Done. I had to add Error outputNull check operator used on a null value
#0 VisualStudioResolver.resolve (package:native_toolchain_c/src/native_toolchain/msvc.dart:283:65)
<asynchronous suspension>
#1 RelativeToolResolver.resolve (package:native_toolchain_c/src/tool/tool_resolver.dart:259:32)
<asynchronous suspension>
#2 PathVersionResolver.resolve (package:native_toolchain_c/src/tool/tool_resolver.dart:151:27)
<asynchronous suspension>
#3 RelativeToolResolver.resolve (package:native_toolchain_c/src/tool/tool_resolver.dart:259:32)
<asynchronous suspension>
#4 CliVersionResolver.resolve (package:native_toolchain_c/src/tool/tool_resolver.dart:91:27)
<asynchronous suspension>
#5 CompilerResolver._tryLoadToolFromNativeToolchain (package:native_toolchain_c/src/cbuilder/compiler_resolver.dart:117:23)
<asynchronous suspension>
#6 CompilerResolver.resolveCompiler (package:native_toolchain_c/src/cbuilder/compiler_resolver.dart:45:18)
<asynchronous suspension>
#7 RunCBuilder.compiler (package:native_toolchain_c/src/cbuilder/run_cbuilder.dart:84:44)
<asynchronous suspension>
#8 RunCBuilder.run (package:native_toolchain_c/src/cbuilder/run_cbuilder.dart:115:50)
<asynchronous suspension>
#9 CBuilder.run (package:native_toolchain_c/src/cbuilder/cbuilder.dart:162:7)
<asynchronous suspension>
#10 main.<anonymous closure> (file:///c:/users/levi/appdata/local/temp/7d1c4bb/native_add_version_skew/hook/build.dart:19:5)
<asynchronous suspension>
#11 build (package:native_assets_cli/src/api/build.dart:101:3)
<asynchronous suspension>
#12 main (file:///c:/users/levi/appdata/local/temp/7d1c4bb/native_add_version_skew/hook/build.dart:10:3)
<asynchronous suspension>
stdout:
FINER: 2025-01-14 18:17:16.642465: No compiler set in BuildConfig.cCompiler.cc.
FINER: 2025-01-14 18:17:16.656951: Looking for Visual Studio Locator on PATH.
INFO: 2025-01-14 18:17:16.663228: Running `where vswhere.exe`.
SEVERE: 2025-01-14 18:17:16.892507: INFO: Could not find files for the given pattern(s).
FINE: 2025-01-14 18:17:16.909991: Did not find Visual Studio Locator on PATH.
FINER: 2025-01-14 18:17:16.912369: Looking for Visual Studio Locator in [C:/Program Files \(x86\)/Microsoft Visual Studio/Installer/vswhere.exe, C:/Program Files/Microsoft Visual Studio/Installer/vswhere.exe].
FINE: 2025-01-14 18:17:17.047220: Found [ToolInstance(Visual Studio Locator, null, file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio/Installer/vswhere.exe)].
FINER: 2025-01-14 18:17:17.048224: Looking up version with --version for ToolInstance(Visual Studio Locator, null, file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio/Installer/vswhere.exe).
INFO: 2025-01-14 18:17:17.050225: Running `C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe`.
FINE: 2025-01-14 18:17:17.148590: Visual Studio Locator version 3.1.7+f39851e70f [query version 3.7.2174.19405]
FINE: 2025-01-14 18:17:17.148590: Copyright (C) Microsoft Corporation. All rights reserved.
FINE: 2025-01-14 18:17:17.148590:
FINE: 2025-01-14 18:17:17.171589: Found version for ToolInstance(Visual Studio Locator, 3.1.7+f39851e70f, file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio/Installer/vswhere.exe).
INFO: 2025-01-14 18:17:17.172591: Running `C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe`.
FINE: 2025-01-14 18:17:17.261727: Visual Studio Locator version 3.1.7+f39851e70f [query version 3.7.2174.19405]
FINE: 2025-01-14 18:17:17.261727: Copyright (C) Microsoft Corporation. All rights reserved.
FINE: 2025-01-14 18:17:17.261727: Found why the health checks aren't finishing: This is coming from I merged main and fixed the other CI errors, so let's try it again. Also, my VS Code only takes up 500MB of RAM now, when analyzing the entire repo. I don't know how much it used to be, but I remember my computer getting really slow before! |
Thanks a ton @Levi-Lesches! 🚀
@mosuem Do we need a bump in the ecosystem repo to use the newest version of
🔥 😄 |
(They just released version 0.20.2 with the fix, and firehose picked it up automatically)
Kinda confused here, since some of these packages are not |
Yet another CI issue: Testing PathNotFoundException: Cannot open file, path = 'D:\a\native\native\pkgs\native_assets_cli\example\build\native_add_app\.dart_tool\package_config.json' (OS Error: The system cannot find the file specified. That's because the static Future<PackageLayout> fromRootPackageRoot(
FileSystem fileSystem,
Uri rootPackageRoot,
) async {
rootPackageRoot = rootPackageRoot.normalizePath();
final packageConfigUri =
rootPackageRoot.resolve('.dart_tool/package_config.json'); // <--
assert(await fileSystem.file(packageConfigUri).exists());
final packageConfig = await loadPackageConfigUri(packageConfigUri);
return PackageLayout._(
fileSystem, rootPackageRoot, packageConfig, packageConfigUri);
} |
Also, it seems that
|
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
I've dove into this. It's because we don't properly pass the The same issue exists for the check if the native assets experiment should be enabled or not. It currently also looks at all packages in the package graph. Before pub workspaces, if we didn't pass I'm going to fix this behavior in |
Sounds good. And I found this in the firehose checks: Running `/opt/hostedtoolcache/dart/3.7.0-309.0.dev/x64/bin/dart pub global activate -sgit https://github.com/bmw-tech/dart_apitool.git --git-ref 123049d3fa3c1459a5129b2b61d852a388a8511e` in /home/runner/work/native/native/current_repo So there probably needs to be an update there to use the latest |
Re: firehose, dart_apitool version is set here https://github.com/dart-lang/ecosystem/blob/94b4cea02f2948432a1c9218c573cc03d5ef144c/pkgs/firehose/lib/src/health/health.dart#L20C22-L20C62. I will file a PR to update it! |
Filed dart-lang/ecosystem#338 Edit: merged. |
|
@HosseinYousefi I fixed as much as I could, see the diff here. The issue now is that I get $ dart tool\generate_ffi_bindings.dart
INFO: Generating C wrappers
Unknown type ffi.UnsignedInt for return type And I described some more details in #1884 (comment) |
I will try to fix this part of your PR on Monday. Thanks! |
Closes #1223
TODO:
native_assets_builder/test_data/*
still works withdart pub get
native_assets_cli/example/*
still works withdart pub get
dart analyze
passes at the workspace level`analysis_options.yaml
into workspaceLeaving these packages unmigrated:
jnigen/android_test_runner
native_assets_builder/test_data/native_add_version_skew
Blocked by:
package:firehose
needs to usepackage:dart_apitool: ^0.20.2
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.