microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.09k stars 6.37k forks source link

icu port on Windows creates in its buildtree files with names that cannot be deleted from command line with Powershell or Git Bash #10365

Open traversaro opened 4 years ago

traversaro commented 4 years ago

Describe the bug icu port on Windows creates in its buildtree files with names that cannot be deleted from command line with Powershell or Git Bash

Environment

To Reproduce On Git Bash:

./vcpkg.exe install icu:x64-windows
rm -rf buildtrees

This will fail with the following message:

2020-03-09T17:54:41.5736150Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/common': Directory not empty
2020-03-09T17:54:42.6218293Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/data': Directory not empty
2020-03-09T17:54:42.6242660Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/extra/uconv': Directory not empty
2020-03-09T17:54:42.7189320Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/i18n': Directory not empty
2020-03-09T17:54:42.7218943Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/io': Directory not empty
2020-03-09T17:54:42.7395213Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/stubdata': Directory not empty
2020-03-09T17:54:42.7540731Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/ctestfw': Directory not empty
2020-03-09T17:54:42.7559696Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/genbrk': Directory not empty
2020-03-09T17:54:42.7560696Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/genccode': Directory not empty
2020-03-09T17:54:42.7568641Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/gencfu': Directory not empty
2020-03-09T17:54:42.7584840Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/gencmn': Directory not empty
2020-03-09T17:54:42.7598746Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/gencnval': Directory not empty
2020-03-09T17:54:42.7609501Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/gendict': Directory not empty
2020-03-09T17:54:42.7624626Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/gennorm2': Directory not empty
2020-03-09T17:54:42.7658514Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/genrb': Directory not empty
2020-03-09T17:54:42.7667980Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/gensprep': Directory not empty
2020-03-09T17:54:42.7692643Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/icuinfo': Directory not empty
2020-03-09T17:54:42.7700635Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/icupkg': Directory not empty
2020-03-09T17:54:42.7719057Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/makeconv': Directory not empty
2020-03-09T17:54:42.7731100Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/pkgdata': Directory not empty
2020-03-09T17:54:42.7791331Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-dbg/tools/toolutil': Directory not empty
2020-03-09T17:54:42.8333276Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/common': Directory not empty
2020-03-09T17:54:43.9256518Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/data': Directory not empty
2020-03-09T17:54:43.9280921Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/extra/uconv': Directory not empty
2020-03-09T17:54:44.0025014Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/i18n': Directory not empty
2020-03-09T17:54:44.0054658Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/io': Directory not empty
2020-03-09T17:54:44.0166092Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/stubdata': Directory not empty
2020-03-09T17:54:44.0282365Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/ctestfw': Directory not empty
2020-03-09T17:54:44.0294920Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/genbrk': Directory not empty
2020-03-09T17:54:44.0304162Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/genccode': Directory not empty
2020-03-09T17:54:44.0311362Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/gencfu': Directory not empty
2020-03-09T17:54:44.0318633Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/gencmn': Directory not empty
2020-03-09T17:54:44.0327805Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/gencnval': Directory not empty
2020-03-09T17:54:44.0337758Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/gendict': Directory not empty
2020-03-09T17:54:44.0352058Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/gennorm2': Directory not empty
2020-03-09T17:54:44.0388455Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/genrb': Directory not empty
2020-03-09T17:54:44.0399722Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/gensprep': Directory not empty
2020-03-09T17:54:44.0422974Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/icuinfo': Directory not empty
2020-03-09T17:54:44.0431967Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/icupkg': Directory not empty
2020-03-09T17:54:44.0447936Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/makeconv': Directory not empty
2020-03-09T17:54:44.0461990Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/pkgdata': Directory not empty
2020-03-09T17:54:44.0517702Z rm: cannot remove 'C:/idjl/vcpkg/buildtrees/icu/x64-windows-rel/tools/toolutil': Directory not empty

If you check, it seems that those directories contain a file named C:.
Deleting the folder is also impossible in powershell (see https://github.com/iit-danieli-joint-lab/idjl-software-dependencies-vcpkg/runs/495928460) while it works fine with cmd prompt (https://github.com/iit-danieli-joint-lab/idjl-software-dependencies-vcpkg/pull/5/checks?check_run_id=496262390).

Expected behavior I expect the delete to work correctly.

Failure logs See https://github.com/iit-danieli-joint-lab/idjl-software-dependencies-vcpkg/runs/495838460 .

Additional context To be honest, I do not know if the problem is in vcpkg's icu port, in icu buildsystem or in Git Bash, but I think it any case it would be good to have an issue to track this if someone faces this problem. Feel free to close if you think it is not directly related to vcpkg.

LilyWangL commented 4 years ago

@traversaro Thanks for posting issue. I reproduced this issue on my vmware. I found:

  1. The powershell remove the directory failed due to file icu-config is a read-only file.

  2. And git bash remove the directory failed due to the directory name has a special symbol.

I try to use powershell and git bash to remove other ports source directory, and I remove successfully. I think the files generated by the building port is based on the source file.

traversaro commented 4 years ago

To clarify, i reported the issue because "deleting buildtrees" is document as a way to save space: https://github.com/microsoft/vcpkg/blob/2020.01/docs/about/faq.md#how-can-i-remove-temporary-files .

LilyWangL commented 4 years ago

This is not a VCPKG bug, so I am closing this issue for now.

traversaro commented 4 years ago

This is not a VCPKG bug, so I am closing this issue for now.

Hi @LilyWangL , while this is not a vcpkg bug, it affects vcpkg users that follow the vcpkg documentation in https://github.com/microsoft/vcpkg/blob/2020.01/docs/about/faq.md#how-can-i-remove-temporary-files . Perhaps it could make sense to document in the FAQs that using Git Bash or Powershell is not supported to delete the buildtrees?

heydojo commented 4 years ago

Perhaps it could make sense to document in the FAQs that using Git Bash or Powershell is not supported to delete the buildtrees?

Upstream issue. The portfile could ensure that the offending files are not left in the buildtrees directory with the read-only attribute flag set but only if this issue cannot be solved by reporting it upstream.

This would appear to be something that needs to be patched out of the source code either upstream or by the port if upstream can't/won't for whatever reason.

It is also a git bash problem which should be reported to the developers.

I don't really understand the calls for support of git bash on Windows when powershell and the command prompt are available. Command prompt has worked in pretty much the same way since DOS through all versions of Windows and basic command scripting should have been taught at schools for a considerable number of years by now. If the Windows alternative to bash was a python shell however..

traversaro commented 4 years ago

I don't really understand the calls for support of git bash on Windows when powershell and the command prompt are available. Command prompt has worked in pretty much the same way since DOS through all versions of Windows and basic command scripting should have been taught at schools for a considerable number of years by now.

Hi @heydojo , I am not sure what you refer to as a "calls for support". Git Bash support is explicitly supported by vcpkg (as the boostrap.sh script works fine), and I think that opening an issue on the vcpkg issue tracker on a specific problem occurring on vcpkg is helpful for vcpkg users, for which the equivalent upstream report may not be as easily found or understandable. If any of the vcpkg maintainer instead feel that these kind of issue are off topic, feel free to close them, thanks!