nuget fails on RHEL7.9 OpenShift container - nuget

I'm working on OpenShift container, need to push some .nupkg package based on.nuspec file. I can't even run help, nor nuget pack or push, when trying to execute nuget in cli is giving me error.
sh-4.2$ nuget
Access to the path '/.config/NuGet' is denied.
If I would like to pack it, error is the same :
sh-4.2$ nuget pack RDependencies.nuspec
Access to the path '/.config/NuGet' is denied.
It was installed while Building container, with
RUN yum install -y nuget; yum clean all
Container is based on: Red Hat Enterprise Linux Server release 7.9 (Maipo)
And nuget bin:
sh-4.2$ whereis nuget
nuget: /usr/bin/nuget
sh-4.2$ cat /usr/bin/nuget
#!/bin/sh
exec /usr/bin/mono /usr/lib/mono/nuget/NuGet.exe "$#"
sh-4.2$
Question:
Is it possible to force nuget to create/read from /tmp/ directory which I've got access to?

Seems that I have figure it. The main problem here is OpenShift temporary user which is created during deployment. It doesn't have home directory created, and HOME env variable is set in root dir : HOME=/
After changing it to, e.g. /tmp/
export HOME=/tmp/home_dir/
It starts to work
sh-4.2$ nuget
NuGet Version: 2.8.7.0
usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command.
sh-4.2$ nuget pack
Please specify a nuspec or project file to use.
sh-4.2$

Related

cannot access '/opt/unityhub/chrome-sandbox': No such file or directory Error when install UnityHub

I would like to make automated build of my Unity project with Jenkins, and Jenkins is installed on my Linux server. So I am trying to install UnityHub on Rocky Linux 8(only CUI).
I followed Unity docs to install UnityHub on Linux, but some error occurred.
$ sudo yum install unityhub
...
Running scriptlet: unityhub-3.2.0-1.x86_64 5/5
chmod: cannot access '/opt/unityhub/chrome-sandbox': No such file or directory
...
$ unityhub
The futex facility returned an unexpected error code.
Aborted (core dumped)
$ ls /opt/unityhub/chrome-sandbox
ls: cannot access '/opt/unityhub/chrome-samdbox': No such file or directory
How can I solve this? Or is there any other way to build Unity project on Linux CUI?
After installing run:
sudo dnf install openssl1.1 openssl-libs
Hope this helps

Bazel 0.29.1 LLVM-7.0 on Centos 7

So I have a docker with CentOS 7 which has installed bazel.
I've installed devtoolset-8, llvm-toolset-7.0 and centos-release-scl.
I've also installed bazel 0.29.1 and made.
export CC=clang
export CXX=clang++
I have an shell script which run basel. Befor bazel build command in top of the script I have
source /opt/rh/llvm-toolset-7.0/enable
which enables LLVM-7.0/Clang-7.0. But build failes with:
/opt/rh/llvm-toolset-7.0/root/usr/bin/clang: error while loading
shared libraries: libLLVM-7.so: cannot open shared object file: No
such file or directory
But this lib exists! It's in /opt/rh/llvm-toolset-7.0/root/usr/lib64/
May someone pls help with this ?
Add below to .bash_profile or .bashrc:
source /opt/rh/llvm-toolset-7.0/enable
export CC=/opt/rh/llvm-toolset-7.0/root/usr/bin/clang
export CXX=/opt/rh/llvm-toolset-7.0/root/usr/bin/clang++
Run below as Root
echo /opt/rh/llvm-toolset-7.0/root/usr/lib64/ > /etc/ld.so.conf.d/llvm-toolset.conf
ldconfig

Unable to install docker on Ubuntu server

