Revert "Migrate to use pub workspace"

This reverts commit b9b77058a9fa6430603b81b601fdc0c031cb9f63.


Revert "Add missing sample pubspec to workspace"

This reverts commit 892ea15ac73f0a89b080135d70f9ff35b0edcfc0.


These seem to break the engine.

Change-Id: Ieee26deb7928c3869a1b6265326c3ce568ffe731
Tested: this is a revert.
CoreLibraryReviewExempt: this is a revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/.gitignore b/.gitignore
index 4cb1a0c..a29bb37 100644
--- a/.gitignore
+++ b/.gitignore
@@ -82,7 +82,7 @@
 /.dart_tool/native_assets_builder/
 
 # Files generated by pub and other dart tools.
-.dart_tool/
+/.dart_tool/
 
 # Generated by tools/generate_package_config.dart to include extra packages in
 # the project.
diff --git a/pkg/_fe_analyzer_shared/pubspec.yaml b/pkg/_fe_analyzer_shared/pubspec.yaml
index cfc6b74..1161dcf 100644
--- a/pkg/_fe_analyzer_shared/pubspec.yaml
+++ b/pkg/_fe_analyzer_shared/pubspec.yaml
@@ -6,7 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   meta: ^1.9.0
@@ -20,3 +19,8 @@
   collection: any
   test: any
 
+dependency_overrides:
+  test:
+    path: ../../third_party/pkg/test/pkgs/test/
+  analyzer:
+    path: ../analyzer
diff --git a/pkg/_js_interop_checks/pubspec.yaml b/pkg/_js_interop_checks/pubspec.yaml
index 183e502..4e299a3 100644
--- a/pkg/_js_interop_checks/pubspec.yaml
+++ b/pkg/_js_interop_checks/pubspec.yaml
@@ -6,8 +6,6 @@
   # Use min prerelease bound to get the latest formatter changes.
   sdk: '^3.7.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/_macros/pubspec.yaml b/pkg/_macros/pubspec.yaml
index cafd28b..37e6dc5 100644
--- a/pkg/_macros/pubspec.yaml
+++ b/pkg/_macros/pubspec.yaml
@@ -8,9 +8,7 @@
 repository: https://github.com/dart-lang/sdk/tree/main/pkg/_macros
 
 environment:
-  sdk: ^3.5.0
-
-resolution: workspace
+  sdk: ^3.4.0-256.0.dev
 
 # Note that as an SDK vendored package, pub package dependencies are only
 # allowed in the dev_dependencies section.
diff --git a/pkg/analysis_server/pubspec.yaml b/pkg/analysis_server/pubspec.yaml
index 6b792b7..cea36d5 100644
--- a/pkg/analysis_server/pubspec.yaml
+++ b/pkg/analysis_server/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: '^3.7.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
@@ -46,3 +44,127 @@
   test_descriptor: any
   test_reflective_loader: any
   web_socket_channel: any
+
+dependency_overrides:
+  _fe_analyzer_shared:
+    path: ../_fe_analyzer_shared
+  analysis_server_plugin:
+    path: ../analysis_server_plugin
+  analyzer:
+    path: ../analyzer
+  analyzer_plugin:
+    path: ../analyzer_plugin
+  analyzer_utilities:
+    path: ../analyzer_utilities
+  args:
+    path: ../../third_party/pkg/args
+  async:
+    path: ../../third_party/pkg/async
+  boolean_selector:
+    path: ../../third_party/pkg/boolean_selector
+  cli_util:
+    path: ../../third_party/pkg/cli_util
+  clock:
+    path: ../../third_party/pkg/clock
+  collection:
+    path: ../../third_party/pkg/collection
+  convert:
+    path: ../../third_party/pkg/convert
+  crypto:
+    path: ../../third_party/pkg/crypto
+  dart_style:
+    path: ../../third_party/pkg/dart_style
+  dtd:
+    path: ../dtd
+  file:
+    path: ../../third_party/pkg/file/packages/file
+  frontend_server_client:
+    path: ../../third_party/pkg/webdev/frontend_server_client
+  glob:
+    path: ../../third_party/pkg/glob
+  http:
+    path: ../../third_party/pkg/http/pkgs/http
+  http_multi_server:
+    path: ../../third_party/pkg/http_multi_server
+  http_parser:
+    path: ../../third_party/pkg/http_parser
+  intl:
+    path: ../../third_party/pkg/intl
+  json_rpc_2:
+    path: ../../third_party/pkg/json_rpc_2
+  js:
+    path: ../js
+  language_server_protocol:
+    path: ../../third_party/pkg/language_server_protocol
+  linter:
+    path: ../linter
+  lints:
+    path: ../../third_party/pkg/lints
+  logging:
+    path: ../../third_party/pkg/logging
+  matcher:
+    path: ../../third_party/pkg/matcher
+  memory_usage:
+    path: ../../third_party/pkg/leak_tracker/pkgs/memory_usage
+  meta:
+    path: ../meta
+  mime:
+    path: ../../third_party/pkg/tools/pkgs/mime
+  package_config:
+    path: ../../third_party/pkg/package_config
+  path:
+    path: ../../third_party/pkg/path
+  pool:
+    path: ../../third_party/pkg/pool
+  pub_semver:
+    path: ../../third_party/pkg/pub_semver
+  shelf:
+    path: ../../third_party/pkg/shelf/pkgs/shelf
+  shelf_packages_handler:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_packages_handler
+  shelf_static:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_static
+  shelf_web_socket:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_web_socket
+  source_map_stack_trace:
+    path: ../../third_party/pkg/tools/pkgs/source_map_stack_trace
+  source_maps:
+    path: ../../third_party/pkg/source_maps
+  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
+  telemetry:
+    path: ../telemetry
+  term_glyph:
+    path: ../../third_party/pkg/term_glyph
+  test:
+    path: ../../third_party/pkg/test/pkgs/test
+  test_api:
+    path: ../../third_party/pkg/test/pkgs/test_api
+  test_core:
+    path: ../../third_party/pkg/test/pkgs/test_core
+  test_descriptor:
+    path: ../../third_party/pkg/test_descriptor
+  test_reflective_loader:
+    path: ../../third_party/pkg/test_reflective_loader
+  typed_data:
+    path: ../../third_party/pkg/typed_data
+  unified_analytics:
+    path: ../../third_party/pkg/tools/pkgs/unified_analytics
+  vm_service:
+    path: ../vm_service
+  watcher:
+    path: ../../third_party/pkg/watcher
+  web_socket_channel:
+    path: ../../third_party/pkg/web_socket_channel
+  webkit_inspection_protocol:
+    path: ../../third_party/pkg/webkit_inspection_protocol
+  yaml:
+    path: ../../third_party/pkg/yaml
+  yaml_edit:
+    path: ../../third_party/pkg/yaml_edit
diff --git a/pkg/analysis_server_client/pubspec.yaml b/pkg/analysis_server_client/pubspec.yaml
index 3875509..afc1a20 100644
--- a/pkg/analysis_server_client/pubspec.yaml
+++ b/pkg/analysis_server_client/pubspec.yaml
@@ -12,8 +12,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   path: any
diff --git a/pkg/analysis_server_plugin/pubspec.yaml b/pkg/analysis_server_plugin/pubspec.yaml
index 1aa7a78..50b963c 100644
--- a/pkg/analysis_server_plugin/pubspec.yaml
+++ b/pkg/analysis_server_plugin/pubspec.yaml
@@ -6,7 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   analyzer: ^7.3.0
@@ -22,3 +21,127 @@
   test_reflective_loader: any
   test: any
 
