Skip to content
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

pub publish is not picking symbolic links #2699

Open
frencojobs opened this issue Oct 29, 2020 · 2 comments
Open

pub publish is not picking symbolic links #2699

frencojobs opened this issue Oct 29, 2020 · 2 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@frencojobs
Copy link

Environment

  • pub version or flutter pub version: 2.10.2
  • OS version: Ubuntu Linux 20.04
  • Are you using the Chinese community mirror or a corporate firewall? No

Problem

I have a mono repo containing multiple packages that I want to publish. Since all projects share the same README.md, I put the README.md in the root and put a link in all projects. The directory structure looks like this,

root/
├── package1/
│   ├── README.md -> link to ../README.md
│   └── pubspec.yaml
├── package2/
│   ├── README.md -> link to ../README.md
│   └── pubspec.yaml
└── README.md

When I want to publish package1, I cd into the package1 directory, and run pub publish. But the command fails with an error saying the link is broken.

Expected behavior

I want it to work well.

Actual behavior

It shows an error like this,

Package archive contains a broken symlink: `README.md` -> `../README.md`.

--trace output

This is a section from --trace output that I think is relevant to the error.

ERR : Package archive contains a broken symlink: `README.md` -> `../README.md`.
FINE: Exception type: ApplicationException
FINE: package:pub/src/utils.dart 513:5            fail
    | package:pub/src/http.dart 309:3             handleJsonError
    | package:pub/src/command/lish.dart 109:9     LishCommand._publish
    | ===== 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 182:13  PubCommandRunner.runCommand
@frencojobs frencojobs changed the title pub publlish is not picking symbolic links pub publish is not picking symbolic links Oct 29, 2020
@jonasfj
Copy link
Member

jonasfj commented Jan 20, 2021

(A) Should multiple packages really have the same README ?
(B) Couldn't a simple script wrapping pub publish simply copy it?


I'm wondering if it's a good idea to allow symlinks at all?

We probably should scan packages on pub.dev to find out how many use symlinks, and for what purpose.

@Gustl22
Copy link
Contributor

Gustl22 commented Mar 13, 2023

@jonasfj It makes sense e.g. for having the same license in every package. Git supports symlinks in their scope, so I expect pub to support it too (maybe outside of sub-package scope).

Gustl22 added a commit to bluefireteam/audioplayers that referenced this issue Apr 5, 2023
… READMEs (#1457)

# Description

* update AudioCache explanation (closes #1256)
* replace package README.md symlinks with files, and switched main
README file to `audioplayers` package (#1433,
dart-lang/pub#2699)
* update migration guide to use Changelog
* update contribution guide
* update parity table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants