Skip to content

Conversation

Copy link

Copilot AI commented Jan 6, 2026

The confvar function generates MD5 hashes of configuration variables to create stamp filenames for dependency tracking. Variable order affects the hash, causing spurious rebuilds when PKG_CONFIG_DEPENDS accumulates variables from different include files in non-deterministic order.

Change

Sort variables before hashing in rules.mk:

# Before
confvar=$(shell echo '$(foreach v,$(1),$(v)=$(subst ','\'',$($(v))))' | $(MKHASH) md5)

# After  
confvar=$(shell echo '$(foreach v,$(sort $(1)),$(v)=$(subst ','\'',$($(v))))' | $(MKHASH) md5)

This ensures identical variable sets produce identical hashes regardless of input order, preventing unnecessary rebuilds when the same configurations are specified in different sequences.

Original prompt

Please analyze the coe and find issues of the Makefile logic that cause rebuilding of packages even if no changes happened.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ebuilds

Co-authored-by: aparcar <16000931+aparcar@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix rebuilding issues in Makefile logic Fix confvar to sort variables before hashing Jan 6, 2026
Copilot AI requested a review from aparcar January 6, 2026 07:14
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.

2 participants