+# These dependency overrides are present in order to allow publishing this
+# package. Otherwise, `dart pub publish` complains, even though they are dev
+# dependencies.
+dependency_overrides:
+  _fe_analyzer_shared:
+    path: ../_fe_analyzer_shared
+  analyzer:
+    path: ../analyzer
+  analyzer_plugin:
+    path: ../analyzer_plugin
+  analyzer_utilities:
+    path: ../analyzer_utilities
+  args:
+    path: ../../third_party/pkg/args
+  async:
+    path: ../../third_party/pkg/async
+  boolean_selector:
+    path: ../../third_party/pkg/boolean_selector
+  cli_util:
+    path: ../../third_party/pkg/cli_util
+  clock:
+    path: ../../third_party/pkg/clock
+  collection:
+    path: ../../third_party/pkg/collection
+  convert:
+    path: ../../third_party/pkg/convert
+  crypto:
+    path: ../../third_party/pkg/crypto
+  dart_style:
+    path: ../../third_party/pkg/dart_style
+  file:
+    path: ../../third_party/pkg/file/packages/file
+  frontend_server_client:
+    path: ../../third_party/pkg/webdev/frontend_server_client
+  glob:
+    path: ../../third_party/pkg/glob
+  http:
+    path: ../../third_party/pkg/http/pkgs/http
+  http_multi_server:
+    path: ../../third_party/pkg/http_multi_server
+  http_parser:
+    path: ../../third_party/pkg/http_parser
+  intl:
+    path: ../../third_party/pkg/intl
+  js:
+    path: ../js
+  language_server_protocol:
+    path: ../../third_party/pkg/language_server_protocol
+  linter:
+    path: ../linter
+  lints:
+    path: ../../third_party/pkg/lints
+  logging:
+    path: ../../third_party/pkg/logging
+  matcher:
+    path: ../../third_party/pkg/matcher
+  memory_usage:
+    path: ../../third_party/pkg/leak_tracker/pkgs/memory_usage
+  meta:
+    path: ../meta
+  mime:
+    path: ../../third_party/pkg/tools/pkgs/mime
+  package_config:
+    path: ../../third_party/pkg/package_config
+  path:
+    path: ../../third_party/pkg/path
+  pool:
+    path: ../../third_party/pkg/pool
+  pub_semver:
+    path: ../../third_party/pkg/pub_semver
+  server_plugin:
+    path: ../server_plugin
+  shelf:
+    path: ../../third_party/pkg/shelf/pkgs/shelf
+  shelf_packages_handler:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_packages_handler
+  shelf_static:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_static
+  shelf_web_socket:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_web_socket
+  source_map_stack_trace:
+    path: ../../third_party/pkg/tools/pkgs/source_map_stack_trace
+  source_maps:
+    path: ../../third_party/pkg/source_maps
+  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
+  telemetry:
+    path: ../telemetry
+  term_glyph:
+    path: ../../third_party/pkg/term_glyph
+  test:
+    path: ../../third_party/pkg/test/pkgs/test
+  test_api:
+    path: ../../third_party/pkg/test/pkgs/test_api
+  test_core:
+    path: ../../third_party/pkg/test/pkgs/test_core
+  test_descriptor:
+    path: ../../third_party/pkg/test_descriptor
+  test_reflective_loader:
+    path: ../../third_party/pkg/test_reflective_loader
+  typed_data:
+    path: ../../third_party/pkg/typed_data
+  unified_analytics:
+    path: ../../third_party/pkg/tools/pkgs/unified_analytics
+  usage:
+    path: ../../third_party/pkg/usage
+  vm_service:
+    path: ../vm_service
+  watcher:
+    path: ../../third_party/pkg/watcher
+  web_socket_channel:
+    path: ../../third_party/pkg/web_socket_channel
+  webkit_inspection_protocol:
+    path: ../../third_party/pkg/webkit_inspection_protocol
+  yaml:
+    path: ../../third_party/pkg/yaml
+  yaml_edit:
+    path: ../../third_party/pkg/yaml_edit
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index eaacb4d..c88e8cd 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -7,7 +7,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   _fe_analyzer_shared: ^80.0.0
@@ -40,3 +39,17 @@
   test_reflective_loader: any
   vm_service: any
 
+# These dependency overrides are present in order to allow publishing this
+# package. Otherwise, `dart pub publish` complains, even though they are dev
+# dependencies.
+dependency_overrides:
+  _fe_analyzer_shared:
+    path: ../_fe_analyzer_shared
+  analyzer_utilities:
+    path: ../analyzer_utilities
+  heap_snapshot:
+    path: ../heap_snapshot
+  linter:
+    path: ../linter
+  vm_service:
+    path: ../vm_service
diff --git a/pkg/analyzer_cli/pubspec.yaml b/pkg/analyzer_cli/pubspec.yaml
index 6e67306..0607768 100644
--- a/pkg/analyzer_cli/pubspec.yaml
+++ b/pkg/analyzer_cli/pubspec.yaml
@@ -7,8 +7,6 @@
 environment:
   sdk: ^3.7.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   analyzer: any
diff --git a/pkg/analyzer_plugin/pubspec.yaml b/pkg/analyzer_plugin/pubspec.yaml
index 85c501c..0928a42 100644
--- a/pkg/analyzer_plugin/pubspec.yaml
+++ b/pkg/analyzer_plugin/pubspec.yaml
@@ -6,7 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   analyzer: ^7.2.0
@@ -27,3 +26,12 @@
   meta: any
   test_reflective_loader: any
   test: any
+
+# These dependency overrides are present in order to allow publishing this
+# package. Otherwise, `dart pub publish` complains, even though they are dev
+# dependencies.
+dependency_overrides:
+  analyzer_utilities:
+    path: ../analyzer_utilities
+  linter:
+    path: ../linter
diff --git a/pkg/analyzer_utilities/pubspec.yaml b/pkg/analyzer_utilities/pubspec.yaml
index 10713d1..90a36b9 100644
--- a/pkg/analyzer_utilities/pubspec.yaml
+++ b/pkg/analyzer_utilities/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   analyzer: any
diff --git a/pkg/async_helper/pubspec.yaml b/pkg/async_helper/pubspec.yaml
index a7bb1e2..6fea2df 100644
--- a/pkg/async_helper/pubspec.yaml
+++ b/pkg/async_helper/pubspec.yaml
@@ -11,8 +11,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   expect: any
diff --git a/pkg/bisect_dart/pubspec.yaml b/pkg/bisect_dart/pubspec.yaml
index 0ce1eea..fde8326 100644
--- a/pkg/bisect_dart/pubspec.yaml
+++ b/pkg/bisect_dart/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 dependencies:
   cli_config: any
   logging: any
diff --git a/pkg/build_integration/pubspec.yaml b/pkg/build_integration/pubspec.yaml
index 67ab74a..bbf5cf8 100644
--- a/pkg/build_integration/pubspec.yaml
+++ b/pkg/build_integration/pubspec.yaml
@@ -8,8 +8,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   front_end: any
diff --git a/pkg/compiler/pubspec.yaml b/pkg/compiler/pubspec.yaml
index f853ee6..e170571 100644
--- a/pkg/compiler/pubspec.yaml
+++ b/pkg/compiler/pubspec.yaml
@@ -7,8 +7,6 @@
 environment:
   sdk: ^3.7.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/dart2bytecode/pubspec.yaml b/pkg/dart2bytecode/pubspec.yaml
index 770e9d2..8f128ab 100644
--- a/pkg/dart2bytecode/pubspec.yaml
+++ b/pkg/dart2bytecode/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   args: any
diff --git a/pkg/dart2js_info/pubspec.yaml b/pkg/dart2js_info/pubspec.yaml
index bcb4f4c..0101ed0 100644
--- a/pkg/dart2js_info/pubspec.yaml
+++ b/pkg/dart2js_info/pubspec.yaml
@@ -8,8 +8,6 @@
 environment:
   sdk: '^3.7.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   args: any
diff --git a/pkg/dart2js_runtime_metrics/pubspec.yaml b/pkg/dart2js_runtime_metrics/pubspec.yaml
index 236f6ae..d02f25c 100644
--- a/pkg/dart2js_runtime_metrics/pubspec.yaml
+++ b/pkg/dart2js_runtime_metrics/pubspec.yaml
@@ -9,8 +9,6 @@
 environment:
   sdk: "^3.7.0"
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   expect: any
diff --git a/pkg/dart2js_tools/pubspec.yaml b/pkg/dart2js_tools/pubspec.yaml
index 5bb9638..ca19fe6 100644
--- a/pkg/dart2js_tools/pubspec.yaml
+++ b/pkg/dart2js_tools/pubspec.yaml
@@ -8,8 +8,6 @@
 environment:
   sdk: '^3.7.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   path: any
diff --git a/pkg/dart2native/pubspec.yaml b/pkg/dart2native/pubspec.yaml
index 9598631..3d8c882 100644
--- a/pkg/dart2native/pubspec.yaml
+++ b/pkg/dart2native/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Add the bin/dart2native.dart script to the scripts pub installs.
 executables:
   dart2native:
diff --git a/pkg/dart2wasm/pubspec.yaml b/pkg/dart2wasm/pubspec.yaml
index c065abd..b546c56 100644
--- a/pkg/dart2wasm/pubspec.yaml
+++ b/pkg/dart2wasm/pubspec.yaml
@@ -4,8 +4,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/dart_internal/pubspec.yaml b/pkg/dart_internal/pubspec.yaml
index 7a543cc..e784e00 100644
--- a/pkg/dart_internal/pubspec.yaml
+++ b/pkg/dart_internal/pubspec.yaml
@@ -11,7 +11,6 @@
   # version of the SDK without it being a breaking change.
   sdk: '>=3.5.0 <3.9.0'
 
-resolution: workspace
 
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
diff --git a/pkg/dart_service_protocol_shared/pubspec.yaml b/pkg/dart_service_protocol_shared/pubspec.yaml
index 2e0122e..6713501 100644
--- a/pkg/dart_service_protocol_shared/pubspec.yaml
+++ b/pkg/dart_service_protocol_shared/pubspec.yaml
@@ -7,8 +7,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 dependencies:
   meta: ^1.11.0
 
