Use any deps for all unpublished packages

It should not be necessary to ever run `pub get` for a package which is
not published. All packages used in the SDK are controlled by a single
package config, so it's not necessary to declare versions or paths for
any packages.

Remove all dependency overrides.

R=devoncarew@google.com

Change-Id: Icb328813b471f35ee4c99995f4e90aac4d8ed438
Tested: Covered by existing static analysis.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244767
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
This commit is contained in:
Nate Bosch 2022-05-17 01:22:25 +00:00 committed by Commit Bot
parent 09b7f36b2f
commit 6ebd2633cd
30 changed files with 169 additions and 407 deletions

View file

@ -7,9 +7,4 @@ environment:
dependencies:
_fe_analyzer_shared: any
kernel:
path: ../kernel
dependency_overrides:
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
kernel: any

View file

@ -6,43 +6,29 @@ environment:
sdk: '>=2.17.0 <3.0.0'
dependencies:
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
analyzer:
path: ../analyzer
analyzer_plugin:
path: ../analyzer_plugin
_fe_analyzer_shared: any
analyzer: any
analyzer_plugin: any
args: any
collection: any
convert: any
crypto: any
dart_style: any
http: any
html: any
http: any
linter: any
meta:
path: ../meta
stream_channel: any
telemetry:
path: ../telemetry
test: any
meta: any
path: any
stream_channel: any
telemetry: any
test: any
watcher: any
yaml: any
dev_dependencies:
analyzer_utilities:
path: ../analyzer_utilities
analyzer_utilities: any
cli_util: any
lints: ^2.0.0
lints: any
logging: any
matcher: any
test_reflective_loader: any
dependency_overrides:
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
analyzer:
path: ../analyzer
meta:
path: ../meta

View file

@ -10,19 +10,13 @@ environment:
dependencies:
analyzer: any
args: any
linter: ^1.0.0
linter: any
meta: any
path: any
pub_semver: ^2.0.0
pub_semver: any
yaml: any
dev_dependencies:
lints: any
test_reflective_loader: ^0.2.0
test: ^1.0.0
dependency_overrides:
analyzer:
path: ../analyzer
meta:
path: ../meta
test_reflective_loader: any
test: any

View file

@ -6,11 +6,9 @@ environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
analyzer:
path: ../analyzer
analyzer: any
html: any
meta:
path: ../meta
meta: any
path: any
test: any

View file

@ -13,5 +13,4 @@ environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
expect:
path: ../expect
expect: any

View file

@ -9,8 +9,7 @@ environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
front_end:
path: ../front_end
front_end: any
dev_dependencies:
test: any

View file

@ -10,110 +10,25 @@ environment:
# package. The `.packages` file in the repository root will be used by default.
dependencies:
_fe_analyzer_shared: any
# Published packages - repo version ensured via dependency_overrides
_js_interop_checks: any
collection: any
crypto: any
dart2js_info:
path: ../dart2js_info
front_end:
path: ../front_end
kernel:
path: ../kernel
# Unpublished packages that can be used via path dependency
_js_interop_checks:
path: ../_js_interop_checks
js_ast:
path: ../js_ast
js_runtime:
path: ../js_runtime
dart2js_info: any
front_end: any
js_ast: any
js_runtime: any
kernel: any
dev_dependencies:
# Published packages - repo version ensured via dependency_overrides
args: any
dart_style: any
http: any
js:
path: ../js
js: any
path: any
source_maps: any
# Unpublished packages that can be used via path dependency
async_helper:
path: ../async_helper
dart2js_tools:
path: ../dart2js_tools
expect:
path: ../expect
modular_test:
path: ../modular_test
sourcemap_testing:
path: ../sourcemap_testing
testing:
path: ../testing
dependency_overrides:
# Packages with source in the SDK
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
analyzer:
path: ../analyzer
front_end:
path: ../front_end
js:
path: ../js
kernel:
path: ../kernel
meta:
path: ../meta
dart2js_info:
path: ../dart2js_info
smith:
path: ../smith
# Packages brought in via DEPS
args:
path: ../../third_party/pkg/args
async:
path: ../../third_party/pkg/async
charcode:
path: ../../third_party/pkg/charcode
collection:
path: ../../third_party/pkg/collection
convert:
path: ../../third_party/pkg/convert
crypto:
path: ../../third_party/pkg/crypto
fixnum:
path: ../../third_party/pkg/fixnum
http_parser:
path: ../../third_party/pkg/http_parser
matcher:
path: ../../third_party/pkg/matcher
mime:
path: ../../third_party/pkg/mime
package_config:
path: ../../third_party/pkg_tested/package_config
path:
path: ../../third_party/pkg/path
protobuf:
path: ../../third_party/pkg/protobuf/protobuf
shelf:
path: ../../third_party/pkg/shelf/pkgs/shelf
shelf_static:
path: ../../third_party/pkg/shelf/pkgs/shelf_static
source_span:
path: ../../third_party/pkg/source_span
stack_trace:
path: ../../third_party/pkg/stack_trace
stream_channel:
path: ../../third_party/pkg/stream_channel
string_scanner:
path: ../../third_party/pkg/string_scanner
test:
path: ../../third_party/pkg/test/pkgs/test
test_api:
path: ../../third_party/pkg/test/pkgs/test_api
typed_data:
path: ../../third_party/pkg/typed_data
yaml:
path: ../../third_party/pkg/yaml
async_helper: any
dart2js_tools: any
expect: any
modular_test: any
sourcemap_testing: any
testing: any

