refactor: simplify Makefile by extracting repeated patterns#8549
Open
myleshorton wants to merge 1 commit intomainfrom
Open
refactor: simplify Makefile by extracting repeated patterns#8549myleshorton wants to merge 1 commit intomainfrom
myleshorton wants to merge 1 commit intomainfrom
Conversation
- Extract BUILD_TYPE_SUFFIX for installer filename suffix (was repeated 6x) - Extract GOMOBILE_ENV for gomobile env prefix (was repeated 5x) - Extract NFPM_ENV for Linux packaging env vars (was repeated 3x) - Remove require-gomobile (copy-paste bug: checked sentry, never used) - Remove notarize-log (broken syntax, hardcoded UUID, dead code) - Remove duplicate ios target declaration - Inline GOOS/GOARCH in windows-amd64/arm64 targets - Fix .PHONY for delete-data (was missing the dot) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the project’s top-level Makefile to reduce duplication by extracting repeated filename/env patterns into variables and removing dead/buggy targets.
Changes:
- Introduces
BUILD_TYPE_SUFFIX,GOMOBILE_ENV, andNFPM_ENVto centralize repeated Makefile fragments. - Removes unused/broken targets (
require-gomobile,notarize-log) and eliminates a duplicateiostarget declaration. - Cleans up a few targets by inlining
GOOS/GOARCHfor Windows and fixing.PHONYfordelete-data.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| ./lantern-core/utils | ||
|
|
||
| # Common env prefix for gomobile commands | ||
| GOMOBILE_ENV = GOMOBILECACHE="$(GOMOBILECACHE)" GOTOOLCHAIN=$(GO_VERSION) |
jigar-f
reviewed
Mar 20, 2026
|
|
||
|
|
||
| .PHONY: notarize-log | ||
| notarize-log: |
Contributor
There was a problem hiding this comment.
I like to keep this. This is helpful when Noterize fails; we can easily check what the problem is.
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
BUILD_TYPE_SUFFIXvariable for installer filename suffix (was duplicated 6 times)GOMOBILE_ENVfor theGOMOBILECACHE/GOTOOLCHAINenv prefix (was duplicated 5 times)NFPM_ENVfor common Linux packaging env vars (was duplicated 3 times)require-gomobiletarget (copy-paste bug: it checked for sentry-cli, not gomobile, and was never referenced)notarize-logtarget (broken syntax on line 239, hardcoded UUID, dead code)iostarget declaration (was defined twice, lines 503 and 505)windows-amd64/windows-arm64(remove unnecessary target-specific vars).PHONYfordelete-data(wasPHONY:— missing the dot)Net: -11 lines, no behavioral changes.
Test plan
make android-release-cistill works in CImake linux-release-cipackages deb/rpm/archlinux correctlymake macos-releasebuilds and signs correctlymake windows-releasebuilds correctly🤖 Generated with Claude Code