irondash / cargokit

Integrate cargo build with flutter plugins and applications.
Other
51 stars 16 forks source link

Cannot run on windows + non-release mode #40

Open fzyzcjy opened 7 months ago

fzyzcjy commented 7 months ago

Hi thanks for the toolkit! I am trying to use it on windows but seems to have a bug. Reproduction steps are: On a windows 10 machine (indeed virtual machine in my case), use powershell to execute:

git clone https://github.com/irondash/hello_rust_ffi_plugin
cd hello_rust_ffi_plugin/example
flutter run -d windows --verbose

Then fail to compile and see:

``` PS C:\Users\Tom\hello_rust_ffi_plugin\example> flutter run -d windows Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! Resolving dependencies... (1.3s) * async 2.11.0 (was 2.11.0) * boolean_selector 2.1.1 (was 2.1.1) * characters 1.3.0 (was 1.3.0) * clock 1.1.1 (was 1.1.1) * collection 1.18.0 (was 1.18.0) * cupertino_icons 1.0.6 (was 1.0.5) * fake_async 1.3.1 (was 1.3.1) * flutter_lints 2.0.3 (was 2.0.2) (3.0.1 available) * lints 2.1.1 (was 2.1.1) (3.0.0 available) * matcher 0.12.16 (was 0.12.16) * material_color_utilities 0.5.0 (was 0.5.0) (0.8.0 available) * meta 1.10.0 (was 1.9.1) (1.11.0 available) * path 1.8.3 (was 1.8.3) * plugin_platform_interface 2.1.7 (was 2.1.5) * source_span 1.10.0 (was 1.10.0) * stack_trace 1.11.1 (was 1.11.1) * stream_channel 2.1.2 (was 2.1.2) * string_scanner 1.2.0 (was 1.2.0) * term_glyph 1.2.1 (was 1.2.1) * test_api 0.6.1 (was 0.6.1) * vector_math 2.1.4 (was 2.1.4) * web 0.3.0 (was 0.1.4-beta) (0.4.0 available) Changed 22 dependencies! 5 packages have newer versions incompatible with dependency constraints. Try `flutter pub outdated` for more information. Launching lib\main.dart on Windows in debug mode... windows/flutter/CMakeLists.txt does not use FLUTTER_TARGET_PLATFORM, updating. Building Windows application... ⢿Terminate batch job (Y/N)? ^C PS C:\Users\Tom\hello_rust_ffi_plugin\example> flutter run -d windows --verbose [ +370 ms] Unable to locate an Android SDK. [ +211 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +1 ms] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update. [ +7 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +12 ms] Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! [ +149 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +3 ms] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update. [ +9 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +120 ms] Skipping pub get: version match. [ +138 ms] Found plugin hello_rust_ffi_plugin at C:\Users\Tom\hello_rust_ffi_plugin\ [ +127 ms] Found plugin hello_rust_ffi_plugin at C:\Users\Tom\hello_rust_ffi_plugin\ [ +98 ms] Generating C:\Users\Tom\hello_rust_ffi_plugin\example\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java [ +229 ms] Initializing file store [ +29 ms] Skipping target: gen_localizations [ +7 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: C:\Users\Tom\hello_rust_ffi_plugin\example\.dart_tool\package_config_subset} [ +168 ms] Found plugin hello_rust_ffi_plugin at C:\Users\Tom\hello_rust_ffi_plugin\ [ +13 ms] gen_dart_plugin_registrant: Complete [ +2 ms] Skipping target: _composite [ +2 ms] complete [ +9 ms] Launching lib\main.dart on Windows in debug mode... [ +8 ms] C:\Users\Tom\fvm\default\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\Users\Tom\fvm\default\bin\cache\dart-sdk\bin\snapshots\frontend_server.dart.snapshot --sdk-root C:\Users\Tom\fvm\default\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/74d16627b940bb15e50891f82cad6c3e3465bd6d/ --output-dill C:\Users\Tom\AppData\Local\Temp\flutter_tools.d669e3a5\flutter_tool.12452cc1\app.dill --packages C:\Users\Tom\hello_rust_ffi_plugin\example\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build\25c7fdbd37e2353f978846c51150293c.cache.dill.track.dill --verbosity=error --enable-experiment=alternative-invalidation-strategy [ +65 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.CMake.Project [ +87 ms] Exit code 0 from: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.CMake.Project [ +2 ms] [ { "instanceId": "88105f9f", "installDate": "2022-03-03T04:21:18Z", "installationName": "VisualStudio/17.1.0+32210.238", "installationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community", "installationVersion": "17.1.32210.238", "productId": "Microsoft.VisualStudio.Product.Community", "productPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\devenv.exe", "state": 4294967295, "isComplete": true, "isLaunchable": true, "isPrerelease": false, "isRebootRequired": false, "displayName": "Visual Studio Community 2022", "description": "Powerful IDE, free for students, open-source contributors, and individuals", "channelId": "VisualStudio.17.Release", "channelUri": "https://aka.ms/vs/17/release/channel", "enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service", "installedChannelUri": "https://aka.ms/vs/17/release/channel", "releaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.1#17.1.0", "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288", "updateDate": "2022-03-03T04:21:18.6874627Z", "catalog": { "buildBranch": "d17.1", "buildVersion": "17.1.32210.238", "id": "VisualStudio/17.1.0+32210.238", "localBuild": "build-lab", "manifestName": "VisualStudio", "manifestType": "installer", "productDisplayVersion": "17.1.0", "productLine": "Dev17", "productLineVersion": "2022", "productMilestone": "RTW", "productMilestoneIsPreRelease": "False", "productName": "Visual Studio", "productPatchVersion": "0", "productPreReleaseMilestoneSuffix": "7.0", "productSemanticVersion": "17.1.0+32210.238", "requiredEngineVersion": "3.1.2196.8931" }, "properties": { "campaignId": "2030", "channelManifestId": "VisualStudio.17.Release/17.1.0+32210.238", "nickname": "", "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe" } } ] [ +13 ms] Building Windows application... [ +13 ms] <- compile package:hello_rust_ffi_plugin_example/main.dart [ +3 ms] executing: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -S C:\Users\Tom\hello_rust_ffi_plugin\example\windows -B build\windows\x64 -G Visual Studio 17 2022 -A x64 -DFLUTTER_TARGET_PLATFORM=windows-x64 [ +112 ms] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042. [ +753 ms] -- Configuring done [ +593 ms] -- Generating done [ +78 ms] -- Build files have been written to: C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64 [ +51 ms] executing: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe --build build\windows\x64 --config Debug --target INSTALL --verbose [ +269 ms] Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework [ +2 ms] Copyright (C) Microsoft Corporation. All rights reserved. [ +109 ms] Build started 11/29/2023 9:33:16 AM. [ +296 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj" on node 1 (default targets). [ +2 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj" (1) is building "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ZERO_CHECK.vcxproj" (2) on node 1 (default targets). [ +3 ms] InitializeBuildStatus: [ +1 ms] Creating "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. [ +30 ms] CustomBuild: [ +1 ms] All outputs are up-to-date. [ +102 ms] Checking Build System [ +123 ms] FinalizeBuildStatus: [ +1 ms] Deleting file "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild". [ ] Touching "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate". [ +1 ms] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ZERO_CHECK.vcxproj" (default targets). [ +102 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj" (1) is building "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ALL_BUILD.vcxproj" (3) on node 1 (default targets). [ +1 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ALL_BUILD.vcxproj" (3) is building "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\plugins\hello_rust_ffi_plugin\hello_rust_ffi_plugin_cargokit.vcxpro j" (4) on node 1 (default targets). [ +1 ms] InitializeBuildStatus: [ +1 ms] Creating "x64\Debug\hello_rust_ffi_plugin_cargokit\hello_ru.0EB085AF.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. [ +2 ms] CustomBuild: [ +1 ms] "The build of 'C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\CMakeFiles\09884c161b4d1159148036d354c7554c\hello_rust_ffi_plugin_c argokit.rule' depends on 'C:\USERS\TOM\HELLO_RUST_FFI_PLUGIN\EXAMPLE\BUILD\WINDOWS\X64\PLUGINS\HELLO_RUST_FFI_PLUGIN\RELEASE\HELLO_RUST_FFI_PLUGIN.DLL' which is produced by the build of 'C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\CMakeFiles\d596b4374547061572aa24c233e75f53\hello_rust_ffi_plugin.d ll.rule'. The items cannot be built in parallel." [ +115 ms] Generating Release/hello_rust_ffi_plugin.dll, _phony_ [ +242 ms] 1 file(s) moved. [ +331 ms] Resolving dependencies... [ +665 ms] github 9.17.0 (9.20.0 available) [ +1 ms] http 1.1.0 (1.1.2 available) [ ] path 1.8.0 (1.8.3 available) [ ] petitparser 5.4.0 (6.0.1 available) [ +1 ms] version 3.0.0 (3.0.2 available) [ ] Got dependencies! [ +3 ms] 5 packages have newer versions incompatible with dependency constraints. [ +1 ms] Try `dart pub outdated` for more information. [ +495 ms] Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill. [+3723 ms] INFO: Precompiled binaries are disabled [ +300 ms] INFO: Building hello_rust_ffi_plugin for x86_64-pc-windows-msvc [ +212 ms] FinalizeBuildStatus: [ +1 ms] Deleting file "x64\Debug\hello_rust_ffi_plugin_cargokit\hello_ru.0EB085AF.tlog\unsuccessfulbuild". [ ] Touching "x64\Debug\hello_rust_ffi_plugin_cargokit\hello_ru.0EB085AF.tlog\hello_rust_ffi_plugin_cargokit.lastbuildstate". [ ] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\plugins\hello_rust_ffi_plugin\hello_rust_ffi_plugin_cargokit.vcxpro j" (default targets). [ +81 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ALL_BUILD.vcxproj" (3) is building "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\flutter_wrapper_app.vcxproj" (5) on node 1 (default targets). [ +1 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\flutter_wrapper_app.vcxproj" (5) is building "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\flutter_assemble.vcxproj" (6) on node 1 (default targets). [ ] InitializeBuildStatus: [ +2 ms] Creating "x64\Debug\flutter_assemble\flutter_assemble.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. [ +2 ms] CustomBuild: [ +1 ms] "The build of 'C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\CMakeFiles\9e28d992a8143f7af058561420f0ae9f\flutter_assemble.rule' depends on 'C:\USERS\TOM\HELLO_RUST_FFI_PLUGIN\EXAMPLE\WINDOWS\FLUTTER\EPHEMERAL\FLUTTER_WINDOWS.DLL' which is produced by the build of 'C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\CMakeFiles\f6a442b70ac87b7a38c4bfb0ed8343c4\flutter_windows.dll.rul e'. The items cannot be built in parallel." [ +77 ms] Generating C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/flutter_windows.dll, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/flutter_export.h, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/flutter_windows.h, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/flutter_messenger.h, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/flutter_plugin_registrar.h, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/flutter_texture_registrar.h, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/cpp_client_wrapper/standard_codec.cc, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/cpp_client_wrapper/plugin_registrar.cc, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/cpp_client_wrapper/flutter_engine.cc, C:/Users/Tom/hello_rust_ffi_plugin/example/windows/flutter/ephemeral/cpp_client_wrapper/flutter_view_controller.cc, _phony_ [+1560 ms] [ +546 ms] Unable to locate an Android SDK. [ +33 ms] [ +53 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ +1 ms] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +1 ms] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update. [ +2 ms] [ +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ +1 ms] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ +2 ms] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ +1 ms] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ +3 ms] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ +2 ms] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +4 ms] [ +12 ms] Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! [ +178 ms] [ +179 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update. [ +10 ms] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update. [ ] [ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +1 ms] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update. [ ] [ +5 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update. [ +71 ms] [ +83 ms] Initializing file store [ +36 ms] [ +36 ms] Done initializing file store [ +138 ms] [ +138 ms] Skipping target: native_assets [ +10 ms] [ +10 ms] Skipping target: gen_localizations [ +1 ms] [ +2 ms] Skipping target: gen_dart_plugin_registrant [+4074 ms] [+4074 ms] Skipping target: unpack_windows [ +641 ms] [ +640 ms] Skipping target: kernel_snapshot [ +265 ms] [ +266 ms] Skipping target: debug_bundle_windows_assets [ +1 ms] [ ] Persisting file store [ +12 ms] [ +14 ms] Done persisting file store [ +7 ms] [ +7 ms] build succeeded. [ +13 ms] [ +12 ms] "flutter assemble" took 5,520ms. [ +267 ms] [ +267 ms] ensureAnalyticsSent: 252ms [ +2 ms] [ ] Running 0 shutdown hooks [ +1 ms] [ ] Shutdown hooks complete [ ] [ ] exiting with code 0 [ +120 ms] FinalizeBuildStatus: [ +1 ms] Deleting file "x64\Debug\flutter_assemble\flutter_assemble.tlog\unsuccessfulbuild". [ +1 ms] Touching "x64\Debug\flutter_assemble\flutter_assemble.tlog\flutter_assemble.lastbuildstate". [ ] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\flutter_assemble.vcxproj" (default targets). [ +9 ms] InitializeBuildStatus: [ +1 ms] Creating "flutter_wrapper_app.dir\Debug\flutter_.C03E6CCE.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. [ +4 ms] CustomBuild: [ +1 ms] All outputs are up-to-date. [ +68 ms] ClCompile: [ +1 ms] All outputs are up-to-date. [ +24 ms] Lib: [ +1 ms] All outputs are up-to-date. [ +1 ms] flutter_wrapper_app.vcxproj -> C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\Debug\flutter_wrapper_app.lib [ +19 ms] FinalizeBuildStatus: [ +2 ms] Deleting file "flutter_wrapper_app.dir\Debug\flutter_.C03E6CCE.tlog\unsuccessfulbuild". [ +2 ms] Touching "flutter_wrapper_app.dir\Debug\flutter_.C03E6CCE.tlog\flutter_wrapper_app.lastbuildstate". [ +1 ms] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\flutter_wrapper_app.vcxproj" (default targets). [ +39 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ALL_BUILD.vcxproj" (3) is building "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\flutter_wrapper_plugin.vcxproj" (7) on node 1 (default targets). [ +2 ms] InitializeBuildStatus: [ +1 ms] Creating "flutter_wrapper_plugin.dir\Debug\flutter_.219563FD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. [ +2 ms] CustomBuild: [ +2 ms] All outputs are up-to-date. [ +7 ms] ClCompile: [ +1 ms] All outputs are up-to-date. [ +2 ms] Lib: [ +2 ms] All outputs are up-to-date. [ +1 ms] flutter_wrapper_plugin.vcxproj -> C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\Debug\flutter_wrapper_plugin.lib [ +12 ms] FinalizeBuildStatus: [ +2 ms] Deleting file "flutter_wrapper_plugin.dir\Debug\flutter_.219563FD.tlog\unsuccessfulbuild". [ +2 ms] Touching "flutter_wrapper_plugin.dir\Debug\flutter_.219563FD.tlog\flutter_wrapper_plugin.lastbuildstate". [ +1 ms] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\flutter\flutter_wrapper_plugin.vcxproj" (default targets). [ +37 ms] Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ALL_BUILD.vcxproj" (3) is building "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\runner\hello_rust_ffi_plugin_example.vcxproj" (8) on node 1 (default targets). [ +1 ms] InitializeBuildStatus: [ +1 ms] Creating "hello_rust_ffi_plugin_example.dir\Debug\hello_ru.6CD68D06.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. [ +1 ms] CustomBuild: [ +1 ms] All outputs are up-to-date. [ +35 ms] ClCompile: [ +3 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /IC:\Users\Tom\hello_rust_ffi_plugin\example\windows /IC:\Users\Tom\hello_rust_ffi_plugin\example\windows\flutter\ephemeral /IC:\Users\Tom\hello_rust_ffi_plugin\example\windows\flutter\ephemeral\cpp_client_wrapper\include /Zi /nologo /W4 /WX /diagnostics:column /Od /Ob0 /D _UNICODE /D UNICODE /D WIN32 /D _WINDOWS /D _HAS_EXCEPTIONS=0 /D _DEBUG /D "FLUTTER_VERSION=\"1.0.0+1\"" /D FLUTTER_VERSION_MAJOR=1 /D FLUTTER_VERSION_MINOR=0 /D FLUTTER_VERSION_PATCH=0 /D FLUTTER_VERSION_BUILD=1 /D NOMINMAX /D UNICODE /D _UNICODE /D "CMAKE_INTDIR=\"Debug\"" /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++17 /Fo"hello_rust_ffi_plugin_example.dir\Debug\\" /Fd"hello_rust_ffi_plugin_example.dir\Debug\vc143.pdb" /external:W4 /Gd /TP /wd4100 /errorReport:queue C:\Users\Tom\hello_rust_ffi_plugin\example\windows\flutter\generated_plugin_registrant.cc C:\Users\Tom\hello_rust_ffi_plugin\example\windows\runner\flutter_window.cpp [ +94 ms] generated_plugin_registrant.cc [ +520 ms] flutter_window.cpp [+1075 ms] Generating Code... [ +117 ms] ResourceCompile: [ +1 ms] All outputs are up-to-date. [ +40 ms] Link: [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\runner\Debug\hello_rust_ffi_plugin_example.exe" /INCREMENTAL /ILK:"hello_rust_ffi_plugin_example.dir\Debug\hello_rust_ffi_plugin_example.ilk" /NOLOGO ..\flutter\Debug\flutter_wrapper_app.lib dwmapi.lib C:\Users\Tom\hello_rust_ffi_plugin\example\windows\flutter\ephemeral\flutter_windows.dll.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:C:\Users\Tom\hello_rust_ffi_plugin\example\windows\runner\runner.exe.manifest /DEBUG /PDB:"C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/runner/Debug/hello_rust_ffi_plugin_example.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/runner/Debug/hello_rust_ffi_plugin_example.lib" /MACHINE:X64 /pdbthreads:6 /machine:x64 hello_rust_ffi_plugin_example.dir\Debug\Runner.res [ +2 ms] hello_rust_ffi_plugin_example.dir\Debug\flutter_window.obj [ +1 ms] hello_rust_ffi_plugin_example.dir\Debug\main.obj [ +1 ms] hello_rust_ffi_plugin_example.dir\Debug\utils.obj [ +1 ms] hello_rust_ffi_plugin_example.dir\Debug\win32_window.obj [ +1 ms] hello_rust_ffi_plugin_example.dir\Debug\generated_plugin_registrant.obj [ +265 ms] hello_rust_ffi_plugin_example.vcxproj -> C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\runner\Debug\hello_rust_ffi_plugin_example.exe [ +11 ms] FinalizeBuildStatus: [ +2 ms] Deleting file "hello_rust_ffi_plugin_example.dir\Debug\hello_ru.6CD68D06.tlog\unsuccessfulbuild". [ +2 ms] Touching "hello_rust_ffi_plugin_example.dir\Debug\hello_ru.6CD68D06.tlog\hello_rust_ffi_plugin_example.lastbuildstate". [ +1 ms] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\runner\hello_rust_ffi_plugin_example.vcxproj" (default targets). [ +12 ms] InitializeBuildStatus: [ +1 ms] Creating "x64\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. [ +2 ms] CustomBuild: [ +1 ms] All outputs are up-to-date. [ +61 ms] Building Custom Rule C:/Users/Tom/hello_rust_ffi_plugin/example/windows/CMakeLists.txt [ +70 ms] FinalizeBuildStatus: [ +1 ms] Deleting file "x64\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild". [ +1 ms] Touching "x64\Debug\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate". [ +1 ms] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\ALL_BUILD.vcxproj" (default targets). [ +6 ms] InitializeBuildStatus: [ +1 ms] Touching "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild". [ +82 ms] PostBuildEvent: [ +1 ms] setlocal [ +1 ms] "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [ +2 ms] if %errorlevel% neq 0 goto :cmEnd [ ] :cmEnd [ ] endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [ +1 ms] :cmErrorLevel [ ] exit /b %1 [ +1 ms] :cmDone [ +1 ms] if %errorlevel% neq 0 goto :VCEnd [ +1 ms] :VCEnd [ +81 ms] -- Install configuration: "Debug" [ +66 ms] -- Up-to-date: C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/runner/Debug/data/icudtl.dat [ +96 ms] -- Up-to-date: C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/runner/Debug/flutter_windows.dll [ +1 ms] CMake Error at cmake_install.cmake:162 (file): [ +1 ms] file INSTALL cannot find [ +1 ms] "C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/plugins/hello_rust_ffi_plugin/Debug/hello_rust_ffi_plugin.dll": [ +1 ms] No error. [ +15 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: The command "setlocal [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +4 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +2 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmEnd [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +2 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmErrorLevel [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: exit /b %1 [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +2 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmDone [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +3 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :VCEnd" exited with code 1. [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] Done Building Project "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj" (default targets) -- FAILED. [ +1 ms] Build FAILED. [ ] "C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj" (default target) (1) -> [ ] (PostBuildEvent target) -> [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: The command "setlocal [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +2 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +3 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +3 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmErrorLevel [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: exit /b %1 [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +1 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :cmDone [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +3 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +4 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(157,5): error MSB3073: :VCEnd" exited with code 1. [C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\INSTALL.vcxproj] [ +2 ms] 0 Warning(s) [ +1 ms] 1 Error(s) [ +1 ms] Time Elapsed 00:00:17.41 [ +13 ms] Building Windows application... (completed in 19.5s) [ +2 ms] Exception: Build process failed. [ +10 ms] "flutter run" took 20,848ms. [ +5 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:752:9) #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1350:27) #3 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #4 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9) #6 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5) #8 run.. (package:flutter_tools/runner.dart:112:9) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #10 main (package:flutter_tools/executable.dart:90:3) [ +212 ms] ensureAnalyticsSent: 199ms [ +1 ms] Running 1 shutdown hook [ +5 ms] Shutdown hooks complete [ +1 ms] exiting with code 1 ```

