pub
pub copied to clipboard
Package Publish Fails (Possibly Involving Symlinks)
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 https://github.com/pingbird/puro/issues/61#issuecomment-1826411458), 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.
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
We don't support symlinks inside the package when publishing. https://github.com/dart-lang/pub/issues/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?
I'm not sure what's going on. I can reproduce it on my machine:
- Cloning my repo into a new folder, which is not in a symlink folder
B:\dart_holodex_api - Download the Dart SDK to
B:\dart-sdk - In
B:\dart_holodex_api, run the commandB:\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.
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