How to build Redis 6 with TLS on Mac - macos

I want to use TLS with Redis on Mac (macOS 10.15.4, kernel: Darwin 19.4.0). This is what I tried according to Documentation:
export BUILD_TLS=yes
mkdir redis && cd redis
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make BUILD_TLS=yes
make test
sudo make install
All tests passed but when I run:
% redis-server --tls-cluster yes
I get error:
*** FATAL CONFIG FILE ERROR (Redis 6.0.4) *** Reading the configuration file, at line 2
>>> 'tls-cluster "yes"'
Bad directive or wrong number of arguments

Give a try to brew install redis (currently in version 6.0.5) it includes already support for TLS, in any case, if you would like to compile it from the source you could check the brew formula: https://github.com/Homebrew/homebrew-core/blob/master/Formula/redis.rb#L18
def install
system "make", "install", "PREFIX=#{prefix}", "CC=#{ENV.cc}", "BUILD_TLS=yes"
%w[run db/redis log].each { |p| (var/p).mkpath }
# Fix up default conf file to match our paths
inreplace "redis.conf" do |s|
s.gsub! "/var/run/redis.pid", var/"run/redis.pid"
s.gsub! "dir ./", "dir #{var}/db/redis/"
s.sub! /^bind .*$/, "bind 127.0.0.1 ::1"
end
etc.install "redis.conf"
etc.install "sentinel.conf" => "redis-sentinel.conf"
end

You did not specify the value for the tls-cluster configuration option. This works (on my MacBook Catelina 10.15.5):
% redis-server --tls-cluster yes

Related

How to install unison from source on macOS

I was wondering whether somebody managed to install unison's latest version from source, on its macOS machine (Here I am trying with Catalina). I followed the steps here :
I verified that I had XCode installed (otherwise forget about compiling anything :)
I cloned the official Git repository by running
git clone https://github.com/bcpierce00/unison.git
I moved to the newly created directory unison
cd unison
As mentionned in the documentation I then ran the make command telling it to build the text UI:
make UISTYLE=text
Result should have been an executable file called unisonbut instead of this I got the following error :
Blablabla$ make UISTYLE=text
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src UISTYLE=text
UISTYLE = text
Building for Unix
NATIVE = true
THREADS = false
STATIC = false
OSTYPE =
OSARCH = osx
ocamlopt: ubase/rx.mli ---> ubase/rx.cmi
ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -ccopt -mmacosx-version-min=10.6 -c /Users/Shared/unison/src/ubase/rx.mli
make[1]: ocamlopt: No such file or directory
make[1]: *** [ubase/rx.cmi] Error 1
make: *** [text] Error 2
I then wondered whether XCode might not carry with him an OCaml compiler. So I installed the official one using MacPort therefore running:
sudo port install ocaml
sudo port install opam
I then rerun the same make command
make UISTYLE=text
This time the result looked better and ended with:
/Applications/Xcode.app/Contents/Developer/usr/bin/make tags
if [ -f "`which etags`" ]; then \
etags *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
*Makefile* \
; fi
However, still no unison file visible anywhere.
Question is ... since there is no error message, where is this executable?
Re-hello people from the Internet,
I managed to help myself here and got a nice and fresh unison executable on my macOS Catalina computer.
Basically, the base make tries to move the compilation product into /Users/<your_user>/bin/. which makes sense I guess, but is rarely used by us macOS users. So here is what I did to fix the issue :
Create the bin directory into your home
mkdir ~/bin
Re run the make by doing
make UISTYLE=text
Verify you have the executable by asking its version:
~/bin/unison -version
Happy me, I got the expected message back from my terminal:
unison version 2.51.3 (ocaml 4.08.1)
Hope it can help somebody.

The compilation of ocamlfind failed at "install -m 0755 ocaml-stub