Given that

[   +1 ms]   CMake Error at cmake_install.cmake:162 (file):
[   +1 ms]     file INSTALL cannot find
[   +1 ms]
"C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/plugins/hello_rust_ffi_plugin/Debug/hello_rust_ffi_plugin.dll":
[   +1 ms]     No error.

I check the folders:

``` PS C:\Users\Tom\hello_rust_ffi_plugin\example> ls C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/plugins/hello_rust_ffi_plugin Directory: C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\plugins\hello_rust_ffi_plugin Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 11/29/2023 9:32 AM cargokit_build d----- 11/29/2023 9:35 AM CMakeFiles d----- 11/29/2023 9:35 AM Release d----- 11/29/2023 9:32 AM x64 -a---- 11/29/2023 9:32 AM 18784 ALL_BUILD.vcxproj -a---- 11/29/2023 9:32 AM 370 ALL_BUILD.vcxproj.filters -a---- 11/29/2023 9:32 AM 1145 cmake_install.cmake -a---- 11/29/2023 9:32 AM 3460 hello_rust_ffi_plugin.sln -a---- 11/29/2023 9:32 AM 46824 hello_rust_ffi_plugin_cargokit.vcxproj -a---- 11/29/2023 9:32 AM 1139 hello_rust_ffi_plugin_cargokit.vcxproj.filters -a---- 11/29/2023 9:32 AM 14111 INSTALL.vcxproj -a---- 11/29/2023 9:32 AM 551 INSTALL.vcxproj.filters PS C:\Users\Tom\hello_rust_ffi_plugin\example> ls C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/plugins/hello_rust_ffi_plugin/Release Directory: C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\plugins\hello_rust_ffi_plugin\Release Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 11/29/2023 9:32 AM 122880 hello_rust_ffi_plugin.dll -a---- 11/29/2023 9:32 AM 2150 hello_rust_ffi_plugin.dll.lib -a---- 11/29/2023 9:32 AM 1249280 hello_rust_ffi_plugin.pdb PS C:\Users\Tom\hello_rust_ffi_plugin\example> ls C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/plugins/hello_rust_ffi_plugin/Debug ls : Cannot find path 'C:\Users\Tom\hello_rust_ffi_plugin\example\build\windows\x64\plugins\hello_rust_ffi_plugin\Debug' because it does not exist. At line:1 char:1 + ls C:/Users/Tom/hello_rust_ffi_plugin/example/build/windows/x64/plug ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Users\Tom\he...fi_plugin\Debug:String) [Get-ChildItem], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand PS C:\Users\Tom\hello_rust_ffi_plugin\example> ```

Thus, it seems Release folder has the dll, while Debug does not, and cmake somehow expects to see files in the Debug folder, even if here we are building the debug mode instead of release mode.

Thus, I try to run it in release mode:

flutter run -d windows --release

And it works well:

image

P.S. After run --release, it seems that need to run flutter clean to reproduce the bug.

knopp commented 7 months ago

The example project had a really old cargokit version. I pushed an update and can't reproduce the problem anymore.

fzyzcjy commented 7 months ago

Thanks for the reply! I do reproduce the bug using latest cargokit in flutter_rust_bridge's examples on a windows VM, but the CI is happy instead. I am not sure whether it is a corner case in my windows VM, and will report more information if someone else also sees it.