Skip to content

Fixes filters using an aliased value#2615

Open
nickclark2016 wants to merge 1 commit intopremake:masterfrom
nickclark2016:fix-aliased-filters
Open

Fixes filters using an aliased value#2615
nickclark2016 wants to merge 1 commit intopremake:masterfrom
nickclark2016:fix-aliased-filters

Conversation

@nickclark2016
Copy link
Member

What does this PR do?

Fixes #2614

How does this PR change Premake's behavior?

No

Anything else we should know?

N/A

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

@nickclark2016 nickclark2016 requested a review from a team February 1, 2026 21:39
@nickclark2016 nickclark2016 marked this pull request as draft February 1, 2026 21:55
@nickclark2016 nickclark2016 marked this pull request as ready for review February 2, 2026 00:13
function suite.targetWithArm64FilterSuffix()
architecture "ARM64"

filter { "architecture:ARM64" } -- Should match when architecture is AARCH64

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth adding a lowercase test?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or better yet, a mixed case test, e.g. aRm64.

x86_64 = "x64",
ARM = "ARM",
AARCH64 = "ARM64",
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now identical to vs200x_architectures.
It seems they can be regrouped, and so below function might be simplified.

Comment on lines +115 to +121
local field = p.field.get(key)
if field and field.aliases then
local aliased = field.aliases[value]
if aliased then
value = tostring(aliased):lower()
end
end
Copy link
Contributor

@Jarod42 Jarod42 Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That pattern is repeated 3 times, maybe create a subfunction, something like:

function p.field.alias_resolved(key, value) do
  value = value:lower()
  local field = p.field.get(key)
  if field and field.aliases then
    local aliased = field.aliases[value]
	if aliased then
		value = tostring(aliased):lower()
	end
  end 
  return value
end

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.

filter no longer matches architecture:arm64, starting in beta8

3 participants