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

[darknet] build failure #16011

Closed
kunyue001 opened this issue Feb 3, 2021 · 14 comments · Fixed by #15942
Closed

[darknet] build failure #16011

kunyue001 opened this issue Feb 3, 2021 · 14 comments · Fixed by #15942
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@kunyue001
Copy link

kunyue001 commented Feb 3, 2021

Host Environment

  • OS: [e.g. Windows/Linux etc...]
  • Compiler: revision
    Windows
    To Reproduce
    Steps to reproduce the behavior:
    ./vcpkg install xxxx

Failure logs

-Cut and past the appropriate build messages from the console output.
-Please attach any additional failure logs mentioned in the console output.
Starting package 1/1: darknet:x64-windows
Building package darknet[core,cuda,cudnn,full,opencv-cuda,weights,weights-train]:x64-windows...
-- Using cached C:/Users/Kun/vcpkg/downloads/AlexeyAB-darknet-00d578e327c22638ea12e73c4efb74c798c08de5.tar.gz
-- Cleaning sources at C:/Users/Kun/vcpkg/buildtrees/darknet/src/c798c08de5-d29893808b.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Users/Kun/vcpkg/downloads/AlexeyAB-darknet-00d578e327c22638ea12e73c4efb74c798c08de5.tar.gz
-- Using source at C:/Users/Kun/vcpkg/buildtrees/darknet/src/c798c08de5-d29893808b.clean
-- Downloading https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights -> darknet-cache/yolov4-tiny.weights...
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:105 (message):


  File does not have expected hash:

          File path: [ C:/Users/Kun/vcpkg/downloads/temp/darknet-cache/yolov4-tiny.weights ]
      Expected hash: [ 804ca2ab8e3699d31c95bf773d22f901f186703487c7945f30dc2dbb808094793362cb6f5da5cd0b4b83f820c8565a3cba22fafa069ee6ca2a925677137d95f4 ]
        Actual hash: [ 7d4d9fe150f9fe3ea7d2310f1445fe983b31fbf06d301c70ecfe00e8559e6f1bf940198c2dd55db772238f23ea0092fb6553558e5414f3ee173b8b28e53c5b54 ]

  The file may have been corrupted in transit.  This can be caused by
  proxies.  If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY
  environment variables to
  "https://user:password@your-proxy-ip-address:port/".



Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:195 (test_hash)
  ports/darknet/portfile.cmake:28 (vcpkg_download_distfile)
  scripts/ports.cmake:128 (include)


Error: Building package darknet:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: darknet:x64-windows
  Vcpkg version: 2021-01-13-unknownhash

Additionally, attach any relevant sections from the log files above.

Additional context
Add any other context about the problem here, such as what you have already tried to resolve the issue.

@JonLiu1993 JonLiu1993 changed the title [<port name>] build failure [darknet] build failure Feb 3, 2021
@JonLiu1993 JonLiu1993 self-assigned this Feb 3, 2021
@JonLiu1993 JonLiu1993 added category:question This issue is a question requires:repro The issue is not currently repro-able and removed category:question This issue is a question labels Feb 3, 2021
@JonLiu1993
Copy link
Member

@kunyue001 ,please make sure your vcpkg is latest, and I can confirm you downloaded package is broken.Can you please test if you can extract C:/Users/Kun/vcpkg/downloads/temp/darknet-cache/yolov4-tiny.weights manually?
Thanks.

@JonLiu1993 JonLiu1993 added category:question This issue is a question and removed requires:repro The issue is not currently repro-able labels Feb 3, 2021
@cenit
Copy link
Contributor

cenit commented Feb 3, 2021

Exactly as @JonLiu1993 said. You need to do a git pull inside vcpkg folder and then retry the command

@kunyue001
Copy link
Author

@kunyue001 ,please make sure your vcpkg is latest, and I can confirm you downloaded package is broken.Can you please test if you can extract C:/Users/Kun/vcpkg/downloads/temp/darknet-cache/yolov4-tiny.weights manually?
Thanks.

I have tired git pull in the vcpkg folder.

PS C:\Users\Kun\vcpkg> git pull
Already up to date.
PS C:\Users\Kun\vcpkg> .\vcpkg install darknet[full]:x64-windows
Computing installation plan...
The following packages will be built and installed:
darknet[core,cuda,cudnn,full,opencv-cuda,weights,weights-train]:x64-windows -> 2021-01-21
Detecting compiler hash for triplet x64-windows...
Could not locate cached archive: C:\Users\Kun\AppData\Local\vcpkg\archives\b6\b630ac73e1f43c2ef9393149176e146a6b08b0f3.zip
Starting package 1/1: darknet:x64-windows
Building package darknet[core,cuda,cudnn,full,opencv-cuda,weights,weights-train]:x64-windows...
-- Using cached C:/Users/Kun/vcpkg/downloads/AlexeyAB-darknet-00d578e327c22638ea12e73c4efb74c798c08de5.tar.gz
-- Cleaning sources at C:/Users/Kun/vcpkg/buildtrees/darknet/src/c798c08de5-d29893808b.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Users/Kun/vcpkg/downloads/AlexeyAB-darknet-00d578e327c22638ea12e73c4efb74c798c08de5.tar.gz
-- Using source at C:/Users/Kun/vcpkg/buildtrees/darknet/src/c798c08de5-d29893808b.clean
-- Downloading https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights -> darknet-cache/yolov4-tiny.weights...
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:105 (message):

