archiecobbs / s3backer

FUSE/NBD single file backing store via Amazon S3
Other
535 stars 77 forks source link

nbd kit detection, packaging request #223

Closed khumarahn closed 5 months ago

khumarahn commented 5 months ago

Hi. I'm maintaining s3backer for gentoo, and I'd like to address the following bug: https://bugs.gentoo.org/932531

This is when s3backer is compiled without explicit support for nbd, so sys-block/nbd and sys-block/nbdkit are not pulled as dependencies. But nbdkit is already installed for some reason while nbd is not. So, s3backer configures itself to build with nbd support but fails because nbd-client is not available.

Ideally, s3backer would have a configuration flag that toggles support for nbd. (And configuration would fail if nbd and nbdkit are not found.) Is this a hard thing to implement?

Another (very minor) issue for packaging is that /run is usually a tmpfs, and installing any files in /run is non-persistent and wrong. This is easy so solve for me https://gitweb.gentoo.org/repo/gentoo.git/tree/net-fs/s3backer/s3backer-2.1.2.ebuild#n52 but it would have been nicer if this changed upstream

archiecobbs commented 5 months ago

Hi. I'm maintaining s3backer for gentoo, and I'd like to address the following bug: https://bugs.gentoo.org/932531

So just to make sure I understand, would you consider the following a correct fix? → Instead of trying to build s3backer with NBD support if nbdkit is found, only try to build it with NBD support if both nbd and nbdkit are found.

Another (very minor) issue for packaging is that /run is usually a tmpfs, and installing any files in /run is non-persistent and wrong.

Thanks, I'll fix this.

khumarahn commented 5 months ago

Hi!

So just to make sure I understand, would you consider the following a correct fix? → Instead of trying to build s3backer with NBD support if nbdkit is found, only try to build it with NBD support if both nbd and nbdkit are found.

This would absolutely work. Or some explicit control like a cmake option -DWITH_NBD=ON, just in case of any future demands. Then build would fail if the option is on and both nbd and nbdkit are not found

khumarahn commented 5 months ago

After a little thought, I think I would prefer an explicit control. Otherwise, a hypothetical situation when this becomes important is:

khumarahn commented 5 months ago

Here's an example of cmake configuration which works great for us and other distributions maintainers: https://i2pd.readthedocs.io/en/latest/devs/building/unix/#cmake-options

archiecobbs commented 5 months ago

Should all be fixed.

khumarahn commented 5 months ago

Thank you so much :-) It looks right and works on my system! I made a PR for gentoo, so we'll have it in the tree soon: https://github.com/gentoo/gentoo/pull/36993

archiecobbs commented 5 months ago

Great - thanks for the report.