Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ffmpeg] Build error on x64-windows-static #43189

Open
baiyfcu opened this issue Jan 10, 2025 · 13 comments
Open

[ffmpeg] Build error on x64-windows-static #43189

baiyfcu opened this issue Jan 10, 2025 · 13 comments
Assignees
Labels
requires:repro The issue is not currently repro-able

Comments

@baiyfcu
Copy link

baiyfcu commented Jan 10, 2025

The files msys2-gawk-5-01baeb86.3.1-1-x86_64.pkg.tar.zst and msys2-gzip-1.13-1-x86_64.pkg.tar.zst show some file sizes as 0 when opened on Windows ARM, causing issues with extraction. After re-packaging these two files, they can be extracted correctly.

CMake Error: Problem with archive_write_header(): Can't create '\?\D:\workpath\env\vcpkg\downloads\tools\msys2\c84c41b5827fcd39.tmp\usr\bin\gawk.exe'
CMake Error: Current file: usr/bin/gawk.exe
CMake Error at scripts/cmake/vcpkg_acquire_msys.cmake:232 (file):
file failed to extract:
D:/workpath/env/vcpkg/downloads/msys2-gawk-5-01baeb86.3.1-1-x86_64.pkg.tar.zst
Call Stack (most recent call first):
ports/ffmpeg/portfile.cmake:153 (vcpkg_acquire_msys)
scripts/ports.cmake:196 (include)

CMake Error: Problem with archive_write_header(): Can't create '\?\D:\workpath\env\vcpkg\downloads\tools\msys2\28c6b09dc5eb58f5.tmp\usr\bin\gunzip'
CMake Error: Current file: usr/bin/gunzip
CMake Error at scripts/cmake/vcpkg_acquire_msys.cmake:232 (file):
file failed to extract:
D:/workpath/env/vcpkg/downloads/msys2-gzip-1.13-1-x86_64.pkg.tar.zst
Call Stack (most recent call first):
ports/ffmpeg/portfile.cmake:153 (vcpkg_acquire_msys)
scripts/ports.cmake:196 (include)

@baiyfcu
Copy link
Author

baiyfcu commented Jan 10, 2025

In the compressed file msys2-gawk-5-01baeb86.3.1-1-x86_64.pkg.tar.zst, the problematic file is usr\bin\gawk.exe. In the file msys2-gzip-1.13-1-x86_64.pkg.tar.zst, the problematic file is usr\bin\gunzip.

@baiyfcu
Copy link
Author

baiyfcu commented Jan 10, 2025

Image

@jimwang118 jimwang118 self-assigned this Jan 10, 2025
@dg0yt
Copy link
Contributor

dg0yt commented Jan 10, 2025

I guess the 0 KB files are symlinks. Not sure how it is actually implemented, but I guess they could be extracted as pure copies.

@jimwang118 jimwang118 added the requires:repro The issue is not currently repro-able label Jan 10, 2025
@jimwang118
Copy link
Contributor

I can't reproduce this issue locally.
Image

@baiyfcu
Copy link
Author

baiyfcu commented Jan 13, 2025

I guess the 0 KB files are symlinks. Not sure how it is actually implemented, but I guess they could be extracted as pure copies.

It might be related to this.

@baiyfcu
Copy link
Author

baiyfcu commented Jan 13, 2025

I can't reproduce this issue locally. Image

Let me confirm if this issue has been tested in a Windows ARM environment on your side.

@baiyfcu
Copy link
Author

baiyfcu commented Jan 13, 2025

When installing libiconv:x64-windows-static with vcpkg, it shows an error similar to this.

CMake Error: Problem with archive_write_header(): Can't create '\\?\D:\workpath\env\vcpkg\downloads\tools\msys2\44e616cca626862b.tmp\usr\bin\ld.exe'
CMake Error: Current file: usr/bin/ld.exe
CMake Error at scripts/cmake/vcpkg_acquire_msys.cmake:232 (file):
  file failed to extract:
  D:/workpath/env/vcpkg/downloads/msys2-binutils-2.43.1-1-x86_64.pkg.tar.zst
Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:332 (vcpkg_acquire_msys)
  ports/libiconv/portfile.cmake:30 (vcpkg_configure_make)
  scripts/ports.cmake:196 (include)

