I want to update beast to the tip of the master branch manually:
https://github.com/Microsoft/vcpkg/blob/master/ports/beast/portfile.cmake
I'd like to set REF to the git commit hash of the latest version of Beast, which is v40, so I don't have to be bothered with tags which are insecure anyway. Beast version 40 has git commit SHA f2d825594ee34ccc1ebc0b231899a1735245778d
See
https://github.com/vinniefalco/Beast/commit/f2d825594ee34ccc1ebc0b231899a1735245778d
Is this possible? Or am I forced to push a tag? How do I set the SHA512 field? Git doesn't use SHA512 as far as I know, what is this digest? Its not the digest of the corresponding ZIP file offered by GitHub. Can I do away with this field and just work with commit ids?
There doesn't seem to be much in terms of documentation on the vcpkg_from_github function from what I saw. I looked at vcpkg_from_github.cmake in the vcpkg sources but that didn't really help much.
I don't have vcpkg installed and I would like to not have to build it, I prefer to just submit a pull request to update Beast manually.
This port support --head option
Add --head option for vcpkg install. It only applies to github-based project and allows you to use the latest master commit
For example: ./vcpkg install cpprestsdk:x64-windows --head will build cpprestsdk from the latest master commit instead of version 2.9.0 specified in the CONTROL file
There might have been a misunderstanding. I'm not looking to update my local installation of Beast, I am looking to update the portfile.cmake which is in the vcpkg repository to the latest version, so that _other_ people who install Beast will get a newer version.
Sorry. Yes, you can easily fo that.
vcpkg install beastactual SHA512 ...)But I think it's better to set the tag and use it in the REF
I followed your directions:
Vcpkg will print correct SHA512 value (actual SHA512 ...)
But this never happened. There was no output which told me the SHA512.
Its not the digest of the corresponding ZIP file offered by GitHub.
It's computed from tar.gz archive. In this case it is probably https://github.com/vinniefalco/Beast/archive/f2d825594ee34ccc1ebc0b231899a1735245778d.tar.gz
Just tried with ref: f2d825594ee34ccc1ebc0b231899a1735245778d
vcpkg install beast print:
File does not have expected hash:
File path: [ D:/Work/vcpkg/downloads/vinniefalco-Beast-f2d825594ee34ccc1ebc0b231899a1735245778d.tar.gz ]
Expected hash: [ 78b1b09d6785e8b782bea72b6849936c0be45df1fd137db832c0afe1b09af122e0fd69e25321bcd8681f03015d94345a40f9650a5560f12c73457e4cc82e2f30 ]
Actual hash: [ 21ea2ba77ff8c1dac873e7abd4caa03da50f155c34b39783380d4319c930be02076bf2b7ffcf93a964cac60bfb0a2ec8621156c332adedd3a2af82a27ca50e1a ]
The file may be corrupted.
Set SHA512 to 21ea2ba77ff8c1dac873e7abd4caa03da50f155c34b39783380d4319c930be02076bf2b7ffcf93a964cac60bfb0a2ec8621156c332adedd3a2af82a27ca50e1a
How did you come up with that digest?
Just run vcpkg install beast (with REF f2d825594ee34ccc1ebc0b231899a1735245778d in portfile.cmake)
Full log:
The following packages will be built and installed:
beast:x64-windows
Building package beast:x64-windows...
-- CURRENT_INSTALLED_DIR=D:/Work/vcpkg/installed/x64-windows
-- DOWNLOADS=D:/Work/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=D:/Work/vcpkg/packages/beast_x64-windows
-- CURRENT_BUILDTREES_DIR=D:/Work/vcpkg/buildtrees/beast
-- CURRENT_PORT_DIR=d:/Work/vcpkg/ports/beast/.
-- Downloading https://github.com/vinniefalco/Beast/archive/f2d825594ee34ccc1ebc0b231899a1735245778d.tar.gz...
-- Downloading https://github.com/vinniefalco/Beast/archive/f2d825594ee34ccc1ebc0b231899a1735245778d.tar.gz... OK
-- Testing integrity of downloaded file...
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:12 (message):
File does not have expected hash:
File path: [ D:/Work/vcpkg/downloads/vinniefalco-Beast-f2d825594ee34ccc1ebc0b231899a1735245778d.tar.gz ]
Expected hash: [ 78b1b09d6785e8b782bea72b6849936c0be45df1fd137db832c0afe1b09af122e0fd69e25321bcd8681f03015d94345a40f9650a5560f12c73457e4cc82e2f30 ]
Actual hash: [ 21ea2ba77ff8c1dac873e7abd4caa03da50f155c34b39783380d4319c930be02076bf2b7ffcf93a964cac60bfb0a2ec8621156c332adedd3a2af82a27ca50e1a ]
The file may be corrupted.
Call Stack (most recent call first):
scripts/cmake/vcpkg_download_distfile.cmake:52 (test_hash)
scripts/cmake/vcpkg_from_github.cmake:63 (vcpkg_download_distfile)
ports/beast/portfile.cmake:4 (vcpkg_from_github)
scripts/ports.cmake:73 (include)
I got actual hash
This is great! Thanks!
FYI, vcpkg hash could also come in handy here.
You run vcpkg hash on the .zip download from GitHub?
Yes