diff --git a/pkg/dartdev/pubspec.yaml b/pkg/dartdev/pubspec.yaml
index 1adbb5b..6e77322 100644
--- a/pkg/dartdev/pubspec.yaml
+++ b/pkg/dartdev/pubspec.yaml
@@ -4,9 +4,7 @@
 publish_to: none
 
 environment:
-  sdk: ^3.5.0
-
-resolution: workspace
+  sdk: ^3.3.0
 
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
diff --git a/pkg/dds/pubspec.yaml b/pkg/dds/pubspec.yaml
index 85169f0..a321f02 100644
--- a/pkg/dds/pubspec.yaml
+++ b/pkg/dds/pubspec.yaml
@@ -8,7 +8,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   args: ^2.0.0
diff --git a/pkg/dds_service_extensions/pubspec.yaml b/pkg/dds_service_extensions/pubspec.yaml
index 5378711..ecbe5fb 100644
--- a/pkg/dds_service_extensions/pubspec.yaml
+++ b/pkg/dds_service_extensions/pubspec.yaml
@@ -8,7 +8,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   async: ^2.4.1
diff --git a/pkg/dev_compiler/pubspec.yaml b/pkg/dev_compiler/pubspec.yaml
index 7b59c7af..89a6240 100644
--- a/pkg/dev_compiler/pubspec.yaml
+++ b/pkg/dev_compiler/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: '>=3.6.0 <4.0.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/dtd/pubspec.yaml b/pkg/dtd/pubspec.yaml
index f85312e2..5c17757 100644
--- a/pkg/dtd/pubspec.yaml
+++ b/pkg/dtd/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 dependencies:
   json_rpc_2: ^3.0.2
   stream_channel: ^2.1.2
diff --git a/pkg/dtd_impl/pubspec.yaml b/pkg/dtd_impl/pubspec.yaml
index 59a76e7..ffad53f 100644
--- a/pkg/dtd_impl/pubspec.yaml
+++ b/pkg/dtd_impl/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   args: any
diff --git a/pkg/dynamic_modules/pubspec.yaml b/pkg/dynamic_modules/pubspec.yaml
index 20a9ade..e7cb25a 100644
--- a/pkg/dynamic_modules/pubspec.yaml
+++ b/pkg/dynamic_modules/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   args: any
diff --git a/pkg/expect/pubspec.yaml b/pkg/expect/pubspec.yaml
index 64cb321..570f3fc 100644
--- a/pkg/expect/pubspec.yaml
+++ b/pkg/expect/pubspec.yaml
@@ -12,8 +12,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   smith: any
diff --git a/pkg/front_end/pubspec.yaml b/pkg/front_end/pubspec.yaml
index fbfa6df..a12e09d 100644
--- a/pkg/front_end/pubspec.yaml
+++ b/pkg/front_end/pubspec.yaml
@@ -8,11 +8,6 @@
 environment:
   sdk: ^3.5.0
 
-workspace:
-  - testcases
-
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
@@ -39,3 +34,39 @@
   vm: any
   vm_service: any
   web_socket_channel: any
+
+dependency_overrides:
+  _fe_analyzer_shared:
+    path: ../_fe_analyzer_shared
+  _js_interop_checks:
+    path: ../_js_interop_checks
+  build_integration:
+    path: ../build_integration
+  compiler:
+    path: ../compiler
+  dart2js_info:
+    path: ../dart2js_info
+  dart2wasm:
+    path: ../dart2wasm
+  dev_compiler:
+    path: ../dev_compiler
+  expect:
+    path: ../expect
+  js_ast:
+    path: ../js_ast
+  js_runtime:
+    path: ../js_runtime
+  js_shared:
+    path: ../js_shared
+  kernel:
+    path: ../kernel
+  mmap:
+    path: ../mmap
+  smith:
+    path: ../smith
+  testing:
+    path: ../testing
+  vm:
+    path: ../vm
+  wasm_builder:
+    path: ../wasm_builder
diff --git a/pkg/front_end/testcases/pubspec.yaml b/pkg/front_end/testcases/pubspec.yaml
deleted file mode 100644
index 6e0649e..0000000
--- a/pkg/front_end/testcases/pubspec.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-name: front_end_testcases
-# This package is not intended for consumption on pub.dev. DO NOT publish.
-publish_to: none
-environment:
-  sdk: ^3.8.0-0
-resolution: workspace
\ No newline at end of file
diff --git a/pkg/frontend_server/pubspec.yaml b/pkg/frontend_server/pubspec.yaml
index 2117ca4..889783e 100644
--- a/pkg/frontend_server/pubspec.yaml
+++ b/pkg/frontend_server/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/heap_snapshot/pubspec.yaml b/pkg/heap_snapshot/pubspec.yaml
index 82e0936..6858d12 100644
--- a/pkg/heap_snapshot/pubspec.yaml
+++ b/pkg/heap_snapshot/pubspec.yaml
@@ -5,8 +5,9 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 dependencies:
   vm_service: any
 
+dependency_overrides:
+  vm_service:
+    path: ../vm_service
diff --git a/pkg/js/pubspec.yaml b/pkg/js/pubspec.yaml
index c6cda0c..aea29ff 100644
--- a/pkg/js/pubspec.yaml
+++ b/pkg/js/pubspec.yaml
@@ -9,8 +9,6 @@
 environment:
   sdk: ^3.7.0-0
 
-resolution: workspace
-
 # We use 'any' version constraints here as we get our package versions from
 # the dart-lang/sdk repo's DEPS file. Note that this is a special case; the
 # best practice for packages is to specify their compatible version ranges.
diff --git a/pkg/js_ast/pubspec.yaml b/pkg/js_ast/pubspec.yaml
index d683ebe..ae333c5 100644
--- a/pkg/js_ast/pubspec.yaml
+++ b/pkg/js_ast/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: '^3.7.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   expect: any
diff --git a/pkg/js_runtime/pubspec.yaml b/pkg/js_runtime/pubspec.yaml
index e407500..b529be7 100644
--- a/pkg/js_runtime/pubspec.yaml
+++ b/pkg/js_runtime/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/js_shared/pubspec.yaml b/pkg/js_shared/pubspec.yaml
index 7af6179..6c51a5f 100644
--- a/pkg/js_shared/pubspec.yaml
+++ b/pkg/js_shared/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/kernel/pubspec.yaml b/pkg/kernel/pubspec.yaml
index 8a6d989..ae32d019 100644
--- a/pkg/kernel/pubspec.yaml
+++ b/pkg/kernel/pubspec.yaml
@@ -8,8 +8,6 @@
 environment:
   sdk: ^3.6.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/linter/pubspec.yaml b/pkg/linter/pubspec.yaml
index 37560cf..6e22ddb 100644
--- a/pkg/linter/pubspec.yaml
+++ b/pkg/linter/pubspec.yaml
@@ -9,8 +9,6 @@
 environment:
   sdk: ^3.7.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   analyzer: any
diff --git a/pkg/macros/pubspec.yaml b/pkg/macros/pubspec.yaml
index a72e75f..d297f83 100644
--- a/pkg/macros/pubspec.yaml
+++ b/pkg/macros/pubspec.yaml
@@ -8,8 +8,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 dependencies:
   _macros:
     sdk: dart
diff --git a/pkg/meta/pubspec.yaml b/pkg/meta/pubspec.yaml
index 9658f47..de88d15 100644
--- a/pkg/meta/pubspec.yaml
+++ b/pkg/meta/pubspec.yaml
@@ -13,8 +13,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # We use 'any' version constraints here as we get our package versions from
 # the dart-lang/sdk repo's DEPS file. Note that this is a special case; the
 # best practice for packages is to specify their compatible version ranges.
diff --git a/pkg/mmap/pubspec.yaml b/pkg/mmap/pubspec.yaml
index 5ccf2c7..bc2e499 100644
--- a/pkg/mmap/pubspec.yaml
+++ b/pkg/mmap/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   ffi: any
diff --git a/pkg/modular_test/pubspec.yaml b/pkg/modular_test/pubspec.yaml
index 3d5f8e3..d54ad6c 100644
--- a/pkg/modular_test/pubspec.yaml
+++ b/pkg/modular_test/pubspec.yaml
@@ -9,8 +9,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   args: any
diff --git a/pkg/native_stack_traces/pubspec.yaml b/pkg/native_stack_traces/pubspec.yaml
index 466fad1..4c2ef7b 100644
--- a/pkg/native_stack_traces/pubspec.yaml
+++ b/pkg/native_stack_traces/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 executables:
   decode:
 
diff --git a/pkg/node_preamble/pubspec.yaml b/pkg/node_preamble/pubspec.yaml
index 1e16b99..d013607 100644
--- a/pkg/node_preamble/pubspec.yaml
+++ b/pkg/node_preamble/pubspec.yaml
@@ -2,7 +2,4 @@
 name: node_preamble
 environment:
   sdk: ^3.7.0
-
-resolution: workspace
-
 publish_to: none
