Page MenuHomePhabricator

[secp256k1] ci: Test `make precomp`
ClosedPublic

Authored by PiRK on Jan 19 2026, 10:21.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCf2fcb4903172: [secp256k1] ci: Test `make precomp`
Summary

Backport/cmake note:
I'm not sure how we could add cmake targets similar to clean-precomp. If we add a secp256k1-clean-precomp target to remove the two header files we then need to rerun cmake to detect that the header files are missing and that we need to conditionnaly generate the gen_ecmult_gen_static_prec_table and gen_ecmult_static_pre_g targets and make them dependencies of the secp256k1 target.

For now we need to manually delete the header files to automatically regenerate them with cmake. Or in the case of ecmult_static_pre_g.h, we do it automatically also if SECP256K1_ECMULT_WINDOW_SIZE is > 15.

This is a partial backport of secp256k1#988
https://github.com/bitcoin-core/secp256k1/pull/988/commits/bb36fe9be0998c81ebc9f18e122bb7617d919877
Depends on D19400

Test Plan

land and check cirrus build

ninja clean-precomp
ninja gen-precomp
git status

Change one of the precomputed files, rerun gen-precomp, check that it is restored

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK retitled this revision from ci: Test `make precomp` to [secp256k1] ci: Test `make precomp`.Jan 19 2026, 10:24
PiRK published this revision for review.Jan 19 2026, 13:36
Fabien requested changes to this revision.Jan 19 2026, 14:02
Fabien added a subscriber: Fabien.

You can add a custom target that removes the files.
If they are missing ninja should regenerate them because they are outputs of a custom command and also a dependencies of the target being built.

This revision now requires changes to proceed.Jan 19 2026, 14:02
PiRK edited the test plan for this revision. (Show Details)

delete cirrus.sh (this is build_autotools.sh for us), add cmake targets, test them in build_cmake.sh

Fabien requested changes to this revision.Jan 20 2026, 14:51
Fabien added inline comments.
src/secp256k1/CMakeLists.txt
245 ↗(On Diff #57877)

should still be secp256k1 ? gen-precomp is not a C target

252 ↗(On Diff #57877)
254 ↗(On Diff #57877)

should use copy_if_different

This revision now requires changes to proceed.Jan 20 2026, 14:51
src/secp256k1/CMakeLists.txt
245 ↗(On Diff #57877)

From what i tested, this succesfully causes the gen-precomp command to call the above custom command via the file dependency.
Without this, the move-precomp- target below may be executed first or in parallel, and fail.

In my mind the secp256k1 target no longer needs the dependency as in the default case the header is now just a regular source file from the repo.

src/secp256k1/CMakeLists.txt
245 ↗(On Diff #57877)

Actually the DEPENDS below is enough. We can completely remove this target_sources

PiRK edited the test plan for this revision. (Show Details)

remove unnecessary target_sources, use copy_if_different

This revision is now accepted and ready to land.Jan 20 2026, 20:55
This revision was automatically updated to reflect the committed changes.