Currently, SPL's build system detects Gentoo Linux as Ubuntu Linux.
I have written a patch that synchronizes the behavior with that of the ZFS build system to correct this.
Fix distribution detection
- Fixes Gentoo Linux detection, based on commit
- Implements detection for Lunar Linux
- Rearranges distribution lists to match those in zfsonlinux/zfs
This branch causes a regression on deb systems because they all ship a /etc/debian_version file. (eg: Ubuntu and Mint are detected as Debian if this test happens too early.)
Perhaps calling lsb_release and testing the Distributor ID field is a better way to do this check. The existing elif logic for can be kept for distributions that do not subscribe to the LSB standard.
This patch makes the build system detection behave identically to build system for zfsonlinux/zfs. Is there misdetection there too?
Yes. For example, I get this in the config.log for zfs on Ubuntu:
configure:11731: checking linux distribution
configure:11754: result: debian
I thought this was fixed earlier. It is currently a cosmetic glitch.
git-blame says that the regression happened at commit zfsonlinux/zfs@d9bfe0f.
It looks like the detection logic needs to be improved because Gentoo matches more than one distro signature.
The distribution detection logic appears to have diverged in the two build systems. In my opinion, that is something that should be fixed.
What is the nature of the regression that occurs on Ubuntu with this patch? Is it purely cosmetic or is there anything substantial that happens that would merit maintaining the current situation until a more comprehensive solution can be found?
Only local installations are affected because this logic is disabled in the PPA.
Given that nobody complained about it during the last ten months, this is a minor cosmetic bug, but it could cause problems later if something is written that depends on an accurate VENDOR value.
The lsb_release utility is a Python program, which explains why it isn't part of something universal like the util-linux package.
Fix distribution detection so that Ubuntu does not identify as Debian
dajhorn, I reordered the distribution detection list, which should address both the original issue and the Ubuntu regression. If it works, then a similar pull request should be made for zfsonlinux/zfs.
Please test this and report whether or not it fixed your problem.
@gentoofan: Yes, this works properly.
Yes, the effect of this are largely cosmetic. The distribution is just used to automatically detect which packaging system should be used for things like the make pkg build target. Still, I'm all for fixing. Once I see a pull request for both the spl and zfs code which systems them up I'll merge it.
Merged with some additional cleanup as a3a69b7