diff --git a/pkg/record_use/pubspec.yaml b/pkg/record_use/pubspec.yaml
index da8e87a..043bcdb 100644
--- a/pkg/record_use/pubspec.yaml
+++ b/pkg/record_use/pubspec.yaml
@@ -7,8 +7,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 dependencies:
   collection: ^1.18.0
   pub_semver: ^2.1.4
diff --git a/pkg/reload_test/pubspec.yaml b/pkg/reload_test/pubspec.yaml
index c89da30..6306786 100644
--- a/pkg/reload_test/pubspec.yaml
+++ b/pkg/reload_test/pubspec.yaml
@@ -7,8 +7,6 @@
 environment:
   sdk: '>=3.6.0 <4.0.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   dev_compiler: any
diff --git a/pkg/scrape/pubspec.yaml b/pkg/scrape/pubspec.yaml
index c93e7c8..38364e3 100644
--- a/pkg/scrape/pubspec.yaml
+++ b/pkg/scrape/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   analyzer: any
diff --git a/pkg/server_plugin/pubspec.yaml b/pkg/server_plugin/pubspec.yaml
index 1cfe4c9..493848e 100644
--- a/pkg/server_plugin/pubspec.yaml
+++ b/pkg/server_plugin/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
 
@@ -14,3 +12,122 @@
 dev_dependencies:
   lints: any
 
+dependency_overrides:
+  _fe_analyzer_shared:
+    path: ../_fe_analyzer_shared
+  analyzer:
+    path: ../analyzer
+  analyzer_plugin:
+    path: ../analyzer_plugin
+  analyzer_utilities:
+    path: ../analyzer_utilities
+  args:
+    path: ../../third_party/pkg/args
+  async:
+    path: ../../third_party/pkg/async
+  boolean_selector:
+    path: ../../third_party/pkg/boolean_selector
+  cli_util:
+    path: ../../third_party/pkg/cli_util
+  clock:
+    path: ../../third_party/pkg/clock
+  collection:
+    path: ../../third_party/pkg/collection
+  convert:
+    path: ../../third_party/pkg/convert
+  crypto:
+    path: ../../third_party/pkg/crypto
+  dart_style:
+    path: ../../third_party/pkg/dart_style
+  file:
+    path: ../../third_party/pkg/file/packages/file
+  frontend_server_client:
+    path: ../../third_party/pkg/webdev/frontend_server_client
+  glob:
+    path: ../../third_party/pkg/glob
+  http:
+    path: ../../third_party/pkg/http/pkgs/http
+  http_multi_server:
+    path: ../../third_party/pkg/http_multi_server
+  http_parser:
+    path: ../../third_party/pkg/http_parser
+  intl:
+    path: ../../third_party/pkg/intl
+  js:
+    path: ../js
+  language_server_protocol:
+    path: ../../third_party/pkg/language_server_protocol
+  linter:
+    path: ../linter
+  lints:
+    path: ../../third_party/pkg/lints
+  logging:
+    path: ../../third_party/pkg/logging
+  matcher:
+    path: ../../third_party/pkg/matcher
+  memory_usage:
+    path: ../../third_party/pkg/leak_tracker/pkgs/memory_usage
+  meta:
+    path: ../meta
+  mime:
+    path: ../../third_party/pkg/tools/pkgs/mime
+  package_config:
+    path: ../../third_party/pkg/package_config
+  path:
+    path: ../../third_party/pkg/path
+  pool:
+    path: ../../third_party/pkg/pool
+  pub_semver:
+    path: ../../third_party/pkg/pub_semver
+  shelf:
+    path: ../../third_party/pkg/shelf/pkgs/shelf
+  shelf_packages_handler:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_packages_handler
+  shelf_static:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_static
+  shelf_web_socket:
+    path: ../../third_party/pkg/shelf/pkgs/shelf_web_socket
+  source_map_stack_trace:
+    path: ../../third_party/pkg/tools/pkgs/source_map_stack_trace
+  source_maps:
+    path: ../../third_party/pkg/source_maps
+  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
+  telemetry:
+    path: ../telemetry
+  term_glyph:
+    path: ../../third_party/pkg/term_glyph
+  test:
+    path: ../../third_party/pkg/test/pkgs/test
+  test_api:
+    path: ../../third_party/pkg/test/pkgs/test_api
+  test_core:
+    path: ../../third_party/pkg/test/pkgs/test_core
+  test_descriptor:
+    path: ../../third_party/pkg/test_descriptor
+  test_reflective_loader:
+    path: ../../third_party/pkg/test_reflective_loader
+  typed_data:
+    path: ../../third_party/pkg/typed_data
+  unified_analytics:
+    path: ../../third_party/pkg/tools/pkgs/unified_analytics
+  usage:
+    path: ../../third_party/pkg/usage
+  vm_service:
+    path: ../vm_service
+  watcher:
+    path: ../../third_party/pkg/watcher
+  web_socket_channel:
+    path: ../../third_party/pkg/web_socket_channel
+  webkit_inspection_protocol:
+    path: ../../third_party/pkg/webkit_inspection_protocol
+  yaml:
+    path: ../../third_party/pkg/yaml
+  yaml_edit:
+    path: ../../third_party/pkg/yaml_edit
diff --git a/pkg/smith/pubspec.yaml b/pkg/smith/pubspec.yaml
index 92b76a5..a5d9f04 100644
--- a/pkg/smith/pubspec.yaml
+++ b/pkg/smith/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   expect: any
diff --git a/pkg/sourcemap_testing/pubspec.yaml b/pkg/sourcemap_testing/pubspec.yaml
index fc9b8ff..3ca3233 100644
--- a/pkg/sourcemap_testing/pubspec.yaml
+++ b/pkg/sourcemap_testing/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.7.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/status_file/pubspec.yaml b/pkg/status_file/pubspec.yaml
index f3193fd..daa7a5b 100644
--- a/pkg/status_file/pubspec.yaml
+++ b/pkg/status_file/pubspec.yaml
@@ -5,8 +5,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   args: any
diff --git a/pkg/telemetry/pubspec.yaml b/pkg/telemetry/pubspec.yaml
index 691735a..0c0f1cf 100644
--- a/pkg/telemetry/pubspec.yaml
+++ b/pkg/telemetry/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   http: any
diff --git a/pkg/test_runner/pubspec.yaml b/pkg/test_runner/pubspec.yaml
index 102c13e..15c4089 100644
--- a/pkg/test_runner/pubspec.yaml
+++ b/pkg/test_runner/pubspec.yaml
@@ -9,8 +9,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   args: any
diff --git a/pkg/testing/pubspec.yaml b/pkg/testing/pubspec.yaml
index 5dadc4b..444246d 100644
--- a/pkg/testing/pubspec.yaml
+++ b/pkg/testing/pubspec.yaml
@@ -7,8 +7,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependency:
   lints: any
diff --git a/pkg/vm/pubspec.yaml b/pkg/vm/pubspec.yaml
index 26858eb..af00c7f 100644
--- a/pkg/vm/pubspec.yaml
+++ b/pkg/vm/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: '>=3.7.0 <4.0.0'
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
diff --git a/pkg/vm_service/pubspec.yaml b/pkg/vm_service/pubspec.yaml
index 9959a12..fad3dd9 100644
--- a/pkg/vm_service/pubspec.yaml
+++ b/pkg/vm_service/pubspec.yaml
@@ -9,7 +9,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 # We use 'any' version constraints here as we get our package versions from
 # the dart-lang/sdk repo's DEPS file. Note that this is a special case; the
diff --git a/pkg/vm_service/test/test_package/pubspec.yaml b/pkg/vm_service/test/test_package/pubspec.yaml
index 079f93c..d1bfffa 100644
--- a/pkg/vm_service/test/test_package/pubspec.yaml
+++ b/pkg/vm_service/test/test_package/pubspec.yaml
@@ -1,5 +1,4 @@
 name: test_package
 publish_to: none
 environment:
-  sdk: ^3.5.0
-resolution: workspace
+  sdk: ^3.5.0
\ No newline at end of file
diff --git a/pkg/vm_service_interface/pubspec.yaml b/pkg/vm_service_interface/pubspec.yaml
index 1b1de82..ac92a70 100644
--- a/pkg/vm_service_interface/pubspec.yaml
+++ b/pkg/vm_service_interface/pubspec.yaml
@@ -9,7 +9,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   vm_service: '>=14.3.0 <16.0.0'
diff --git a/pkg/vm_service_protos/pubspec.yaml b/pkg/vm_service_protos/pubspec.yaml
index a439959..297d13a 100644
--- a/pkg/vm_service_protos/pubspec.yaml
+++ b/pkg/vm_service_protos/pubspec.yaml
@@ -9,7 +9,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 dependencies:
   fixnum: ^1.0.0
diff --git a/pkg/vm_snapshot_analysis/pubspec.yaml b/pkg/vm_snapshot_analysis/pubspec.yaml
index 94e4b31..dadf1cb 100644
--- a/pkg/vm_snapshot_analysis/pubspec.yaml
+++ b/pkg/vm_snapshot_analysis/pubspec.yaml
@@ -6,7 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
 
 executables:
   snapshot_analysis: analyse
diff --git a/pkg/wasm_builder/pubspec.yaml b/pkg/wasm_builder/pubspec.yaml
index 88218f7..ca699a9 100644
--- a/pkg/wasm_builder/pubspec.yaml
+++ b/pkg/wasm_builder/pubspec.yaml
@@ -6,8 +6,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   collection: any
diff --git a/pubspec.yaml b/pubspec.yaml
deleted file mode 100644
index a506bae..0000000
--- a/pubspec.yaml
+++ /dev/null
@@ -1,319 +0,0 @@
-# Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-# This file defines pub workspace for the sdk enabling a common resolution.
-name: _
-publish_to: none
-environment:
-  # This constraint decides the langage-version for all dart code in the
-  # repository that doesn't have its own package. Mainly the code in `tests/`.
-  #
-  # It needs to be updated before testing language features introduced in the
-  # next language version.
-  sdk: ^3.8.0-0
-
-# These are the packages that are contained in the SDK.
-workspace:
-  - pkg/analysis_server
-  - pkg/analysis_server_client
-  - pkg/analysis_server_plugin
-  - pkg/analyzer
-  - pkg/analyzer_cli
-  - pkg/analyzer_plugin
-  - pkg/analyzer_utilities
-  - pkg/async_helper
-  - pkg/bisect_dart
-  - pkg/build_integration
-  - pkg/compiler
-  - pkg/dart2bytecode
-  - pkg/dart2js_info
-  - pkg/dart2js_runtime_metrics
-  - pkg/dart2js_tools
-  - pkg/dart2native
-  - pkg/dart2wasm
-  - pkg/dartdev
-  - pkg/dart_internal
-  - pkg/dart_service_protocol_shared
-  - pkg/dds
-  - pkg/dds_service_extensions
-  - pkg/dev_compiler
-  - pkg/dtd
-  - pkg/dtd_impl
-  - pkg/dynamic_modules
-  - pkg/expect
-  - pkg/_fe_analyzer_shared
-  - pkg/front_end
-  - pkg/frontend_server
-  - pkg/heap_snapshot
-  - pkg/js
-  - pkg/js_ast
-  - pkg/_js_interop_checks
-  - pkg/js_runtime
-  - pkg/js_shared
-  - pkg/kernel
-  - pkg/linter
-  - pkg/_macros
-  - pkg/macros
-  - pkg/meta
-  - pkg/mmap
-  - pkg/modular_test
-  - pkg/native_stack_traces
-  - pkg/node_preamble
-  - pkg/record_use
-  - pkg/reload_test
-  - pkg/scrape
-  - pkg/server_plugin
-  - pkg/smith
-  - pkg/sourcemap_testing
-  - pkg/status_file
-  - pkg/telemetry
-  - pkg/testing
-  - pkg/test_runner
-  - pkg/vm
-  - pkg/vm_service
-  - pkg/vm_service_interface
-  - pkg/vm_service_protos
-  - pkg/vm_snapshot_analysis
-  - pkg/wasm_builder
-  - samples/ffi/http
-  # dap and language_server_protocol are checked in to and
-  # developed in the sdk repo, though they are located in `third_party/`.
-  - third_party/pkg/dap
-  - third_party/pkg/language_server_protocol
-  - tools/package_deps
-  - tools
-
-# All third_party packages here are retrieved via the DEPS-file and overridden
-# here.
-dependency_overrides:
-  _experiment_sound:
-    path: third_party/pkg/webdev/fixtures/_experimentSound
-  _test_circular1_sound:
-    path: third_party/pkg/webdev/fixtures/_testCircular1Sound
-  _test_circular2_sound:
-    path: third_party/pkg/webdev/fixtures/_testCircular2Sound
-  _test_hot_restart1:
-    path: third_party/pkg/webdev/fixtures/_testHotRestart1Sound
-  _test_hot_restart2:
-    path: third_party/pkg/webdev/fixtures/_testHotRestart2Sound
-  _test_package_sound:
-    path: third_party/pkg/webdev/fixtures/_testPackageSound
-  _test_sound:
-    path: third_party/pkg/webdev/fixtures/_testSound
-  _webdev_sound_smoke:
-    path: third_party/pkg/webdev/fixtures/_webdevSoundSmoke
-  analysis_config:
-    path: third_party/pkg/webdev/_analysis_config
-  api_benchmark:
-    path: third_party/pkg/protobuf/api_benchmark
-  args:
-    path: third_party/pkg/core/pkgs/args
-  async:
-    path: third_party/pkg/core/pkgs/async
-  bazel_worker:
-    path: third_party/pkg/tools/pkgs/bazel_worker
-  benchmark_harness:
-    path: third_party/pkg/tools/pkgs/benchmark_harness
-  boolean_selector:
-    path: third_party/pkg/tools/pkgs/boolean_selector
-  browser_launcher:
-    path: third_party/pkg/tools/pkgs/browser_launcher
-  checks:
-    path: third_party/pkg/test/pkgs/checks
-  cli_config:
-    path: third_party/pkg/tools/pkgs/cli_config
-  cli_util:
-    path: third_party/pkg/tools/pkgs/cli_util
-  clock:
-    path: third_party/pkg/tools/pkgs/clock
-  collection:
-    path: third_party/pkg/core/pkgs/collection
-  convert:
-    path: third_party/pkg/core/pkgs/convert
-  corpus:
-    path: third_party/pkg/ecosystem/pkgs/corpus
-  coverage:
-    path: third_party/pkg/tools/pkgs/coverage
-  crypto:
-    path: third_party/pkg/core/pkgs/crypto
-  csslib:
-    path: third_party/pkg/tools/pkgs/csslib
-  dart_flutter_team_lints:
-    path: third_party/pkg/ecosystem/pkgs/dart_flutter_team_lints
-  dart_style:
-    path: third_party/pkg/dart_style
-  dartdoc:
-    path: third_party/pkg/dartdoc
-  extension_discovery:
-    path: third_party/pkg/tools/pkgs/extension_discovery
-  fake_async:
-    path: third_party/pkg/test/pkgs/fake_async
-  ffi:
-    path: third_party/pkg/native/pkgs/ffi
-  file:
-    path: third_party/pkg/tools/pkgs/file
-  file_testing:
-    path: third_party/pkg/tools/pkgs/file_testing
-  fixnum:
-    path: third_party/pkg/core/pkgs/fixnum
-  frontend_server_client:
-    path: third_party/pkg/webdev/frontend_server_client
-  glob:
-    path: third_party/pkg/tools/pkgs/glob
-  graphs:
-    path: third_party/pkg/tools/pkgs/graphs
-  html:
-    path: third_party/pkg/tools/pkgs/html
-  http:
-    path: third_party/pkg/http/pkgs/http
-  http2:
-    path: third_party/pkg/http/pkgs/http2
-  http_client_conformance_tests:
-    path: third_party/pkg/http/pkgs/http_client_conformance_tests
-  http_multi_server:
-    path: third_party/pkg/http/pkgs/http_multi_server
-  http_parser:
-    path: third_party/pkg/http/pkgs/http_parser
-  http_profile:
-    path: third_party/pkg/http/pkgs/http_profile
-  intl:
-    path: third_party/pkg/i18n/pkgs/intl
-  json_rpc_2:
-    path: third_party/pkg/tools/pkgs/json_rpc_2
-  leak_tracker:
-    path: third_party/pkg/leak_tracker/pkgs/leak_tracker
-  leak_tracker_testing:
-    path: third_party/pkg/leak_tracker/pkgs/leak_tracker_testing
-  lints:
-    path: third_party/pkg/core/pkgs/lints
-  logging:
-    path: third_party/pkg/core/pkgs/logging
-  markdown:
-    path: third_party/pkg/tools/pkgs/markdown
-  matcher:
-    path: third_party/pkg/test/pkgs/matcher
-  memory_usage:
-    path: third_party/pkg/leak_tracker/pkgs/memory_usage
-  mime:
-    path: third_party/pkg/tools/pkgs/mime
-  native_assets_builder:
-    path: third_party/pkg/native/pkgs/native_assets_builder
-  native_assets_cli:
-    path: third_party/pkg/native/pkgs/native_assets_cli
-  native_toolchain_c:
-    path: third_party/pkg/native/pkgs/native_toolchain_c
-  oauth2:
-    path: third_party/pkg/tools/pkgs/oauth2
-  os_detect:
-    path: third_party/pkg/core/pkgs/os_detect
-  package_config:
-    path: third_party/pkg/tools/pkgs/package_config
-  path:
-    path: third_party/pkg/core/pkgs/path
-  platform:
-    path: third_party/pkg/core/pkgs/platform
-  pool:
-    path: third_party/pkg/tools/pkgs/pool
-  protobuf:
-    path: third_party/pkg/protobuf/protobuf
-  protobuf_benchmarks:
-    path: third_party/pkg/protobuf/benchmarks
-  protoc_plugin:
-    path: third_party/pkg/protobuf/protoc_plugin
-  pub:
-    path: third_party/pkg/pub
-  pub_semver:
-    path: third_party/pkg/tools/pkgs/pub_semver
-  regression_tests:
-    path: third_party/pkg/test/integration_tests/regression
-  shelf:
-    path: third_party/pkg/shelf/pkgs/shelf
-  shelf_packages_handler:
-    path: third_party/pkg/shelf/pkgs/shelf_packages_handler
-  shelf_proxy:
-    path: third_party/pkg/shelf/pkgs/shelf_proxy
-  shelf_static:
-    path: third_party/pkg/shelf/pkgs/shelf_static
-  shelf_test_handler:
-    path: third_party/pkg/shelf/pkgs/shelf_test_handler
-  shelf_web_socket:
-    path: third_party/pkg/shelf/pkgs/shelf_web_socket
-  source_map_stack_trace:
-    path: third_party/pkg/tools/pkgs/source_map_stack_trace
-  source_maps:
-    path: third_party/pkg/tools/pkgs/source_maps
-  source_span:
-    path: third_party/pkg/tools/pkgs/source_span
-  spawn_hybrid:
-    path: third_party/pkg/test/integration_tests/spawn_hybrid
-  sse:
-    path: third_party/pkg/tools/pkgs/sse
-  stack_trace:
-    path: third_party/pkg/tools/pkgs/stack_trace
-  stream_channel:
-    path: third_party/pkg/tools/pkgs/stream_channel
-  string_scanner:
-    path: third_party/pkg/tools/pkgs/string_scanner
-  swift2objc:
-    path: third_party/pkg/native/pkgs/swift2objc
-  swiftgen:
-    path: third_party/pkg/native/pkgs/swiftgen
-  sync_http:
-    path: third_party/pkg/sync_http
-  tar:
-    path: third_party/pkg/tar
-  term_glyph:
-    path: third_party/pkg/tools/pkgs/term_glyph
-  test:
-    path: third_party/pkg/test/pkgs/test
-  test_api:
-    path: third_party/pkg/test/pkgs/test_api
-  test_core:
-    path: third_party/pkg/test/pkgs/test_core
-  test_descriptor:
-    path: third_party/pkg/test/pkgs/test_descriptor
-  test_process:
-    path: third_party/pkg/test/pkgs/test_process
-  test_reflective_loader:
-    path: third_party/pkg/tools/pkgs/test_reflective_loader
-  tool:
-    path: third_party/pkg/webdev/tool
-  typed_data:
-    path: third_party/pkg/core/pkgs/typed_data
-  unified_analytics:
-    path: third_party/pkg/tools/pkgs/unified_analytics
-  vector_math:
-    path: third_party/pkg/vector_math
-  wasm_tests:
-    path: third_party/pkg/test/integration_tests/wasm
-  watcher:
-    path: third_party/pkg/tools/pkgs/watcher
-  web:
-    path: third_party/pkg/web/web
-  web_socket:
-    path: third_party/pkg/http/pkgs/web_socket
-  web_socket_channel:
-    path: third_party/pkg/http/pkgs/web_socket_channel
-  webdriver:
-    path: third_party/pkg/webdriver
-  webkit_inspection_protocol:
-    path: third_party/pkg/webkit_inspection_protocol
-  yaml:
-    path: third_party/pkg/tools/pkgs/yaml
-  yaml_edit:
-    path: third_party/pkg/tools/pkgs/yaml_edit
-  io:
-    path: third_party/pkg/tools/pkgs/io
-  devtools_shared:
-    path: third_party/devtools/devtools_shared
-  observatory_test_package:
-    path: runtime/observatory/tests/service/observatory_test_package
-  # heapsnapshot has dependencies from outside the sdk, so cannot be part of
-  # the workspace. https://github.com/dart-lang/sdk/issues/50061
-  heapsnapshot:
-    path: runtime/tools/heapsnapshot
-  # observatory needs a migration to language version 3.6 before it can be
-  # included in the workspace. (If it is not deleted before)
-  observatory:
-    path: runtime/observatory
diff --git a/runtime/tools/heapsnapshot/pubspec.yaml b/runtime/tools/heapsnapshot/pubspec.yaml
index 7d14e65..74c3d9c 100644
--- a/runtime/tools/heapsnapshot/pubspec.yaml
+++ b/runtime/tools/heapsnapshot/pubspec.yaml
@@ -20,3 +20,8 @@
   path: ^1.8.0
   test: ^1.21.6
 
