pub version or flutter pub version: Pub 2.7.0-dev.0.0When running pub get --verbose in the toh-6 example I get this infinite loop. Without --verbose it just appears to hang.
SLVR: ! thus: test >=0.12.0-beta.3 requires analyzer >=0.26.4 <0.34.0 or >=0.36.0 <0.40.0 or matcher >=0.12.3 <0.12.4 or test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 or 0.2.7
SLVR: ! not test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 or 0.2.7 is partially satisfied by not test_core <0.2.2-∞
SLVR: ! which is caused by "test_core <0.2.2-∞ depends on matcher >=0.12.3 <0.12.4"
SLVR: ! thus: test >=0.12.0-beta.3 requires analyzer >=0.26.4 <0.34.0 or >=0.36.0 <0.40.0 or matcher >=0.12.3 <0.12.4 or test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 or 0.2.7
SLVR: ! not test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 or 0.2.7 is partially satisfied by not test_core <0.2.2-∞
SLVR: ! which is caused by "test_core <0.2.2-∞ depends on matcher >=0.12.3 <0.12.4"
SLVR: ! thus: test >=0.12.0-beta.3 requires analyzer >=0.26.4 <0.34.0 or >=0.36.0 <0.40.0 or matcher >=0.12.3 <0.12.4 or test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 or 0.2.7
SLVR: ! not test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 or 0.2.7 is partially satisfied by not test_core <0.2.2-∞
SLVR: ! which is caused by "test_core <0.2.2-∞ depends on matcher >=0.12.3 <0.12.4"
SLVR: ! thus: test >=0.12.0-beta.3 requires analyzer >=0.26.4 <0.34.0 or >=0.36.0 <0.40.0 or matcher >=0.12.3 <0.12.4 or test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 or 0.2.7
--trace doesn't show anything different.
To reproduce:
git clone https://github.com/angular-examples/toh-6.git
cd toh-6
pub get
Looking through the bug reports it looks like this sort of thing is an ongoing problem for pub. I'm pretty sure Go's new dependency system is immune to this sort of thing. Maybe you could switch to its model for Dart 3.
Thanks for reporting!
Not sure what goes on here.
CCing @nex3 who did the original constraint solver implementation.
It does look like the solver's conflict resolver is somehow going into an infinite loop here. I've attached the full solver log with the repeated output cut off after a few lines.
Interestingly, it looks like the root cause is actually pretty simple: this package depends on angular ^5.0.0 which only supports analyzer versions <0.36.0, while recent versions of test only support analyzer versions >=0.36.0. Interestingly, if you change the constraint on test to >=1.0.0 <1.6.5, the solver does find a solution:
The solution for
test >=1.0.0 <1.6.5
+ analyzer 0.34.3 (0.39.1 available)
+ angular 5.2.0 (5.3.1 available)
+ angular_ast 0.5.8 (0.5.11 available)
+ angular_compiler 0.4.2 (0.4.5 available)
+ angular_forms 2.1.1 (2.1.4 available)
+ angular_router 2.0.0-alpha+21 (2.0.0-alpha+24 available)
+ angular_test 2.2.0 (2.4.0 available)
+ archive 2.0.11
+ args 1.5.2
+ async 2.4.0
+ bazel_worker 0.1.23
+ boolean_selector 1.0.5
+ build 1.1.0 (1.2.1 available)
+ build_config 0.3.2 (0.4.1+1 available)
+ build_daemon 0.2.3 (2.1.0 available)
+ build_modules 1.0.11 (2.6.3 available)
+ build_resolvers 0.2.3 (1.2.2 available)
+ build_runner 1.2.3 (1.7.2 available)
+ build_runner_core 2.0.1 (4.1.0 available)
+ build_test 0.10.6 (0.10.9+1 available)
+ build_web_compilers 0.4.4+3 (2.7.1 available)
+ built_collection 4.2.2
+ built_value 6.7.1 (7.0.0 available)
+ charcode 1.1.2
+ checked_yaml 1.0.2
+ code_builder 3.2.0 (3.2.1 available)
+ collection 1.14.12
+ convert 2.1.1
+ crypto 2.1.3
+ csslib 0.14.6+1 (0.16.1 available)
+ dart_style 1.2.3 (1.3.3 available)
+ fixnum 0.10.11
+ front_end 0.1.9+1 (0.1.29 available)
+ glob 1.2.0
+ graphs 0.2.0
+ html 0.14.0 (0.14.0+3 available)
+ http 0.11.3+17 (0.12.0+2 available)
+ http_multi_server 2.1.0
+ http_parser 3.1.3
+ intl 0.15.8 (0.16.0 available)
+ io 0.3.3
+ js 0.6.1+1
+ json_annotation 2.4.0 (3.0.0 available)
+ json_rpc_2 2.1.0
+ kernel 0.3.9+1 (0.3.29 available)
+ logging 0.11.3+2
+ matcher 0.12.3+1 (0.12.6 available)
+ meta 1.1.8
+ mime 0.9.6+3
+ mockito 3.0.2 (4.1.1 available)
+ multi_server_socket 1.0.2
+ node_interop 1.0.3
+ node_io 1.0.1+2
+ node_preamble 1.4.8
+ package_config 1.1.0
+ package_resolver 1.0.10
+ pageloader 3.1.1 (3.2.2 available)
+ path 1.6.4
+ pedantic 1.8.0+1
+ plugin 0.2.0+3
+ pool 1.4.0
+ protobuf 1.0.1
+ pub_semver 1.4.2
+ pubspec_parse 0.1.5
+ quiver 2.0.5 (2.1.2+1 available)
+ scratch_space 0.0.4+1
+ shelf 0.7.5
+ shelf_packages_handler 1.0.4
+ shelf_static 0.2.8
+ shelf_web_socket 0.2.3
+ source_gen 0.9.4+1 (0.9.4+6 available)
+ source_map_stack_trace 1.1.5
+ source_maps 0.10.8
+ source_span 1.5.5
+ stack_trace 1.9.3
+ stream_channel 1.7.0 (2.0.0 available)
+ stream_transform 0.0.20
+ string_scanner 1.0.5
+ sync_http 0.1.4
+ term_glyph 1.1.0
+ test 1.5.3 (1.9.4 available)
+ test_api 0.2.2 (0.2.11 available)
+ test_core 0.2.1+1 (0.2.15 available)
+ timing 0.1.1+2
+ typed_data 1.1.6
+ vm_service_client 0.2.6+3
+ watcher 0.9.7+12
+ web_socket_channel 1.1.0
+ webdriver 2.1.1
+ yaml 2.2.0
But the solver should be able to find this solution on its own, and the fact that it can't is a bug. It looks like the crucial issue is this line:
not test_core 0.2.2 or 0.2.3 or 0.2.4 or 0.2.5 or 0.2.6 is partially satisfied by not test_core <0.2.2-∞
This is simply not true: knowing that no versions of test_core below 0.2.2-∞ can be selected doesn't tell you anything about whether 0.2.2, 0.2.3, et al can be selected. The resolution logic seems to be able to detect this correctly but the satisfaction logic does not, so that's where I'd look to fix this bug.
Let me know if I can provide any more assistance!
This same issue can be reproduced in package:inject_generator.
Both packages have these same dependencies:
dev_dependencies:
build_runner: ^1.0.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
The issue can be worked around by removing the build_test package reference, running pub get, adding build_test back in, and then running pub get a second time.
This issue should be closed. The original example now resolves correctly:
git clone https://github.com/angular-examples/toh-6.git
cd toh-6
pub get
It means that the linked fix (or some other) worked.
Most helpful comment
This same issue can be reproduced in package:inject_generator.
Both packages have these same dependencies:
The issue can be worked around by removing the
build_testpackage reference, runningpub get, addingbuild_testback in, and then runningpub geta second time.