Skip to content

Makefile: auto-detect btrfs headers for portable local builds#65

Merged
alicefr merged 1 commit into
bootc-dev:mainfrom
HarshwardhanPatil07:fix/btrfs-autodetect-buildtags
Jun 22, 2026
Merged

Makefile: auto-detect btrfs headers for portable local builds#65
alicefr merged 1 commit into
bootc-dev:mainfrom
HarshwardhanPatil07:fix/btrfs-autodetect-buildtags

Conversation

@HarshwardhanPatil07

Copy link
Copy Markdown
Contributor
  • make build-bink fails on systems without btrfs-progs-devel
  • Add hack/btrfs_installed_tag.sh — probes for btrfs/ioctl.h and emits exclude_graphdriver_btrfs when headers are absent (same pattern used by Podman, Buildah, and Skopeo)
  • On systems with btrfs-progs-devel installed, behavior is unchanged — btrfs compiles normally
harshpat@harshpat-thinkpadp1gen4i:~/Downloads/repos/bink$ make build-bink
=== Building bink CLI binary ===
go build -ldflags "-X github.com/bootc-dev/bink/internal/version.Version=dev -X github.com/bootc-dev/bink/internal/version.GitCommit=d30220c -X github.com/bootc-dev/bink/internal/version.BuildDate=2026-06-22T11:30:14Z" -o bink ./cmd/bink
# github.com/containers/storage/drivers/btrfs
../../../coderepo/pkg/mod/github.com/containers/storage@v1.58.0/drivers/btrfs/version.go:6:10: fatal error: btrfs/version.h: No such file or directory
    6 | #include <btrfs/version.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:32: build-bink] Error 1

…-devel

Add hack/btrfs_installed_tag.sh (same pattern as Podman/Buildah) that
probes for btrfs/ioctl.h and emits exclude_graphdriver_btrfs when the
headers are missing. Wire it into the Makefile via BUILDTAGS so
`make build-bink` works out of the box on any system.

Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@alicefr

alicefr commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

@HarshwardhanPatil07 thanks for the PR! Looks good!

@alicefr alicefr merged commit 443096e into bootc-dev:main Jun 22, 2026
5 checks passed
@jlebon

jlebon commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Nice find. That requirement bothered me as well and I hadn't had time to investigate it properly.

Honestly, I think we should just always pass this tag. There's no reason we need whatever btrfs-specific features in that stack since everything is done through podman remote anyway.

@cgwalters

Copy link
Copy Markdown

I would suggest trying not to vendor the podman sources at all because that puts one on a huge CVE train - try to use e.g. github.com/docker/docker/client ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants