darling icon indicating copy to clipboard operation
darling copied to clipboard

Packages on GitHub are build with dependency on glibc 2.32 which prevents running on Ubuntu 20.04.

Open alexey-milovidov opened this issue 4 years ago • 8 comments

I've also tried to build Darling from sources inside Docker:

docker run -it --rm --volume $(pwd):/home/milovidov/work ubuntu:20.04 /bin/bash

apt update
apt install -y cmake clang bison flex libfuse-dev libudev-dev pkg-config libc6-dev-i386 linux-headers-generic gcc-multilib libcairo2-dev libgl1-mesa-dev libglu1-mesa-dev libtiff5-dev libfreetype6-dev git libelf-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libavutil-dev libpulse-dev libavformat-dev libavcodec-dev libavresample-dev libdbus-1-dev libxkbfile-dev libssl-dev
apt install -y libcap2-bin python2
git clone --recursive https://github.com/darlinghq/darling.git
cd darling
mkdir build && cd build
cmake ..
make -j32
make -j32 lkm

but then I have troubles installing it (make install tries to rebuild everything).

milovidov@milovidov-desktop:~/work/darling/darling/build$ sudo cp ./src/startup/darling /usr/bin/darling 
milovidov@milovidov-desktop:~/work/darling/darling/build$ darling shell
Cannot mount overlay: No such file or directory
^C

alexey-milovidov avatar Jun 29 '21 12:06 alexey-milovidov

You could try to make install into some directory inside Docker and then just copy that to the host.

But we highly recommend you to build and run Darling in a VM (instead of Docker).

bugaevc avatar Jun 29 '21 13:06 bugaevc

I confirm that everything builds successfully on Ubuntu 21.04 VM and make install works :) PS. It does not work in Docker by default, maybe --privileged should help, but I'm not ready to repeat...

alexey-milovidov avatar Jun 30 '21 13:06 alexey-milovidov

@alexey-milovidov docker does not emulate anything on the kernel side. Even if you use darling inside docker, you stil need to have the darling kernel module on the host. AFAIC.

HinTak avatar Jun 30 '21 13:06 HinTak

That's clear. The question is - maybe it is possible to use Docker in privileged mode (or similarly, chroot) just to make and install the kernel module to avoid the issue above.

alexey-milovidov avatar Jun 30 '21 13:06 alexey-milovidov

Well, the kernel module needs to be compiled and built against the host's kernel, so I cannot see any way of getting around having direct access to the host.

HinTak avatar Jun 30 '21 14:06 HinTak

Ok. I'm wondering why it requires userspace glibc of specific version... I'm not a "kernel" guy, so don't mind.

alexey-milovidov avatar Jun 30 '21 14:06 alexey-milovidov

The provided Ubuntu packages require glibc of a specific version simply because that's the version they've been built against. We might have as well built them against an older version of glibc; Darling itself doesn't care much.

bugaevc avatar Jun 30 '21 14:06 bugaevc

Well, as a rule, you build where you run. It is perfectly okay to build the non-kernel part of darling inside docker, and run inside the same docker. The kernel part still needs to be build and load outside of docker in the host.

The problem you have is building the non-kernel side of darling inside a newer docker, but expect to run the non-kernel part of darling outside in the older host.

HinTak avatar Jun 30 '21 14:06 HinTak