View file

@ -9,17 +9,17 @@ environment:
sdk: '>=2.11.99 <3.0.0'
dependencies:
args: ^2.3.0
collection: ^1.10.1
fixnum: '>=0.10.5 <2.0.0'
path: ^1.3.6
protobuf: '>=1.0.1 <3.0.0'
shelf: ^1.2.0
yaml: ^3.1.0
args: any
collection: any
fixnum: any
path: any
protobuf: any
shelf: any
yaml: any
dev_dependencies:
lints: any
test: ^1.2.0
test: any
executables:
dart2js_info: tools

View file

@ -12,6 +12,4 @@ environment:
sdk: ">=2.14.0 <2.15.0"
dev_dependencies:
# Unpublished packages that can be used via path dependency
expect:
path: ../expect
expect: any

View file

@ -4,10 +4,12 @@ publish_to: none
description: >
Collection of tools used with dart2js including analyzing compilation
information, deobfuscation of stack-traces and minified names.
dependencies:
path: any
source_maps: ^0.10.10
source_span: any
stack_trace: ^1.9.3
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
path: any
source_maps: any
source_span: any
stack_trace: any

View file

@ -5,26 +5,8 @@ environment:
sdk: '>=2.12.0'
dependencies:
_js_interop_checks:
path: ../_js_interop_checks
front_end:
path: ../front_end
kernel:
path: ../kernel
vm:
path: ../vm
wasm_builder:
path: ../wasm_builder
dependency_overrides:
# Packages with source in the SDK
_js_interop_checks:
path: ../_js_interop_checks
front_end:
path: ../front_end
kernel:
path: ../kernel
vm:
path: ../vm
wasm_builder:
path: ../wasm_builder
_js_interop_checks: any
front_end: any
kernel: any
vm: any
wasm_builder: any

View file

@ -5,37 +5,28 @@ publish_to: none
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
analysis_server:
path: ../analysis_server
analysis_server_client:
path: ../analysis_server_client
analyzer:
path: ../analyzer
analysis_server: any
analysis_server_client: any
analyzer: any
args: any
cli_util: any
collection: any
dart2native:
path: ../dart2native
dart2native: any
dart_style: any
dartdoc: any
dds:
path: ../dds
front_end:
path: ../front_end
meta:
path: ../meta
nnbd_migration:
path: ../nnbd_migration
dds: any
front_end: any
meta: any
nnbd_migration: any
path: any
pub: any
telemetry:
path: ../telemetry
telemetry: any
usage: any
dev_dependencies:
expect:
path: ../expect
expect: any
lints: any
pub_semver: any
test: any

View file

@ -7,51 +7,30 @@ environment:
dependencies:
_fe_analyzer_shared: any
_js_interop_checks:
path: ../_js_interop_checks
_js_interop_checks: any
args: any
async: any
bazel_worker: any
build_integration:
path: ../build_integration
collection: ^1.15.0
front_end:
path: ../front_end
kernel:
path: ../kernel
build_integration: any
collection: any
front_end: any
kernel: any
meta: any
path: any
source_maps: any
source_span: any
dev_dependencies:
browser_launcher: ^1.0.0
expect:
path: ../expect
browser_launcher: any
expect: any
http_multi_server: any
js: any
lints: any
modular_test:
path: ../modular_test
sourcemap_testing:
path: ../sourcemap_testing
stack_trace: any
modular_test: any
shelf: any
sourcemap_testing: any
stack_trace: any
test: any
testing:
path: ../testing
vm:
path: ../vm
webkit_inspection_protocol: ^1.0.0
dependency_overrides:
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
js:
path: ../js
meta:
path: ../meta
shelf:
path: ../../third_party/pkg/shelf/pkgs/shelf
http_multi_server:
path: ../../third_party/pkg/http_multi_server
testing: any
vm: any
webkit_inspection_protocol: any

