elm-make: elm-package.json: openBinaryFile: does not exist - elm

I do a fresh installation: npm i elm#0.18 -g
I try to build using: elm-make ./src/scripts/MainModule.elm
I get:
elm-make: elm-package.json: openBinaryFile: does not exist (No such file or directory)
But the elm-package.json file is right there in the directory where elm-make is called from.
Thoughts?
Note: I'm using nvm, in case it matters.

I am able to reproduce the error by deleting elm-package.json, but leaving the elm-stuff/ directory. You should be able to fix this by deleting your elm-stuff/ directory and letting elm-make rebuild the project for you.
For reference, issue here: https://github.com/elm-lang/elm-make/issues/171

#HParker is right, the only way to reproduce it is following these steps:
Run elm-make and let it install all the dependencies
Remove elm-package.json file
Run elm-make again
If it's not your case you can debug what's going using strace, e. g.
strace -yfv elm-make 2>&1 | grep elm-package.json
Example output:
[pid 32319] openat(AT_FDCWD, "elm-package.json", O_RDONLY|O_NOCTTY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
[pid 32319] write(2<pipe:[427229]>, "elm-package.json: openBinaryFile"..., 76elm-package.json: openBinaryFile: does not exist (No such file or directory)) = 76
If it tries to open elm-package.json in current working directory you will see AT_FDCWD variable, if not you should see the full path.

The problem was that package authors were updating packages to support elm .19 by changing elm-package.json to elm.json but not bumping up major versions of their packages.

Related

CMake's find_library cannot find library without version, extension and lib prefix

I am trying to link against a system library: /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4, when I have this CMakeLists.txt
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(all)
find_library(TCMALLOC_LIB NAMES tcmalloc)
if(TCMALLOC_LIB)
message("Found TCMALLOC_LIB: ${TCMALLOC_LIB}")
else()
message(FATAL_ERROR "TCMALLOC_LIB library not found")
endif()
(also tried find_library(TCMALLOC_LIB tcmalloc))
I get
CMake Error at CMakeLists.txt:13 (message):
TCMALLOC_LIB library not found
While, if I have
find_library(TCMALLOC_LIB NAMES libtcmalloc.so.4)
everything is fine: Found TCMALLOC_LIB: /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4
Am I doing something wrong? Why do I need to specify filename precisely? How can I debug find_library?
Update - Real cause
As #Tsyvarev mentioned in the comment, it turns out that cmake could not find the library because I installed it only "partially", the -dev version (libgoogle-perftools-dev) should have been installed.
TL;DR
Well, it turns out that tcmalloc is not a regular/conventional library, namely, it does not have libtcmalloc.so symlink pointing to .so.4, that is why cmake cannot find it.
How can I debug find_library?
I found a way of debugging find_library via strace:
$ rm -rf ./* && strace cmake ../scripts/ 2>&1 | grep tcmalloc
access("/usr/local/nvidia/bin/libtcmalloc.so", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/cuda/bin/libtcmalloc.so", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/sbin/libtcmalloc.so", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/bin/libtcmalloc.so", R_OK) = -1 ENOENT (No such file or directory)
...
<many lines skipped>
...
From this strace output we see that cmake, indeed tries to prepend lib and append .so, but it does not try to prepend any version.
Now, if we look at another "normal" library:
# locate protobuf | grep "\.so"
/usr/lib/x86_64-linux-gnu/libprotobuf.so
/usr/lib/x86_64-linux-gnu/libprotobuf.so.17
/usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0
we will see that it DOES install .so symlink, while tcmalloc does not:
# locate tcmalloc | grep "\.so"
/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4
/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4.3.0

FASTCGI Install on Raspberry PI Error - Cannot Manually Build Package

I have searched the internet all weekend and cannot find anyone who has had a similar error. I am trying to install libapache-mod-factcgi but the package errors out and I cannot figure out why.
pi#applejacks:/tmp $ sudo apt-get source -b libapache2-mod-fastcgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
Skipping already downloaded file 'libapache-mod-fastcgi_2.4.7~0910052141-1.1+deb8u1.dsc'
Skipping already downloaded file 'libapache-mod-fastcgi_2.4.7~0910052141.orig.tar.gz'
Skipping already downloaded file 'libapache-mod-fastcgi_2.4.7~0910052141-1.1+deb8u1.diff.gz'
Need to get 0 B of source archives.
Skipping unpack of already unpacked source in libapache-mod-fastcgi-2.4.7~0910052141
dpkg-buildpackage: source package libapache-mod-fastcgi
dpkg-buildpackage: source version 2.4.7~0910052141-1.1+deb8u1
dpkg-buildpackage: source distribution jessie
dpkg-buildpackage: source changed by Andreas Beckmann <anbe#debian.org>
dpkg-buildpackage: host architecture armhf
dpkg-source --before-build libapache-mod-fastcgi-2.4.7~0910052141
debian/rules clean
dh_listpackages: Please specify the compatibility level in debian/compat
dh_listpackages: Compatibility levels before 5 are no longer supported (level 1 requested)
/usr/share/cdbs/1/rules/dpatch.mk:33: CDBS WARNING: dpatch.mk is deprecated since 0.4.85 - please use source format 3.0 (quilt) instead
test -x debian/rules
rmdir /tmp/libapache-mod-fastcgi-2.4.7~0910052141/build-tmp
rmdir: failed to remove ‘/tmp/libapache-mod-fastcgi-2.4.7~0910052141/build-tmp’: No such file or directory
/usr/share/cdbs/1/rules/buildcore.mk:46: recipe for target 'cleanbuilddir' failed
make: [cleanbuilddir] Error 1 (ignored)
dh_clean
dh_clean: Please specify the compatibility level in debian/compat
/usr/share/cdbs/1/rules/debhelper.mk:189: recipe for target 'clean' failed
make: *** [clean] Error 2
dpkg-buildpackage: error: debian/rules clean gave error exit status 2
Build command 'cd libapache-mod-fastcgi-2.4.7~0910052141 && dpkg-buildpackage -b -uc' failed.
E: Child process failed
I'm trying to build Apache2 on RPi also. These commands got the .deb building for me:
cd libapache-mod-fastcgi-2.4.7~0910052141;
echo 10 > debian/compat;
dpkg-buildpackage -b -uc
Then cd .. to go one level up, then install the package with dpkg -i ./libapache2-mod-fastcgi_2.4.7~0910052141-1.1+deb8u1_armhf.deb

Ninja not found by CMake

I'm trying to build some code I got from GitHub using CMake, but keep getting the followings errors:
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/golang/project/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/2.8.11/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/golang/project/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/2.8.11/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!
How do I set these variables correctly?
I used a ./build_libs.sh file that came with the GitHub code to build this.
The script you are executing uses the CMake Ninja generator. For that to work you need Ninja on the path. On most Linux distributions you can install it from a package.
Ubuntu: ninja-build
openSUSE: ninja
If you can't find it for your distribution, you have to download it and add its location to the path environment variable.
My solution: symlink "ninja-build" to "ninja".
# ln -s /usr/bin/ninja /usr/bin/ninja-build
This only works on very old versions of CMake, which I will explain below.
I had already dropped my fresh "ninja" binary into /usr/bin and checked it had 0755 permissions. I was stumped until I ran an strace on the generator command.
# strace cmake -GNinja .. | grep -i ninja
access("ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/sbin/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/bin/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/sbin/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/bin/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/sbin/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/bin/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/opt/texlive/2016/bin/i386-linux/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
access("/root/bin/ninja-build", R_OK) = -1 ENOENT (No such file or directory)
It was looking for "ninja-build", not "ninja"!
I use CMake with Ninja extensively at work and at home, on Windows and Linux. So why haven't I seen this bug before?
Well... in this instance I'm using a very old version of CMake, version 2.8.12. It's so old it's almost fossilised. So presumably it's either a CMake bug which was fixed later, or the Ninja project changed the name of the binary at some point.
In Debian/Ubuntu systems, go ahead and install it
apt install ninja-build
Then rerun CMake.
If ninja really exists in $PATH and it still does not work, you should check the permission of the executable file via ls -l /PATH/TO/NINJA. Make sure others have read and execute permissions (like '-rwxr-xr-x').
See also: 0013910: Ninja generator initialization fails if /usr/bin/ninja is not world-readable
You may still suffer
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
even you already have::
put ninja in your PATH
ninja executable with proper privilege
newer version of cmake**
Then it might because -D CMAKE_MAKE_PROGRAM and -G Ninja are specified at the same time but CMAKE_MAKE_PROGRAM with invalid value (such as empty).
For example
Android Studio with gradle plugin version :
classpath 'com.android.tools.build:gradle:7.0.0-alpha03'
and not using SDK Manager provided cmake, by:
put cmake executable in PATH environment variable
put ninja executable in PATH environment variable
specify cmake version equal to the one in PATH, in modules's build.gradle, like:
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.19.1" // this line
}
}
Then actually gradle calling cmake like this:
cmake ^
-HD:\dev\android_cv_examples\HelloNDK7\app\src\main\cpp ^
-DCMAKE_SYSTEM_NAME=Android ^
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ^
-DCMAKE_SYSTEM_VERSION=26 ^
-DANDROID_ABI=arm64-v8a ^
-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a ^
-DANDROID_NDK=D:\soft\Android\ndk-r21b ^
-DCMAKE_ANDROID_NDK=D:\soft\Android\ndk-r21b ^
-DCMAKE_TOOLCHAIN_FILE=D:\soft\Android\ndk-r21b\build\cmake\android.toolchain.cmake ^
-DCMAKE_MAKE_PROGRAM= ^
-DCMAKE_C_FLAGS= ^
-DCMAKE_CXX_FLAGS=-std=c++11 ^
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\dev\android_cv_examples\HelloNDK7\app\build\intermediates\cmake\debug\obj\arm64-v8a ^
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\dev\android_cv_examples\HelloNDK7\app\build\intermediates\cmake\debug\obj\arm64-v8a ^
-DCMAKE_BUILD_TYPE=Debug ^
-BD:\dev\android_cv_examples\HelloNDK7\app\.cxx\cmake\debug\arm64-v8a ^
-GNinja ^
-DANDROID_PLATFORM=android-24
Note: If removing previous cmake build cache, and modify that calling script by deleting -DCMAKE_MAKE_PROGRAM then problem will be solved.
I am using Mac Monterey. I put ninja into /Applications and /Users/USER/Applications and made sure $PATH was pointing to these directories, but no luck.
I only made CMake discover Ninja by installing it via homebrew:
brew install ninja
My issue was fixed by upgrading CMake to the latest version as specified in this answer:
https://askubuntu.com/a/865294/924090
This was apparently an issue in CMake that is now fixed in the latest version. More information here:
https://gitlab.kitware.com/cmake/cmake/-/issues/21486
At U20 was resolved for me only when using "pip install ninja" rather than "sudo apt install ninja-build"

How to set up Kurento Media Server helpers?

I want to build Kurento Media Server against latest Fedora.
However, CMake fails to configure sources:
Could not find a package configuration file provided by "KurentoHelpers"
with any of the following names:
KurentoHelpersConfig.cmake
kurentohelpers-config.cmake
I installed kms-cmake-utils, as suggested, to /usr/local/. However, I still have this error, even if I set CMAKE_PREFIX_PATH to the folder where kms-cmake-utils's install target put .cmake modules.
In fact, there is no KurentoHelpersConfig.cmake file in kms-cmake-utils.
How can I configure Kurento for Fedora?
Try installing to /usr instead of /usr/local because cmake is looking for modules in /usr/share
Executing cmake like this should fix the problem:
cmake .. -DCMAKE_PREFIX_PATH=/usr
You should append path of KurentoHelpersConfig.cmake to CMAKE_MODULE_PATH, do that by adding this line to CMakeLists.txt :
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/share/cmake-3.5/Modules")
It seems something wrong in cmake, it cannot read external CMAKE_MODULE_PATH, so I force set into its arguments line ( Ubuntu server x86_64 used), pay attention -DCMAKE_MODULE_PATH=$CMAKE_MODULE_PATH.
HOME=`pwd`
BUILD=$HOME/build
export CMAKE_MODULE_PATH=$BUILD/usr/local/share/cmake-3.5/Modules
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=$HOMEDIR/build -DCMAKE_MODULE_PATH=$CMAKE_MODULE_PATH ..
make DESTDIR=$HOMEDIR/build install

Debian package bug on squeeze?

My hand-made debian package wont install if i build it on Squeeze (well, a squeezechroot)?
If i built it on a wheezy box though it builds installable packages.
Note that it builds fine in either case. Im generating the debian packages using CMake/CPack.
The error message i get is:
user#buildbox:/builddir/packagename# dpkg -i packagename_1.0.3.deb
(Reading database ... 35116 files and directories currently installed.)
Unpacking packagename (from packagename_1.0.3.deb) ...
dpkg: error processing packagename_1.0.3.deb (--install):
unable to create `/usr/share/packagename/builddir/mixer_devices.txt.dpkg-new' (while processing `./usr/share/packagename/builddir/mixer_devices.txt'): No such file or directory
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
packagename_1.0.3.deb
Might it be that mixer_devices is not contained within the created deb file for some reason?
Just do an ar x packagename_1.0.3.deb and see what the tar file contains.