gql-dart/multipack

Add support for circular dependencies

smkhalsa opened this issue · 4 comments

currently, I get the following error

Unhandled exception:
NoSuchMethodError: The getter 'reversed' was called on null.
Receiver: null
Tried calling: reversed
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1      main (file:///Users/smkhalsa/.pub-cache/hosted/pub.dartlang.org/multipack-0.1.3/bin/multipack.dart:10:69)
<asynchronous suspension>
#2      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

when running multipack pubspec override if I have a circular dependency.

@klavs do you have any insight on this?

klavs commented

I do not know how to universally handle circular dependencies in a directed graph. I'd imagine user would have to define how to break the cycle so that we can figure out what's the topological order.

I think lerna handles circular dependencies, there might be hints in their source code.

https://github.com/huang12zheng/multipack

I just had done a test with multipack pubspec override

  • test workflow
# step1
# file /Users/huangzheng/.pub-cache/bin/multipack
# change to
dart "/Users/huangzheng/frontend/multipack/bin/multipack.dart" "$@"
# step2
run `multipack pubspec override` in ferry

And, I don't know how to deal with InfoCommand