+dependency_overrides:
+  heap_snapshot:
+    path: ../../../pkg/heap_snapshot
+  mmap:
+    path: ../../../pkg/mmap
diff --git a/samples/ffi/http/pubspec.yaml b/samples/ffi/http/pubspec.yaml
index 22ef1da..1e4f6a3 100644
--- a/samples/ffi/http/pubspec.yaml
+++ b/samples/ffi/http/pubspec.yaml
@@ -2,10 +2,8 @@
 version: 0.0.1
 publish_to: none
 
-resolution: workspace
-
 environment:
-  sdk: ^3.5.0
+  sdk: '>=3.1.0 <4.0.0'
 
 dependencies:
   ffi: ^2.1.0
diff --git a/sdk/lib/js_util/js_util.dart b/sdk/lib/js_util/js_util.dart
index d960938..3d73e10 100644
--- a/sdk/lib/js_util/js_util.dart
+++ b/sdk/lib/js_util/js_util.dart
@@ -150,10 +150,10 @@
 /// Converts a JavaScript Promise to a Dart [Future].
 ///
 /// ```dart
-/// // ignore: deprecated_member_use_from_same_package, deprecated_member_use
+/// // ignore: deprecated_member_use_from_same_package
 /// import 'dart:js_util';
 ///
-/// // ignore: deprecated_member_use_from_same_package, deprecated_member_use
+/// // ignore: deprecated_member_use_from_same_package
 /// import 'package:js/js.dart';
 ///
 /// @JS()
diff --git a/third_party/pkg/dap/pubspec.yaml b/third_party/pkg/dap/pubspec.yaml
index bf98dd9..97b1feb 100644
--- a/third_party/pkg/dap/pubspec.yaml
+++ b/third_party/pkg/dap/pubspec.yaml
@@ -6,9 +6,7 @@
 repository: https://github.com/dart-lang/sdk/tree/main/third_party/pkg/dap
 
 environment:
-  sdk: ^3.5.0
-
-resolution: workspace
+  sdk: ^3.0.0
 
 # We use 'any' version constraints here as we get our package versions from
 # the dart-lang/sdk repo's DEPS file. Note that this is a special case; the
diff --git a/third_party/pkg/language_server_protocol/pubspec.yaml b/third_party/pkg/language_server_protocol/pubspec.yaml
index 3222b87..968040d 100644
--- a/third_party/pkg/language_server_protocol/pubspec.yaml
+++ b/third_party/pkg/language_server_protocol/pubspec.yaml
@@ -6,9 +6,7 @@
 publish_to: none
 
 environment:
-  sdk: ^3.5.0
-
-resolution: workspace
+  sdk: ^3.0.0
 
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
diff --git a/tools/generate_package_config.dart b/tools/generate_package_config.dart
index 9dbe707..08760d4 100644
--- a/tools/generate_package_config.dart
+++ b/tools/generate_package_config.dart
@@ -5,94 +5,381 @@
 /// Generates the repo's ".dart_tool/package_config.json" file.
 library;
 
-// This script should not depend on any external packages, as it is run before
-// any package resolution has taken place.
 import 'dart:convert';
 import 'dart:io';
 
