libsodium-bindings icon indicating copy to clipboard operation
libsodium-bindings copied to clipboard

Fails to build on mac using `libsodium-1.0.19` via homebrew

Open agevelt opened this issue 2 years ago • 1 comments

Currently libsodium-bindings won't build on mac when using homebrew because homebrew recently updated the libsodium recipe and now only carries libsodium-1.0.19.

This fails on any combination of the flags use-pkg-config and homebrew-libsodium.

Using use-pkg-config with or without homebrew-libsodium:

libsodium-bindings           > Error: Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7: The pkg-config package                                                
libsodium-bindings           > 'libsodium' version ==1.0.18 is required but the version installed on the                                             
libsodium-bindings           > system is version 1.0.19                                                                                              
libsodium-bindings           >       

Using no flags or homebrew-libsodium:

libsodium-bindings           > Error: Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7: Missing dependency on a                                    
libsodium-bindings           > foreign library:                                                                                           
libsodium-bindings           > * Missing (or bad) C library: sodium                                                                       
libsodium-bindings           > This problem can usually be solved by installing the system package that                                   
libsodium-bindings           > provides this library (you may need the "-dev" version). If the library is                                 
libsodium-bindings           > already installed but in a non-standard location then you can use the flags                                
libsodium-bindings           > --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the                                  
libsodium-bindings           > library file does exist, it may contain errors that are caught by the C                                    
libsodium-bindings           > compiler at the preprocessing stage. In this case you can re-run configure                                 
libsodium-bindings           > with the verbosity flag -v3 to see the error messages.                                                     
libsodium-bindings           >                                                            

I've tested relaxing the libsodium dependency in libsodium-bindings.cabal: pkgconfig-depends: libsodium ==1.0.18 || ==1.0.19

That seems to build, though I haven't checked if any breaking changes have been introduced as a result.

agevelt avatar Nov 17 '23 11:11 agevelt

Lovely, thank you for the update, I was wondering when that would happen. :) Reading the changelog there does not seem to be any breaking change, although we don't support the additions that have been introduced yet.

Kleidukos avatar Nov 17 '23 11:11 Kleidukos