Skip to content

bug when using --delete-conflicting-outputs #2409

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

Closed
juliocbcotta opened this issue Aug 13, 2019 · 6 comments
Closed

bug when using --delete-conflicting-outputs #2409

juliocbcotta opened this issue Aug 13, 2019 · 6 comments

Comments

@juliocbcotta
Copy link

juliocbcotta commented Aug 13, 2019

Running the command
~/git/plugin_gen.flutter/example (master*) $ flutter pub run build_runner build --delete-conflicting-outputs

If I ran the command multiple times, sometimes it works, sometimes it does not. If I delete the generated files by hand the next run works. Sometimes the command is able to remove the previous generated files.

Error:

You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues

FileSystemException: Cannot delete file, path = '/Users/juliocotta/git/plugin_gen.flutter/example/example/ios/.symlinks/plugins/flutter_gen_sample_plugin/lib/my_test_plugin.g.dart' (OS Error: No such file or directory, errno = 2)
dart:isolate  _RawReceivePortImpl._handleMessage

pub failed (1)
  • Dart SDK Version (dart --version)

dart --version
Dart VM version: 2.5.0-dev.1.0.flutter-f29f41f1a5 (Wed Aug 7 12:03:10 2019 +0000) on "macos_x64"

  • What package(s) from this repo you are using, and the version (i.e. build_runner 0.7.12)

My example uses build_runner: ^1.6.5
My generator uses build: ^1.1.5 , build_runner: ^1.6.5

MacOSX

  • Whether you are using Chrome, Safari, Firefox, Edge (if applicable)

not applicable

  • Any other packages or constraints we should know about

The generator uses source_gen: ^0.9.4

Related:
flutter doctor -v
[✓] Flutter (Channel master, v1.8.5-pre.117, on Mac OS X 10.14.6 18G87, locale pt-BR)
• Flutter version 1.8.5-pre.117 at /Users/juliocotta/flutter/flutter
• Framework revision 83a8a575ee (3 days ago), 2019-08-10 12:38:20 -0700
• Engine revision ff49ca1c6e
• Dart version 2.5.0 (build 2.5.0-dev.1.0 f29f41f1a5)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/juliocotta/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• ANDROID_HOME = /Users/juliocotta/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.7.5

[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] IntelliJ IDEA Community Edition (version 2019.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 34.0.4
• Dart plugin version 191.6183.88

[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!

@juliocbcotta
Copy link
Author

juliocbcotta commented Aug 13, 2019

I am generating 2 files, sometimes I get a similar error, but for the another file.

Unhandled exception:
FileSystemException: Cannot delete file, path = '/Users/juliocotta/git/plugin_gen.flutter/example/example/ios/.symlinks/plugins/flutter_gen_sample_plugin/lib/platform_plugin.g.dart' (OS Error: No such file or directory, errno = 2)
#0      _File._delete.<anonymous closure> (dart:io/file_impl.dart:291:9)
#1      _RootZone.runUnary (dart:async/zone.dart:1379:54)
#2      _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#4      Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#5      Future._completeWithValue (dart:async/future_impl.dart:483:5)
#6      Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513:7)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

@jakemac53
Copy link
Contributor

It sounds like the file is being deleted by some other process before the build system has a chance to delete it itself? It is worth noting that in general --delete-conflicting-outputs should only need to be passed for the first build after cloning the repo manually clearing the cache (.dart_tool/build directory).

Is it possible you had two build processes going at once? That would probably be the easiest way to get into a scenario like this.

@natebosch
Copy link
Member

Please remember to use code fences around stack traces.

https://help.github.com/en/articles/creating-and-highlighting-code-blocks

@juliocbcotta
Copy link
Author

@jakemac53 I rebooted my machine, opened Android Studio and only executed the command by the terminal. It still happens from time to time while editing some hand written files ( I am not firing the command and editing files at the same time, just to be clear).

@juliocbcotta
Copy link
Author

Today I split my example project in two, it means I no longer generate two files at the same time.
I could not reproduce the error after that. So if team thinks it is ok to close this issue, I am fine with that.

@jakemac53
Copy link
Contributor

Ok, I will go ahead and close this since we can't reproduce it. If we get more info we would be happy to re-investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants