Add support for glibc for binary build#100
Conversation
metalarm10
left a comment
There was a problem hiding this comment.
@metalarm10 made 1 comment.
Reviewable status: 0 of 10 files reviewed, 1 unresolved discussion (waiting on masihyeganeh, miladz68, TxCorpi0x, and ysv).
build/tx-chain/flags.go line 19 at r1 (raw file):
// builder --override-txd-os ubuntu integration-tests/xrpl // TXD_OS=ubuntu builder integration-tests/xrpl func RegisterTXdOSFlag(fs *pflag.FlagSet) func(context.Context) context.Context {
I didn't understand this part that RegisterTXdOSFlag registers and resolves the flag (for either Alpine or Ubuntu options), but it seems never called by any process so the flags are never registered into the build process. I believe main.go needs a modification something like: build.Main(selfBuild.Commands, txchain.RegisterTXdOSFlag).
I also tried to build images locally with TXD_OS=ubuntu make images command, which resulted in Alpine images (I am also Apple silicon user).
(Please correct me if I misunderstood a step or how should I use the feature correctly).
metalarm10
left a comment
There was a problem hiding this comment.
@metalarm10 reviewed 11 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on masihyeganeh, miladz68, TxCorpi0x, and ysv).
metalarm10
left a comment
There was a problem hiding this comment.
@metalarm10 resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on masihyeganeh, miladz68, and ysv).
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 11 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on masihyeganeh and miladz68).
metalarm10
left a comment
There was a problem hiding this comment.
@metalarm10 reviewed all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on masihyeganeh and miladz68).
Description
This pull request introduces support for building and packaging the
txdbinary for both Alpine (musl/static) and Debian/Ubuntu (glibc/dynamic) Docker images. It enables flexible selection of the base image and linking strategy via a new--override-txd-osflag or environment variable. The changes also streamline dependency management, update relevant toolchain logic, and ensure the correct handling of the WASM VM library for each platform.Build system enhancements (Docker, linking, and platform support):
txdwith a dynamically linkedlibwasmvmshared library for Debian/Ubuntu images, while retaining static linking for Alpine images. This includes new toolchain configuration, environment setup, and Dockerfile template changes to copy the.solibrary when needed. [1] [2] [3] [4] [5] [6] [7] [8]--override-txd-osCLI flag and$TXD_OSenvironment variable to select the base image and linking mode, with context propagation and default fallback.BuildTXdDockerImageand related functions to use the selected base image and linking mode, including proper handling of WASM library copying and toolchain setup. [1] [2]Dependency and toolchain updates:
libwasmvm-glibctool definition and download logic: Updatedbuild/tools/tools.goto define the new WASM VM shared library for glibc builds and added download URLs and hashes. [1] [2]build/go.mod, including new versions oftx-crust,tx-crust/znet, and IBC modules, and addedgithub.com/spf13/pflag. [1] [2] [3]General improvements and refactoring:
These changes collectively enable seamless builds and deployments of
txdfor both Alpine and Debian/Ubuntu environments, improving cross-platform compatibility and simplifying developer workflows.Reviewers checklist:
Authors checklist
This change is