I am unable to install docker on Ubuntu server.
The Error:
1.Failed to fetch https://download.docker.com/linux/ubuntu/dists/xenial/InRelease Unable to find expected entry 'stable/source/Sources' in Release file (Wrong sources.list entry or malformed file)
2.Failed to fetch http://ppa.launchpad.net/spring/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
3.Some index files failed to download. They have been ignored, or old ones used instead.
My sources.list file looks like :
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
Also I am trying to install docker in virtual environment within Ubuntu server and above sources.list file in sources.list file within root folder.
I am trying to install docker as perquisite for my hyper ledger network set up?
Looks like docker doesn't have Sources. But you are looking for binaries anyway. So remove the deb-src line.
The second errormust come from a different sources.list file, check /etc/apt/sources.list.d/, too.
But both of these aren't stopping you. The missing index files will simply be ignored. They aren't stopping you from installing docker so your problem must be something else not stated in the question.
Remove all docker entries from /etc/apt/sources.list and also delete all /etc/apt/sources.list.d/docker*
Then simply use this script as root:
curl https://get.docker.com | bash
Or as user:
curl https://get.docker.com | sudo bash
Then install it via edited script (deleted docker install)
curl https://gist.githubusercontent.com/Razikus/6b61af8c69e563d587201c34f5c66568/raw/5608cdb81e33650b70ac934e261bbd5410269f7a/prereqs-ubuntu.sh | bash
According to comment, differences between original and changed:
Check diff from CLI:
diff <(curl https://hyperledger.github.io/composer/unstable/prereqs-ubuntu.sh) <(curl https://gist.githubusercontent.com/Razikus/6b61af8c69e563d587201c34f5c66568/raw/5608cdb81e33650b70ac934e261bbd5410269f7a/prereqs-ubuntu.sh)
It will be faster than searching for error

Docker: kafka confluent go client error

I am trying to use apache kafka with go, things look good when i execute the project with go run but when i use docker build i get error....
# pkg-config --cflags rdkafka
Package rdkafka was not found in the pkg-config search path.
Perhaps you should add the directory containing `rdkafka.pc'
to the PKG_CONFIG_PATH environment variable
No package 'rdkafka' found
pkg-config: exit status 1
I installed librdkafka from https://github.com/confluentinc/confluent-kafka-go
git clone https://github.com/edenhill/librdkafka.git
cd librdkafka
./configure --prefix /usr
make
sudo make install
I tried
PKG_CONFIG_PATH=/usr/lib/pkgconfig
source ~/.bashrc
but not luck. Any help is appreciated.
Probably you should include librdkafka.dll, msvcr120.dll and zlib.dll in your project root. At least this is what i should do to get this work on Windows. Not sure about Linux.
This below line inside the Dockerfile worked for me as this sets the environmental variable and this will persist when a container is run from the resulting image.
ENV PKG_CONFIG_PATH ${PKG_CONFIG_PATH}:/usr/lib/pkgconfig/

CMake install directory permission

I have built a project using cmake (LLVM project) and tried to install it by issuing the following command:
$ cmake3 --build . --target install
If I run it using root then there is no problem and the files will be installed under the directory /usr/local/.
My problem is when I want to install the project using normal user.
I get the following error:
CMake Error at cmake_install.cmake:36 (file):
file INSTALL cannot set permissions on "/usr/local/include/llvm"
I have changed the permission of directory /usr/local/ to 777 recursively, and their ownership to root:wheel and I added my normal user to group wheel. But I still cannot install the files into the /usr/local/ directory.
The main issue is about building project in Eclipse which fails at "Build Install" command.
chmod 777 -R / is a very scary command. I've destroyed a system once by doing that.
The philosophy I use for this is:
If I need to deploy something through my IDE to debug or test before packaging, I deploy it locally within my home directory.
I only install stuff to my system (outside of home) if it has been packaged first (*.deb, *.rpm, *.tar.gz) so that I can remove it without problems.
For me, I do this with:
cmake $src
cmake --build . --target install -- DESTDIR=stage
This will configure my project, make it, then install it locally in a folder called ./stage which resides in my build directory. I can then run my executable from ./stage/usr/bin. Note that this only works if make is your generator.
Once I've tested it and I'm happy, I package it and deploy to my system or upload to a repository:
cpack
sudo dpkg -i <package>.deb
We should use USE_SOURCE_PERMISSIONS in our install function.
Example:
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" USE_SOURCE_PERMISSIONS)