Cannot specify name and version when generating a lock file - conan

I am using a simple conan file example from a repository of examples. I would like to generate a lockfile, but when I try the command, I get this error:
.../folly/basic $ conan lock create
ERROR: Specify the 'name' and the 'version'
When I try to do so, following the documentation, I still get the same error:
.../folly/basic $ conan lock create --name=libb --version=0.2
ERROR: Specify the 'name' and the 'version'
.../folly/basic $ conan lock create --name libb --version 0.2
ERROR: Specify the 'name' and the 'version'
Does anybody have any advice? I am sure it's something obvious, but I am new to conan.

The Conan lock create requires a conanfile.py file which is not present in your example. That example uses a simple conanfile.txt to install the project dependencies (Folly and OpenSSL).
You still can generate the lock file by installing those requirements:
$ mkdir build && cd build/
$ conan install ..
...
$ ls
conan.lock conanbuildinfo.cmake conanbuildinfo.txt conaninfo.txt graph_info.json
Also, note that you are not passing the conanfile path, as required by the command:
.../folly/basic $ conan lock create
ERROR: Specify the 'name' and the 'version'
Instead, you should pass the path where the conanfile.py is installed:
$ conan lock create conanfile.py
However, if you want to generate a lock file only for a single reference (e.g. Folly), you can directly do it by the follow command:
$ conan lock create --reference folly/2020.08.10.00# -r conancenter

Related

cmake3 keeps using old CXXFLAGS value

I'm trying to build the azure storage sdk and have hit a build failure. Looking at the build commands, I see that it is trying to use an old CXXFLAGS value (not sure if this is the reason for the failure but would like to clean this up).
My steps were essentially:
export CXXFLAGS="-fPIC"
run cmake3 and make on cpprestsdk
unset CXXFLAGS
run cmake3 on azure-storage-cpp
Then when I look at my compile_commands.json file, I still see the -fPIC option being used. I tried deleting the directory and cloning again but it is still there.
CXXFLAGS is not set anymore, even tried using a new shell but still no luck:
$ echo $CXXFLAGS
Any ideas what is going on?
Edit:
I'm using the following command:
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
and am following CentOS instructions from https://github.com/Azure/azure-storage-cpp

How to dynamically pass parameter to the RPM during installation

