How to print process's outputs while `make`? - makefile

How to print cargo build's process while make in brew install?
Makefile
CARGO=RUSTFLAGS='-F warnings' cargo
...
release:
$(CARGO) build --all --release
...
Formula
def install
# system command
system "make release"
# copy files
libexec.install Dir["*"]
# exec links
bin.install_symlink "#{libexec}/target/install/bin"
end
Outputs
...
==> make release
# *** need outputs here ***

Related

In Ocaml Camlp5 is not installing (and it is necessary to use Quotations)

In Ocaml 4, I have to use the Quotation module, on its Quotation.add and Quotation.ExStr functions. It seems I have to install the Camlp5 library (seems to be a preprocessor) to do so. Found lots of info about Camlp, like:
Camlp5: https://camlp5.readthedocs.io/en/latest/intro.html
Camlp5: https://camlp5.github.io/doc/html/index.html
Camlp4: https://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial004.html
But no installation guides, so I tried: opam install camlp5 with the result:
┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
│ λ build conf-perl-string-shellquote 1
└─
╶─ No changes have been performed
So some dependencies seem not to be there, and I have tried: opam depext --install camlp5 with the result:
┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
│ λ build conf-perl-string-shellquote 1
└─
╶─ No changes have been performed
# Run eval $(opam env) to update the current shell environment
So does not seem to work.
The error diagnosis is the same for both commands:
The following actions will be performed:
∗ install conf-perl-string-shellquote 1 [required by camlp5]
∗ install conf-perl-ipc-system-simple 1 [required by camlp5]
∗ install camlp5 8.00.01
===== ∗ 3 =====
Do you want to continue? [Y/n] y
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[camlp5.8.00.01] found in cache
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ERROR] The compilation of conf-perl-ipc-system-simple failed at
"/Users/.../.opam/opam-init/hooks/sandbox.sh build perl
-MIPC::System::Simple -e 1".
[ERROR] The compilation of conf-perl-string-shellquote failed at
"/Users/.../.opam/opam-init/hooks/sandbox.sh build perl
-MString::ShellQuote -e 1".
#=== ERROR while compiling conf-perl-string-shellquote.1 ======================#
# context 2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#ff95b837
# path ~/.opam/4.10.2/.opam-switch/build/conf-perl-string-shellquote.1
# command ~/.opam/opam-init/hooks/sandbox.sh build perl -MString::ShellQuote -e 1
# exit-code 2
# env-file ~/.opam/log/conf-perl-string-shellquote-1585-1872ec.env
# output-file ~/.opam/log/conf-perl-string-shellquote-1585-1872ec.out
### output ###
# Can't locate String/ShellQuote.pm in #INC (you may need to install the String::ShellQuote module) (#INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras[...]
# BEGIN failed--compilation aborted.
#=== ERROR while compiling conf-perl-ipc-system-simple.1 ======================#
# context 2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#ff95b837
# path ~/.opam/4.10.2/.opam-switch/build/conf-perl-ipc-system-simple.1
# command ~/.opam/opam-init/hooks/sandbox.sh build perl -MIPC::System::Simple -e 1
# exit-code 2
# env-file ~/.opam/log/conf-perl-ipc-system-simple-1585-d2c37b.env
# output-file ~/.opam/log/conf-perl-ipc-system-simple-1585-d2c37b.out
### output ###
# Can't locate IPC/System/Simple.pm in #INC (you may need to install the IPC::System::Simple module) (#INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extra[...]
# BEGIN failed--compilation aborted.
I have been trying similars and alternatives for some hours, and cannot achieve it. Any help?
PS1: I am working in MAC.
PS2: If someone wants, my context for this problem is that I want to use the functions of one directory -which is a black box for me-, and all the examples are written with the parser, like <<y+2=5>> so I do not know the grammar and have to achieve to make the parser run.
EDIT 1 (The solution proposed by Ivg)
After trying both commands of the proposed solution by Ivg (answering local::lib in one of the questions and yes on the others), the second of the errors seem to be corrected, when doing opam install camlp5:
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install conf-perl-string-shellquote 1
└─
Where the whole terminal has been:
... ~ % opam install camlp5
The following actions will be performed:
∗ install conf-perl-string-shellquote 1 [required by camlp5]
∗ install conf-perl-ipc-system-simple 1 [required by camlp5]
∗ install camlp5 8.00.01
===== ∗ 3 =====
Do you want to continue? [Y/n] y
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[camlp5.8.00.01] found in cache
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ERROR] The compilation of conf-perl-ipc-system-simple failed at
"/Users/.../.opam/opam-init/hooks/sandbox.sh build perl
-MIPC::System::Simple -e 1".
∗ installed conf-perl-string-shellquote.1
#=== ERROR while compiling conf-perl-ipc-system-simple.1 ======================#
# context 2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#ff95b837
# path ~/.opam/4.10.2/.opam-switch/build/conf-perl-ipc-system-simple.1
# command ~/.opam/opam-init/hooks/sandbox.sh build perl -MIPC::System::Simple -e 1
# exit-code 2
# env-file ~/.opam/log/conf-perl-ipc-system-simple-20351-1872ec.env
# output-file ~/.opam/log/conf-perl-ipc-system-simple-20351-1872ec.out
### output ###
# Can't locate IPC/System/Simple.pm in #INC (you may need to install the IPC::System::Simple module) (#INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4/darwin-thread-multi-2level /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2le[...]
# BEGIN failed--compilation aborted.
EDIT 2 (Solved, repeating)
Suddenly it worked. I wrote once again sudo cpan IPC::System::Simple (there was no questions now) and after that, opam install conf-perl-ipc-system-simple.
Anyway, the Quoation module is not opening for me.
The error messages are indicating that your perl installation is missing two modules, String::ShellQuote and IPC::System::Simple. Since opam don't know how to do this on macOS (there are too many options) it just indicates that those modules are missing and required for camlp5 installation so it can't proceed. It is now your move and you need to figure out how to make those two modules available for your perl installation.
You can try and use CPAN for that, e.g., (sudo might not be necessary, depending on your configuration)
sudo cpan IPC::System::Simple
sudo cpan String::ShellQuote

