Skip to content

feat(build): introduce build configuration for channel inclusion#953

Closed
kaviraj-j wants to merge 1 commit intosipeed:mainfrom
kaviraj-j:feat/modular-build
Closed

feat(build): introduce build configuration for channel inclusion#953
kaviraj-j wants to merge 1 commit intosipeed:mainfrom
kaviraj-j:feat/modular-build

Conversation

@kaviraj-j
Copy link
Copy Markdown

  • Add build.yaml.example for configuring which channels to compile into the binary.
  • Implement genbuild script to generate channel imports based on build.yaml.
  • Update Makefile to run genbuild automatically during the build process.
  • Create documentation in BUILD_CONFIG.md to guide users on configuring and using the build system.
  • Move channel imports to channels_imports.go, generated by genbuild, to reduce binary size.

📝 Description

  • This PR adds a configurable build system for channels.
  • Channels included in the final binary are determined through a build configuration file, allowing only the required channels to be compiled.
  • If no configuration is provided, all available channels are included by default.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Closes #923

📚 Technical Context

  • Reasoning:
    Previously, all channel implementations were always compiled into the binary, increasing binary size and including unused dependencies. This change introduces a generation step that reads a build configuration file and dynamically creates the required channel imports during the build process. The generated imports file ensures that only selected channels are compiled, resulting in a more modular build and reduced binary size while keeping the build workflow automated.

🧪 Test Environment

  • Hardware: PC
  • OS: macOS 15.6.1 24G90 arm64

📸 Evidence

Details Size difference between including all channel implementation in the build vs only including Telegram Screenshot 2026-03-01 at 3 09 43 PM

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

- Add `build.yaml.example` for configuring which channels to compile into the binary.
- Implement `genbuild` script to generate channel imports based on `build.yaml`.
- Update `Makefile` to run `genbuild` automatically during the build process.
- Create documentation in `BUILD_CONFIG.md` to guide users on configuring and using the build system.
- Move channel imports to `channels_imports.go`, generated by `genbuild`, to reduce binary size.
@xiaket
Copy link
Copy Markdown
Collaborator

xiaket commented Mar 1, 2026

I have a concern over this approach.

We will need a discussion on whether we want this feature before we can take this in, and if we want it, what is the best way to implement it. For example, what are the things we would like to customise, and how to best group them.

The current approach of having a go cmd as a script feels pre-mature for me.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sipeed-bot
Copy link
Copy Markdown

sipeed-bot Bot commented Mar 25, 2026

@kaviraj-j Hi! This PR has had no activity for over 2 weeks, so I'm closing it for now to keep things organized. Feel free to reopen anytime if you'd like to continue.

@sipeed-bot sipeed-bot Bot closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Skip features during build

3 participants