Skip to content

Add support for glibc for binary build#100

Open
TxCorpi0x wants to merge 3 commits intomasterfrom
mehdi/linux-build-compatible-wasm
Open

Add support for glibc for binary build#100
TxCorpi0x wants to merge 3 commits intomasterfrom
mehdi/linux-build-compatible-wasm

Conversation

@TxCorpi0x
Copy link
Contributor

@TxCorpi0x TxCorpi0x commented Mar 4, 2026

Description

This pull request introduces support for building and packaging the txd binary 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-os flag 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):

  • Added support for glibc/dynamic linking: Introduced new logic to build txd with a dynamically linked libwasmvm shared 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 .so library when needed. [1] [2] [3] [4] [5] [6] [7] [8]
  • Added new flag and context logic: Implemented the --override-txd-os CLI flag and $TXD_OS environment variable to select the base image and linking mode, with context propagation and default fallback.
  • Updated Docker image build logic: Refactored BuildTXdDockerImage and related functions to use the selected base image and linking mode, including proper handling of WASM library copying and toolchain setup. [1] [2]
  • Updated Dockerfile templates and image configs: Modified Dockerfile templates and image configuration structures to support conditional inclusion of the WASM shared library and proper base image selection. [1] [2] [3] [4]

Dependency and toolchain updates:

  • Added libwasmvm-glibc tool definition and download logic: Updated build/tools/tools.go to define the new WASM VM shared library for glibc builds and added download URLs and hashes. [1] [2]
  • Updated Go module dependencies: Upgraded and replaced several dependencies in build/go.mod, including new versions of tx-crust, tx-crust/znet, and IBC modules, and added github.com/spf13/pflag. [1] [2] [3]

General improvements and refactoring:

  • Refactored build tag and linking logic: Improved handling of build tags and linking modes, including new functions for arch naming and platform-specific logic. [1] [2]
  • Updated Docker image build steps for Gaia, Hermes, and Osmosis: Changed base images and installation commands for improved compatibility and consistency. [1] [2] [3]

These changes collectively enable seamless builds and deployments of txd for both Alpine and Debian/Ubuntu environments, improving cross-platform compatibility and simplifying developer workflows.

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@TxCorpi0x TxCorpi0x marked this pull request as ready for review March 10, 2026 07:07
@TxCorpi0x TxCorpi0x requested a review from a team as a code owner March 10, 2026 07:07
@TxCorpi0x TxCorpi0x requested review from masihyeganeh, metalarm10, miladz68 and ysv and removed request for a team March 10, 2026 07:07
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.

1 participant