View file

@ -14,9 +14,3 @@ environment:
dependencies:
meta: any
smith: any
dependency_overrides:
meta:
path: ../meta
smith:
path: ../smith

View file

@ -10,44 +10,25 @@ environment:
dependencies:
_fe_analyzer_shared: any
kernel:
path: ../kernel
kernel: any
package_config: any
dev_dependencies:
analyzer: any
args: ^2.0.0
async_helper:
path: ../async_helper
build_integration:
path: ../build_integration
compiler:
path: ../compiler
dart2wasm:
path: ../dart2wasm
dart_style: ^2.0.0
dev_compiler:
path: ../dev_compiler
expect:
path: ../expect
json_rpc_2: ^3.0.0
path: ^1.3.9
test: ^1.3.4
testing:
path: ../testing
test_reflective_loader: ^0.2.0
vm:
path: ../vm
args: any
async_helper: any
build_integration: any
compiler: any
dart2wasm: any
dart_style: any
dev_compiler: any
expect: any
json_rpc_2: any
path: any
test: any
test_reflective_loader: any
testing: any
vm: any
vm_service: any
web_socket_channel: ^2.0.0
web_socket_channel: any
yaml: any
dependency_overrides:
analyzer:
path: ../analyzer
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
package_config:
path: ../../third_party/pkg_tested/package_config
vm_service:
path: ../vm_service

View file

@ -7,24 +7,17 @@ environment:
sdk: "^2.15.0"
dependencies:
args: ^2.0.0
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
build_integration:
path: ../build_integration
compiler:
path: ../compiler
dev_compiler:
path: ../dev_compiler
front_end:
path: ../front_end
kernel:
path: ../kernel
package_config: ^2.0.0
_fe_analyzer_shared: any
args: any
build_integration: any
compiler: any
dev_compiler: any
front_end: any
kernel: any
package_config: any
path: any
usage: any
vm:
path: ../vm
vm: any
dev_dependencies:
mockito: any

View file

@ -6,7 +6,6 @@ environment:
sdk: '>=2.16.0 <3.0.0'
dev_dependencies:
expect:
path: ../expect
lints: ^2.0.0
test: ^1.3.4
expect: any
lints: any
test: any

View file

@ -6,7 +6,5 @@ environment:
sdk: '>=2.12.0 <3.0.0'
dev_dependencies:
expect:
path: ../expect
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
expect: any
_fe_analyzer_shared: any

View file

@ -9,9 +9,7 @@ environment:
sdk: '>=2.12.0 <3.0.0'
dev_dependencies:
args: ^2.0.0
expect:
path: ../expect
front_end:
path: ../front_end
args: any
expect: any
front_end: any
test: any

View file

@ -5,6 +5,7 @@ description: >
Small framework to test modular pipelines.
This is used within the Dart SDK to define and validate modular tests, and to
execute them using the modular pipeline of different SDK tools.
environment:
sdk: '>=2.16.0 <3.0.0'
@ -14,8 +15,6 @@ dependencies:
yaml: any
dev_dependencies:
async_helper:
path: ../async_helper
expect:
path: ../expect
async_helper: any
expect: any
test: any

View file

@ -10,30 +10,19 @@ dependencies:
_fe_analyzer_shared: any
analyzer: any
analyzer_plugin: any
args: ^2.3.0
cli_util: ^0.3.5
collection: ^1.15.0
crypto: ^3.0.1
args: any
cli_util: any
collection: any
crypto: any
meta: any
path: ^1.6.2
pub_semver: ^2.1.0
source_span: ^1.4.1
path: any
pub_semver: any
source_span: any
yaml: any
dev_dependencies:
analyzer_utilities:
path: ../analyzer_utilities
http: ^0.13.4
analyzer_utilities: any
http: any
lints: any
test: ^1.6.4
test_reflective_loader: ^0.2.0
dependency_overrides:
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
analyzer:
path: ../analyzer
analyzer_plugin:
path: ../analyzer_plugin
meta:
path: ../meta
test: any
test_reflective_loader: any

View file

