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

Package Publish Fails (Possibly Involving Symlinks) #4057

Open
getBoolean opened this issue Nov 25, 2023 · 4 comments
Open

Package Publish Fails (Possibly Involving Symlinks) #4057

getBoolean opened this issue Nov 25, 2023 · 4 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@getBoolean
Copy link

Environment

  • Dart version (run dart --version): 3.2.0 (stable) (Tue Nov 14 18:26:59 2023 +0000) on "windows_x64"
  • OS kind and version (e.g. "Windows 10, version 1809" or "macOS 12.4"): Windows 11 Pro, version 23H2 build 22631.2715
  • Are you using the Chinese community mirror or a corporate firewall? no

Problem

I'm attempting to run dart pub publish --dry-run in my dart_holodex_api repo, but I am getting an error. I am using Puro here, but @pingbird was able to reproduce without puro

name: dart_holodex_api
description: A Dart wrapper for ...
version: 2.0.0
homepage: https://github.com/getBoolean/dart_holodex_api
environment:
  sdk: ">=3.0.0 <4.0.0"

dependencies:
  freezed_annotation: ^2.2.0
  http: ">=0.13.4 <2.0.0"
  intl: ">=0.17.0 <0.19.0"
  json_annotation: ^4.8.0

dev_dependencies:
  build_runner: ^2.3.3
  dotenv: ^4.1.0
  freezed: ^2.3.2
  json_serializable: ^6.6.0
  lints: "^3.0.0"
  test: ^1.16.0

Expected behavior

The publish command should work when symlinks are involved.

Actual behavior

The publish command seems to fail because of a symlink. @pingbird was able to reproduce it when the repo was inside a symlink (see pingbird/puro#61 (comment)), but that is still odd because I do not have the repo in a symlink.

PowerShell script to check for symlinks:

$ ((get-item B:\dev).Attributes.ToString())
Directory
$ ((get-item B:\dev\GitHub).Attributes.ToString())
Directory
$ ((get-item B:\dev\GitHub\dart_holodex_api).Attributes.ToString())
Directory

--trace output

$ dart pub publish --dry-run --trace
Resolving dependencies... 
Got dependencies!
Invalid argument (beneath): ../../../../dev/GitHub/dart_holodex_api: "must be relative and normalized"
package:pub/src/ignore.dart 229:7         Ignore.listFiles
package:pub/src/package.dart 232:19       Package.listFiles
package:pub/src/command/lish.dart 268:33  LishCommand.runProtected
This is an unexpected error. The full log and other details are collected in:

    C:\Users\Boolean\.puro\shared\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.

pub_log.txt

@getBoolean
Copy link
Author

getBoolean commented Nov 25, 2023

I also downloaded the Dart SDK 3.2.0 and 3.2.1 standalone and ran this command and got the same error B:\tools\dart-sdk\bin\dart.exe pub publish --dry-run

@sigurdm
Copy link
Contributor

sigurdm commented Dec 7, 2023

We don't support symlinks inside the package when publishing. #3143

In this case the package is just inside a symlinked folder? I would have thought that should work...

Is it possible to create a reproduction?

@sigurdm sigurdm added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Dec 7, 2023
@getBoolean
Copy link
Author

getBoolean commented Dec 7, 2023

I'm not sure what's going on. I can reproduce it on my machine:

  1. Cloning my repo into a new folder, which is not in a symlink folder B:\dart_holodex_api
  2. Download the Dart SDK to B:\dart-sdk
  3. In B:\dart_holodex_api, run the command B:\dart-sdk\bin\dart.exe pub publish --dry-run

I get the same exception even though it is impossible to be in a symlink folder. There should also not be any symlinks in the repository.

@Correct-Syntax
Copy link

I'm also getting this error when trying to publish a new version of my package.

Invalid argument (beneath): ../../../../../Users/Acer/Documents/get_storage_info: "must be relative and normalized"
package:pub/src/ignore.dart 229:7                      Ignore.listFiles
package:pub/src/package.dart 261:19                    Package.listFiles
package:pub/src/command/lish.dart 307:40               LishCommand._publicationFromEntrypoint
===== asynchronous gap ===========================
package:pub/src/command/lish.dart 440:25               LishCommand.runProtected
===== asynchronous gap ===========================
package:pub/src/command.dart 196:7                     PubCommand.run
===== asynchronous gap ===========================
package:args/command_runner.dart 212:13                CommandRunner.runCommand
===== asynchronous gap ===========================
package:dartdev/dartdev.dart 232:18                    DartdevRunner.runCommand
===== asynchronous gap ===========================
package:dartdev/dartdev.dart 46:16                     runDartdev
===== asynchronous gap ===========================
C:\b\s\w\ir\x\w\sdk\pkg\dartdev\bin\dartdev.dart 13:5  main
This is an unexpected error. The full log and other details are collected in:

    C:\Users\Acer\AppData\Local\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.

Windows 10

Source code: https://github.com/Correct-Syntax/get_storage_info
Published here: https://pub.dev/packages/get_storage_info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants