Build error: libsodium.a , macOS-x86_64

I have never been able to build pijul on macOS, using Homebrew as package manager, and now this includes the version 1 beta. Very frustrating. First I set envvars as suggested:

export LIBRARY_PATH=/usr/local/lib \
OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib \
OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include \

Then for the build command
cargo install pijul --version "~1.0.0-alpha"

after dozens of compiler warnings about various things, I get this very odd message:

ld: warning: ignoring file ../../src/libsodium/.libs/libsodium.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64

and this leads to very many symbols not found.

I have no idea how to fix this.

Your text says “1.0.0-beta” but your command says “1.0.0-alpha”.
I don’t know if it has anything to do with it.

@joyously: you’re right, that command should by --version "~1.0.0-beta" indeed.

I don’t know much about OSX. My dream would be to have people with OSX and Windows experience test and benchmark Pijul on these platforms. I’ve heard it’s terribly slow on some repos on Windows, and now it’s hard to compile on OSX.

@fbaube I just installed it on my macOS by doing:

brew install llvm libsodium openssl xxhash zstd
cargo install pijul --version "~1.0.0-beta" --features git

The --features git is just to have the pijul git subcommand.

My mistake - too much cutting & pasting between windows. Just to be sure, I just re-ran the build with “beta”, and got the same failure.

Just to be sure, I did a brew reinstall on the dependencies and then re-ran the build. I got the same error. So I guess there is something amiss in my Mac’s libraries.
The brew reinstall reinstalled these versions:

🍺  /usr/local/Cellar/llvm/13.0.0_2: 5,449 files, 940.8MB
🍺  /usr/local/Cellar/libsodium/1.0.18_1: 73 files, 1MB
🍺  /usr/local/Cellar/openssl@3/3.0.1: 6,420 files, 28.1MB
🍺  /usr/local/Cellar/xxhash/0.8.1: 17 files, 381.7KB
🍺  /usr/local/Cellar/zstd/1.5.1: 31 files, 2.7MB
🍺  /usr/local/Cellar/php/8.1.2: 507 files, 79.8MB

The build fail is being caused by libsodium.a, and my Mac has these files:

/usr/local/Cellar/libsodium/1.0.18_1/lib >> ls -l
total 848K
drwxr-xr-x 6 fbaube staff 192 May 30 2019 ./
drwxr-xr-x 10 fbaube staff 320 Jan 21 13:32 ../
-r--r--r-- 1 fbaube staff 345K Jan 21 13:32 libsodium.23.dylib
-r--r--r-- 1 fbaube staff 500K May 30 2019 libsodium.a
lrwxr-xr-x 1 fbaube staff 18 May 30 2019 libsodium.dylib -> libsodium.23.dylib
drwxr-xr-x 3 fbaube staff 96 Jan 21 13:32 pkgconfig/
/usr/local/Cellar/libsodium/1.0.18_1/lib >> file libsodium.a
libsodium.a: current ar archive random library

So, still no idea why I get the errors

  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [aead_aes256gcm] Error 1
  make[3]: *** Waiting for unfinished jobs....
  clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  ld: warning: ignoring file ../../src/libsodium/.libs/libsodium.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64