Repository navigation
Closed
Labels
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Environment
pub versionorflutter pub version: Pub 2.9.0-21.0.dev.flutter-06183779d7- OS version: Linux 5.2.17-1rodete3-amd64 x86_64
- Are you using the Chinese community mirror or a corporate firewall? No
Problem
When attempting to run pub publish --dry-run I get the following unexpected error: Invalid argument(s) (sdkPath): Must not be null
This seems to happen with any package. Check all publishable pre-submit runs in the flutter/plugins PRs.
Expected behavior
I'd expect the command to tell me if the package is publishable or not.
Actual behavior
The command errors out with the following error after listing all the files that are about to be "published":
Invalid argument(s) (sdkPath): Must not be null
dart:core ArgumentError.checkNotNull
package:analyzer/src/dart/analysis/context_builder.dart 49:19 ContextBuilderImpl.createContext
package:pub/src/dart.dart 115:36 AnalysisContextManager.createContextsForDirectory
package:pub/src/validator/strict_dependencies.dart 27:28 new StrictDependenciesValidator
package:pub/src/validator.dart 135:7 Validator.runAll
package:pub/src/command/lish.dart 165:21 LishCommand._validate
package:pub/src/command/lish.dart 141:15 LishCommand.run
package:args/command_runner.dart 197:27 CommandRunner.runCommand
package:pub/src/command_runner.dart 193:39 PubCommandRunner.runCommand.<fn>
dart:async new Future.sync
package:pub/src/utils.dart 113:12 captureErrors.wrappedCallback
dart:async runZoned
package:pub/src/utils.dart 130:5 captureErrors
package:pub/src/command_runner.dart 193:13 PubCommandRunner.runCommand
--trace output
Here's the `--trace` run:
Publishing extension_google_sign_in_as_googleapis_auth 1.0.0 to https://pub.dartlang.org:
|-- .gitignore
...
|-- pubspec.yaml
'-- test
'-- extension_google_sign_in_as_googleapis_auth_test.dart
Invalid argument(s) (sdkPath): Must not be null
dart:core ArgumentError.checkNotNull
package:analyzer/src/dart/analysis/context_builder.dart 49:19 ContextBuilderImpl.createContext
package:pub/src/dart.dart 115:36 AnalysisContextManager.createContextsForDirectory
package:pub/src/validator/strict_dependencies.dart 27:28 new StrictDependenciesValidator
package:pub/src/validator.dart 135:7 Validator.runAll
package:pub/src/command/lish.dart 165:21 LishCommand._validate
package:pub/src/command/lish.dart 141:15 LishCommand.run
package:args/command_runner.dart 197:27 CommandRunner.runCommand
package:pub/src/command_runner.dart 193:39 PubCommandRunner.runCommand.<fn>
dart:async new Future.sync
package:pub/src/utils.dart 113:12 captureErrors.wrappedCallback
package:stack_trace Chain.capture
package:pub/src/utils.dart 126:11 captureErrors
package:pub/src/command_runner.dart 193:13 PubCommandRunner.runCommand
===== asynchronous gap ===========================
dart:async Future.catchError
package:pub/src/utils.dart 113:52 captureErrors.wrappedCallback
package:stack_trace Chain.capture
package:pub/src/utils.dart 126:11 captureErrors
package:pub/src/command_runner.dart 193:13 PubCommandRunner.runCommand
---- Log transcript ----
FINE: Pub 2.9.0-21.0.dev.flutter-06183779d7
IO : Spawning "git --version" in /usr/local/google/home/dit/github/plugins-origin/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.
IO : Finished git. Exit code 0.
| stdout:
| | git version 2.28.0.rc0.105.gf9edc3c819-goog
| Nothing output on stderr.
FINE: Determined git command git.
IO : Spawning "git check-ignore --quiet ." in /usr/local/google/home/dit/github/plugins-origin/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.
IO : Finished git. Exit code 1.
| Nothing output on stdout.
| Nothing output on stderr.
IO : Spawning "git ls-files --cached --others --exclude-standard" in /usr/local/google/home/dit/github/plugins-origin/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.
IO : Finished git. Exit code 0.
| stdout:
| | .gitignore
...
| | test/extension_google_sign_in_as_googleapis_auth_test.dart
| Nothing output on stderr.
FINE: Archiving and publishing extension_google_sign_in_as_googleapis_auth 1.0.0 (.).
MSG : Publishing extension_google_sign_in_as_googleapis_auth 1.0.0 to https://pub.dartlang.org:
| |-- .gitignore
...
| '-- test
| '-- extension_google_sign_in_as_googleapis_auth_test.dart
FINE: Creating .tar.gz stream containing:
| ./.gitignore
...
| ./test/extension_google_sign_in_as_googleapis_auth_test.dart
IO : Spawning "/bin/tar --format=ustar --create --gzip --directory /usr/local/google/home/dit/github/plugins-origin/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/. --files-from /dev/stdin --owner=pub --group=pub" in /usr/local/google/home/dit/github/plugins-origin/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.
ERR : Invalid argument(s) (sdkPath): Must not be null
FINE: Exception type: ArgumentError
ERR : dart:core ArgumentError.checkNotNull
| package:analyzer/src/dart/analysis/context_builder.dart 49:19 ContextBuilderImpl.createContext
| package:pub/src/dart.dart 115:36 AnalysisContextManager.createContextsForDirectory
| package:pub/src/validator/strict_dependencies.dart 27:28 new StrictDependenciesValidator
| package:pub/src/validator.dart 135:7 Validator.runAll
| package:pub/src/command/lish.dart 165:21 LishCommand._validate
| package:pub/src/command/lish.dart 141:15 LishCommand.run
| package:args/command_runner.dart 197:27 CommandRunner.runCommand
| package:pub/src/command_runner.dart 193:39 PubCommandRunner.runCommand.<fn>
| dart:async new Future.sync
| package:pub/src/utils.dart 113:12 captureErrors.wrappedCallback
| package:stack_trace Chain.capture
| package:pub/src/utils.dart 126:11 captureErrors
| package:pub/src/command_runner.dart 193:13 PubCommandRunner.runCommand
| ===== asynchronous gap ===========================
| dart:async Future.catchError
| package:pub/src/utils.dart 113:52 captureErrors.wrappedCallback
| package:stack_trace Chain.capture
| package:pub/src/utils.dart 126:11 captureErrors
| package:pub/src/command_runner.dart 193:13 PubCommandRunner.runCommand
---- End log transcript ----
Metadata
Metadata
Assignees
Labels
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Activity
ditman commentedon Jul 17, 2020
These are the versions used by the CI:
Flutter 1.21.0-2.0.pre.51 • channel master • https://github.com/flutter/flutter.git
Framework • revision df542b6831 (2 hours ago) • 2020-07-16 18:32:46 -0700
Engine • revision d3b81f19fc
Tools • Dart 2.9.0 (build 2.9.0-21.0.dev 06183779d7)
jakemac53 commentedon Jul 17, 2020
Note that this has not yet been released, but the HEAD Dart SDK can not publish packages. We need to be sure this gets fixed before the next release.
mkustermann commentedon Jul 17, 2020
/cc @jonasfj
ditman commentedon Jul 17, 2020
Managed to reproduce the issue by checking out different revs of dart-sdk, building them with ninja, and then using that pub binary from the build output to test (
~/github/engine/src/out/host_release/dart-sdk/bin/pub publish --dry-run).Start/end ranges for the bisect of third_party/dart determined in a flutter/flutter bisection: here.
Bisected to this PR: https://dart-review.googlesource.com/c/sdk/+/154081
git bisect log
jonasfj commentedon Jul 20, 2020
I guess this is yet another good reason move
pubinto the SDK repository..sigurdm commentedon Jul 20, 2020
cc @scheglov
https://dart-review.googlesource.com/c/sdk/+/154081 seemingly made the sdkPath argument required in the implementation class.
For unbreaking this we could provide an explicit sdkPath from pub.
sigurdm commentedon Jul 20, 2020
This is rolled into the sdk here: https://dart-review.googlesource.com/c/sdk/+/154940
ditman commentedon Jul 20, 2020
Thanks @sigurdm!
scheglov commentedon Jul 20, 2020
https://dart-review.googlesource.com/c/sdk/+/155001 will revert the requirement of
sdkPath.ditman commentedon Jul 20, 2020
I think once https://dart-review.googlesource.com/c/sdk/+/154940 rolls into flutter/master, the issue there can be closed as fixed. Thanks for the follow-up @scheglov!
Don't make sdkPath required yet in implementations.