btrfs icon indicating copy to clipboard operation
btrfs copied to clipboard

Remove necessity to link against C package

Open stevvooe opened this issue 8 years ago • 13 comments

When I set out on this journey, the intent was to require only the btrfs headers and not actually link against btrfs. While the goal is somewhat achieved, we still require linking against libbtrfs to achieve correct struct alignment. This needs to be removed.

stevvooe avatar Apr 04 '17 18:04 stevvooe

@vbatts PTAL

stevvooe avatar Apr 04 '17 18:04 stevvooe

fair. It's not so much the cgo usage, but rather the linking to libbtrfs (some distros don't provide the *.so along with the headers).

vbatts avatar Apr 04 '17 18:04 vbatts

@vbatts Agreed!

stevvooe avatar Apr 04 '17 20:04 stevvooe

Actually, after https://github.com/containerd/btrfs/pull/12, we are not technically linking against libbtrfs. The project does still require the header files.

stevvooe avatar Feb 27 '18 23:02 stevvooe

Would you consider merging with this library in either direction? It's in pure Go, the code is mostly a line-by-line port of btrfs-tools.

dennwc avatar Apr 26 '19 14:04 dennwc

@dennwc I would be in favor of it

crosbymichael avatar May 07 '19 17:05 crosbymichael

Should I open the pull request to this repository? Or would you consider using the new library?

As an alternative, I can probably transfer the library to containerd.

dennwc avatar May 07 '19 18:05 dennwc

Could we try replacing the lib with the btrfs snapshotter to run the snapshot test suite aginst to see if there are any issues or change in behavior?

crosbymichael avatar May 07 '19 18:05 crosbymichael

The snapshotter lives in the main containerd repo

crosbymichael avatar May 07 '19 18:05 crosbymichael

Sure, will test it. Probably next week.

dennwc avatar May 07 '19 18:05 dennwc

@crosbymichael Test pass, please check the test branch.

dennwc avatar May 17 '19 18:05 dennwc

@dennwc looks pretty good.

@stevvooe @dmcgowan what do you think about using, replacing this lib with a pure go implementation?

crosbymichael avatar May 22 '19 13:05 crosbymichael

Pure Go sounds good

dmcgowan avatar May 22 '19 17:05 dmcgowan