xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.14k stars 782 forks source link

PowerShell installation script will fail when the TMP path contains fields in 8.3 format #5255

Closed Patrick-Ze closed 4 months ago

Patrick-Ze commented 4 months ago

Xmake 版本

n.a.

操作系统版本和架构

Version 22H2 (OS Build 19045.4529)

描述问题

https://xmake.io/#/guide/installation 提供的一键安装脚本 Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content

TMP路径中包含8.3格式的字段时(例如用户名较长) C:\Users\USER~1.NAM 通过环境变量获取的临时文件夹路径会导致安装失败,原因是Remove-ItemSet-Location不支持这样的路径(见 https://github.com/PowerShell/PowerShell/issues/7760#issue-359155177 )。 安装脚本会在Remove-Item $outfile这句失败

            Write-Output $pid | Out-File -FilePath $outfile
            Remove-Item $outfile

期待的结果

xmake.io的一键安装脚本应当能正常完成安装

工程配置

无需配置即可复现

附加信息和错误日志

> Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content
                         _
    __  ___ __  __  __ _| | ______
    \ \/ / |  \/  |/ _  | |/ / __ \
     >  <  | \__/ | /_| |   <  ___/
    /_/\_\_|_|  |_|\__ \|_|\_\____| getter

Cannot write to temp path
Please set environment var "TMP" to another path
Remove-Item:
Line |
  78 |              Remove-Item $outfile
     |              ~~~~~~~~~~~~~~~~~~~~
     | An object at the specified path C:\Users\USER~1.NAM does not exist.
waruqi commented 4 months ago

这种直接提个 pr 过来修下就好

Patrick-Ze commented 4 months ago

这种直接提个 pr 过来修下就好

是已经在提PR了,发现guideline需要先提issue才提了这个

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Just submit a PR and come over to fix it.

waruqi commented 4 months ago

merged, thanks

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Just submit a PR and have it fixed.

I was already submitting a PR, but I found that the guideline requires an issue to be submitted first, so I submitted this.