fix(cgo): remove -L${SRCDIR} from LDFLAGS to eliminate ld warning for external consumers#37
Draft
WGB5445 wants to merge 1 commit into
Draft
fix(cgo): remove -L${SRCDIR} from LDFLAGS to eliminate ld warning for external consumers#37WGB5445 wants to merge 1 commit into
WGB5445 wants to merge 1 commit into
Conversation
… external consumers
CGO_LDFLAGS is now required by both in-repo developers and external consumers.
The -L${SRCDIR}/native/<triple> path only worked for in-repo builds; external
consumers saw an ld warning because ${SRCDIR} expands to a read-only module
cache path where no .a file exists.
Both scenarios now pass the library search path explicitly via CGO_LDFLAGS:
In-repo: CGO_LDFLAGS="-L$(pwd)/aptosconfidential/native/$TRIPLE" go test
External: CGO_LDFLAGS="-L$(pwd)/native/<triple>" go build
CI, README, and CLAUDE.md updated accordingly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-L${SRCDIR}/native/<triple>from all 8 platform CGO files — this path only resolved correctly for in-repo builds. External consumers saw a spuriousld: warning: search path '...go@v1.1.2/aptosconfidential/native/<triple>' not foundbecause${SRCDIR}expands to the read-only module cache where no.afile exists.CGO_LDFLAGS.Usage after this change
External consumer:
go run github.com/aptos-labs/confidential-asset-bindings/bindings/go/aptosconfidential/tools/download@v1.1.3 CGO_LDFLAGS="-L$(pwd)/native/aarch64-apple-darwin" go build ./...In-repo developer:
Test plan
CGO_LDFLAGS="-L$(pwd)/aptosconfidential/native/aarch64-apple-darwin" go test ./aptosconfidential/...— PASS, zero ld warningsCGO_LDFLAGS="-L$(pwd)/native/aarch64-apple-darwin" go build ./...— PASS, zero ld warningsgo-bindings-smoke(linux/amd64) passes with updatedCGO_LDFLAGSenv var🤖 Generated with Claude Code