Closed koji-1009 closed 2 years ago
I've got same issues too. looks like its dart uri scheme check limit the url's scheme, and git ssh reposity does not have one scheme.
pub version or flutter pub version: Pub 2.17.0-266.0.dev OS version: macOS Monterey Are you using the Chinese community mirror or a corporate firewall?: No
error log here:
ERR : Illegal scheme character (at character 4) git@gitlab.y5ops.com:ZENZEN/official_flutter_plugins.git ^ FINE: Exception type: FormatException ERR : dart:core Uri.parse package:path/src/context.dart 1077:33 _parseUri package:path/src/context.dart 1052:22 Context.prettyUri package:path/path.dart 461:34 prettyUri package:pub/src/source/git.dart 730:23 GitResolvedDescription.format package:pub/src/solver/report.dart 326:40 SolveReport._writeId package:pub/src/solver/report.dart 302:5 SolveReport._reportPackage ===== asynchronous gap =========================== package:pub/src/solver/report.dart 138:9 SolveReport._reportOverrides ===== asynchronous gap =========================== package:pub/src/solver/report.dart 48:5 SolveReport.show ===== asynchronous gap =========================== package:pub/src/solver/result.dart 112:5 SolveResult.showReport ===== asynchronous gap =========================== package:pub/src/entrypoint.dart 321:7 Entrypoint.acquireDependencies ===== asynchronous gap =========================== package:pub/src/command/get.dart 52:5 GetCommand.runProtected ERR : This is an unexpected error. The full log and other details are collected in: /Users/eric8810/.pub-cache/log/pub_log.txt Consider creating an issue on https://github.com/dart-lang/pub/issues/new and attaching the relevant parts of that log file. ---- End log transcript ----
Hmm - this is indeed a regression. I wonder about the best fix. Should we just never handle the git uri with package 'Uri'?
@lrhn Would you expect Uri.parse
to be able to parse something of the form: 'git@github.com:dart-lang/pub.git'?
This is what github suggests to use for cloning a repository via ssh.
I think it's the colon that creates problems.
nice & quick fix, thank you. when will this be pushed to flutter master toolchain? @sigurdm
Thanks!
nice fix! when and what version will it be pushed? we are facing this issue with iOS builds only (android works ok..) in version 2.13 it fails version 2.10.4 it passes.
Good fix. I would not expect Uri.parse
to be able to parse something of the form: 'git@github.com:dart-lang/pub.git'.
If it did, it would have to put everything into the path, because the schema can't contain @
and the authority needs a leading //
, so the only remotely valid parsing would be as a relative path.
It doesn't parse as that since the grammar of relative URI references requires the first segment to not contain a :
(whether it contains non-schema characters first or not).
So, not parsing as a URI, definitely never parsing as a URI with a schema, which is how I expect that it's intended.
@eric8810
when will this be pushed to flutter master toolchain?
It has landed in the dart sdk here: https://github.com/dart-lang/sdk/commit/557089ea5d784b9664b3e896795e81e8c580912e
It was rolled to flutter/engine here: https://github.com/flutter/engine/pull/32459
This still has to roll into the flutter/flutter . Not sure exactly the expected timing of that...
This still has to roll into the flutter/flutter . Not sure exactly the expected timing of that...
@sigurdm, could you please provide any updates on expected timing for merging this into flutter/flutter
?
Thanks!
It looks like this might be also happening to dart pub global activate -sgit
on stable?
IO : Spawning "git clone --depth 1 git@github.com:resideo/izakaya.git /private/var/folders/0n/0qft49497gn32fqr3zqbm56h0000gn/T/pub_88uD8Z" in /Users/nicholasspencer/Development/comfort_plugins_flutter/packages/jasper_driver_platform_plugin/.
IO : Finished git. Exit code 0.
| Nothing output on stdout.
| stderr:
| | Cloning into '/private/var/folders/0n/0qft49497gn32fqr3zqbm56h0000gn/T/pub_88uD8Z'...
IO : Deleting directory /private/var/folders/0n/0qft49497gn32fqr3zqbm56h0000gn/T/pub_88uD8Z.
ERR : Illegal scheme character (at character 4)
| git@github.com:resideo/izakaya.git
| ^
FINE: Exception type: FormatException
ERR : dart:core Uri.parse
| package:path/src/context.dart 1077:33 _parseUri
| package:path/src/context.dart 1052:22 Context.prettyUri
| package:path/path.dart 461:34 prettyUri
| package:pub/src/global_packages.dart 295:28 GlobalPackages._describeActive
| package:pub/src/global_packages.dart 194:34 GlobalPackages._installInCache
| package:pub/src/global_packages.dart 114:11 GlobalPackages.activateGit
My fix was not handling all usage of git@ style uris. filed another fix - hoping to get it into dart 2.18
Environment
pub version
orflutter pub version
:Pub 2.17.0-265.0.dev
Problem
If you specify a git repository for dependency in the form
git@github.com:rrousselGit/provider.git
, then Succeeds in flutter's stable channel, but fails in flutter's master channel.The operation can be reproduced by describing the dependency as follows. (The project that noticed this problem refers to a private GitHub repository that only internal members have access to.)
https://github.com/dart-lang/pub/commit/610ce7f280189f39ec411eb0a8592a191940d8d2#diff-1639c4669c428c26e68cfebd5039a33f87ba568795f2c058c303ca8528f62b77R720
In the above commit,
Uri.parse
is now called internally. Dart'sUri.parse
throws FormatException for formats likegit@github.com
.dartpad
Expected behavior
pub upgrade succeeds
Actual behavior
pub upgrade fails
--trace output