We are in need to dynamically pass a variable during RPM installation and capture it in the spec file to trigger a script in %post
Following is the command
RPM Install Command
sudo rpm -Uvh --force abc.noarch.rpm --define '_ip 10.1.2.4' --define 'version 3'
**abc.spec**
Name: abc
Version: 1
Release: 1.0
Summary: Test
%{!?_ip: %define _ip 0.0.0.0 }
%{!?_version: %define _version 0 }
%post
echo "ip:::: %{_ip}"
echo "VESION:::: %{_version}"
So when I run the RPM with the above command , I get the following output.
[root#test solution]$ sudo rpm -Uvh --force abc.noarch.rpm --define '_ip 10.1.2.4' --define 'version 3'
Preparing... ################################# [100%]
Updating / installing...
1:abc ################################# [ 50%]
ip:::: 0.0.0.0
VESION:::: 0
Though i pass a different value in the CLI command , I still see that the argument which I pass is not been captured in the spec file.
Need inputs on how to capture the values which im passing the CLI .
The option --define defines macro. Macros are evaluated when building an RPM from SRC.RPM using rpmbuild. The binary (does not matter if arch or noarch) package has every macro already expanded. Even the %bindir etc.
The RPM ecosystem was designed as non-interactive. This is a big difference from the DEB ecosystem when questions can be raised using debconf.
You cannot workaround it. You cannot ask even by directly reading STDIN as rpm close this descriptor before executing scriptlets.
The best practice is to use configuration files. E.g. /etc/abc/ip.conf. And:
either instruct user to manualy (or using Ansible) alter that file and store their correct data
or do NOT distribute /etc/abc/ip.conf in main abc package and instead require abc-config. And then create one or more config packages which will be like:
Package: abc-testing-config
Provides: abc-config
...
%files
/etc/abc/ip.conf
And you then instruct users to install abc abc-test-config. Or it can be abc abc-EMEA-config etc....

Manjaro install ncurses5-compat-libs

I'm trying to install this package ncurses5-compat-libs but I can because of the following problem.
What I did:
1. yay ncurses5-compat-libs
There are 2 types of errors:
Either I will check 'Y' and I will add the key, so in this case, I will receive the error message as follow
gpg: keyserver receive failed: Permission denied
==> Error: Problem importing keys
Or I will check as 'n' to don't add the key and I will receive
==> Verifying source file signatures with gpg...
ncurses-6.1.tar.gz ... FAILED (unknown public key 702353E0F7E48EDB)
==> ERROR: One or more PGP signatures could not be verified!
Error downloading sources: ncurses5-compat-libs
2. sudo gpg --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
I've tried to add it manually but it didn't work.
3. sudo gpg --recv-keys 702353E0F7E48EDB
Also this one I've tried to add it manually but it didn't work
4. yay -S --noconfirm --needed ncurses5-compat-libs
5. Trying to fallow this forum
and least but not last
6. I've tried to clone the repository by hand by following
git clone http://aur.archlinux.org/ncurses5-compat-libs.git
cd ncurses5-compat-libs
sudo gpg --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
makepkg -sic
cd ..
sudo rm -r ncurses5-compat-libs
And guess what, I'm back from where I started...
==> Verifying source file signatures with gpg...
ncurses-6.1.tar.gz ... FAILED (unknown public key 702353E0F7E48EDB)
==> ERROR: One or more PGP signatures could not be verified!
Error downloading sources: ncurses5-compat-libs
Dose any of you guys have any idea how can I fix this problem? If so let me know because I'm getting crazy already not been able to fix this.
You shouldn't need specifically ncurses5-compat-libs if you have a higher version of ncurses. Because version 6 is backwards compatible with version 5. You need to check whether you have libtinfo.so.6 or not. If you have it then you just need to create a system link. Check if you have libtinfo.so.6, so Run:
ls /lib/ | grep libtinfo
if you can't see libtinfo.so.6, you need to install ncurses (the current latest version of it: 6.2) and then create a system link that I mentioned below. so run:
sudo pacman -S ncurses
sudo pacman -S lib32-ncurses
if you have libtinfo.so.6 then run:
sudo link /lib/libtinfo.so.6 /lib/libtinfo.so.5
I went a step further from creating the link in the other answer here:
sudo link /lib/libtinfo.so.6 /lib/libtinfo.so.5
And created a dummy package so I could build something that depended on that being a thing:
$ cat /opt/aur/ncurses5-compat-libs-dummy/PKGBUILD
pkgname='ncurses5-compat-libs'
pkgver=6.1
pkgrel=1
arch=(any)
provides=('libtinfo5')
$ cd /opt/aur/ncurses5-compat-libs/dummy
$ makepkg -si
worked like a charm

How do I install libpng on MSYS2?

I want to build a program with mingw w64 and I have msys2 installed.
I tried to work with pacman from the msys2 prompt.
$ pacman -Q libpng
error: package 'libpng' was not found
$ pacman -S libpng
error: target not found: libpng
$ pacman -S *libpng
error: target not found: *libpng
I attempted to use google and came up with:
$ pacman -S mingw-w64-libpng
error: target not found: mingw-w64-libpng
$ pacman -F mingw-w64-libpng
warning: database file for 'mingw32' does not exist (use '-Fy' to download)
warning: database file for 'mingw64' does not exist (use '-Fy' to download)
warning: database file for 'msys' does not exist (use '-Fy' to download)
error: no options specified (use -h for help)
Very peculiar that after all the downloading I did, which I distinctly recall including a database for pacman, that these database files don't seem to exist.
$ pacman -Fy mingw-w64-libpng
[... stuff downloads ... ]
error: no options specified (use -h for help)
$ pacman -U mingw-w64-libpng
loading packages...
error: 'mingw-w64-libpng': could not find or read package
So now the questions are,
1) How in the future will I find the magic prefix for a well-known library in order to be able to tell pacman what to install?
2) How at the moment do I instruct pacman to install the libpng package which seems to be in the mingw-w64-libpng package?
3) Is that the package with the development headers or is that yet another package, as I have adjusted to on Deb/Ubuntu by looking for something like libpng-dev?
Have you tried pacman -Ss libpng? This will list all packages mentioning libpng, prefix and all:
$ pacman -Ss libpng
mingw32/mingw-w64-i686-libpng 1.6.35-1
A collection of routines used to create PNG format graphics (mingw-w64)
mingw64/mingw-w64-x86_64-libpng 1.6.35-1 [installed]
A collection of routines used to create PNG format graphics (mingw-w64)
I notice that these names include an architecture (i686/x86_64), which is fairly common in MinGW package names.
EDIT: The headers end up here:
$ ls /mingw64/include/libpng16/
png.h pngconf.h pnglibconf.h

How to set the CMAKE_PREFIX_PATH?

I have a problem with the global environmental variable CMAKE_PREFIX_PATH. I already set this and I can see it is set when I type env, but when I run cmake . to build HipHop, it tells me that the variable isn't set.
Is there a way I can hard-code this into the makefiles?
Try to run cmake -DCMAKE_PREFIX_PATH=/your/path .
CMAKE_PREFIX_PATH works as a build directive, rather than as an environment variable. Moreover, you may perform the build into a dedicated temporary directory (it's cleaner, because when done, you can remove that temporary directory and you get back a clean pristine source tree).
$ mkdir -p tmpbuild && cd tmpbuild
$ cmake -DCMAKE_PREFIX_PATH=~/deliveries/hiphop ..
$ make install
$ cd ..
On MacOS it's different. I had to use:
make -i CMAKE_PREFIX_PATH="/the/path"
This was while installing VMQT, and this error was shown:
CMake Error at CMakeLists.txt:87 (find_package): By not providing
"FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake
to find a package configuration file provided by "OpenCV", but CMake
did not find one.
Could not find a package configuration file provided by "OpenCV"
with any of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If
"OpenCV" provides a separate development package or SDK, be sure it
has been installed.
Used this to solve it: make -i CMAKE_PREFIX_PATH="/opt/homebrew/Cellar/opencv/4.6.0_1/lib/cmake/opencv4/"