Skip to content
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

test CI #423

Merged
merged 5 commits into from
Oct 30, 2023
Merged

test CI #423

merged 5 commits into from
Oct 30, 2023

Conversation

jgriffiths
Copy link
Contributor

Temporary PR to test CI since the one on #414 isn't running for some reason

jgriffiths and others added 5 commits October 29, 2023 15:54
Third party libraries that make use of wally can use these calls to
avoid potential mismatches by end user applications that override the
default allocator.
Based on a patch by Marko Bencun <marko@shiftcrypto.ch>.

Original commit description/rationale:

When configuring libwally core with these flags:

    ./configure --enable-static --disable-shared

and compiling using `make`, libtool outputs this message:

    copying selected object files to avoid basename conflicts...

It copies the base64 and hex object files as they have the same
basename as the files built from `src/ccan/ccan/base64/base64.c`
`ccan/ccan/str/hex/hex.c`.

By using `make V=1` one can see that it is trying to copy it using
`ln` (a hardlink). This does not work properly inside a Docker
container on macOS, where the hard link is created but cannot be used
immediately ("file not found" in the next step where the object files
are used in linking). We tested this on two macOS machines, and it
only consistently did not work on one of them. We could not figure out
the root cause for the error. Giving the files unique names avoids the
copying/hardlinking and avoids the error.
version-info is what determines the dotted triplet of numbers trailing
the shared library filename. Meticulous maintenance of version-info
allows multiple ABI versions of the library to be installed on a system
concurrently and also makes obvious when library clients need to be
recompiled for a newer ABI (and when no recompilation is necessary).

See: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
Altering ac_configure_args to configure libsecp256k1 with options
differing from those of libwally-core causes issues if the wally
Makefile is out of date and needs to call autoreconf etc to
regenerate itself. The secp arguments are passed back to the top
level configure which changes and possibly breaks the original
configuration.

Instead, import and use AX_SUBDIRS_CONFIGURE from the autoconf-archive
which supports sub-confiration with bespoke arguments.

Because autoreconf does not recurse into subdirectories named by
AX_SUBDIRS_CONFIGURE, we lose the automagic Autotools (re)generation in
src/secp256k1, so add an explicit call to src/secp256k1/autogen.sh in
tools/autogen.sh.
(Modified from the original submission).

Libwally-core, in its stock configuration, compiles and statically links
against a private copy of libsecp256k1_zkp. However, Gentoo unbundles
libsecp256k1_zkp and instead links libwally-core against a system-wide
shared libsecp256k1_zkp with headers in /usr/include/secp256k1_zkp and a
libsecp256k1_zkp.pc that specifies the relevant CFLAGS and LIBS.

Implement a --with-system-secp256k1 configure option to allow compiling
and linking against a system-installed libsecp256k1. Pass the user-
specified package name (or 'libsecp256k1' or 'libsecp256k1_zkp' by
default, depending on --enable-standard-secp) to PKG_CHECK_MODULES to
find the CFLAGS and LIBS of a system-installed libsecp256k1. Call
AC_CHECK_FUNCS to assert that the required modules are present in the
system-installed libsecp256k1.

If the user does not specify --with-system-secp256k1 (or specifies
--without-system-secp256k1), the build will use the bundled copy of
libsecp256k1_zkp as before. Remove the existing libtool hack: When
building as a static library, the user will need to link libsecp256k1.a
in addition to libwallycore.a.
@jgriffiths jgriffiths merged commit 15bff1e into master Oct 30, 2023
4 checks passed
@jgriffiths jgriffiths mentioned this pull request Oct 30, 2023
@jgriffiths jgriffiths deleted the abi_merge_tmp branch October 30, 2023 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.

2 participants