Skip to content

fix: auto-detect CMake vs autotools for warnet image build#801

Open
b-l-u-e wants to merge 1 commit intobitcoin-dev-project:mainfrom
b-l-u-e:fix/769-warnet-image-build-cmake-autotools
Open

fix: auto-detect CMake vs autotools for warnet image build#801
b-l-u-e wants to merge 1 commit intobitcoin-dev-project:mainfrom
b-l-u-e:fix/769-warnet-image-build-cmake-autotools

Conversation

@b-l-u-e
Copy link
Copy Markdown
Contributor

@b-l-u-e b-l-u-e commented Apr 8, 2026

warnet image build now chooses the Bitcoin Core build path automatically:

  • CMake when CMakeLists.txt exists at the given ref on raw.githubusercontent.com - Dockerfile.cmake and default CMake BUILD_ARGS.
  • Autotools otherwise - Dockerfile.autotools and default autotools BUILD_ARGS.

Users can still override with --build-args.

  • Removed docker-bake.hcl and the Docker bake section from docs/developer-notes.md in favor of on-the-fly builds via the CLI.

Dockerfiles

  • Renamed: DockerfileDockerfile.autotools, Dockerfile.dev - Dockerfile.cmake.
  • After shallow git fetch, use git checkout FETCH_HEAD so tags (e.g. v26.0) work (Dockerfile.cmake, Dockerfile.autotools, insecure/Dockerfile).
  • Autotools: pin alpine:3.20; set Berkeley DB LDFLAGS/CPPFLAGS only when /opt/db-* exists.

Testing

  • warnet image build with bitcoin/bitcoin, --commit-sha master (cmake) and v26.0 (autotools), --arches amd64, --action load both produced loadable images locally.

This Closes #769.

@pinheadmz
Copy link
Copy Markdown
Contributor

pinheadmz commented Apr 22, 2026

rebased on main and tweaked a few things: https://github.com/pinheadmz/warnet/tree/fix/769-warnet-image-build-cmake-autotools

If you allow maintainers to edit your branch I can just push my suggestions

Comment thread src/warnet/image_build.py
Probes the GitHub raw content URL for CMakeLists.txt at the given commit.
Returns 'cmake' if found, 'autotools' otherwise.
"""
url = f"https://raw.githubusercontent.com/{repo}/{commit_sha}/CMakeLists.txt"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this works. did you test it? provide examples please

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.

warnet image build should automatically switch to cmake/autotools

2 participants