I'm new to OCaml and I'm trying to install cohttp. After a failure because I hadn't accepted the Xcode license agreement (OS X Sierra 10.12.6) I get an error while the package manager (opam) is trying to install a sub-dependency, ocamlfind.
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
[ERROR] The compilation of ocamlfind failed at "install -m 0755 ocaml-stub /Users/greg/.opam/system/bin/ocaml".
Processing 1/27: [ocamlfind: rm]
#=== ERROR while installing ocamlfind.1.7.3-1 =================================#
# opam-version 1.2.2
# os darwin
# command install -m 0755 ocaml-stub /Users/greg/.opam/system/bin/ocaml
# path /Users/greg/.opam/system/build/ocamlfind.1.7.3-1
# compiler system (4.05.0)
# exit-code 127
# env-file /Users/greg/.opam/system/build/ocamlfind.1.7.3-1/ocamlfind-93888-487c34.env
# stdout-file /Users/greg/.opam/system/build/ocamlfind.1.7.3-1/ocamlfind-93888-487c34.out
# stderr-file /Users/greg/.opam/system/build/ocamlfind.1.7.3-1/ocamlfind-93888-487c34.err
The log files are empty. The env file has this (lightly edited):
PATH=/Users/greg/.opam/system/bin:/usr/local/google-cloud-sdk/bin:/Users/greg/.nvm/versions/node/v6.5.0/bin::/opt/chefdk/bin:/usr/local/mysql/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/greg/.chefdk/gem/ruby/2.1.0/bin
OCAML_TOPLEVEL_PATH=/Users/greg/.opam/system/lib/toplevel
PERL5LIB=/Users/greg/.opam/system/lib/perl5:
MANPATH=/Users/greg/.opam/system/man:/Users/greg/.nvm/versions/node/v6.5.0/share/man:/usr/local/mysql/man:/usr/local/share/man:/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man
OPAMSWITCH=system
OPAMUTF8MSGS=1
CAML_LD_LIBRARY_PATH=/Users/greg/.opam/system/lib/stublibs:/usr/local/lib/ocaml/stublibs
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/fq/9ggcftcj1lsb150mldyjn5sh0000gn/T/
NVM_PATH=/Users/greg/.nvm/versions/node/v6.5.0/lib/node
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.jNLKBcDJTX/Render
TERM_PROGRAM_VERSION=388.1.1
TERM_SESSION_ID=E845D49D-9C60-4CEA-8777-19F521ED83A1
NVM_DIR=/Users/greg/.nvm
USER=greg
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.0CA6ZcRBJQ/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x52
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
PWD=/Users/greg/dev/ocaml
EDITOR=emacs
LANG=en_CA.UTF-8
NODE_PATH=./src
XPC_FLAGS=0x0
NODE_ENV=development
XPC_SERVICE_NAME=0
HOME=/Users/greg
SHLVL=1
LOGNAME=greg
NVM_BIN=/Users/greg/.nvm/versions/node/v6.5.0/bin
NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
PROMPT_COMMAND=set_tab_title
_=/usr/local/bin/opam
OPAM_PACKAGE_VERSION=1.7.3-1
OPAM_PACKAGE_NAME=ocamlfind
MAKELEVEL=
MAKEFLAGS=
I don't have a lot to go on to debug this. Any suggestions on where to go from here?
This github issue for opam led me to a solution that worked for me: https://github.com/ocaml/opam-repository/issues/10064
The solution to the github issue was that the user had the local directory, ., in their $PATH which led to the wrong install command being run. This wasn't my problem, but I had an extra : in my path.
/Users/greg/.nvm/versions/node/v6.5.0/bin::/opt/chefdk/bin:/usr/local/mysql/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
According to the comment below having two colons in a row in the path string will add the empty string as part of the path which is interpreted as the current directory.
Removing the extra colon allows the install of ocamlfind to succeed.

Can not configure Mapnik due to icuuc

Trying to compile Mapnik on OSX 10.8
So after I clone the Github repo, I go to run the configure command like so:
./configure and then get the error:
Checking for C++ library icuuc... no
Could not find required header or shared library for icuuc
and later:
Exiting... the following required dependencies were not found:
- icuuc (ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/)
Looking at the Mapnik troubleshooting area for a solution: https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting
Says: Solution: If g++ is available then ICU must be in a custom location so set the paths to the libs and includes - ie. ICU_LIBS=/usr/local/lib and ICU_INCLUDES=/usr/local/include.
By running g++ from command line I get: i686-apple-darwin11-llvm-g++-4.2: no input files
So this means that g++ is available, but I have no idea how to go about setting the paths so that configure can find them.
ICU Libraries were installed by default or with homebrew, not sure which.
terminal: brew install icu4c
Warning: icu4c-51.1 already installed
Finding the icu4c install directory:
terminal: mdfind icu4c
/usr/local/Cellar/icu4c
You can add the path of your ICU_LIB/INCLUDE to your configure command:
./configure ICU_INCLUDES=/usr/local/Cellar/icu4c/include ICU_LIBS=/usr/local/Cellar/icu4c/lib
And for more help about configure on what options are accepted do:
./configure --help
For the installation reference, you can check this:
https://github.com/mapnik/mapnik/blob/v2.2.0/INSTALL.md
As per our discussion and my last comment something like the following might work.
export ICU_LIBS=/usr/local/Cellar/icu4c/lib
export ICU_INCLUDES=/usr/local/Cellar/icu4c/include
./configure
If you find same errors:
Checking for C++ library XXX... no
Follow the command
sudo apt-get install g++ libXXX-dev
Using tips (TAB button), you can see what XXX libraries you have available
sudo apt-get install libXXX(press double TAB)

PLR Installation on Mac Lion

I am trying to install PL/R 8.3.0.13.1 on my MacBook Pro running OS X 10.7.5, Postgres 9.2 and R 2.15.2. I have found on the web a nice step-by-step guide for Windows but I can't find anything similar for Mac.
I got stuck when I run this command [as official documentation] ( http://www.joeconway.com/plr/doc/plr-install.html ):
USE_PGXS=1 make
Output:
make: pkg-config: Command not found
make: pkg-config: Command not found
make: pkg-config: Command not found
make: pkg-config: Command not found
make: pkg-config: Command not found
*** Cannot build PL/R because R_HOME cannot be found.
*** Refer to the documentation for details.
Clearly that means I need to create somehow R_HOME, variable and/or location...
Any idea how to do it?
The error message is actually a bit confusing. If you look at the Makefile of PL/R, the logic is that it uses R_HOME to find R when set, otherwise it tries pkg-config. You have neither set, so it bails out.
I recommend going the pkg-config route if possible. The R_HOME route appears to assume an R installation scheme that might not be universally applicable. Perhaps it applies to builds straight from source.
The above applies to all platforms. Now on OS X, it depends on how you installed R. For example, if you used MacPorts, it would go something like this:
sudo port install pkgconfig
sudo port install R
and then build PL/R itself:
make USE_PGXS=1
But that will break because PL/R does not expect that MacPorts separates the R headers into two separate directories (architecture-dependent and -independent I suppose).
Homebrew might work better, but the principle is the same.
You need to figure out what you should set your PLR environment R_HOME variable. In a terminal session I get this
computername:~ username$ R RHOME #only enter stuff after"$"
/Library/Frameworks/R.framework/Resources
This is at the bottom of that page you linked to:
"Tip: R_HOME must be defined in the environment of the user under which PostgreSQL is started, before the postmaster is started. Otherwise PL/R will refuse to load. See plr_environ(), which allows examination of the environment available to the PostgreSQL postmaster process. "
This is from a webpage describing the problem and offering a fix:
To fix: Add a "R_HOME = '/usr/lib/R' " to /etc/postgresql/version/cluster/environmen
Example Fix for version 8.1:
$ sudo -s
# echo -e "\nR_HOME = '/usr/lib/R'" >> /etc/postgresql/8.1/main/environment
# exit
To Test:
$ sudo /etc/init.d/postgresql-8.1 restart
$ sudo -u postgres psql plr_test
plr_test=# select test();
test
------

Try to port intall gcc47, Error: Dependency 'ld64' not found

Try to install gcc47 on osx 10.6.8 but got the following error:
sudo port install gcc47
---> Computing dependencies for gcc47
Error: Dependency 'ld64' not found.
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
Did I miss anything?
I think it's still there at /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/ld64 However, the Portfile seems so buggy that port index can't parse it. I installed llvm-3.0 first and then edited the Portfile, commenting out the following lines
#if {![variant_isset llvm29] && ![variant_isset llvm30] && ![variant_isset llvm31]} {
# default_variants +llvm30
#}
#set llvm_version {}
#variant llvm29 conflicts llvm30 llvm31 description {Use llvm-2.9 for libLTO} {
# set llvm_version 2.9
# depends_lib-append port:llvm-${llvm_version}
#}
#variant llvm30 conflicts llvm29 llvm31 description {Use llvm-3.0 for libLTO} {
set llvm_version 3.0
# depends_lib-append port:llvm-${llvm_version}
#}
#variant llvm31 conflicts llvm29 llvm30 description {Use llvm-3.1 for libLTO} {
# set llvm_version 3.1
# depends_lib-append port:llvm-${llvm_version}
#}
After this, running "sudo portindex" cleared the issue. Finally I was able to install ld64 and gcc47.
The following commands solved my problem. Since the error was only for ld64 and cctools ports in my case.
sudo port clean ld64 cctools
sudo port install gcc47
The ld64 package has been pulled from macports as of today:
http://www.macports.org/ports.php?by=name&substr=ld64
It was still available yesterday though.
However, the package did not build correctly when I tried it yesterday because of build errors with llvm-3.0.
The ld64 package is back on the index but it fails to build :-(
First there is a xcodebuild issue with the license agreement. I fixed it with the tip from 1. But now there's a build failure because of an undeclared identifier.
Run the following command; seems working for now.
sudo port selfupdate
sudo port install gcc47
I do not know how you get this problem. I am also encountering this problem after I upgrade my system to Mavericks. After check the main.log file, I found that the error is because the build cannot find . Then, I install the newest version Xcode Command Line Tools , it works! Hope my experience is helpful to you.

Resources