Skip to content

image build: use cmake #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

pinheadmz
Copy link
Contributor

Closes #672

Seems to be working for me so far locally, will test a few other options as well.

Should we add a test to CI for this? It might just take too long to run...

@willcl-ark
Copy link
Contributor

We do need this, but it will break rebuilding <= v28.0 images...

I think we should simply add a new dockerfile with this in. When combined with #669 having multiple dockerfiles becomes easy to handle IMO. To build v28.0 you'd just run:

docker buildx bake bitcoin-28

and for >28.0 you'd do:

docker buildx bake bitcoin-29
# or perhaps we can get working...?
docker buildx bake <commit sha>

and let the bake magic handle which dockerfile is used for you.

@pinheadmz
Copy link
Contributor Author

Ah brilliant mate. Will review baker first then rebase this. 👨‍🍳

@danvergara
Copy link
Contributor

I did this PR to leverage bake and cmake together

willcl-ark#32

build_args = '"--disable-tests --without-gui --disable-bench --disable-fuzz-binary --enable-suppress-external-warnings --disable-dependency-tracking "'
else:
build_args = f'"{build_args}"'
build_args = '"-DWITH_ZMQ=ON "' if not build_args else f'"{build_args}"'
Copy link
Contributor

@deadmanoz deadmanoz Mar 7, 2025

Choose a reason for hiding this comment

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

Won't be able to build images <= v28.X if this change is made.

I tested building v28.1 using the new bake functional:

  • pre this change - builds fine
  • post this change - build fails
28.35 + ./configure 'LDFLAGS=-L/lib/' 'CPPFLAGS=-g0 -I/include/ --param ggc-min-expand=1 --param ggc-min-heapsize=32768' '--prefix=/opt/bitcoin' '-DWITH_ZMQ=ON'
28.48 configure: error: unrecognized option: '-DWITH_ZMQ=ON'

@deadmanoz
Copy link
Contributor

deadmanoz commented Mar 7, 2025

@pinheadmz, @willcl-ark do you wish for users to be able to use warnet image build for arbitrary Bitcoin Core commits (pre the CMake switchover of bitcoin/bitcoin#30454)?

If so, we'll need to support the 2 different styles of build_args (and reference the different Dockerfiles) to do so.

https://gist.github.com/hebasto/2ef97d3a726bfce08ded9df07f7dab5e

@pinheadmz
Copy link
Contributor Author

@deadmanoz yes but I think it's fair to assume that from now on, all pull requests will be cmake-based. However, I guess it's possible that someone may want to modify an old version of bitcoin and test that in warnet...

I wonder if there's an easy trick we can use to determine which build system to execute, maybe just like the presence of autogen.sh in the root directory ?

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 still builds with autotools
4 participants