microsoft / vcpkg

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

[vcpkg-tool] build failure for some ports (libiconv, gettext) I have found so far #23381

Closed StarGate-One closed 2 years ago

StarGate-One commented 2 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: ./vcpkg install libiconv:x64-windows ./vcpkg install gettext:x64-windows

Failure logs -Cut and paste the appropriate build messages from the console output - in zip file -Please attach any additional failure logs mentioned in the console output - in zip file Included port libiconv console log along with the complete .\buildtrees\libiconv folder minus the src libiconv.zip

Additional context It seems a change made in between these 2 release versions of the vcpkg-tool something has caused the bash command to fail somehow? The bootstrap-vcpkg.bat is still downloading the 2022-02-24 version of vcpkg-tool, but I was testing the 2022-03-03 version.

dg0yt commented 2 years ago

Did you already inspect or remove D:/vcpkg-test/downloads/tools/msys2/7e05e7aa09f1709f? Can you share the config.log file either from the x64-windows-dbg folder or as config.log... from buildtrees/libiconv?

StarGate-One commented 2 years ago

Did you already inspect or remove D:/vcpkg-test/downloads/tools/msys2/7e05e7aa09f1709f? fresh/clean clone of vcpkg for each version of vcpkg - both download and install the pre-requisite msys2 tools in the /downloads/tools/msys2 directory Can you share the config.log file either from the x64-windows-dbg folder or as config.log... from buildtrees/libiconv? included libiconv.zip file in the original post, above, but most of the files are 0 byte size..

dg0yt commented 2 years ago
  • If you wish not to download/unzip and inspect its content, ...

I did that, but config.log* isn't there.

...you can always clone a vcpkg to another repo, download the 2022-03-03 vcpkg-tool and put in the vcpkg repo root and try to install libconv and gettext and see if you obtain the same results?

No, I can't because I don't have Visual Studio. And the ports do build in vcpkg CI, so even if I did, I might not be able reproduce the issue.

Your issue is with tools from MSYS2. MSYS2 is sensitive to mixing different versions of the runtime. So I'm not curiuous about the vpkg tool versions but about other possible sources for these tools. And config.log has details such as the PATH seen inside of the configure script.

StarGate-One commented 2 years ago
dg0yt commented 2 years ago
  • If you do not have the tools to work this issue, then why are you even involved?

I'm a friendly contributor with msys2 and gettext;x64-windows experience. I'm sorry if you feel my help is inappropriate.

StarGate-One commented 2 years ago
StarGate-One commented 2 years ago

Ok, did this the hard way, started backing out commits until the vcpkg install libiconv did not fail...

  1. $ git reset --hard 6ef3648a2b7daf197fce82d936ff88ef98c26361 HEAD is now at 6ef3648a Use System32\tar.exe if present instead of 7zip for zip archives. (#406) Ports libiconv and gettext fail (gettext will fail due to cascading dependencies of libiconv)
  2. $ git reset --hard ca46ecb19fcf9dc45f4c87345a218ce6b264ca76 HEAD is now at ca46ecb1 [localization][automated][ci skip] update locale files (https://github.com/microsoft/vcpkg-tool/commit/ca46ecb19fcf9dc45f4c87345a218ce6b264ca76) Ports libiconv and gettext install successfully.

@dg0yt - Note on the failing libiconv, the .\buildtrees\libiconv\config-x64-windows-dbg-out.log is created as a 0 byte file, the .\buildtrees\libiconv\config-x64-windows-dbg-err.log is created with the sed and expr programs not found and to execute in a POSIX shell. The .\buildtrees\libiconv\x64-windows-dbg directory contains only a single 0 byte file name .lineno. The .\buildtrees\libiconv\x64-windows-dbg\config.h and config.status are not created.

@ras0219-msft @BillyONeal @strega-nil-ms - I studied the changes made in commit Use System32\tar.exe if present instead of 7zip for zip archives. (#406) but with my C/C++ not being that well, I could not identify the exact line(s) causing the failure.

Note these 2 ports use the vcpkg_configure_make and vcpkg_install_make cmake scripts, so I would theorize this may affect some other ports using these same script may also fail with the 2022-03-03 vcpkg-tool version.

I apologize for closing accidently earlier, the purple "Close with Comment" just look more visually appealing the just the green "Comment" button.

StarGate-One commented 2 years ago

Hope this helps, - I think I figured it out...

  1. I have a fresh install of Windows 10 Pro 19044:1566, only a few weeks old.
  2. It seems somehow is dependent on what shell is looking at the file system at any given time, realizing windows treats C:\Windows\System32 and C:\Windows\system32 the same, when most, if not all nix flavors differentiate between upper and lower case: a. When I do a dir from Windows cmd prompt, system32 is C:\Windows\system32 b. When I look at my environment variables, one of my path values is C:\Windows\system32 c. Comparing the output when I did the .\vcpkg install libiconv --debug >.\somelogname.log 2>&1 when using the 2 different vcpkg versions there are the normal differences, time, process id, etc but the one that caught my attention was the PATH information output was different between the two, more specifically the 2022-02-24 version has C:\Windows\system32 and the 2022-03-03 version has C:\Windows\System32 - see the difference, the one working has lower case system32, the one broke, and upper case System32.
  3. So I modified vcpkg-tool src/vcpkg/base/system.cpp and src/vcpkg-test/files.cpp making any occurrence of System32 be system32, recompiled and run my test again - which it then successfully installed libiconv with the latest vcpkg-tool source as of 03:42 UTC 03-07-2022.
  4. Now what I do not know is if it breaks anything else???
  5. I do have Git installed so I opened a git bash shell and cd /c/Windows/System32 and cd /c/Windows/system32 both work, but when I do cd /c/Windows and do an ls -ald System* I do get all the Windows/System directories, but when I do a ls -ald system* I only get the file system.ini - no System directories. I am not familiar with MSYS2 bash (although git uses it also from my understanding) but git bash may had some additional scripts that allows it to find the Windows System versus Windows system directories.
  6. I do not know if this is something that is actually wrong with vcpkg-tool in how it handles getting the system32 files or it finds the Windows tar first while in a bash shell or something amiss in my new windows install?
  7. I have attached by test logs, 2022-02-24, 2022-03-03 (broken) and 2022-03-03 (my fixes), screen shot of my compares and the cpp files I changed to make all System32 be system32. CompareOfvcpkg-tool_2022-02-24and2022-03-03 CompareOfvcpkg-tool_2022-02-24andvcpkg-fix-system32 vcpkg-2022-02-24.log vcpkg-2022-03-03.log files.cpp.txt system.cpp.txt
JackBoosY commented 2 years ago

@StarGate-One Thanks for the very detailed information. I think case is the reason for this issue. In Windows, the system is not case-sensitive. However in mingW this behavior may be broken. This will cause all port builds that use vcpkg_configure_make in Windows to fail.

Can you please make a PR to https://github.com/microsoft/vcpkg-tool/pulls to fix this?

Thanks!

StarGate-One commented 2 years ago

Could not be repro in CI - closing.

JackBoosY commented 2 years ago

Should wait for next release.

StarGate-One commented 2 years ago

This is fixed now, I close.