2

I was working with the Github API in order create a script to transfer secrets from Gitlab.

While doing so I have been trying to setup the libsodium-go package to encrypt the secrets. Here is the link for reference https://github.com/GoKillers/libsodium-go

I have followed the steps mentioned on the page.

Pre-setup:

Please install Libsodium here https://download.libsodium.org/doc/installation/index.html
sudo ldconfig
sudo apt-get install pkg-config

Install libsodium-go:

go get -d github.com/GoKillers/libsodium-go
cd $GOPATH/src/github.com/GoKillers/libsodium-go
./build.sh

But for the pre setup have used brew install libsodium

When I run the ./build.sh

I get the following error

In file included from cryptohash/crypto_hash.go:5:
/usr/local/include/sodium.h:5:10: fatal error: 'sodium/version.h' file not found
#include "sodium/version.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.

Not sure how to resolve this. Any help would be appreciated!

  • libsodium is installing using ./configure, make and make install, however the golang package is not downloading, package downloads with a gitclone, and build.sh runs with warnings. it does not however produce a binary. – whitespace Apr 26 '21 at 09:35
  • I did go ahead and try installing libsodium using brew. From the /usr/local/Cellar/libsodium/1.0.18_1/include/ was able to copy the sodium folder to /usr/local/include. This seems to be a quick fix but still don't think its the right way. – Adith Dev Reddy Apr 26 '21 at 10:03

1 Answers1

1

Was having the same issue, when I ran brew install libsodium, a warning was displayed stating that libsodium has been installed, it's just not linked. To link run brew link libsodium. If conflicting files are found, running brew link --overwrite libsodium resolved the problem.

waridrox
  • 19
  • 1
  • 3