illiliti / libudev-zero

Daemonless replacement for libudev
ISC License
202 stars 22 forks source link

Update build settings #29

Closed AGLExport closed 3 years ago

AGLExport commented 3 years ago

Hi illiliti.

I work to create libudev-zero recipe for yocto. Current Makefile has some issue for installing and packaging. I want to contribute to fix.

illiliti commented 3 years ago

What's the point to change library name? I understand that typical structure is different(and more correct) from the current one, but what's exactly this change fixes besides structure?

AGLExport commented 3 years ago

Hi illiliti.

Thanks comment.

This library name change is based on https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

In case of library name is libraryname.so.x.y, x show the interface compatibility, y show the minor version (it's option). libraryname.so is symbolic link to libraryname.so.x.

In initial time, libraryname.so is symbolic link to libraryname.so.1. At building time of execution file (it call exe1), linker link libraryname.so.1. When interface will update, new library name will change libraryname.so.2. In this timing, libraryname.so is symbolic link to libraryname.so.2. After that, at building time of execution file (it call exe2), linker link libraryname.so.2.

If I want to exec exe1 after library update, current libudev-zero structure can't support it. Because if I install both version in my system, libudev.so.1 is symbolic link to libudev.so(new) and libudev.so.2 is symbolic link to libudev.so(new). In this case exe1 will be dynamic link to new version of libudev.so. It will crash.

After changed, libudev.so.1(old version) and libudev.so.2(new version) can use in one system.

Existing package solutions (dpk, rpm, etc) based on this rule. libraryname.deb is including libraryname.so.x or libraryname.so.x libraryname.so.x.y libraryname-dev.deb is including libraryname.so and include file. The packaging checker checking to libraryname.so is symbolic link or not.

I aim to adjust libudev-zero to these rule in my patch.

bkuhls commented 3 years ago

This line https://github.com/illiliti/libudev-zero/blob/master/Makefile#L48 needs to be changed as well to fix a build error:

 make[1]: *** No rule to make target 'libudev.so', needed by 'install'.  Stop.
illiliti commented 3 years ago

@bkuhls, @AGLExport - I'm sorry, that's my bad.

I'm going to write unit tests and setup CI to make everything stable. Just need to find time for this

fungilife commented 3 years ago

1st thank you very much for the good work. 1 I may be lacking in git knowledge but it is hard to build this not knowing which is the latest, 1.0 was building version 204 ... it took me a while to figure out which packed-refernce tag was for 215, it was a wild guess. I still have no clue where the 204 215 numbers come from.

2 I have been testing this on arch based non-systemd systems, where eudev and libeudev are split, and in the absence of both I have used libudev-zero, smdev, and nldev from suckless.

3 lsusb from usbutils (arch) was throwing out errors before (19**-204) but was also returning correct output. Then with 215 I get a different error and no output. When I rebuild libusb and usbutils against libudev-zero then the output is better. I also found that gparted will not run with libudev-zero in arch due to device-mapper, trying to rebuild lvm2 (parent of device-mapper) without udev/eudev was impossible, as are many other arch based pkgs.

Here is some output of warnings/errors:

% sudo gparted /usr/lib/gparted/gpartedbin: /usr/lib/libudev.so.1: no version information available (required by /usr/lib/libdevmapper.so.1.02) /usr/lib/gparted/gpartedbin: symbol lookup error: /usr/lib/libdevmapper.so.1.02: undefined symbol: udev_queue_get_udev_is_active, version LIBUDEV_183

% sudo lsusb lsusb: /usr/lib/libudev.so.1: no version information available (required by lsusb) lsusb: /usr/lib/libudev.so.1: no version information available (required by lsusb) lsusb: /usr/lib/libudev.so.1: no version information available (required by /usr/lib/libusb-1.0.so.0) Bus 001 Device 001: ID 1d6b:0001 Linux 5.6.15-arch1-1 ohci_hcd OHCI PCI host controller

Same setup libudev-zero 215

% sudo gparted /usr/lib/gparted/gpartedbin: symbol lookup error: /usr/lib/libdevmapper.so.1.02: undefined symbol: ueue_get_udev_is_active,** version LIBUDEV_183

% lsusb lsusb: /usr/lib/libudev.so.1: version `LIBUDEV_196' not found (required by lsusb)

illiliti commented 3 years ago

@fungilife See https://github.com/illiliti/libudev-zero/issues/4. Also, this is not good place to discuss. In the next time, please open an issue here -> https://github.com/illiliti/libudev-zero/issues/new