Alpine Add Package from Edge repository - repository

If I'm using Alpine 3.8, how can I add a specific package from the Alpine Edge repository? Is this even supported? There is no equivalent of backports, from what I can see.
I want to add the new version of this: https://pkgs.alpinelinux.org/package/edge/community/armhf/librdkafka
And not the older version in the 3.8 repo:
https://pkgs.alpinelinux.org/package/v3.8/community/s390x/librdkafka

You could specify the exact repo to apk, using the --repository parameter.
In your case:
apk add librdkafka --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community

You can also add the repo:
echo "#testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
and reference it with apk via #testing. Example:
apk add package-name#testing

Edge repository may be enabled permanently. Just do the following:
sed -i '/edge/s/^#//' /etc/apk/repositories

Related

Using Github CI Pipeline with wxWidgets

I got a cross platform application using a wxWidgets gui and want to test the cross build with github ci pipeline.
The Linux test runs fine as i'm able to install the wxWidgets dependencies using apt-get.
But i got no idea how to setup the wxWidgets Windows dependencies. Google didn't help me either.
any suggestions what command i need to put into my yml-file?
thanks!
edit: what i've tried so far...
- name: install wxwidgets
shell: powershell
run: |
choco install wxwidgets
but this is the same like cloning the git version, only with an older version
and
run: |
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg integrate install
vcpkg install wxwidgets
the pipeline keeps hanging while installing vcpkg
You should be able to install wxWidgets using vcpkg, of course, but you can also just download the official binaries and use them instead, e.g. like this:
build-cpp-windows-2019:
name: C++/MSVS (windows-2019)
runs-on: windows-2019
env:
wxMSW_VER: 3.1.3
WXWIN: c:\wx
steps:
[...]
- name: Install wxWidgets
run: |
mkdir ${env:WXWIN} | Out-Null
cd ${env:WXWIN}
curl -OL https://github.com/wxWidgets/wxWidgets/releases/download/v${env:wxMSW_VER}/wxWidgets-${env:wxMSW_VER}-headers.7z
7z x wxWidgets-${env:wxMSW_VER}-headers.7z
curl -OL https://github.com/wxWidgets/wxWidgets/releases/download/v${env:wxMSW_VER}/wxMSW-${env:wxMSW_VER}_vc14x_x64_Dev.7z
7z x wxMSW-${env:wxMSW_VER}_vc14x_x64_Dev.7z

How I customize the sam build to pass a ssh and access my private repo on GitHub?

I created a stack of lambda functions and I use the ide pycharm to test them on my localhost. In the requirements.txt file I added a reference to a private repository on github.
The repository works and I was able to install it through the requirements.txt of other projects.
But when I start the local test, using aws sam cli, sam buil fails, because the container does not have the ssh key to access the repository.
Is there any way to customize the sam build process and give it my ssh key to the container access my private repo and install the package?
Or any another solution?
This solution is written for Python, but it's probably applicable one way or another to node.js, Java etc.
I'm using the following workaround. At first it seems to defeat the purpose of building in a container, but if your private repositories are not compiled natively you should be fine. Direct dependencies that are compiled natively will be properly installed in the context of the container.
grep -v "git+" requirements.txt > public_requirements.txt
sam build --template-file "$TEMPLATE_FILE" --build-dir build --use-container --manifest public_requirements.txt
echo "Adding private dependencies"
grep "git+" requirements.txt | xargs python -m pip install --no-deps -t build/LambdaFunction/
If your private dependencies depend on libraries that are compiled natively, you can either add them to the temporary public_requirements.txt, or install them in another container and then copy to build/LambdaFunction/.

Gradle and Mysql in gitlab CI

I have a test job which requires gradle to run the test as well as mysql. This example
shows how to use mysql. The problem is the image tag in the link overrides my global image tag of gradle because of which gradle is not found. Is there a way to use multiple images in one job or any other work-around.
This is a shortened version of .gitlab-ci.yml. This is the full one:
image: gradle:jdk11
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
# isolated from any previous builds.
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_ROOT_PASSWORD: mysql
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
## build configs....
test_MariaDBImpl:
needs:
- build_MariaDBImpl
stage: test
services:
- mysql
image: mysql
script:
- echo "create user if not exists 'test'#'localhost'; grant all privileges on *.* to 'test'#'localhost'; flush privileges;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql
- gradle cleanTest :MariaDBImpl:test
Edit 1: One work around that I thought of was to add a before_script and download either gradle or mysql in it but I guess there is a better way?
Edit 2: Or maybe create a docker image with all three and use that one instead?
That's the expected behaviour with GitLab-CI. You set image: gradle:jdk11 as default image to use for the CI job unless overridden in the job configuration like you did with image: mysql.
As you said you have several options here if you need both gradle and mysql-client.
Build your own Docker image that contains both
Remove image: mysql, use the default image: gradle:jdk11 and install mysql-client at the beginning of your script block or with before_script. gradle:jdk11 is based on Ubuntu so you can run: apt-get update && apt-get install -y mysql-client
Keep image: mysql and install gradle with apt-get update && apt-get install -y gradle (I don't recommend that, installing gradle via APT install a lot of packages and will slow your CI job down unnecessarily)
Keep image: mysql, add gradle wrapper to your repository and directly call it from gitlab-ci. Edit: This is not very useful as it would also require to download the JDK to build the project. It works best if the base image already contains it.
My preference would be to keep on using gradle:jdk11 as base image and just install the mysql-client package for that specific job since your other jobs only need gradle.

Error relocating /usr/bin/mono: getrandom: symbol not found

I'm trying to install mono inside an alpine 3.8 container and I received this message when running mono:
Error relocating /usr/bin/mono: getrandom: symbol not found
Is there a way to fix this ?
mono is only available in edge testing alpine repository. In order to install it, we need to have musl at least version 1.1.20, which is available in alpine v3.9 main or edge main repositories.
So, you have two options to proceed:
1. Install musl from alpine v3.9 repository on alpine v3.8 base image and install mono from alpine edge testing after that:
FROM alpine:3.8
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/v3.9/main musl\>1.1.20
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing mono
CMD mono
2. Install mono from alpine edge testing on alpine v3.9 base image:
FROM alpine:3.9
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing mono
CMD mono

How to provide standard library sources for IntelliJ IDEA's Rust project?

I am using Mac for development. I installed Rust 1.13.0 using brew install rust and the Rust plugin 0.1.0.1385 for IntelliJ IDEA. I created my first test project with cargo and while opening it with IDEA I got the message
No standard library sources found, some code insight will not work
I haven't found any sources installed, nor the Rust sources package in Homebrew.
How do I provide sources for the project and what are the practical implication if I ignore this step?
As commented, the supported approach is to use rustup:
Navigate to https://rustup.rs/ and follow the installation instructions for your platform.
Add the rust-src component by running: rustup component add rust-src
Create a new Rust project in IntelliJ and choose your existing Rust project source. If the folder already contains previous IntelliJ project files, you may have to delete those first before it will let you proceed.
IntelliJ-Rust should automatically configure the standard library sources to point to the sources downloaded by rustup.
As a reference, since the question title is broad, for Fedora 28 I had to:
dnf install cargo rust-src
sudo ln -s /usr/lib/rustlib/src /usr/lib/rustlib/x86_64-unknown-linux-gnu/
then give /usr/lib/rustlib/x86_64-unknown-linux-gnu/src/rust/src as "Standard library"
Full setup:
Issue opened to simplify the process
When not using the rustup installer, one can install the source package and direct the rust plugin to use those:
(Tested with CLion 2020.2.1, rust-1.46.0-x86_64-pc-windows-gnu.msi, rustc-1.46.0-src.tar.gz. Offline Rust installers and source archive from there: https://forge.rust-lang.org/infra/other-installation-methods.html )
Although the preferred way of installing Rust is by using rustup, as pointed out by the other posts, it is not uncommon to use the packages that your distro makes available.
I use, for example, the packages provided by Gentoo and I share the same problem about the not prefilled field for standard libraries.
Nevertheless, you can easily find out where your standard libraries have been installed by typing the following find command:
find /usr/lib* -type d -name "rust" | grep src
or the following if you installed rust in your home
find -type d -name "rust" | grep src
The previous commands will help, unless, of course, in your distro there is a package for the binaries and one for the source and you only installed the binary one.
I know the question is for MacOS but this answer is shown up when searching for it on Linux. Below I will answer for Ubuntu.
The path is /usr/lib/rustlib/src/rust/src for Ubuntu 20.04
The way I did is:
Installed rustc from the repositories, which includes cargo
sudo apt install rustc
Then installed rust source package
sudo apt install rust-src
I used apt-file (can be installed with sudo apt install apt-file) to search for the install path of the sources
sudo apt-file update
apt-file list rust-src
This show the path as /usr/src/rustc-1.41.0/src .
But a ls -la in /usr/lib/rustlib/ will reveal symlinks and /usr/lib/rustlib/src/rust/src points to the previous found directory.
Using the symlink on IntelliJ will survive new rust versions.
For Fedora 32 install Rust using command:
dnf install cargo rust-src
and the path to standard libary source is:
/usr/lib/rustlib/src/rust
I used Ubuntu. I follow these steps:
sudo apt install rust-src
wait for the install, then
dpkg -L rust-src
copy the last line. For me it is the standard library path:
/usr/lib/rustlib/src/rust
For MacOS, you need to put /opt/homebrew/bin/.