dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.03k stars 225 forks source link

Entry error, can not include space in path ? #4221

Open Dynesshely opened 3 months ago

Dynesshely commented 3 months ago

Environment

Problem

When run dart pub publish, the console output error is:

Invalid argument(s): Entry E:\Development\Projects\Crequency\KitX\KitX Standard\KitX%20Shared\KitX.Shared.Dart\kitx_shared_dart is not inside E:\Development\Projects\Crequency\KitX\KitX Standard\KitX Shared\KitX.Shared.Dart\kitx_shared_dart.
package:pub/src/io.dart 1125:9  createTarGz.<fn>
This is an unexpected error. The full log and other details are collected in:

    C:\Users\Dynesshely\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.

And I'm gussing is the createTarGz function doesn't think the path with %20 is not equals to ?

My project yaml file is:

name: kitx_shared_dart
description: A port of KitX.Shared in dart
version: 3.24.10+6873
repository: https://github.com/Crequency/KitX-Standard/KitX.Shared.Dart/

environment:
    sdk: ^3.3.0

dependencies:
    built_collection: ^5.1.1
    built_value: ^8.9.1

dev_dependencies:
    lints: ^3.0.0
    test: ^1.24.0
    # Run `dart run build_runner build` to generate `.g.dart` files.
    # You can also execute `build_runner.ps1` with pwsh to run the command.
    build_runner: ^2.4.9
    built_value_generator: ^8.9.1

Expected behavior

The library will be normally publish to pub.dev

Actual behavior

Failed at compressing.

--trace output

I attached the pub_log.txt

pub_log.txt

sigurdm commented 3 months ago

And I'm gussing is the createTarGz function doesn't think the path with %20 is not equals to ?

Yeah - but where does %20 come from in the first place? I don't remember doing any url-encoding of paths when publishing.

It seems the first ' ' in the path is left untouched...

Would be great if you could make a reproduction I could look at.

Dynesshely commented 3 months ago

It's very strange when I'm tring to reproduce this.

I created a new dart package with dart create -t package <PACKAGE_NAME> in a directory which is under a path with space.

And in this package, the dart pub publish --dry-run succeed without any trouble.

But back to https://github.com/Crequency/KitX-Standard/tree/dev%3Dmain/KitX%20Shared/KitX.Shared.Dart/kitx_shared_dart , I cloned this with a new environment, but it failed again.

And I found no difference (except pure dart code logic) on two package.

sigurdm commented 3 months ago

I can reproduce locally with https://github.com/Crequency/KitX-Standard/tree/dev%3Dmain/KitX%20Shared/KitX.Shared.Dart/kitx_shared_dart

Will try to investigate