Skip to content

ci: Add CAPNP_BUILD=autotools-static and enable in newdeps - #373

Open
mutatrum wants to merge 1 commit into
bitcoin-core:masterfrom
mutatrum:ci-autotools-static
Open

mutatrum wants to merge 1 commit into
bitcoin-core:masterfrom
mutatrum:ci-autotools-static

Conversation

@mutatrum

@mutatrum mutatrum commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds support for CAPNP_BUILD=autotools-static in ci/scripts/ci.sh so Cap'n Proto can be built from source using autotools instead of cmake. This provides CI coverage for static linking against autotools-built Cap'n Proto libraries and ensures link order regressions are caught.

Enable CAPNP_BUILD=autotools-static in newdeps, and adds autoconf, automake, libtool, and pkg-config to nativeBuildInputs in shell.nix for the nix environment.

As mentioned in #367 (review).

@DrahtBot

DrahtBot commented Oct 2, 2026 •

Copy link
Copy Markdown

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK ryanofsky

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #393 (ci: Add OpenIndiana job by hebasto)
  • #333 (nix: Make clang tooling and IWYU find the right standard library headers by ryanofsky)
  • #175 (Set cmake_minimum_required(VERSION 3.22) by maflcko)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@ryanofsky ryanofsky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Concept ACK 3c13c7d. This adds CI coverage for the static Cap'n Proto link order fixed in #367, which nothing tested before. Thanks for following up and adding it!

The change looks good. The only issue I see is that shell.nix needs pkg-config, which CI only finds outside the nix shell and can break running CI scripts locally (see the inline comment).

Comment thread ci/configs/newdeps.bash Resolved
Comment thread ci/configs/newdeps.bash Outdated
Comment on lines +4 to +5
CAPNP_CHECKOUT=master # This is the v1.x release branch
CAPNP_BUILD=autotools-static

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In commit "ci: Add CAPNP_BUILD=autotools-static and enable in newdeps" (3c13c7d)

One trade-off with turning this on in newdeps: newdeps was the only job building Cap'n Proto master with CMake, and after this nothing tests the CMake package files from capnp master before a release. Bitcoin Core's depends builds capnp with CMake (capnp.mk), so that is the packaging Bitcoin Core relies on. I think this is fine (I suggested "newdeps or a new config" in #367 (review)) but if we add more jobs later it could make sense to move this to a different job.

Comment thread ci/scripts/ci.sh
Comment on lines +29 to +41
if [ "${CAPNP_BUILD-}" = "autotools-static" ]; then
(
cd capnp/c++
git --no-pager log -1 || true
autoreconf -i
./configure --prefix="${capnp_prefix}" \
--disable-shared \
--enable-static \
--without-openssl \
--without-zlib \
CXXFLAGS="-std=c++20"
make -j"$(nproc)" install
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In commit "ci: Add CAPNP_BUILD=autotools-static and enable in newdeps" (3c13c7d)

Note: I checked that this setup catches the problem fixed in #367. With Cap'n Proto master built this way and the mpgen link order from before #367 (56cfdaa reverted), mpgen fails to link with the same undefined reference to capnp::SchemaLoader::get(...) errors as the #367 reproduction. Cap'n Proto master's capnpc.pc still doesn't list capnp in Requires, so the job keeps testing this until that changes upstream.

Comment thread shell.nix Resolved
Add support for CAPNP_BUILD=autotools-static in ci/scripts/ci.sh so Cap'n
Proto can be built from source using autotools instead of cmake. This provides
CI coverage for static linking against autotools-built Cap'n Proto libraries
and ensures link order regressions are caught.

Enable CAPNP_BUILD=autotools-static in newdeps, and add autoconf, automake,
libtool, and pkg-config to nativeBuildInputs in shell.nix for the nix
environment.
@mutatrum
mutatrum force-pushed the ci-autotools-static branch from 3c13c7d to b514e5e Compare November 16, 2026 11:53
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.

3 participants