Having touble installing SWI-Prolog on Linux

I am following the installation instructions from SWI-Prolog's site. I am on a Linux machine.
First I git-clone the repo and cd into swipl-devel.
Next I run the commands:
git submodule update --init
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="${install_under}/swipl" -G Ninja ..
ninja
This all goes smoothly.
Next, when I run ctest -j 4 I get back:
98% tests passed, 1 tests failed out of 66
Total Test time (real) = 15.23 sec
The following tests FAILED:
24 - swipl:xsb/nonmt_tests (Failed)
Errors while running CTest
I then become root and run ninja install. Here is what I get back:
[12/13] Install the project...
-- Install configuration: "RelWithDebInfo"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/bin/x86_64-linux/swipl" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux/libswipl.so.8.3.6" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/bin/x86_64-linux/swipl-ld" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
CMake Error at src/cmake_install.cmake:509 (EXECUTE_PROCESS):
EXECUTE_PROCESS given unknown argument "command".
Call Stack (most recent call first):
cmake_install.cmake:70 (include)
FAILED: CMakeFiles/install.util
cd /home/nick/prolog/swipl-devel/build && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
I am not sure what I am missing.
There is something really going wrong.
I have never had the swipl:xsb/nonmt_tests tests failing (whatever they are).
Is the shell variable install_under properly set when you run the above?
For example, I always install under a directory like /usr/local/logic/swipl, so here you would have to say
-DCMAKE_INSTALL_PREFIX=/usr/local/logic/swipl
or
export install_under=/usr/local/logic/
in your case (not sure whether the export is needed, it sets an environment variable).

Error building latest linux kernel within VirtualBox under 18.04.1-Ubuntu

