When building the Go wrapper (pkg/libsignalgo
), I encounter multiple errors like:
cannot use NewACIServiceID(aci).CFixedBytes() (value of pointer type cPNIType)
as *_Ctype_SignalServiceIdFixedWidthBinaryBytes in variable declaration
It appears that CFixedBytes()
currently returns a *cPNIType
, whereas the C functions expect a *_Ctype_SignalServiceIdFixedWidthBinaryBytes
. This mismatch was introduced by a recent change in the libsignal
bridge code.
Steps to Reproduce:
- Clone the repository and checkout the
main
branch (or tag v0.8.1
).
git clone https://github.com/mautrix/signal.git
cd signal
- Initialize and update submodules:
git submodule update --init --recursive
- Build the Rust bridge:
cd rust/bridge
cargo build --release
- Return to the project root and build the Go wrapper:
cd ../../
CGO_CFLAGS="-I/usr/local/include" CGO_LDFLAGS="-L/usr/local/lib" go build ./pkg/libsignalgo
- Observe the compilation errors as shown above.
Expected Behavior:
pkg/libsignalgo
should compile successfully, with CFixedBytes()
returning the correct pointer type (*C.SignalServiceIdFixedWidthBinaryBytes
) so that the C FFI calls match their signatures.
Environment:
- OS: HardenedBSD (FreeBSD fork)
- Go: go1.20.4 freebsd/amd64
- Rust: rustc 1.70.0
- Submodule (libsignal) pinned at:
efe13e9b363d2c115dba61b76e5e53bbfc2874bc
(pre-breaking change)
- Repo tag:
v0.8.1
(Commit 03d675c
)
Workaround:
Manually pinning the libsignal
submodule to the pre-update commit (efe13e9b…
) restores compatibility and allows the build to succeed.
Proposed Fix:
- Update
CFixedBytes()
in pkg/libsignalgo
to explicitly return *C.SignalServiceIdFixedWidthBinaryBytes
(for example, via an unsafe.Pointer
cast).
- Alternatively, adjust the underlying C type definitions in the
libsignal
bridge so they remain compatible with the existing Go bindings.
Thank you for your help!