-final repoRoot = File(Platform.script.toFilePath()).parent.parent.uri;
+// Important! Do not add package: imports to this file.
+// Do not add relative deps for libraries that themselves use package deps.
+// This tool runs before the .dart_tool/package_config.json file is created, so
+// can not itself use package references.
+
+final repoRoot = dirname(dirname(fromUri(Platform.script)));
 
 void main(List<String> args) {
   final fluteExists =
-      Directory.fromUri(repoRoot.resolve('third_party/flute')).existsSync();
-  final overridesFile = File.fromUri(
-    repoRoot.resolve('pubspec_overrides.yaml'),
-  );
-  if (fluteExists) {
-    // Make a `pubspec_overrides.yaml` file that includes all existing overrides
-    // and also `package:flute` and `package:characters`
-    final pubspec =
-        File.fromUri(repoRoot.resolve('pubspec.yaml')).readAsStringSync();
-    final overrides = RegExp(
-      'dependency_overrides:\n([\\S\\s]*?)^\$',
-      multiLine: true,
-    ).firstMatch(pubspec)![1];
-    overridesFile.writeAsStringSync('''
-# Created by tools/generate_package_config.dart to support flute.
+      Directory(join(repoRoot, platform('third_party/flute'))).existsSync();
 
-dependency_overrides:
-  flute:
-    path: third_party/flute/framework
-  engine:
-    path: third_party/flute/engine
-  flute_script:
-    path: third_party/flute/script
-  flute_benchmarks:
-    path: third_party/flute/benchmarks
-  material_color_utilities:
-    path: third_party/pkg/material_color_utilities/dart
-  characters:
-    path: third_party/pkg/core/pkgs/characters/
-$overrides
-''');
-  } else {
-    // Delete the overrides file if it exists.
-    if (overridesFile.existsSync()) {
-      File.fromUri(
-        repoRoot.resolve('pubspec_overrides.yaml'),
-      ).deleteSync(recursive: true);
+  var packageDirs = [
+    ...listSubdirectories(platform('pkg')),
+    ...listSubdirectories(platform('third_party/pkg')),
+    if (fluteExists) ...listSubdirectories(platform('third_party/flute')),
+    platform('pkg/vm_service/test/test_package'),
+    platform('runtime/observatory'),
+    platform('runtime/observatory/tests/service/observatory_test_package'),
+    platform('runtime/tools/heapsnapshot'),
+    platform('sdk/lib/_internal/sdk_library_metadata'),
+    platform('third_party/devtools/devtools_shared'),
+    platform('tools/package_deps'),
+  ];
+
+  var cfePackageDirs = [platform('pkg/front_end/testcases')];
+
+  var feAnalyzerSharedPackageDirs = [
+    platform('pkg/_fe_analyzer_shared/test/exhaustiveness/data'),
+    platform('pkg/_fe_analyzer_shared/test/flow_analysis/assigned_variables'),
+    platform('pkg/_fe_analyzer_shared/test/flow_analysis/definite_assignment'),
+    platform(
+      'pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment',
+    ),
+    platform('pkg/_fe_analyzer_shared/test/flow_analysis/nullability'),
+    platform('pkg/_fe_analyzer_shared/test/flow_analysis/reachability'),
+    platform('pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion'),
+    platform('pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted'),
+    platform('pkg/_fe_analyzer_shared/test/inheritance'),
+  ];
+
+  var frontendServerPackageDirs = [
+    platform('pkg/frontend_server/test/fixtures'),
+  ];
+
+  var pkgVmPackageDirs = [platform('pkg/vm/testcases')];
+
+  var sampleDirs = listSubdirectories(platform('samples')).toList();
+
+  // Validate that all the given directories exist.
+  var hasMissingDirectories = false;
+  for (var path in [
+    ...packageDirs,
+    ...cfePackageDirs,
+    ...feAnalyzerSharedPackageDirs,
+    ...pkgVmPackageDirs,
+    ...sampleDirs,
+  ]) {
+    if (!Directory(join(repoRoot, path)).existsSync()) {
+      stderr.writeln("Unable to locate directory: '$path'.");
+      hasMissingDirectories = true;
     }
   }
 
-  // Invoke `dart pub get` to create a .dart_tool/package_config.json file.
-  final result = Process.runSync(
-    Platform.resolvedExecutable,
-    ['pub', 'get'],
-    workingDirectory: repoRoot.toFilePath(),
-    environment: {}, // Prevent overriding eg. PUB_CACHE
-  );
-  if (result.exitCode != 0) {
-    print('`pub get` failed');
-    print(result.stderr);
-    print(result.stdout);
-    exit(-1);
+  if (hasMissingDirectories) {
+    exit(1);
   }
-  final packageConfig = jsonDecode(
-    File.fromUri(
-      repoRoot.resolve('.dart_tool/package_config.json'),
-    ).readAsStringSync(),
-  );
 
-  if (!fluteExists) {
-    for (final package in packageConfig['packages']) {
-      final rootUri = package['rootUri'];
-      if (!(rootUri.startsWith('../third_party/') || // Third-party package
-              rootUri.startsWith('../pkg/') || // SDK package
-              rootUri.startsWith('../samples/') || // sample package
-              rootUri.startsWith('../runtime/') || // VM package
-              rootUri.startsWith(
-                '../tools',
-              ) || // A tool package for developing the sdk.
-              rootUri == '../' // The main workspace package
-          )) {
-        print('Package ${package['name']} is imported from outside the sdk.');
-        print('It has rootUri $rootUri.');
-        print(
-          'See https://github.com/dart-lang/sdk/blob/main/docs/Adding-and-Updating-Dependencies.md',
-        );
+  var packages = <Package>[
+    ...makePackageConfigs(packageDirs),
+    ...makeCfePackageConfigs(cfePackageDirs),
+    ...makeFeAnalyzerSharedPackageConfigs(feAnalyzerSharedPackageDirs),
+    ...makeFrontendServerPackageConfigs(frontendServerPackageDirs),
+    ...makePkgVmPackageConfigs(pkgVmPackageDirs),
+    ...makePackageConfigs(sampleDirs),
+  ];
+  packages.sort((a, b) => a.name.compareTo(b.name));
 
-        exit(-1);
+  // Remove specific packages.
+  final packagesToRemove = {
+    // If we're not using flute (i.e., this is a standard checkout), do not
+    // include package:characters in the generated package config file. Contact
+    // athom@ or ensure that license requirements are met before using this
+    // dependency in other parts of the Dart SDK.
+    if (!fluteExists) 'characters',
+  };
+
+  packages.removeWhere((p) {
+    return packagesToRemove.contains(p.name);
+  });
+
+  // Check for duplicate packages - the same package sourced from multiple
+  // repositories.
+  final uniqueNames = packages.map((p) => p.name).toSet();
+
+  var hasDuplicatePackages = false;
+
+  for (var name in uniqueNames) {
+    var matches = packages.where((p) => p.name == name).toList();
+    if (matches.length > 1) {
+      final inMonorepos = matches.where((p) => p.inMonorepo).toList();
+
+      if (inMonorepos.length == 1) {
+        // De-duplicating package 'name' - select just the monorepo version.
+        packages.removeWhere((p) {
+          return p.name == name && !p.inMonorepo;
+        });
+      } else {
+        print('Duplicates found for package:$name');
+        for (var package in matches) {
+          print('  ${package.rootUri}');
+        }
+
+        hasDuplicatePackages = true;
       }
     }
   }
+
+  if (hasDuplicatePackages) {
+    exit(1);
+  }
+
+  var configFile = File(join(repoRoot, '.dart_tool', 'package_config.json'));
+  var packageConfig = PackageConfig(
+    packages,
+    extraData: {
+      'copyright': [
+        'Copyright (c) 2020, the Dart project authors. Please see the AUTHORS ',
+        'file for details. All rights reserved. Use of this source code is ',
+        'governed by a BSD-style license that can be found in the LICENSE file.',
+      ],
+      'comment': [
+        'Package configuration for all packages in pkg/ and third_party/pkg/',
+      ],
+    },
+  );
+  writeIfDifferent(configFile, packageConfig.generateJson('..'));
 }
+
+/// Writes the given [contents] string to [file] if the contents are different
+/// than what's currently in the file.
+///
+/// This updates the file to the given contents, while preserving the file
+/// timestamp if there are no changes.
+void writeIfDifferent(File file, String contents) {
+  if (!file.existsSync() || file.readAsStringSync() != contents) {
+    file.writeAsStringSync(contents);
+  }
+}
+
+/// Generates package configurations for each package in [packageDirs].
+Iterable<Package> makePackageConfigs(List<String> packageDirs) sync* {
+  for (var packageDir in packageDirs) {
+    var name = pubspecName(packageDir);
+    var version = pubspecLanguageVersion(packageDir);
+    var hasLibDirectory =
+        Directory(join(repoRoot, packageDir, 'lib')).existsSync();
+
+    yield Package(
+      name: name,
+      rootUri: packageDir,
+      packageUri: hasLibDirectory ? 'lib/' : null,
+      languageVersion: version,
+    );
+  }
+}
+
+/// Generates package configurations for the special pseudo-packages.
+Iterable<Package> makeSpecialPackageConfigs(
+  String packageNamePrefix,
+  List<String> packageDirs,
+) sync* {
+  // TODO: Remove the use of '.nonexisting/'.
+  for (var packageDir in packageDirs) {
+    yield Package(
+      name: '${packageNamePrefix}_${basename(packageDir)}',
+      rootUri: packageDir,
+      packageUri: '.nonexisting/',
+    );
+  }
+}
+
+/// Generates package configurations for the special pseudo-packages used by the
+/// CFE unit tests (`pkg/front_end/test/unit_test_suites.dart`).
+Iterable<Package> makeCfePackageConfigs(List<String> packageDirs) =>
+    makeSpecialPackageConfigs('front_end', packageDirs);
+
+/// Generates package configurations for the special pseudo-packages used by the
+/// _fe_analyzer_shared id tests.
+Iterable<Package> makeFeAnalyzerSharedPackageConfigs(
+  List<String> packageDirs,
+) => makeSpecialPackageConfigs('_fe_analyzer_shared', packageDirs);
+
+/// Generates package configurations for the special pseudo-packages used by the
+/// frontend_server tests.
+Iterable<Package> makeFrontendServerPackageConfigs(List<String> packageDirs) =>
+    makeSpecialPackageConfigs('frontend_server', packageDirs);
+
+/// Generates package configurations for the special pseudo-packages used by the
+/// pkg/vm unit tests (`pkg/vm/test`).
+Iterable<Package> makePkgVmPackageConfigs(List<String> packageDirs) =>
+    makeSpecialPackageConfigs('pkg_vm', packageDirs);
+
+/// Finds the paths of the subdirectories of [parentPath] that contain pubspecs.
+///
+/// This method recurses until it finds a pubspec.yaml file.
+Iterable<String> listSubdirectories(String parentPath) sync* {
+  final parent = Directory(join(repoRoot, parentPath));
+
+  for (var child in parent.listSync().whereType<Directory>()) {
+    var name = basename(child.path);
+
+    // Don't recurse into dot directories.
+    if (name.startsWith('.')) continue;
+
+    final pubspecFile = File(join(child.path, 'pubspec.yaml'));
+    if (pubspecFile.existsSync() && !isWorkspacePubspec(pubspecFile)) {
+      // Stop recursing when we find a pubspec file (and that pubspec does not
+      // define a pub workspace).
+      yield join(parentPath, name);
+    } else {
+      yield* listSubdirectories(join(parentPath, name));
+    }
+  }
+}
+
+final versionRE = RegExp(r"(?:\^|>=)(\d+\.\d+)");
+
+/// Parses the package name in the pubspec for [packageDir].
+String pubspecName(String packageDir) {
+  var pubspecFile = File(join(repoRoot, packageDir, 'pubspec.yaml'));
+
+  if (!pubspecFile.existsSync()) {
+    print('Error: Missing pubspec for $packageDir');
+    exit(1);
+  }
+
+  var contents = pubspecFile.readAsLinesSync();
+  if (!contents.any((line) => line.contains('name: '))) {
+    print('Error: Pubspec for $packageDir has no name.');
+    exit(1);
+  }
+
+  var name = contents.firstWhere((line) => line.contains('name: '));
+  return name.trim().substring('name:'.length).trim();
+}
+
+/// Returns whether the given pubspec defines a workspace.
+bool isWorkspacePubspec(File pubspecFile) {
+  if (!pubspecFile.existsSync()) {
+    print('Error: Missing pubspec for ${pubspecFile.path}');
+    exit(1);
+  }
+
+  var contents = pubspecFile.readAsLinesSync();
+  return contents.any((line) => line.startsWith('workspace:'));
+}
+
+/// Infers the language version from the SDK constraint in the pubspec for
+/// [packageDir].
+///
+/// The version is returned in the form `major.minor`.
+String pubspecLanguageVersion(String packageDir) {
+  var pubspecFile = File(join(repoRoot, packageDir, 'pubspec.yaml'));
+
+  if (!pubspecFile.existsSync()) {
+    print('Error: Missing pubspec for $packageDir');
+    exit(1);
+  }
+
+  var contents = pubspecFile.readAsLinesSync();
+  if (!contents.any((line) => line.contains('sdk: '))) {
+    print('Error: Pubspec for $packageDir has no SDK constraint.');
+    exit(1);
+  }
+
+  // Handle either "sdk: >=2.14.0 <3.0.0" or "sdk: ^2.3.0".
+  var sdkConstraint = contents.firstWhere((line) => line.contains('sdk: '));
+  sdkConstraint = sdkConstraint.trim().substring('sdk:'.length).trim();
+  if (sdkConstraint.startsWith('"') || sdkConstraint.startsWith("'")) {
+    sdkConstraint = sdkConstraint.substring(1, sdkConstraint.length - 2);
+  }
+
+  var match = versionRE.firstMatch(sdkConstraint);
+  if (match == null) {
+    print("Error: unknown version range for $packageDir: '$sdkConstraint'.");
+    exit(1);
+  }
+  return match[1]!;
+}
+
+class Package {
+  final String name;
+  final String rootUri;
+  final String? packageUri;
+  final String? languageVersion;
+
+  Package({
+    required this.name,
+    required this.rootUri,
+    this.packageUri,
+    this.languageVersion,
+  });
+
+  /// Whether this package lives in a monorepo.
+  bool get inMonorepo {
+    // By convention (and for our purposes), a monorepo package lives in a
+    // `pkgs` directory.
+    final paths = posix(rootUri).split('/');
+    return paths.length >= 2 && paths[paths.length - 2] == 'pkgs';
+  }
+
+  Map<String, Object?> toMap(String relativeTo) {
+    return {
+      'name': name,
+      'rootUri': posix(join(relativeTo, rootUri)),
+      if (packageUri != null) 'packageUri': posix(packageUri!),
+      if (languageVersion != null) 'languageVersion': languageVersion,
+    };
+  }
+}
+
+class PackageConfig {
+  final List<Package> packages;
+  final Map<String, Object?>? extraData;
+
+  PackageConfig(this.packages, {this.extraData});
+
+  String generateJson(String relativeTo) {
+    var config = <String, Object?>{};
+    if (extraData != null) {
+      for (var key in extraData!.keys) {
+        config[key] = extraData![key];
+      }
+    }
+    config['configVersion'] = 2;
+    config['generator'] = 'tools/generate_package_config.dart';
+    config['packages'] =
+        packages.map((package) => package.toMap(relativeTo)).toList();
+    var jsonString = JsonEncoder.withIndent('  ').convert(config);
+    return '$jsonString\n';
+  }
+}
+
+// Below are some (very simplified) versions of the package:path functions.
+
+final String _separator = Platform.pathSeparator;
+
+String dirname(String s) {
+  return s.substring(0, s.lastIndexOf(_separator));
+}
+
+String join(String s1, String s2, [String? s3]) {
+  if (s3 != null) {
+    return join(join(s1, s2), s3);
+  } else {
+    return s1.endsWith(_separator) ? '$s1$s2' : '$s1$_separator$s2';
+  }
+}
+
+String basename(String s) {
+  while (s.endsWith(_separator)) {
+    s = s.substring(0, s.length - 1);
+  }
+  return s.substring(s.lastIndexOf(_separator) + 1);
+}
+
+String fromUri(Uri uri) => uri.toFilePath();
+
+/// Given a platform path, return a posix one.
+String posix(String s) =>
+    Platform.isWindows ? s.replaceAll(_separator, '/') : s;
+
+/// Given a posix path, return a platform one.
+String platform(String s) =>
+    Platform.isWindows ? s.replaceAll('/', _separator) : s;
diff --git a/tools/package_deps/pubspec.yaml b/tools/package_deps/pubspec.yaml
index cfe1ec8..d1e2a1b 100644
--- a/tools/package_deps/pubspec.yaml
+++ b/tools/package_deps/pubspec.yaml
@@ -7,8 +7,6 @@
 environment:
   sdk: '^3.5.0'
 
-resolution: workspace
-
 dependencies:
   cli_util: any
   collection: any
diff --git a/tools/pubspec.yaml b/tools/pubspec.yaml
index 593a58b..88ca198 100644
--- a/tools/pubspec.yaml
+++ b/tools/pubspec.yaml
@@ -4,8 +4,6 @@
 environment:
   sdk: ^3.5.0
 
-resolution: workspace
-
 # This package is not intended for consumption on pub.dev. DO NOT publish.
 publish_to: none
 
diff --git a/tools/run_offsets_extractor.dart b/tools/run_offsets_extractor.dart
index 375d29d..9bf9d14 100755
--- a/tools/run_offsets_extractor.dart
+++ b/tools/run_offsets_extractor.dart
@@ -39,14 +39,15 @@
     print('Building $buildDir - done');
   });
 
-  final (jit, aot) = await (
-    forAllConfigurationsMode((String buildDir, _, __) async {
-      return await run(['$buildDir/offsets_extractor']);
-    }).then<String>((lines) => lines.join('\n')),
-    forAllConfigurationsMode((String buildDir, _, __) async {
-      return await run(['$buildDir/offsets_extractor_aotruntime']);
-    }).then<String>((lines) => lines.join('\n')),
-  ).wait;
+  final (jit, aot) =
+      await (
+        forAllConfigurationsMode((String buildDir, _, _) async {
+          return await run(['$buildDir/offsets_extractor']);
+        }).then<String>((lines) => lines.join('\n')),
+        forAllConfigurationsMode((String buildDir, _, _) async {
+          return await run(['$buildDir/offsets_extractor_aotruntime']);
+        }).then<String>((lines) => lines.join('\n')),
+      ).wait;
 
   if (exitCode == 0) {
     final output = StringBuffer();