I am trying to build the latest Linux kernel (GitHub) using a Oracel VM and a 18.04.1-Ubuntu image.
I installed the need packages and probably even more. Here is a part of the packages I installed:
sudo apt-get update
sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc bison flex libelf-def kernel-package
The full list can be found here.
I ran the following commands in the linux folder after cloning the repository from GitHub.
$ cp /boot/config-$(uname -r) .config
$ make menuconfig
scripts/kconfig/mconf Kconfig
.config:1118:warning: symbol value 'm' invalid for NF_CT_PROTO_GRE
.config:1923:warning: symbol value 'm' invalid for NET_DEVLINK
.config:7865:warning: symbol value 'm' invalid for ASHMEM
.config:8724:warning: symbol value 'm' invalid for ANDROID_BINDER_IPC
.config:8725:warning: symbol value 'm' invalid for ANDROID_BINDERFS
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
I save and exited menuconfig. And finally make leads to the following error.
$ make -j2
Makefile:608: include/config/auto.conf: No such file or directory
Makefile:660: include/config/auto.conf.cmd: No such file or directory
HOSTCC scripts/kconfig/conf.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
*** Error during sync of the configuration.
scripts/kconfig/Makefile:73: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 1
Makefile:562: recipe for target 'syncconfig' failed
make[1]: *** [syncconfig] Error 2
Makefile:678: recipe for target 'include/config/auto.conf.cmd' failed
make: *** [include/config/auto.conf.cmd] Error 2
make: *** Deleting file 'include/config/auto.conf.cmd'
Looks like make is expecting some additional configuration files include/config/auto.conf. Does anyone have a clue for me.
Thanks!
Trying to compile kernel 5.6.3 as non-root, I ran into this exact problem.
Running the suggestion from Oandiy's comment
git clean -xdf
revealed that I had files in my source tree that were owned by root and could not be deleted. Looking in my history I found,
sudo make localmodconfig # DO NOT DO THIS
which had installed files, as root, in include/config/* and include/generated/autoconf.h.
To see if you have the same problem, run
sudo find . -uid 0
or just look at the error messages of git clean -xdf (there shouldn't be any).
After deleting all files and directories owned by root, I recovered from this deadlock with:
unset ARCH
cp .config ../config.backup # If you still have this.
git clean -xdf # No errors (this also deletes .config)
cp ../config.backup .config # Or generate a new one *).
make olddefconfig # Printed at the end: 'No change to .config'
Note that I needed to clear ARCH from my environment.
After this I went on as usual,
VERSION=5.6.3 # I have checked out tag v5.6.3 **)
FLAVOUR=lowlatlocxhci # Or whatever you want to call your kernel.
make -j8 deb-pkg LOCALVERSION=-$FLAVOUR
sudo dpkg -i ../linux-headers-$VERSION-${FLAVOUR}_$VERSION-$FLAVOUR-1_amd64.deb ../linux-image-$VERSION-${FLAVOUR}_$VERSION-${FLAVOUR}-1_amd64.deb
The last command fails to compile virtualbox kernel modules at the moment, but I don't care about those, and those errors can be ignored (as long as you don't use virtual box).
*) The .config used was prepared by booting to a kernel with everything (ie, a dist. kernel), copying its config from /boot to the source tree and running make localmodconfig after making sure all kernel modules that I needed where loaded (by running those applications that cause such modules to be loaded). And finally running make menuconfig to turn off CONFIG_DEBUG_INFO in this kernel and to turn a few things that are normally built into the kernel into modules as well (which I needed for some reason).
**) My git tree has been prepared with:
VERSION=5.6.3
FLAVOUR=lowlatlocxhci
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-$VERSION-$FLAVOUR-$VERSION-$FLAVOUR
cd linux-$VERSION-$FLAVOUR-$VERSION-$FLAVOUR
git checkout -b test_$FLAVOUR v$VERSION
# Make manual changes here, and commit as usual.

Install a particular Ruby version using chef-run

I have been trying to install a particular (latest) version of Ruby using Chef Workstation and its included chef-run CLI.
This is the recipe I'm using for Ruby:
package 'ruby' do
version '2.5.3'
action :install
end
Which, running with the command line
chef-run -i /path-to/private_key user#host ruby.rb
Produces the not very helpful message:
[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✖] Applying ruby from ruby.rb to target.
└── [✖] [127.0.0.1] Failed to converge ruby.
The converge of the remote host failed for the
following reason:
Expected process to exit with [0], but received '100'
I have tried to run it with the -V flag, or look for a log file, but I can't seem to find it. Any idea?
raise the log_level by setting it to debug in the chef-workstation configuration
$ cat ~/.chef-workstation/config.toml
[log]
level="debug"

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.

Resources