@ -7,10 +7,9 @@ environment:
sdk: ^2.13.0
dependencies:
args: ^2.1.1
analyzer:
path: ../analyzer
path: ^1.7.0
args: any
analyzer: any
path: any
dev_dependencies:
lints: any

View file

@ -5,5 +5,4 @@ publish_to: none
environment:
sdk: "^2.12.0"
dev_dependencies:
expect:
path: ../expect
expect: any

View file

@ -7,12 +7,9 @@ environment:
sdk: '>=2.1.0 <3.0.0'
dependencies:
_fe_analyzer_shared:
path: ../_fe_analyzer_shared
dart2js_tools:
path: ../dart2js_tools
expect:
path: ../expect
_fe_analyzer_shared: any
dart2js_tools: any
expect: any
path: any
source_maps: any
source_span: any

View file

@ -1,12 +1,13 @@
name: status_file
# This package is not intended for consumption on pub.dev. DO NOT publish.
publish_to: none
environment:
sdk: "^2.12.0"
dependencies:
path: "^1.4.0"
args: ^2.0.0
path: any
args: any
dev_dependencies:
expect:
path: ../expect
expect: any

View file

@ -7,12 +7,11 @@ environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
http: ^0.13.0
meta:
path: ../meta
path: ^1.4.0
stack_trace: ^1.7.0
usage: ^4.0.0
http: any
meta: any
path: any
stack_trace: any
usage: any
dev_dependencies:
test: ^1.0.0
test: any

View file

@ -9,33 +9,16 @@ environment:
sdk: "^2.3.0"
dependencies:
args: any
dart2js_tools:
path: ../dart2js_tools
package_config:
path: ../../third_party/pkg_tested/package_config
dart2js_tools: any
package_config: any
path: any
pool: any
smith:
path: ../smith
status_file:
path: ../status_file
webdriver:
path: ../../third_party/pkg/webdriver
smith: any
status_file: any
webdriver: any
dev_dependencies:
analyzer:
path: ../../pkg/analyzer
expect:
path: ../expect
analyzer: any
expect: any
file: any
glob: any
dependency_overrides:
# Other packages in the dependency graph have normal hosted dependencies on
# this, so just override it to force the local one.
analyzer:
path: ../../pkg/analyzer
args:
path: ../../third_party/pkg/args
file:
path: ../../third_party/pkg/file/packages/file
glob:
path: ../../third_party/pkg/glob

View file

@ -7,20 +7,16 @@ environment:
sdk: '>=2.15.0 <3.0.0'
dependencies:
args: ^2.0.0
build_integration:
path: ../build_integration
args: any
build_integration: any
collection: any
crypto: any
front_end:
path: ../front_end
kernel:
path: ../kernel
front_end: any
kernel: any
package_config: any
collection: ^1.15.0
dev_dependencies:
expect:
path: ../expect
expect: any
json_rpc_2: any
path: any
test: any

View file

@ -7,7 +7,7 @@ environment:
sdk: '>=2.7.0 <3.0.0'
dependencies:
path: ^1.6.0
path: any
dev_dependencies:
lints: any

View file

@ -327,18 +327,10 @@ class Package implements Comparable<Package> {
// for pkg/ packages.
if (!publishable) {
for (PubDep dep in [..._declaredPubDeps, ..._declaredDevPubDeps]) {
if (pkgPackages.contains(dep.name) && dep is! PathPubDep) {
// check to see if there is a dependency_override to a path dependency
final override = _declaredOverridePubDeps
.singleWhereOrNull((element) => element.name == dep.name);
if (override != null && override is PathPubDep) {
continue;
}
out(' Prefer a relative path dep for pkg/ packages:');
out(' $dep');
fail = true;
}
if (dep is AnyPubDep) continue;
out(' Prefer `any` dependencies for unpublished packages');
out(' $dep');
fail = true;
}
}
@ -530,7 +522,7 @@ abstract class PubDep {
static PubDep parse(String name, Object dep) {
if (dep is String) {
return SemverPubDep(name, dep);
return (dep == 'any') ? AnyPubDep(name) : SemverPubDep(name, dep);
} else if (dep is Map) {
if (dep.containsKey('path')) {
return PathPubDep(name, dep['path']);
@ -543,6 +535,13 @@ abstract class PubDep {
}
}
class AnyPubDep extends PubDep {
AnyPubDep(String name) : super(name);
@override
String toString() => '$name: any';
}
class SemverPubDep extends PubDep {
final String value;