File does not have expected hash:

      File path: [ C:/Users/Kun/vcpkg/downloads/temp/darknet-cache/yolov4-tiny.weights ]
  Expected hash: [ 804ca2ab8e3699d31c95bf773d22f901f186703487c7945f30dc2dbb808094793362cb6f5da5cd0b4b83f820c8565a3cba22fafa069ee6ca2a925677137d95f4 ]
    Actual hash: [ 7d4d9fe150f9fe3ea7d2310f1445fe983b31fbf06d301c70ecfe00e8559e6f1bf940198c2dd55db772238f23ea0092fb6553558e5414f3ee173b8b28e53c5b54 ]

The file may have been corrupted in transit. This can be caused by
proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY
environment variables to
"https://user:password@your-proxy-ip-address:port/".

Call Stack (most recent call first):
scripts/cmake/vcpkg_download_distfile.cmake:195 (test_hash)
ports/darknet/portfile.cmake:28 (vcpkg_download_distfile)
scripts/ports.cmake:128 (include)

Error: Building package darknet:x64-windows failed with: BUILD_FAILED

I can find the file:
PS C:\Users\Kun\vcpkg\downloads> cd .\temp\ PS C:\Users\Kun\vcpkg\downloads\temp> ls Directory: C:\Users\Kun\vcpkg\downloads\temp Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2/3/2021 12:11 PM darknet-cache PS C:\Users\Kun\vcpkg\downloads\temp> cd .\darknet-cache\ PS C:\Users\Kun\vcpkg\downloads\temp\darknet-cache> ls Directory: C:\Users\Kun\vcpkg\downloads\temp\darknet-cache Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 2/3/2021 12:11 PM 24251276 yolov4-tiny.weights PS C:\Users\Kun\vcpkg\downloads\temp\darknet-cache> vim .\yolov4-tiny.weights

@kunyue001
Copy link
Author

Exactly as @JonLiu1993 said. You need to do a git pull inside vcpkg folder and then retry the command

I have updated it using git pull. It gives me the same error.

@cenit
Copy link
Contributor

cenit commented Feb 3, 2021

Yes you're right. I don't know what happened. Might be that github modified the archive somehow? I already have a darknet update PR in the pipeline, I will add correct hashes!
In the meantime, please correct the portfile with the hashes the download gives you and then retry

@JonLiu1993
Copy link
Member

@kunyue001 ,After @cenit 's pr merge, you can update vcpkg and try again.

@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support and removed category:question This issue is a question labels Feb 4, 2021
@soltkreig
Copy link

Did anyone solve this trouble? I can't install darknet on local machine

@vicroms
Copy link
Member

vicroms commented Mar 25, 2021

Make sure that you have the latest portfiles by doing a git pull.
If the error persists try deleting the downloaded darknet sources in {vcpkg-root}/downloads/. As a last option you can overwrite the SHA by modifying {vcpkg-root}/ports/darknet/portfile.cmake.

@MiguelEsteve
Copy link

Does not work to me in any of the cases mentioned above.
Neither doing a git pull, nor overwritting the SHA. Stop using vcpkg.

@sfhacker
Copy link

We have just built darknet master branch from source (Windows 10 x64) with no issues at all.

image

@PhoebeHui
Copy link
Contributor

PhoebeHui commented Apr 12, 2021

File does not have expected hash:

      File path: [ C:/Users/Kun/vcpkg/downloads/temp/darknet-cache/yolov4-tiny.weights ]
  Expected hash: [ 804ca2ab8e3699d31c95bf773d22f901f186703487c7945f30dc2dbb808094793362cb6f5da5cd0b4b83f820c8565a3cba22fafa069ee6ca2a925677137d95f4 ]
    Actual hash: [ 7d4d9fe150f9fe3ea7d2310f1445fe983b31fbf06d301c70ecfe00e8559e6f1bf940198c2dd55db772238f23ea0092fb6553558e5414

Possiable solution to the issue:

  1. Delete the archive files 'C:/Users/Kun/vcpkg/downloads/temp/darknet-cache/yolov4-tiny.weights', you can see the information from output.
--  File path: [ C:/Users/Kun/vcpkg/downloads/temp/darknet-cache/yolov4-tiny.weights ]
  1. Executing 'git pull' to get latest version of portfile.

  2. You can try again, if it still persists, you can overwrite the SHA by updating {vcpkg-root}/ports/darknet/portfile.cmake with 'Actual hash: [ 7d4d9fe150f9fe3ea7d2310f1445fe983b31fbf06d301c70ecfe00e8559e6f1bf940198c2dd55db772238f23ea0092fb6553558e5414'.

@@kunyue001 @soltkreig, we have already fixed this issue on master, please reopen this issue if the issue persist.

@PhoebeHui
Copy link
Contributor

This issue fixed by PR #15296

@vicroms
Copy link
Member

vicroms commented Apr 13, 2021

@PhoebeHui we need to add a version string to the downloaded filename (yolov4-tiny.weights) or this may keep happening, maybe prefixing DARKNET_VERSION is enough (assuming that the contents of the weights file and the library change at the same time).

Since the filename is the same, vcpkg doesn't know that it has to re-download the file.

 vcpkg_download_distfile(YOLOV4-TINY_WEIGHTS
    URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights"
    FILENAME "darknet-cache/${DARKNET_VERSION}-yolov4-tiny.weights"
    SHA512 xyz
  )

@PhoebeHui
Copy link
Contributor

@vicroms, I'm agree with you, however, PR #16635 is talking about to change the way to get the required files, the hash may not needed in future, so this is will not be an issue. I will keep tracking the PR, and see if this is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants