[PR #2499] [MERGED] enhance(installer): use ldflags to inject versions #2998

Closed
opened 2026-04-16 09:43:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/pangolin/pull/2499
Author: @LaurenceJJones
Created: 2/18/2026
Status: Merged
Merged: 2/25/2026
Merged by: @oschwartz10612

Base: devHead: feature/build-variables


📝 Commits (1)

  • 9460e28 ehance(installer): use ldflags to inject versions

📊 Changes

3 files changed (+34 additions, -53 deletions)

View changed files

📝 .github/workflows/cicd.yml (+5 -13)
📝 install/Makefile (+17 -34)
📝 install/main.go (+12 -6)

📄 Description

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Instead of the CI/CD using sed to replace the 'replaceme' text we can instead use ldflags which can inject variables at build time to the versions. The makefile had a bunch of workarounds for dev so these have been removed to cleanup etc etc and fetchs versions from the gh api directly if the variables are not injected like the CI/CD does

How to test?

Using make or explicit make go-build-release PANGOLIN_VERSION=1.15.4 GERBIL_VERSION=1.0.0 BADGER_VERSION=1.0.0 will inject the variables into the binary without using sed


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/pangolin/pull/2499 **Author:** [@LaurenceJJones](https://github.com/LaurenceJJones) **Created:** 2/18/2026 **Status:** ✅ Merged **Merged:** 2/25/2026 **Merged by:** [@oschwartz10612](https://github.com/oschwartz10612) **Base:** `dev` ← **Head:** `feature/build-variables` --- ### 📝 Commits (1) - [`9460e28`](https://github.com/fosrl/pangolin/commit/9460e28c7bc190465c7697dac2cecee0da3b2a35) ehance(installer): use ldflags to inject versions ### 📊 Changes **3 files changed** (+34 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/cicd.yml` (+5 -13) 📝 `install/Makefile` (+17 -34) 📝 `install/main.go` (+12 -6) </details> ### 📄 Description ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description Instead of the CI/CD using sed to replace the 'replaceme' text we can instead use ldflags which can inject variables at build time to the versions. The makefile had a bunch of workarounds for dev so these have been removed to cleanup etc etc and fetchs versions from the gh api directly if the variables are not injected like the CI/CD does ## How to test? Using `make` or explicit `make go-build-release PANGOLIN_VERSION=1.15.4 GERBIL_VERSION=1.0.0 BADGER_VERSION=1.0.0` will inject the variables into the binary without using `sed` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 09:43:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#2998