-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP] Fix "dart pub publish" to 3rd-party package repository with path in the hosted-url #47815
Comments
We have decided to not pick this change into 2.15.0. It will be released on dev and beta soon. This change arrived too late, has not rolled all the way, not being published on dev or other channels. The CP request is left open for consideration for 2.15.1. |
resolution: this is approved to cherry pick (in our first set of post-release cherry picks) |
I believe this was already cherry picked in, in 2.15.1 (https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#281-december-16-2021). |
https://github.com/woodemi/quick_blue/tree/reproduce/publish_to `publish_to`: https://pub.dartlang.org
wangkun42@bogon quick_blue_platform_interface % echo $HTTPS_PROXY
127.0.0.1:1087
wangkun42@bogon quick_blue_platform_interface % echo $PUB_HOSTED_URL
https://pub.flutter-io.cn
wangkun42@bogon quick_blue_platform_interface % flutter2.8.x pub publish
Publishing quick_blue_platform_interface 0.3.2+1 to https://pub.dartlang.org:
|-- CHANGELOG.md
|-- LICENSE
|-- README.md
|-- lib
| |-- method_channel_quick_blue.dart
| |-- models.dart
| '-- quick_blue_platform_interface.dart
'-- pubspec.yaml
Publishing is forever; packages cannot be unpublished.
Policy details are available at https://pub.dev/policy
Do you want to publish quick_blue_platform_interface 0.3.2+1 (y/N)? y
Uploading...
Invalid `publish_to` value: `https://pub.dartlang.org`.
pub finished with exit code 1 |
@Sunbreak, yeah, I just recalled that #!/bin/bash
export PUB_HOSTED_URL="";
dart pub publish Then using that instead of Note. I'm pretty sure this is completely unrelated to the issue being discussed here. |
@jonasfj Is this intentional? When we're trying to use our mirror site, but want to publish the package to pub.dev forever, there's nothing else we can do. |
@AlexV525 yes, it's intentional. Why would you want to include Then it would have to say: The motivation for forbidding it was that we once changed hostname from So if publishing to the default package repository, you have to omit If you have a use-case where this makes sense, please open an issue/question on https://github.com/dart-lang/pub/issues explain the use-case and feel free to CC me. |
commit(s) to merge: sdk/+/221626 adds the following commit dart-lang/pub@b9edfa5 to pub (on-top of the previous cherry-pick).
merge instructions: Should merge clean.
What is the issue: Running
dart pub publish
with a custom pub package server that has a URL containing a path will not work.What is the fix: Instead of
uri.resolve('/api/versions/new')
we douri.resolve('api/versions/new')
. Such thatPUB_HOSTED_URL=https://pub.example.com/user
becomeshttps://pub.example.com/user/api/versions/new
.Note, we've already normalized
PUB_HOSTED_URL
andpublish_to
URLs to always end in slash, if path is non-empty, seevalidateAndNormalizeHostedUrl
.Why cherrypick: Efforts of cloudsmith to finish support for publishing from pub command line is blocked this, as they have organization and repository embedded in the URL.
Risk: Small, the official pub repository URL doesn't have path segments so the change has no effect there.
/cc @mit-mit @whesse @athomas @vsmenon @devoncarew
The text was updated successfully, but these errors were encountered: