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

Update libsodium #634

Open
cyjseagull opened this issue Nov 1, 2022 · 8 comments
Open

Update libsodium #634

cyjseagull opened this issue Nov 1, 2022 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@cyjseagull
Copy link

The official libsodium has been upgraded to 1.18, when is hunter expected to upgrade accordingly.

@NeroBurner
Copy link

once someone updates https://github.com/cpp-pm/hunter/blob/master/cmake/projects/libsodium/hunter.cmake#L39 with a new entry and updates the default version https://github.com/cpp-pm/hunter/blob/master/cmake/configs/default.cmake#L374 as described in https://hunter.readthedocs.io/en/latest/creating-new/update.html

And it should also be checked if a hunter-fork is needed anymore or if the project has a well behaved cmake project file

PRs welcome

@NeroBurner NeroBurner added the help wanted Extra attention is needed label Nov 2, 2022
@grahamreeds
Copy link

grahamreeds commented May 11, 2023

I will take this as I need this and asio updating. I will document it here so I can make sure I cross the t's and dot the i's.

  1. create a branch called pr.hunter_libsodium_1_0_18
  2. Update configs/default.cmake so that the default version of libsodium is now 1.0.18
  3. Get the sha1 for the new version of libsodium
openssl sha1 libsodium-1.0.18.tar.gz
SHA1(libsodium-1.0.18.tar.gz)= 795b73e3f92a362fabee238a71735579bf46bb97
  1. Add new version to libsodium\hunter.cmake:
hunter_add_version(
    PACKAGE_NAME
    libsodium
    VERSION
    "1.0.18"
    URL
    "https://github.com/hunter-packages/libsodium/archive/v1.0.18.tar.gz"
    SHA1
    795b73e3f92a362fabee238a71735579bf46bb97
)

Q) There is some conditional logic for 1.0.10 and 1.0.16. The addition of v1.0.18 will force it to pick the url_sha1_cmake scheme? Is that what we want?

@grahamreeds
Copy link

grahamreeds commented May 11, 2023

Okay. The hunter-packages is readonly. Do I just copy clone the latest libsodium from hunter-packages/libsodium and then copy over v1.0.18 and then push the changes back?

There is no cmake for the newer v1.0.18 version of libsodium.

grahamreeds added a commit to grahamreeds/hunter that referenced this issue May 11, 2023
 cpp-pm#634: Added version 1.0.18 of libsodium to hunter.cmake
@grahamreeds
Copy link

The PR I tried fails with the following error:

subprocess.CalledProcessError: Command '['/opt/hostedtoolcache/Python/3.8.16/x64/python', '/home/runner/work/hunter/hunter/polly-master/bin/build.py', '--clear', '--config', 'Release', '--toolchain', 'clang-cxx17', '--home', '/home/runner/work/hunter/hunter/examples/libsodium', '--fwd', 'CMAKE_POLICY_DEFAULT_CMP0069=NEW', 'HUNTER_SUPPRESS_LIST_OF_FILES=ON', 'HUNTER_ROOT=/home/runner/work/hunter/hunter/_testing/Hunter', 'TESTING_URL=/home/runner/work/hunter/hunter/_testing/hunter.tar.gz', 'TESTING_SHA1=be5fb4d792ef1e5749e6c549f79f224a5c4d10b8', 'HUNTER_RUN_INSTALL=ON', '--verbose']' returned non-zero exit status 1.
Error: Process completed with exit code 1.

@NeroBurner
Copy link

There is a fork in the cpp-pm group already. New versions should be added there

https://github.com/cpp-pm/libsodium

I've tried rebasing the hunter specific commits onto the 1.0.18 tag, update the used Hunter version and Gate, and create a hunter-1.0.18 branch:

https://github.com/cpp-pm/libsodium/tree/hunter-1.0.18

Unfortunately the CMakeLists.txt must be updated for the new files (which should be done by you or someone who needs that package ;) )

I don't know why there is also a 1.0.18-RELEASE tag as well in the upstream repo

@grahamreeds
Copy link

grahamreeds commented May 19, 2023

Okay. I have updated the sugar.cmake file. It turns out just removing the lines 158-161 was enough to get it to compile:

workspaces/libsodium/build (hunter-1.0.18) $ cm
workspaces/libsodium/build (hunter-1.0.18) $ cmake --build . --config RELEASE -j12

Lots of warnings with ignoring '#pragma warning', and the more worrying #warning *** The library is being compiled using an undocumented method.`.

However I did the nice

[100%] Linking C static library liblibsodium.a
[100%] Built target libsodium

@grahamreeds
Copy link

Created a pull request. Assuming that is all correct what next?

@NeroBurner
Copy link

all correct :)

created a tag for you to integrate, also computed the sha1 for you

wget -O - https://github.com/cpp-pm/libsodium/archive/refs/tags/v1.0.18-p0.tar.gz | sha1sum 

0fafd2219825c6a9d62205b1e921c816b3e94113  -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants