Remove necessity to link against C package
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.
@vbatts PTAL
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 Agreed!
Actually, after https://github.com/containerd/btrfs/pull/12, we are not technically linking against libbtrfs. The project does still require the header files.
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 I would be in favor of it
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.
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?
The snapshotter lives in the main containerd repo
Sure, will test it. Probably next week.
@crosbymichael Test pass, please check the test branch.
@dennwc looks pretty good.
@stevvooe @dmcgowan what do you think about using, replacing this lib with a pure go implementation?
Pure Go sounds good