cd tem
zstd -d  ./msys2-binutils-2.43.1-1-x86_64.pkg.tar.zst
tar -xvf msys2-binutils-2.43.1-1-x86_64.pkg.tar

tar -cvf msys2-binutils-2.43.1-1-x86_64.pkg.tar usr .BUILDINFO .MTREE .PKGINFO
zstd ./msys2-binutils-2.43.1-1-x86_64.pkg.tar 

shasum -a 512 msys2-binutils-2.43.1-1-x86_64.pkg.tar .zst   

Currently, the issue can be resolved by extracting the files using the above command, then re-compressing them. After that, replace the file in the vcpkg downloads directory with the newly compressed file and modify the SHA256 string on line 313 of the scripts/cmake/vcpkg_acquire_msys.cmake file.

@baiyfcu
Copy link
Author

baiyfcu commented Jan 13, 2025

I guess the 0 KB files are symlinks. Not sure how it is actually implemented, but I guess they could be extracted as pure copies.

It might be related to this.

Image

@baiyfcu
Copy link
Author

baiyfcu commented Jan 13, 2025

Image
On Windows, when I copied the user directory and compressed the newly copied user directory, after compression, it worked normally. However, there were some extra files in the compressed archive.

@dg0yt
Copy link
Contributor

dg0yt commented Jan 13, 2025

For cmake -E tar ..., another issue shows a problem with locales vs. Unicode: #43176. The suggested mitigation was to "change system locale to en-US." Would this make a difference here?

@baiyfcu
Copy link
Author

baiyfcu commented Jan 13, 2025

After changing the system locale, it seems to be working. However, I found an issue when using the built-in tar -xvf msys2-binutils-2.43.1-1-x86_64.pkg.tar.zst, as it reports an error.

x usr/x86_64-pc-msys/bin/ar.exe: Hard-link target 'usr/bin/ar.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/as.exe: Hard-link target 'usr/bin/as.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/dlltool.exe: Hard-link target 'usr/bin/dlltool.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/ld.bfd.exe: Hard-link target 'usr/bin/ld.bfd.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/ld.exe: Hard-link target 'usr/bin/ld.bfd.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/nm.exe: Hard-link target 'usr/bin/nm.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/objcopy.exe: Hard-link target 'usr/bin/objcopy.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/objdump.exe: Hard-link target 'usr/bin/objdump.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/ranlib.exe: Hard-link target 'usr/bin/ranlib.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/readelf.exe: Hard-link target 'usr/bin/readelf.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/bin/strip.exe: Hard-link target 'usr/bin/strip.exe' does not exist.: No such file or directory
x usr/x86_64-pc-msys/lib/
x usr/x86_64-pc-msys/lib/ldscripts/
x usr/x86_64-pc-msys/lib/ldscripts/i386pe.x
x usr/x86_64-pc-msys/lib/ldscripts/i386pe.xa
x usr/x86_64-pc-msys/lib/ldscripts/i386pe.xbn
tar.exe: Error exit delayed from previous errors.

@baiyfcu baiyfcu closed this as completed Jan 13, 2025
@baiyfcu baiyfcu reopened this Jan 13, 2025
@dg0yt
Copy link
Contributor

dg0yt commented Jan 13, 2025

Does vcpkg use that "built-in tar"?

@baiyfcu
Copy link
Author

baiyfcu commented Jan 13, 2025

To prevent any modified cache, I pulled the latest code from the vcpkg repository again, but the issue still persists.

Image
Using the built-in Windows tar tool to extract and then re-compress and replace the files can resolve the issue.
Although there is an error message during extraction, it can be ignored and does not affect usage.

tar -xvf msys2-binutils-2.43.1-1-x86_64.pkg.tar.zst
tar -c --zstd -f msys2-binutils-2.43.1-1-x86_64.pkg.tar.zst usr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

3 participants